@foxy.io/elements 1.14.0 → 1.15.0-beta.2
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-access-recovery-form.js +1 -1
- package/dist/cdn/foxy-address-card.js +1 -1
- package/dist/cdn/foxy-address-form.js +1 -1
- package/dist/cdn/foxy-applied-tax-card.js +1 -1
- package/dist/cdn/foxy-attribute-card.js +1 -1
- package/dist/cdn/foxy-attribute-form.js +1 -1
- package/dist/cdn/foxy-cancellation-form.js +1 -1
- package/dist/cdn/foxy-collection-page.js +1 -1
- package/dist/cdn/foxy-collection-pages.js +1 -1
- package/dist/cdn/foxy-coupon-card.js +1 -0
- package/dist/cdn/foxy-coupon-code-form.js +1 -0
- package/dist/cdn/foxy-coupon-codes-form.js +1 -0
- package/dist/cdn/foxy-coupon-form.js +1 -0
- package/dist/cdn/foxy-custom-field-card.js +1 -1
- package/dist/cdn/foxy-custom-field-form.js +1 -1
- package/dist/cdn/foxy-customer-api.js +1 -1
- package/dist/cdn/foxy-customer-card.js +1 -1
- package/dist/cdn/foxy-customer-form.js +1 -1
- package/dist/cdn/foxy-customer-portal-settings.js +4 -807
- package/dist/cdn/foxy-customer-portal.js +4 -4
- package/dist/cdn/foxy-customer.js +1 -1
- package/dist/cdn/foxy-customers-table.js +1 -1
- package/dist/cdn/foxy-discount-card.js +1 -1
- package/dist/cdn/foxy-donation.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-form-dialog.js +1 -1
- package/dist/cdn/foxy-generate-codes-form.js +1 -0
- package/dist/cdn/foxy-i18n.js +1 -1
- package/dist/cdn/foxy-items-form.js +1 -1
- package/dist/cdn/foxy-nucleon-element.js +1 -1
- package/dist/cdn/foxy-pagination.js +1 -0
- package/dist/cdn/foxy-payment-card.js +1 -1
- package/dist/cdn/foxy-payment-method-card.js +1 -1
- package/dist/cdn/foxy-query-builder.js +1 -69
- package/dist/cdn/foxy-sign-in-form.js +1 -1
- package/dist/cdn/foxy-spinner.js +1 -1
- package/dist/cdn/foxy-subscription-card.js +1 -1
- package/dist/cdn/foxy-subscription-form.js +3 -3
- package/dist/cdn/foxy-subscriptions-table.js +1 -1
- package/dist/cdn/foxy-table.js +1 -1
- package/dist/cdn/foxy-tax-card.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-card.js +1 -1
- package/dist/cdn/foxy-transactions-table.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-5c8b531d.js → shared-0bda8ecb.js} +1 -1
- package/dist/cdn/{shared-07abcd7b.js → shared-0fcdd1c4.js} +1 -1
- package/dist/cdn/{shared-a46edf4b.js → shared-30131f76.js} +1 -1
- package/dist/cdn/shared-36629ded.js +131 -0
- package/dist/cdn/{shared-bc2bfe52.js → shared-4038cb18.js} +1 -1
- package/dist/cdn/{shared-44cfc617.js → shared-423a4840.js} +1 -1
- package/dist/cdn/shared-4fa5f144.js +1 -0
- package/dist/cdn/shared-51b5e223.js +1 -0
- package/dist/cdn/{shared-593f7e2c.js → shared-51e28c83.js} +1 -1
- package/dist/cdn/shared-710ed658.js +134 -0
- package/dist/cdn/shared-800a5471.js +1 -0
- package/dist/cdn/{shared-8a7bee0d.js → shared-8f7a66c4.js} +1 -1
- package/dist/cdn/{shared-91e768be.js → shared-9af7b5f0.js} +1 -1
- package/dist/cdn/{shared-7a42073a.js → shared-a11160e7.js} +5 -5
- package/dist/cdn/{shared-5f54e916.js → shared-a4e6ecb0.js} +1 -1
- package/dist/cdn/{shared-b5147166.js → shared-a8d96c23.js} +1 -1
- package/dist/cdn/{shared-322e60b1.js → shared-b03b6d72.js} +1 -1
- package/dist/cdn/shared-b2330475.js +1 -0
- package/dist/cdn/{shared-1761daef.js → shared-c1dadefe.js} +1 -1
- package/dist/cdn/shared-c6a4b2d6.js +1 -0
- package/dist/cdn/shared-ccea5a33.js +69 -0
- package/dist/cdn/shared-cd3c902e.js +1 -0
- package/dist/cdn/{shared-34b2c1e2.js → shared-d3831f99.js} +1 -1
- package/dist/cdn/shared-d9a260f0.js +1 -0
- package/dist/cdn/{shared-e5cbf291.js → shared-f875a4f8.js} +1 -1
- package/dist/cdn/{shared-e7f8ffe9.js → shared-fb403e1f.js} +1 -1
- package/dist/cdn/shared-ff149b55.js +804 -0
- package/dist/cdn/translations/customer-portal/zh-hk.json +35 -0
- package/dist/cdn/translations/shared/en.json +105 -0
- package/dist/elements/private/Checkbox/Checkbox.js +36 -22
- package/dist/elements/private/Checkbox/Checkbox.js.map +1 -1
- package/dist/elements/private/EditableList/EditableList.d.ts +20 -0
- package/dist/elements/private/EditableList/EditableList.js +123 -0
- package/dist/elements/private/EditableList/EditableList.js.map +1 -0
- package/dist/elements/public/CouponCard/CouponCard.d.ts +29 -0
- package/dist/elements/public/CouponCard/CouponCard.js +130 -0
- package/dist/elements/public/CouponCard/CouponCard.js.map +1 -0
- package/dist/elements/public/CouponCard/index.d.ts +5 -0
- package/dist/elements/public/CouponCard/index.js +7 -0
- package/dist/elements/public/CouponCard/index.js.map +1 -0
- package/dist/elements/public/CouponCard/types.d.ts +15 -0
- package/dist/elements/public/CouponCard/types.js +2 -0
- package/dist/elements/public/CouponCard/types.js.map +1 -0
- package/dist/elements/public/CouponCodeForm/CouponCodeForm.d.ts +45 -0
- package/dist/elements/public/CouponCodeForm/CouponCodeForm.js +218 -0
- package/dist/elements/public/CouponCodeForm/CouponCodeForm.js.map +1 -0
- package/dist/elements/public/CouponCodeForm/index.d.ts +8 -0
- package/dist/elements/public/CouponCodeForm/index.js +10 -0
- package/dist/elements/public/CouponCodeForm/index.js.map +1 -0
- package/dist/elements/public/CouponCodeForm/types.d.ts +15 -0
- package/dist/elements/public/CouponCodeForm/types.js +2 -0
- package/dist/elements/public/CouponCodeForm/types.js.map +1 -0
- package/dist/elements/public/CouponCodesForm/CouponCodesForm.d.ts +29 -0
- package/dist/elements/public/CouponCodesForm/CouponCodesForm.js +209 -0
- package/dist/elements/public/CouponCodesForm/CouponCodesForm.js.map +1 -0
- package/dist/elements/public/CouponCodesForm/index.d.ts +8 -0
- package/dist/elements/public/CouponCodesForm/index.js +12 -0
- package/dist/elements/public/CouponCodesForm/index.js.map +1 -0
- package/dist/elements/public/CouponCodesForm/internal/InternalCouponCodesFormListItem.d.ts +14 -0
- package/dist/elements/public/CouponCodesForm/internal/InternalCouponCodesFormListItem.js +48 -0
- package/dist/elements/public/CouponCodesForm/internal/InternalCouponCodesFormListItem.js.map +1 -0
- package/dist/elements/public/CouponCodesForm/types.d.ts +16 -0
- package/dist/elements/public/CouponCodesForm/types.js +2 -0
- package/dist/elements/public/CouponCodesForm/types.js.map +1 -0
- package/dist/elements/public/CouponForm/CouponForm.d.ts +77 -0
- package/dist/elements/public/CouponForm/CouponForm.js +1266 -0
- package/dist/elements/public/CouponForm/CouponForm.js.map +1 -0
- package/dist/elements/public/CouponForm/index.d.ts +19 -0
- package/dist/elements/public/CouponForm/index.js +21 -0
- package/dist/elements/public/CouponForm/index.js.map +1 -0
- package/dist/elements/public/CouponForm/private/CategoryRestrictionsPage.d.ts +19 -0
- package/dist/elements/public/CouponForm/private/CategoryRestrictionsPage.js +98 -0
- package/dist/elements/public/CouponForm/private/CategoryRestrictionsPage.js.map +1 -0
- package/dist/elements/public/CouponForm/private/CategoryRestrictionsPageItem.d.ts +19 -0
- package/dist/elements/public/CouponForm/private/CategoryRestrictionsPageItem.js +51 -0
- package/dist/elements/public/CouponForm/private/CategoryRestrictionsPageItem.js.map +1 -0
- package/dist/elements/public/CouponForm/private/CategoryRestrictionsPageItemContent.d.ts +19 -0
- package/dist/elements/public/CouponForm/private/CategoryRestrictionsPageItemContent.js +52 -0
- package/dist/elements/public/CouponForm/private/CategoryRestrictionsPageItemContent.js.map +1 -0
- package/dist/elements/public/CouponForm/types.d.ts +27 -0
- package/dist/elements/public/CouponForm/types.js +2 -0
- package/dist/elements/public/CouponForm/types.js.map +1 -0
- package/dist/elements/public/CustomerPortal/InternalCustomerPortalLoggedInView.js +19 -6
- package/dist/elements/public/CustomerPortal/InternalCustomerPortalLoggedInView.js.map +1 -1
- package/dist/elements/public/GenerateCodesForm/GenerateCodesForm.d.ts +39 -0
- package/dist/elements/public/GenerateCodesForm/GenerateCodesForm.js +197 -0
- package/dist/elements/public/GenerateCodesForm/GenerateCodesForm.js.map +1 -0
- package/dist/elements/public/GenerateCodesForm/index.d.ts +8 -0
- package/dist/elements/public/GenerateCodesForm/index.js +10 -0
- package/dist/elements/public/GenerateCodesForm/index.js.map +1 -0
- package/dist/elements/public/GenerateCodesForm/types.d.ts +24 -0
- package/dist/elements/public/GenerateCodesForm/types.js +2 -0
- package/dist/elements/public/GenerateCodesForm/types.js.map +1 -0
- package/dist/elements/public/I18n/I18n.js +1 -1
- package/dist/elements/public/I18n/I18n.js.map +1 -1
- package/dist/elements/public/I18n/format/date.js +7 -6
- package/dist/elements/public/I18n/format/date.js.map +1 -1
- package/dist/elements/public/I18n/format/discount.d.ts +6 -0
- package/dist/elements/public/I18n/format/discount.js +20 -0
- package/dist/elements/public/I18n/format/discount.js.map +1 -0
- package/dist/elements/public/I18n/format/index.js +4 -0
- package/dist/elements/public/I18n/format/index.js.map +1 -1
- package/dist/elements/public/I18n/format/ordinal.d.ts +6 -0
- package/dist/elements/public/I18n/format/ordinal.js +9 -0
- package/dist/elements/public/I18n/format/ordinal.js.map +1 -0
- package/dist/elements/public/Pagination/Pagination.d.ts +37 -0
- package/dist/elements/public/Pagination/Pagination.js +154 -0
- package/dist/elements/public/Pagination/Pagination.js.map +1 -0
- package/dist/elements/public/Pagination/index.d.ts +6 -0
- package/dist/elements/public/Pagination/index.js +8 -0
- package/dist/elements/public/Pagination/index.js.map +1 -0
- package/dist/elements/public/Table/Table.js +20 -5
- package/dist/elements/public/Table/Table.js.map +1 -1
- package/dist/elements/public/index.d.ts +6 -0
- package/dist/elements/public/index.defined.d.ts +6 -0
- package/dist/elements/public/index.defined.js +6 -0
- package/dist/elements/public/index.defined.js.map +1 -1
- package/dist/elements/public/index.js +6 -0
- package/dist/elements/public/index.js.map +1 -1
- package/dist/mixins/themeable.js +80 -4
- package/dist/mixins/themeable.js.map +1 -1
- package/package.json +1 -1
- package/dist/cdn/shared-00563cb0.js +0 -1
- package/dist/cdn/shared-35dbd2c5.js +0 -1
- package/dist/cdn/shared-9a40309d.js +0 -1
- package/dist/cdn/shared-ce1da35d.js +0 -1
- package/dist/cdn/shared-d01d809a.js +0 -1
- package/dist/cdn/shared-d8ffb279.js +0 -264
- package/dist/cdn/shared-f1dc1c6c.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{e,r as t,S as s,n as i,L as a,_ as n,h as r,j as o}from"./shared-63eaded9.js";import{F as l,D as d,t as h,f as u,a as c}from"./shared-46ee137f.js";import{B as p}from"./shared-0ced76a0.js";import{E as _,F as m}from"./shared-5c8b531d.js";import{E as g,T as v,D as f,C as y}from"./shared-df573cea.js";import"./shared-f0a83bd6.js";import{t as b,b as x,c as w,d as $}from"./shared-9a40309d.js";import{I as k,D,a as S,C,b as E}from"./shared-d8ffb279.js";import"./shared-07abcd7b.js";import{a as I,I as A,D as M,S as T,M as j,W as O,c as V,t as F}from"./shared-b5147166.js";import{O as R,a as P,b as N,c as B,I as q}from"./shared-ec861f31.js";import{T as z}from"./shared-bb824ab4.js";import"./foxy-i18n.js";import{c as Y}from"./shared-4e709717.js";import{h as L,P as W,G as H,a as U,t as X,c as K,y as Q}from"./shared-ff79f3f9.js";import"./shared-60126eee.js";import{P as G}from"./shared-94b0ae99.js";import{a8 as J,a9 as Z,aa as ee,ab as te,ac as se,ad as ie,ae,af as ne,ag as re,ah as oe,ai as le,aj as de,ak as he,al as ue,am as ce,an as pe,ao as _e,ap as me,aq as ge,ar as ve,as as fe,at as ye,au as be}from"./shared-1761daef.js";import{G as xe}from"./shared-91e768be.js";import{p as we}from"./shared-87ca7818.js";import{j as $e}from"./shared-59e44f29.js";import{p as ke,W as De}from"./shared-322e60b1.js";import{i as Se}from"./shared-a46edf4b.js";import"./shared-b0f0e8b5.js";import"./shared-00563cb0.js";import"./shared-593f7e2c.js";import"./shared-6d45a07b.js";function Ce(e){return e?Infinity===(e=b(e))||-Infinity===e?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function Ee(e){return e}var Ie=Object.create,Ae=function(){function t(){}return function(s){if(!e(s))return{};if(Ie)return Ie(s);t.prototype=s;var i=new t;return t.prototype=void 0,i}}();var Me=function(){try{var e=J(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();function Te(e,t,s){"__proto__"==t&&Me?Me(e,t,{configurable:!0,enumerable:!0,value:s,writable:!0}):e[t]=s}var je=Object.prototype.hasOwnProperty;function Oe(e,t,s){var i=e[t];je.call(e,t)&&Z(i,s)&&(void 0!==s||t in e)||Te(e,t,s)}function Ve(e,t,s,i){var a=!s;s||(s={});for(var n=-1,r=t.length;++n<r;){var o=t[n],l=i?i(s[o],e[o],o,s,e):void 0;void 0===l&&(l=e[o]),a?Te(s,o,l):Oe(s,o,l)}return s}var Fe=Object.prototype.hasOwnProperty;function Re(t){if(!e(t))return function(e){var t=[];if(null!=e)for(var s in Object(e))t.push(s);return t}(t);var s=se(t),i=[];for(var a in t)("constructor"!=a||!s&&Fe.call(t,a))&&i.push(a);return i}function Pe(e){return ee(e)?ie(e,!0):Re(e)}var Ne=ae(Object.getPrototypeOf,Object);var Be="object"==typeof exports&&exports&&!exports.nodeType&&exports,qe=Be&&"object"==typeof module&&module&&!module.nodeType&&module,ze=qe&&qe.exports===Be?t.Buffer:void 0,Ye=ze?ze.allocUnsafe:void 0;var Le=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)le(t,re(e)),e=Ne(e);return t}:oe;function We(e){return de(e,Pe,Le)}var He=Object.prototype.hasOwnProperty;function Ue(e){var t=new e.constructor(e.byteLength);return new he(t).set(new he(e)),t}var Xe=/\w*$/;var Ke=s?s.prototype:void 0,Qe=Ke?Ke.valueOf:void 0;function Ge(e,t,s){var i,a,n,r=e.constructor;switch(t){case"[object ArrayBuffer]":return Ue(e);case"[object Boolean]":case"[object Date]":return new r(+e);case"[object DataView]":return function(e,t){var s=t?Ue(e.buffer):e.buffer;return new e.constructor(s,e.byteOffset,e.byteLength)}(e,s);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return function(e,t){var s=t?Ue(e.buffer):e.buffer;return new e.constructor(s,e.byteOffset,e.length)}(e,s);case"[object Map]":case"[object Set]":return new r;case"[object Number]":case"[object String]":return new r(e);case"[object RegExp]":return(n=new(a=e).constructor(a.source,Xe.exec(a))).lastIndex=a.lastIndex,n;case"[object Symbol]":return i=e,Qe?Object(Qe.call(i)):{}}}var Je=ce&&ce.isMap,Ze=Je?pe(Je):function(e){return i(e)&&"[object Map]"==ue(e)};var et=ce&&ce.isSet,tt=et?pe(et):function(e){return i(e)&&"[object Set]"==ue(e)},st={};function it(t,s,i,a,n,r){var o,l=1&s,d=2&s,h=4&s;if(i&&(o=n?i(t,a,n,r):i(t)),void 0!==o)return o;if(!e(t))return t;var u=_e(t);if(u){if(o=function(e){var t=e.length,s=new e.constructor(t);return t&&"string"==typeof e[0]&&He.call(e,"index")&&(s.index=e.index,s.input=e.input),s}(t),!l)return function(e,t){var s=-1,i=e.length;for(t||(t=Array(i));++s<i;)t[s]=e[s];return t}(t,o)}else{var c=ue(t),p="[object Function]"==c||"[object GeneratorFunction]"==c;if(me(t))return function(e,t){if(t)return e.slice();var s=e.length,i=Ye?Ye(s):new e.constructor(s);return e.copy(i),i}(t,l);if("[object Object]"==c||"[object Arguments]"==c||p&&!n){if(o=d||p?{}:function(e){return"function"!=typeof e.constructor||se(e)?{}:Ae(Ne(e))}(t),!l)return d?function(e,t){return Ve(e,Le(e),t)}(t,function(e,t){return e&&Ve(t,Pe(t),e)}(o,t)):function(e,t){return Ve(e,re(e),t)}(t,function(e,t){return e&&Ve(t,ne(t),e)}(o,t))}else{if(!st[c])return n?t:{};o=Ge(t,c,l)}}r||(r=new ge);var _=r.get(t);if(_)return _;r.set(t,o),tt(t)?t.forEach((function(e){o.add(it(e,s,i,e,t,r))})):Ze(t)&&t.forEach((function(e,a){o.set(a,it(e,s,i,a,t,r))}));var m=u?void 0:(h?d?We:ve:d?Pe:ne)(t);return function(e,t){for(var s=-1,i=null==e?0:e.length;++s<i&&!1!==t(e[s],s,e););}(m||t,(function(e,a){m&&(e=t[a=e]),Oe(o,a,it(e,s,i,a,t,r))})),o}st["[object Arguments]"]=st["[object Array]"]=st["[object ArrayBuffer]"]=st["[object DataView]"]=st["[object Boolean]"]=st["[object Date]"]=st["[object Float32Array]"]=st["[object Float64Array]"]=st["[object Int8Array]"]=st["[object Int16Array]"]=st["[object Int32Array]"]=st["[object Map]"]=st["[object Number]"]=st["[object Object]"]=st["[object RegExp]"]=st["[object Set]"]=st["[object String]"]=st["[object Symbol]"]=st["[object Uint8Array]"]=st["[object Uint8ClampedArray]"]=st["[object Uint16Array]"]=st["[object Uint32Array]"]=!0,st["[object Error]"]=st["[object Function]"]=st["[object WeakMap]"]=!1;var at=Math.floor,nt=Math.random;var rt=parseFloat,ot=Math.min,lt=Math.random;function dt(t,s,i){if(i&&"boolean"!=typeof i&&function(t,s,i){if(!e(i))return!1;var a=typeof s;return!!("number"==a?ee(i)&&te(s,i.length):"string"==a&&s in i)&&Z(i[s],t)}(t,s,i)&&(s=i=void 0),void 0===i&&("boolean"==typeof s?(i=s,s=void 0):"boolean"==typeof t&&(i=t,t=void 0)),void 0===t&&void 0===s?(t=0,s=1):(t=Ce(t),void 0===s?(s=t,t=0):s=Ce(s)),t>s){var a=t;t=s,s=a}if(i||t%1||s%1){var n=lt();return ot(t+n*(s-t+rt("1e-"+((n+"").length-1))),s)}return function(e,t){return e+at(nt()*(t-e+1))}(t,s)}var ht=Math.min;function ut(e,t){if(e=function(e){var t=Ce(e),s=t%1;return t==t?s?t-s:t:0}(e),e<1||e>9007199254740991)return[];var s,i=4294967295,a=ht(e,4294967295);e-=4294967295;for(var n=fe(a,t="function"==typeof(s=t)?s:Ee);++i<e;)t(i);return n}class ct extends CustomEvent{constructor(e){super("change",{detail:e})}}let pt,_t,mt=e=>e;class gt extends a{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 x.styles}render(){return r(pt||(pt=mt` <div class="font-lumo text-m w-full"> <ul> ${0} </ul> <div class="p-m"> <slot></slot> </div> </div> `),this.value.map(((e,t)=>r(_t||(_t=mt` <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 ct(this.value))}}let vt,ft,yt=e=>e;class bt extends a{static get styles(){return[x.styles,o(vt||(vt=yt`: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 r(ft||(ft=yt` <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 xt,wt,$t=e=>e;class kt extends a{static get styles(){return[x.styles,o(xt||(xt=$t`::slotted(:not([slot])){margin-top:var(--lumo-space-xl)}`))]}render(){return r(wt||(wt=$t` <article class="relative antialiased font-lumo"> <header class="space-y-xs leading-s"> <h1 class="font-bold 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 Dt,St,Ct=e=>e;class Et extends kt{static get styles(){return[super.styles,o(Dt||(Dt=Ct`::slotted(:not([slot])){margin-top:var(--lumo-space-m)}`))]}render(){return r(St||(St=Ct` <section class="leading-s antialiased font-lumo"> <header> <h2 class="text-header font-semibold text-l"> <slot name="title"></slot> </h2> <p class="text-secondary text-m"> <slot name="subtitle"></slot> </p> </header> <slot></slot> </section> `))}}let It,At=e=>e;class Mt extends CustomEvent{constructor(e){super("change",{detail:e})}}class Tt extends a{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 x.styles}render(){return r(It||(It=At` <label class="${0}"> <span class="text-body 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> `),Y({"transition duration-200 flex justify-between items-center group":!0,"cursor-pointer":!this.disabled}),Y({"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}),Y({"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 Mt(this.checked))}))}}class jt extends Error{constructor(){super("Unhandled request detected. Please add a request handler to connect this component to a backend.")}}class Ot extends CustomEvent{static emit(e){return new Promise(((t,s)=>{const i=new Ot(n({resolve:t,reject:s},e));e.source.dispatchEvent(i)&&s(new jt)}))}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}}const Vt=L`<dom-module id="lumo-custom-field" theme-for="vaadin-custom-field">
|
|
1
|
+
import{e,r as t,S as s,n as i,L as a,_ as n,h as r,j as l}from"./shared-63eaded9.js";import{F as o}from"./shared-46ee137f.js";import{B as d}from"./shared-0ced76a0.js";import{E as h,F as u}from"./shared-0bda8ecb.js";import{E as c,T as p}from"./shared-df573cea.js";import"./shared-f0a83bd6.js";import{t as _,b as g,c as v,d as m}from"./shared-cd3c902e.js";import{D as x,a as b,C as f,b as y}from"./shared-710ed658.js";import"./shared-0fcdd1c4.js";import{a as $,I as w,D as k,S as E,M as j,W as S,c as C,t as I}from"./shared-a8d96c23.js";import"./shared-ec861f31.js";import{I as R}from"./shared-36629ded.js";import"./shared-bb824ab4.js";import"./foxy-i18n.js";import{c as V}from"./shared-4e709717.js";import{h as A,P as M}from"./shared-ff79f3f9.js";import"./shared-60126eee.js";import{P as T}from"./shared-94b0ae99.js";import{a9 as O,aa as q,ab as N,ac as D,ad as F,ae as L,af as U,ag as z,ah as B,ai as P,aj as H,ak as Q,al as J,am as W,an as G,ao as Y,ap as K,aq as X,ar as Z,as as ee,at as te,au as se,av as ie}from"./shared-c1dadefe.js";import{G as ae}from"./shared-9af7b5f0.js";import{p as ne}from"./shared-87ca7818.js";import{j as re}from"./shared-59e44f29.js";import{p as le,W as oe}from"./shared-b03b6d72.js";import{D as de}from"./shared-ff149b55.js";import{i as he}from"./shared-30131f76.js";import"./shared-b0f0e8b5.js";import"./shared-4fa5f144.js";import"./shared-51e28c83.js";import"./shared-6d45a07b.js";function ue(e){return e?Infinity===(e=_(e))||-Infinity===e?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function ce(e){return e}var pe=Object.create,_e=function(){function t(){}return function(s){if(!e(s))return{};if(pe)return pe(s);t.prototype=s;var i=new t;return t.prototype=void 0,i}}();var ge=function(){try{var e=O(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();function ve(e,t,s){"__proto__"==t&&ge?ge(e,t,{configurable:!0,enumerable:!0,value:s,writable:!0}):e[t]=s}var me=Object.prototype.hasOwnProperty;function xe(e,t,s){var i=e[t];me.call(e,t)&&q(i,s)&&(void 0!==s||t in e)||ve(e,t,s)}function be(e,t,s,i){var a=!s;s||(s={});for(var n=-1,r=t.length;++n<r;){var l=t[n],o=i?i(s[l],e[l],l,s,e):void 0;void 0===o&&(o=e[l]),a?ve(s,l,o):xe(s,l,o)}return s}var fe=Object.prototype.hasOwnProperty;function ye(t){if(!e(t))return function(e){var t=[];if(null!=e)for(var s in Object(e))t.push(s);return t}(t);var s=F(t),i=[];for(var a in t)("constructor"!=a||!s&&fe.call(t,a))&&i.push(a);return i}function $e(e){return N(e)?L(e,!0):ye(e)}var we=U(Object.getPrototypeOf,Object);var ke="object"==typeof exports&&exports&&!exports.nodeType&&exports,Ee=ke&&"object"==typeof module&&module&&!module.nodeType&&module,je=Ee&&Ee.exports===ke?t.Buffer:void 0,Se=je?je.allocUnsafe:void 0;var Ce=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)H(t,B(e)),e=we(e);return t}:P;function Ie(e){return Q(e,$e,Ce)}var Re=Object.prototype.hasOwnProperty;function Ve(e){var t=new e.constructor(e.byteLength);return new J(t).set(new J(e)),t}var Ae=/\w*$/;var Me=s?s.prototype:void 0,Te=Me?Me.valueOf:void 0;function Oe(e,t,s){var i,a,n,r=e.constructor;switch(t){case"[object ArrayBuffer]":return Ve(e);case"[object Boolean]":case"[object Date]":return new r(+e);case"[object DataView]":return function(e,t){var s=t?Ve(e.buffer):e.buffer;return new e.constructor(s,e.byteOffset,e.byteLength)}(e,s);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return function(e,t){var s=t?Ve(e.buffer):e.buffer;return new e.constructor(s,e.byteOffset,e.length)}(e,s);case"[object Map]":case"[object Set]":return new r;case"[object Number]":case"[object String]":return new r(e);case"[object RegExp]":return(n=new(a=e).constructor(a.source,Ae.exec(a))).lastIndex=a.lastIndex,n;case"[object Symbol]":return i=e,Te?Object(Te.call(i)):{}}}var qe=G&&G.isMap,Ne=qe?Y(qe):function(e){return i(e)&&"[object Map]"==W(e)};var De=G&&G.isSet,Fe=De?Y(De):function(e){return i(e)&&"[object Set]"==W(e)},Le={};function Ue(t,s,i,a,n,r){var l,o=1&s,d=2&s,h=4&s;if(i&&(l=n?i(t,a,n,r):i(t)),void 0!==l)return l;if(!e(t))return t;var u=K(t);if(u){if(l=function(e){var t=e.length,s=new e.constructor(t);return t&&"string"==typeof e[0]&&Re.call(e,"index")&&(s.index=e.index,s.input=e.input),s}(t),!o)return function(e,t){var s=-1,i=e.length;for(t||(t=Array(i));++s<i;)t[s]=e[s];return t}(t,l)}else{var c=W(t),p="[object Function]"==c||"[object GeneratorFunction]"==c;if(X(t))return function(e,t){if(t)return e.slice();var s=e.length,i=Se?Se(s):new e.constructor(s);return e.copy(i),i}(t,o);if("[object Object]"==c||"[object Arguments]"==c||p&&!n){if(l=d||p?{}:function(e){return"function"!=typeof e.constructor||F(e)?{}:_e(we(e))}(t),!o)return d?function(e,t){return be(e,Ce(e),t)}(t,function(e,t){return e&&be(t,$e(t),e)}(l,t)):function(e,t){return be(e,B(e),t)}(t,function(e,t){return e&&be(t,z(t),e)}(l,t))}else{if(!Le[c])return n?t:{};l=Oe(t,c,o)}}r||(r=new Z);var _=r.get(t);if(_)return _;r.set(t,l),Fe(t)?t.forEach((function(e){l.add(Ue(e,s,i,e,t,r))})):Ne(t)&&t.forEach((function(e,a){l.set(a,Ue(e,s,i,a,t,r))}));var g=u?void 0:(h?d?Ie:ee:d?$e:z)(t);return function(e,t){for(var s=-1,i=null==e?0:e.length;++s<i&&!1!==t(e[s],s,e););}(g||t,(function(e,a){g&&(e=t[a=e]),xe(l,a,Ue(e,s,i,a,t,r))})),l}Le["[object Arguments]"]=Le["[object Array]"]=Le["[object ArrayBuffer]"]=Le["[object DataView]"]=Le["[object Boolean]"]=Le["[object Date]"]=Le["[object Float32Array]"]=Le["[object Float64Array]"]=Le["[object Int8Array]"]=Le["[object Int16Array]"]=Le["[object Int32Array]"]=Le["[object Map]"]=Le["[object Number]"]=Le["[object Object]"]=Le["[object RegExp]"]=Le["[object Set]"]=Le["[object String]"]=Le["[object Symbol]"]=Le["[object Uint8Array]"]=Le["[object Uint8ClampedArray]"]=Le["[object Uint16Array]"]=Le["[object Uint32Array]"]=!0,Le["[object Error]"]=Le["[object Function]"]=Le["[object WeakMap]"]=!1;var ze=Math.floor,Be=Math.random;var Pe=parseFloat,He=Math.min,Qe=Math.random;function Je(t,s,i){if(i&&"boolean"!=typeof i&&function(t,s,i){if(!e(i))return!1;var a=typeof s;return!!("number"==a?N(i)&&D(s,i.length):"string"==a&&s in i)&&q(i[s],t)}(t,s,i)&&(s=i=void 0),void 0===i&&("boolean"==typeof s?(i=s,s=void 0):"boolean"==typeof t&&(i=t,t=void 0)),void 0===t&&void 0===s?(t=0,s=1):(t=ue(t),void 0===s?(s=t,t=0):s=ue(s)),t>s){var a=t;t=s,s=a}if(i||t%1||s%1){var n=Qe();return He(t+n*(s-t+Pe("1e-"+((n+"").length-1))),s)}return function(e,t){return e+ze(Be()*(t-e+1))}(t,s)}var We=Math.min;function Ge(e,t){if(e=function(e){var t=ue(e),s=t%1;return t==t?s?t-s:t:0}(e),e<1||e>9007199254740991)return[];var s,i=4294967295,a=We(e,4294967295);e-=4294967295;for(var n=te(a,t="function"==typeof(s=t)?s:ce);++i<e;)t(i);return n}class Ye extends CustomEvent{constructor(e){super("change",{detail:e})}}let Ke,Xe,Ze=e=>e;class et extends a{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 g.styles}render(){return r(Ke||(Ke=Ze` <div class="font-lumo text-m w-full"> <ul> ${0} </ul> <div class="p-m"> <slot></slot> </div> </div> `),this.value.map(((e,t)=>r(Xe||(Xe=Ze` <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 Ye(this.value))}}let tt,st,it=e=>e;class at extends a{static get styles(){return[g.styles,l(tt||(tt=it`: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 r(st||(st=it` <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 nt,rt,lt=e=>e;class ot extends a{static get styles(){return[g.styles,l(nt||(nt=lt`::slotted(:not([slot])){margin-top:var(--lumo-space-xl)}`))]}render(){return r(rt||(rt=lt` <article class="relative antialiased font-lumo"> <header class="space-y-xs leading-s"> <h1 class="font-bold 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 dt,ht,ut=e=>e;class ct extends ot{static get styles(){return[super.styles,l(dt||(dt=ut`::slotted(:not([slot])){margin-top:var(--lumo-space-m)}`))]}render(){return r(ht||(ht=ut` <section class="leading-s antialiased font-lumo"> <header> <h2 class="text-header font-semibold text-l"> <slot name="title"></slot> </h2> <p class="text-secondary text-m"> <slot name="subtitle"></slot> </p> </header> <slot></slot> </section> `))}}let pt,_t=e=>e;class gt extends CustomEvent{constructor(e){super("change",{detail:e})}}class vt extends a{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 g.styles}render(){return r(pt||(pt=_t` <label class="${0}"> <span class="text-body 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> `),V({"transition duration-200 flex justify-between items-center group":!0,"cursor-pointer":!this.disabled}),V({"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}),V({"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 gt(this.checked))}))}}class mt extends Error{constructor(){super("Unhandled request detected. Please add a request handler to connect this component to a backend.")}}class xt extends CustomEvent{static emit(e){return new Promise(((t,s)=>{const i=new xt(n({resolve:t,reject:s},e));e.source.dispatchEvent(i)&&s(new mt)}))}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}}const bt=A`<dom-module id="lumo-custom-field" theme-for="vaadin-custom-field">
|
|
2
2
|
<template>
|
|
3
3
|
<style include="lumo-required-field">
|
|
4
4
|
:host {
|
|
@@ -122,12 +122,12 @@ import{e,r as t,S as s,n as i,L as a,_ as n,h as r,j as o}from"./shared-63eaded9
|
|
|
122
122
|
}
|
|
123
123
|
</style>
|
|
124
124
|
</template>
|
|
125
|
-
</dom-module>`;document.head.appendChild(
|
|
125
|
+
</dom-module>`;document.head.appendChild(bt.content);const ft=e=>class extends e{static get properties(){return{inputs:{type:Array,readOnly:!0},i18n:{type:Object,value:()=>({parseValue:function(e){return e.split("\t")},formatValue:function(e){return e.join("\t")}})},__errorId:String,__labelId:String,__helperTextId:String,__hasSlottedHelper:Boolean}}connectedCallback(){super.connectedCallback(),this.__observer&&this.__observer.connect()}disconnectedCallback(){super.disconnectedCallback(),this.__observer&&this.__observer.disconnect()}ready(){super.ready(),this.__setInputsFromSlot(),this.__observer=new o(this.$.slot,(()=>{this.__setInputsFromSlot()})),this.$.helperSlot.addEventListener("slotchange",this.__onHelperSlotChange.bind(this)),this.__onHelperSlotChange();const e=/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor);this.addEventListener("keydown",(t=>{if(9===t.keyCode){if("slot"===t.target.parentElement.localName&&!t.defaultPrevented&&e){const e=t.target.parentElement;e.setAttribute("tabindex",-1),setTimeout((()=>e.removeAttribute("tabindex")))}this.inputs.indexOf(t.target)<this.inputs.length-1&&!t.shiftKey||this.inputs.indexOf(t.target)>0&&t.shiftKey?this.dispatchEvent(new CustomEvent("internal-tab")):this.__setValue()}})),this.addEventListener("focusin",(()=>this.setAttribute("focused",""))),this.addEventListener("focusout",(e=>{const t=this.getRootNode().activeElement;this.inputs.some((e=>t===e||e.shadowRoot&&e.shadowRoot.contains(t)))||this.removeAttribute("focused")}));var t=ft._uniqueId=1+ft._uniqueId||1;this.__errorId=`${this.constructor.is}-error-${t}`,this.__labelId=`${this.constructor.is}-label-${t}`,this.__helperTextId=`${this.constructor.is}-helper-${t}`}focus(){this.inputs&&this.inputs[0]&&this.inputs[0].focus()}__updateValue(e){e&&e.stopPropagation(),this.__setValue(),this.validate(),this.dispatchEvent(new CustomEvent("change",{bubbles:!0,cancelable:!1,detail:{value:this.value}}))}__setValue(){this.__settingValue=!0,this.value=this.i18n.formatValue.apply(this,[this.inputs.map((e=>e.value))]),this.__settingValue=!1}__queryAllAssignedElements(e){const t=[];let s;return"SLOT"===e.tagName?s=e.assignedNodes({flatten:!0}).filter((e=>e.nodeType===Node.ELEMENT_NODE)):(t.push(e),s=Array.from(e.children)),s.forEach((e=>t.push(...this.__queryAllAssignedElements(e)))),t}__getInputsFromSlot(){return this.__queryAllAssignedElements(this.$.slot).filter((e=>e.validate||e.checkValidity))}__setInputsFromSlot(){this._setInputs(this.__getInputsFromSlot()),this.__setValue()}__valueChanged(e,t){if(this.__settingValue||!this.inputs)return;const s=this.i18n.parseValue(e);s&&0!=s.length?(this.inputs.forEach(((e,t)=>e.value=s[t])),void 0!==t&&this.validate()):console.warn("Value parser has not provided values array")}__onHelperSlotChange(){const e=this.$.helperSlot.assignedNodes({flatten:!0});this.__hasSlottedHelper=e.filter((e=>3!==e.nodeType)).length>0,this.__hasSlottedHelper?this.setAttribute("has-helper","slotted"):""!==this.helperText&&null!==this.helperText||this.removeAttribute("has-helper")}}
|
|
126
126
|
/**
|
|
127
127
|
@license
|
|
128
128
|
Copyright (c) 2018 Vaadin Ltd.
|
|
129
129
|
This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
130
|
-
*/;class
|
|
130
|
+
*/;class yt extends(c(ft(p(M)))){static get template(){return A`
|
|
131
131
|
<style>
|
|
132
132
|
:host {
|
|
133
133
|
display: inline-flex;
|
|
@@ -166,807 +166,4 @@ This program is available under Apache License Version 2.0, available at https:/
|
|
|
166
166
|
</div>
|
|
167
167
|
<div part="error-message" id="[[__errorId]]" aria-live="assertive" aria-hidden\$="[[__getErrorMessageAriaHidden(invalid, errorMessage, __errorId)]]">[[errorMessage]]</div>
|
|
168
168
|
</div>
|
|
169
|
-
`}static get is(){return"vaadin-custom-field"}static get version(){return"1.3.0"}static get properties(){return{label:{type:String,value:"",observer:"_labelChanged"},name:String,required:{type:Boolean,reflectToAttribute:!0},value:{type:String,observer:"__valueChanged",notify:!0},invalid:{type:Boolean,reflectToAttribute:!0,notify:!0,value:!1,observer:"__invalidChanged"},errorMessage:{type:String,value:"",observer:"__errorMessageChanged"},helperText:{type:String,value:"",observer:"__helperTextChanged"}}}static get observers(){return["__getActiveErrorId(invalid, errorMessage, __errorId, helperText, __helperTextId, __hasSlottedHelper)","__getActiveLabelId(label, __labelId)","__toggleHasValue(value)"]}__invalidChanged(e){this.__setOrToggleAttribute("aria-invalid",e,this)}__errorMessageChanged(e){this.__setOrToggleAttribute("has-error-message",!!e,this)}__helperTextChanged(e){this.__setOrToggleAttribute("has-helper",!!e,this)}__toggleHasValue(e){null!==e&&""!==e.trim()?this.setAttribute("has-value",""):this.removeAttribute("has-value")}_labelChanged(e){""!==e&&null!=e?this.setAttribute("has-label",""):this.removeAttribute("has-label")}validate(){return!(this.invalid=!this.checkValidity())}checkValidity(){return!(this.inputs.filter((e=>!(e.validate||e.checkValidity).call(e))).length||this.required&&!this.value.trim())}__setOrToggleAttribute(e,t,s){e&&s&&s.hasAttribute(e)===!t&&(t?s.setAttribute(e,"boolean"==typeof t?"":t):s.removeAttribute(e))}__getActiveErrorId(e,t,s,i,a,n){const r=[];(i||n)&&r.push(a),t&&e&&r.push(s),r.length>0?this.setAttribute("aria-describedby",r.join(" ")):this.removeAttribute("aria-describedby")}__getActiveLabelId(e,t){this.__setOrToggleAttribute("aria-labelledby",e?t:void 0,this)}__getErrorMessageAriaHidden(e,t,s){return(!(t&&e?s:void 0)).toString()}}customElements.define(Rt.is,Rt);let Pt,Nt=e=>e;class Bt extends CustomEvent{constructor(e){super("change",{detail:e})}}class qt extends w{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":k,"vaadin-custom-field":Rt,"vaadin-select":I,"x-i18n":A}}static get properties(){return n(n({},super.properties),{},{disabled:{attribute:!1},value:{attribute:!1}})}render(){var e;return r(Pt||(Pt=Nt` <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(),Y({"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 Bt({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 zt,Yt=e=>e;class Lt extends CustomEvent{constructor(e){super("change",{detail:e})}}class Wt extends w{constructor(){super(...arguments),this.disabled=!1,this.value="",this.__errorMessage=""}static get scopedElements(){return{"vaadin-password-field":G,"vaadin-button":p,"iron-icon":customElements.get("iron-icon"),"x-i18n":A}}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 r(zt||(zt=Yt` <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=ut(72,(()=>dt(35).toString(36))).join(""),this.dispatchEvent(new Lt({value:this.value,invalid:!1}))}__handleInput(e){this.value=e.target.value,this.dispatchEvent(new Lt({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 Ht(e){return t=>{t.preventDefault(),e(t)}}class Ut extends D{}let Xt,Kt=e=>e;class Qt extends w{constructor(){super("customer-portal-settings"),this.disabled=!1,this.value=Qt.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":M}}static get properties(){return n(n({},super.properties),{},{disabled:{type:Boolean},value:{type:String}})}render(){return r(Xt||(Xt=Kt` <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 we(null!==(e=this.value)&&void 0!==e?e:"").count}get __unitsValue(){var e;return we(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 Ut(this.value))}}Qt.defaultValue="1w";class Gt extends ct{}let Jt,Zt,es,ts,ss=e=>e;class is extends w{constructor(){super("customer-portal-settings"),this.value=[],this.disabled=!1,this.__newValue=Qt.defaultValue}static get scopedElements(){return{"iron-icon":customElements.get("iron-icon"),"vaadin-button":customElements.get("vaadin-button"),"x-frequency-input":Qt,"x-skeleton":T,"x-list":gt,"x-i18n":A}}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 r(Jt||(Jt=ss` <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?r(Zt||(Zt=ss`<span slot="${0}">${0}</span>`),t,this.__getText(e)):r(es||(es=ss`<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?r(ts||(ts=ss` <x-i18n .ns="${0}" .lang="${0}" key="fmod.add_option_hint" class="${0}"> </x-i18n> `),this.ns,this.lang,Y({"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=Qt.defaultValue,this.__sendChange()}__sendChange(){this.dispatchEvent(new Gt(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 as extends S{}let ns,rs,os=e=>e;class ls extends w{constructor(){super(...arguments),this.disabled=!1,this.value="*",this.__errorMessage="",this.__items=["all","some"],this.__handleNewValueChange=$((e=>{try{$e(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":C,"x-i18n":A}}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 r(ns||(ns=os` <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]?r(rs||(rs=os` <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 as(this.value))}}class ds extends CustomEvent{constructor(e){super("change",{detail:e})}}class hs extends CustomEvent{constructor(){super("remove")}}let us,cs,ps=e=>e;class _s extends w{constructor(){super(...arguments),this.open=!1,this.value={jsonataQuery:"*",values:[]},this.disabled=!1}static get scopedElements(){return{"x-frequency-list":is,"x-jsonata-input":ls,"iron-icon":customElements.get("iron-icon"),"x-group":xe,"x-i18n":A}}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 r(us||(us=ps` <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> `),Y({"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,Ht((()=>{this.dispatchEvent(new hs)})),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}=we(e);return this._t("frequency",{units:this._t(s,{count:t}),count:t})}__renderJSONataSummary(e){return r(cs||(cs=ps` <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 ds(this.value))}}class ms extends CustomEvent{constructor(e){super("change",{detail:e})}}let gs,vs,fs=e=>e;class ys extends w{constructor(){super(...arguments),this.value=[],this.disabled=!1}static get scopedElements(){return{"x-frequency-modification-rule":_s,"vaadin-button":customElements.get("vaadin-button"),"x-section":Et,"iron-icon":customElements.get("iron-icon"),"x-group":xe,"x-i18n":A}}static get properties(){return n(n({},super.properties),{},{value:{type:Array},disabled:{type:Boolean}})}render(){const{ns:e,lang:t}=this;return r(gs||(gs=fs` <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)=>r(vs||(vs=fs` <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,Y({"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 ms(this.value))}}function bs(e,t){const s=(new Date).getFullYear(),i={month:"long",day:"numeric"};return e.split("..").map((e=>{const a=ke(e),r=(null==a?void 0:a.getFullYear())===s?void 0:"numeric";return null==a?void 0:a.toLocaleDateString(t,n({year:r},i))})).join(" – ")}class xs extends CustomEvent{constructor(e){super("change",{detail:e})}}let ws,$s,ks,Ds=e=>e;class Ss extends w{constructor(){super("customer-portal-settings"),this.disabled=!1,this.__items=["all","month","day"]}static get scopedElements(){return{"x-monthday-picker":j,"x-weekday-picker":O,"x-choice":C,"x-i18n":A}}static get properties(){return n(n({},super.properties),{},{disabled:{type:Boolean},value:{type:Object}})}render(){var e,t,s,i;return r(ws||(ws=Ds` <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)?r($s||($s=Ds` <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)?r(ks||(ks=Ds` <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 xs(this.value))}}const Cs=L`<dom-module id="lumo-date-picker-overlay" theme-for="vaadin-date-picker-overlay">
|
|
170
|
-
<template>
|
|
171
|
-
<style include="lumo-menu-overlay">
|
|
172
|
-
[part="overlay"] {
|
|
173
|
-
/*
|
|
174
|
-
Width:
|
|
175
|
-
date cell widths
|
|
176
|
-
+ month calendar side padding
|
|
177
|
-
+ year scroller width
|
|
178
|
-
*/
|
|
179
|
-
width:
|
|
180
|
-
calc(
|
|
181
|
-
var(--lumo-size-m) * 7
|
|
182
|
-
+ var(--lumo-space-xs) * 2
|
|
183
|
-
+ 57px
|
|
184
|
-
);
|
|
185
|
-
height: 100%;
|
|
186
|
-
max-height: calc(var(--lumo-size-m) * 14);
|
|
187
|
-
overflow: hidden;
|
|
188
|
-
-webkit-tap-highlight-color: transparent;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
[part="overlay"] {
|
|
192
|
-
flex-direction: column;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
[part="content"] {
|
|
196
|
-
padding: 0;
|
|
197
|
-
height: 100%;
|
|
198
|
-
overflow: hidden;
|
|
199
|
-
-webkit-mask-image: none;
|
|
200
|
-
mask-image: none;
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
@media (max-width: 420px), (max-height: 420px) {
|
|
204
|
-
[part="overlay"] {
|
|
205
|
-
width: 100vw;
|
|
206
|
-
height: 70vh;
|
|
207
|
-
max-height: 70vh;
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
</style>
|
|
211
|
-
</template>
|
|
212
|
-
</dom-module>`;document.head.appendChild(Cs.content);const Es=L`<dom-module id="lumo-date-picker-overlay-content" theme-for="vaadin-date-picker-overlay-content">
|
|
213
|
-
<template>
|
|
214
|
-
<style>
|
|
215
|
-
:host {
|
|
216
|
-
position: relative;
|
|
217
|
-
background-color: transparent;
|
|
218
|
-
/* Background for the year scroller, placed here as we are using a mask image on the actual years part */
|
|
219
|
-
background-image: linear-gradient(var(--lumo-shade-5pct), var(--lumo-shade-5pct));
|
|
220
|
-
background-size: 57px 100%;
|
|
221
|
-
background-position: top right;
|
|
222
|
-
background-repeat: no-repeat;
|
|
223
|
-
cursor: default;
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
/* Month scroller */
|
|
227
|
-
|
|
228
|
-
[part="months"] {
|
|
229
|
-
/* Month calendar height:
|
|
230
|
-
header height + margin-bottom
|
|
231
|
-
+ weekdays height + margin-bottom
|
|
232
|
-
+ date cell heights
|
|
233
|
-
+ small margin between month calendars
|
|
234
|
-
*/
|
|
235
|
-
--vaadin-infinite-scroller-item-height:
|
|
236
|
-
calc(
|
|
237
|
-
var(--lumo-font-size-l) + var(--lumo-space-m)
|
|
238
|
-
+ var(--lumo-font-size-xs) + var(--lumo-space-s)
|
|
239
|
-
+ var(--lumo-size-m) * 6
|
|
240
|
-
+ var(--lumo-space-s)
|
|
241
|
-
);
|
|
242
|
-
--vaadin-infinite-scroller-buffer-offset: 20%;
|
|
243
|
-
-webkit-mask-image: linear-gradient(transparent, #000 10%, #000 85%, transparent);
|
|
244
|
-
mask-image: linear-gradient(transparent, #000 10%, #000 85%, transparent);
|
|
245
|
-
position: relative;
|
|
246
|
-
margin-right: 57px;
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
/* Year scroller */
|
|
250
|
-
|
|
251
|
-
[part="years"] {
|
|
252
|
-
/* TODO get rid of fixed magic number */
|
|
253
|
-
--vaadin-infinite-scroller-buffer-width: 97px;
|
|
254
|
-
width: 57px;
|
|
255
|
-
height: auto;
|
|
256
|
-
top: 0;
|
|
257
|
-
bottom: 0;
|
|
258
|
-
font-size: var(--lumo-font-size-s);
|
|
259
|
-
box-shadow: inset 2px 0 4px 0 var(--lumo-shade-5pct);
|
|
260
|
-
-webkit-mask-image: linear-gradient(transparent, #000 35%, #000 65%, transparent);
|
|
261
|
-
mask-image: linear-gradient(transparent, #000 35%, #000 65%, transparent);
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
[part="year-number"],
|
|
265
|
-
[part="year-separator"] {
|
|
266
|
-
opacity: 0.5;
|
|
267
|
-
transition: 0.2s opacity;
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
[part="years"]:hover [part="year-number"],
|
|
271
|
-
[part="years"]:hover [part="year-separator"] {
|
|
272
|
-
opacity: 1;
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
/* TODO unsupported selector */
|
|
276
|
-
#scrollers {
|
|
277
|
-
position: static;
|
|
278
|
-
display: block;
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
/* TODO unsupported selector, should fix this in vaadin-date-picker that it adapts to the
|
|
282
|
-
* width of the year scroller */
|
|
283
|
-
#scrollers[desktop] [part="months"] {
|
|
284
|
-
right: auto;
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
/* Year scroller position indicator */
|
|
288
|
-
[part="years"]::before {
|
|
289
|
-
border: none;
|
|
290
|
-
width: 1em;
|
|
291
|
-
height: 1em;
|
|
292
|
-
background-color: var(--lumo-base-color);
|
|
293
|
-
background-image: linear-gradient(var(--lumo-tint-5pct), var(--lumo-tint-5pct));
|
|
294
|
-
transform: translate(-75%, -50%) rotate(45deg);
|
|
295
|
-
border-top-right-radius: calc(var(--lumo-border-radius) / 2);
|
|
296
|
-
box-shadow: 2px -2px 6px 0 var(--lumo-shade-5pct);
|
|
297
|
-
z-index: 1;
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
[part="year-number"],
|
|
301
|
-
[part="year-separator"] {
|
|
302
|
-
display: flex;
|
|
303
|
-
align-items: center;
|
|
304
|
-
justify-content: center;
|
|
305
|
-
height: 50%;
|
|
306
|
-
transform: translateY(-50%);
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
[part="years"] [part="year-separator"]::after {
|
|
310
|
-
color: var(--lumo-disabled-text-color);
|
|
311
|
-
content: "•";
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
/* Current year */
|
|
315
|
-
|
|
316
|
-
[part="years"] [part="year-number"][current] {
|
|
317
|
-
color: var(--lumo-primary-text-color);
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
/* Toolbar (footer) */
|
|
321
|
-
|
|
322
|
-
[part="toolbar"] {
|
|
323
|
-
padding: var(--lumo-space-s);
|
|
324
|
-
box-shadow: 0 -1px 0 0 var(--lumo-contrast-10pct);
|
|
325
|
-
border-bottom-left-radius: var(--lumo-border-radius);
|
|
326
|
-
margin-right: 57px;
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
@supports (mask-image: linear-gradient(#000, #000)) or (-webkit-mask-image: linear-gradient(#000, #000)) {
|
|
330
|
-
[part="toolbar"] {
|
|
331
|
-
box-shadow: none;
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
[part="toolbar"] [part\$="button"] {
|
|
336
|
-
margin: 0;
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
/* Narrow viewport mode (fullscreen) */
|
|
340
|
-
|
|
341
|
-
:host([fullscreen]) [part="toolbar"] {
|
|
342
|
-
order: -1;
|
|
343
|
-
background-color: var(--lumo-base-color);
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
:host([fullscreen]) [part="overlay-header"] {
|
|
347
|
-
order: -2;
|
|
348
|
-
height: var(--lumo-size-m);
|
|
349
|
-
padding: var(--lumo-space-s);
|
|
350
|
-
position: absolute;
|
|
351
|
-
left: 0;
|
|
352
|
-
right: 0;
|
|
353
|
-
justify-content: center;
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
:host([fullscreen]) [part="toggle-button"],
|
|
357
|
-
:host([fullscreen]) [part="clear-button"],
|
|
358
|
-
[part="overlay-header"] [part="label"] {
|
|
359
|
-
display: none;
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
/* Very narrow screen (year scroller initially hidden) */
|
|
363
|
-
|
|
364
|
-
[part="years-toggle-button"] {
|
|
365
|
-
position: relative;
|
|
366
|
-
right: auto;
|
|
367
|
-
display: flex;
|
|
368
|
-
align-items: center;
|
|
369
|
-
height: var(--lumo-size-s);
|
|
370
|
-
padding: 0 0.5em;
|
|
371
|
-
border-radius: var(--lumo-border-radius);
|
|
372
|
-
z-index: 3;
|
|
373
|
-
color: var(--lumo-primary-text-color);
|
|
374
|
-
font-weight: 500;
|
|
375
|
-
-webkit-font-smoothing: antialiased;
|
|
376
|
-
-moz-osx-font-smoothing: grayscale;
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
:host([years-visible]) [part="years-toggle-button"] {
|
|
380
|
-
background-color: var(--lumo-primary-color);
|
|
381
|
-
color: var(--lumo-primary-contrast-color);
|
|
382
|
-
}
|
|
383
|
-
|
|
384
|
-
[part="years-toggle-button"]::before {
|
|
385
|
-
content: none;
|
|
386
|
-
}
|
|
387
|
-
|
|
388
|
-
/* TODO magic number (same as used for iron-media-query in vaadin-date-picker-overlay-content) */
|
|
389
|
-
@media screen and (max-width: 374px) {
|
|
390
|
-
:host {
|
|
391
|
-
background-image: none;
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
[part="years"] {
|
|
395
|
-
background-color: var(--lumo-shade-5pct);
|
|
396
|
-
}
|
|
397
|
-
|
|
398
|
-
[part="toolbar"],
|
|
399
|
-
[part="months"] {
|
|
400
|
-
margin-right: 0;
|
|
401
|
-
}
|
|
402
|
-
|
|
403
|
-
/* TODO make date-picker adapt to the width of the years part */
|
|
404
|
-
[part="years"] {
|
|
405
|
-
--vaadin-infinite-scroller-buffer-width: 90px;
|
|
406
|
-
width: 50px;
|
|
407
|
-
}
|
|
408
|
-
|
|
409
|
-
:host([years-visible]) [part="months"] {
|
|
410
|
-
padding-left: 50px;
|
|
411
|
-
}
|
|
412
|
-
}
|
|
413
|
-
</style>
|
|
414
|
-
</template>
|
|
415
|
-
</dom-module>`;document.head.appendChild(Es.content);const Is=L`<dom-module id="lumo-month-calendar" theme-for="vaadin-month-calendar">
|
|
416
|
-
<template>
|
|
417
|
-
<style>
|
|
418
|
-
:host {
|
|
419
|
-
-moz-user-select: none;
|
|
420
|
-
-ms-user-select: none;
|
|
421
|
-
-webkit-user-select: none;
|
|
422
|
-
-webkit-tap-highlight-color: transparent;
|
|
423
|
-
user-select: none;
|
|
424
|
-
font-size: var(--lumo-font-size-m);
|
|
425
|
-
color: var(--lumo-body-text-color);
|
|
426
|
-
text-align: center;
|
|
427
|
-
padding: 0 var(--lumo-space-xs);
|
|
428
|
-
}
|
|
429
|
-
|
|
430
|
-
/* Month header */
|
|
431
|
-
|
|
432
|
-
[part="month-header"] {
|
|
433
|
-
color: var(--lumo-header-text-color);
|
|
434
|
-
font-size: var(--lumo-font-size-l);
|
|
435
|
-
line-height: 1;
|
|
436
|
-
font-weight: 500;
|
|
437
|
-
margin-bottom: var(--lumo-space-m);
|
|
438
|
-
}
|
|
439
|
-
|
|
440
|
-
/* Week days and numbers */
|
|
441
|
-
|
|
442
|
-
[part="weekdays"],
|
|
443
|
-
[part="weekday"],
|
|
444
|
-
[part="week-numbers"] {
|
|
445
|
-
font-size: var(--lumo-font-size-xs);
|
|
446
|
-
line-height: 1;
|
|
447
|
-
color: var(--lumo-tertiary-text-color);
|
|
448
|
-
}
|
|
449
|
-
|
|
450
|
-
[part="weekdays"] {
|
|
451
|
-
margin-bottom: var(--lumo-space-s);
|
|
452
|
-
}
|
|
453
|
-
|
|
454
|
-
/* TODO should have part="week-number" for the cell in weekdays-container */
|
|
455
|
-
[part="weekday"]:empty,
|
|
456
|
-
[part="week-numbers"] {
|
|
457
|
-
width: var(--lumo-size-xs);
|
|
458
|
-
}
|
|
459
|
-
|
|
460
|
-
/* Date and week number cells */
|
|
461
|
-
|
|
462
|
-
[part="date"],
|
|
463
|
-
[part="week-number"] {
|
|
464
|
-
box-sizing: border-box;
|
|
465
|
-
display: inline-flex;
|
|
466
|
-
align-items: center;
|
|
467
|
-
justify-content: center;
|
|
468
|
-
height: var(--lumo-size-m);
|
|
469
|
-
position: relative;
|
|
470
|
-
}
|
|
471
|
-
|
|
472
|
-
[part="date"] {
|
|
473
|
-
transition: color 0.1s;
|
|
474
|
-
}
|
|
475
|
-
|
|
476
|
-
/* Today date */
|
|
477
|
-
|
|
478
|
-
[part="date"][today] {
|
|
479
|
-
color: var(--lumo-primary-text-color);
|
|
480
|
-
}
|
|
481
|
-
|
|
482
|
-
/* Focused date */
|
|
483
|
-
|
|
484
|
-
[part="date"]::before {
|
|
485
|
-
content: "";
|
|
486
|
-
position: absolute;
|
|
487
|
-
z-index: -1;
|
|
488
|
-
top: 50%;
|
|
489
|
-
left: 50%;
|
|
490
|
-
transform: translate(-50%, -50%);
|
|
491
|
-
min-width: 2em;
|
|
492
|
-
min-height: 2em;
|
|
493
|
-
width: 80%;
|
|
494
|
-
height: 80%;
|
|
495
|
-
max-height: 100%;
|
|
496
|
-
max-width: 100%;
|
|
497
|
-
border-radius: var(--lumo-border-radius);
|
|
498
|
-
}
|
|
499
|
-
|
|
500
|
-
[part="date"][focused]::before {
|
|
501
|
-
box-shadow: 0 0 0 2px var(--lumo-primary-color-50pct);
|
|
502
|
-
}
|
|
503
|
-
|
|
504
|
-
:host(:not([focused])) [part="date"][focused]::before {
|
|
505
|
-
animation: vaadin-date-picker-month-calendar-focus-date 1.4s infinite;
|
|
506
|
-
}
|
|
507
|
-
|
|
508
|
-
@keyframes vaadin-date-picker-month-calendar-focus-date {
|
|
509
|
-
50% {
|
|
510
|
-
box-shadow: 0 0 0 2px transparent;
|
|
511
|
-
}
|
|
512
|
-
}
|
|
513
|
-
|
|
514
|
-
/* TODO should not rely on the role attribute */
|
|
515
|
-
[part="date"][role="button"]:not([disabled]):not([selected]):hover::before {
|
|
516
|
-
background-color: var(--lumo-primary-color-10pct);
|
|
517
|
-
}
|
|
518
|
-
|
|
519
|
-
[part="date"][selected] {
|
|
520
|
-
color: var(--lumo-primary-contrast-color);
|
|
521
|
-
}
|
|
522
|
-
|
|
523
|
-
[part="date"][selected]::before {
|
|
524
|
-
background-color: var(--lumo-primary-color);
|
|
525
|
-
}
|
|
526
|
-
|
|
527
|
-
[part="date"][disabled] {
|
|
528
|
-
color: var(--lumo-disabled-text-color);
|
|
529
|
-
}
|
|
530
|
-
|
|
531
|
-
@media (pointer: coarse) {
|
|
532
|
-
[part="date"]:hover:not([selected])::before,
|
|
533
|
-
[part="date"][focused]:not([selected])::before {
|
|
534
|
-
display: none;
|
|
535
|
-
}
|
|
536
|
-
|
|
537
|
-
[part="date"][role="button"]:not([disabled]):active::before {
|
|
538
|
-
display: block;
|
|
539
|
-
}
|
|
540
|
-
|
|
541
|
-
[part="date"][selected]::before {
|
|
542
|
-
box-shadow: none;
|
|
543
|
-
}
|
|
544
|
-
}
|
|
545
|
-
|
|
546
|
-
/* Disabled */
|
|
547
|
-
|
|
548
|
-
:host([disabled]) * {
|
|
549
|
-
color: var(--lumo-disabled-text-color) !important;
|
|
550
|
-
}
|
|
551
|
-
</style>
|
|
552
|
-
</template>
|
|
553
|
-
</dom-module><custom-style>
|
|
554
|
-
<style>
|
|
555
|
-
@keyframes vaadin-date-picker-month-calendar-focus-date {
|
|
556
|
-
50% {
|
|
557
|
-
box-shadow: 0 0 0 2px transparent;
|
|
558
|
-
}
|
|
559
|
-
}
|
|
560
|
-
</style>
|
|
561
|
-
</custom-style>`;document.head.appendChild(Is.content);const As=L`<dom-module id="lumo-date-picker" theme-for="vaadin-date-picker">
|
|
562
|
-
<template>
|
|
563
|
-
<style include="lumo-field-button">
|
|
564
|
-
:host {
|
|
565
|
-
outline: none;
|
|
566
|
-
}
|
|
567
|
-
|
|
568
|
-
[part="toggle-button"]::before {
|
|
569
|
-
content: var(--lumo-icons-calendar);
|
|
570
|
-
}
|
|
571
|
-
|
|
572
|
-
[part="clear-button"]::before {
|
|
573
|
-
content: var(--lumo-icons-cross);
|
|
574
|
-
}
|
|
575
|
-
|
|
576
|
-
@media (max-width: 420px), (max-height: 420px) {
|
|
577
|
-
[part="overlay-content"] {
|
|
578
|
-
height: 70vh;
|
|
579
|
-
}
|
|
580
|
-
}
|
|
581
|
-
</style>
|
|
582
|
-
</template>
|
|
583
|
-
</dom-module>`;document.head.appendChild(As.content);const Ms=L`<dom-module id="lumo-date-picker-text-field" theme-for="vaadin-date-picker-text-field">
|
|
584
|
-
<template>
|
|
585
|
-
<style>
|
|
586
|
-
:not(*):placeholder-shown, /* to prevent broken styles on IE */
|
|
587
|
-
:host([dir="rtl"]) [part="value"]:placeholder-shown,
|
|
588
|
-
:host([dir="rtl"]) [part="input-field"] ::slotted(input:placeholder-shown) {
|
|
589
|
-
--_lumo-text-field-overflow-mask-image: none;
|
|
590
|
-
}
|
|
591
|
-
|
|
592
|
-
:host([dir="rtl"]) [part="value"],
|
|
593
|
-
:host([dir="rtl"]) [part="input-field"] ::slotted(input) {
|
|
594
|
-
--_lumo-text-field-overflow-mask-image: linear-gradient(to left, transparent, #000 1.25em);
|
|
595
|
-
}
|
|
596
|
-
</style>
|
|
597
|
-
</template>
|
|
598
|
-
</dom-module>`;document.head.appendChild(Ms.content);
|
|
599
|
-
/**
|
|
600
|
-
@license
|
|
601
|
-
Copyright (c) 2019 Vaadin Ltd.
|
|
602
|
-
This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
603
|
-
*/
|
|
604
|
-
const Ts=document.createElement("template");Ts.innerHTML='<dom-module id="vaadin-date-picker-text-field-styles" theme-for="vaadin-date-picker-text-field">\n <template>\n <style>\n :host([dir="rtl"]) [part="input-field"] {\n direction: ltr;\n }\n\n :host([dir="rtl"]) [part="value"]::placeholder {\n direction: rtl;\n text-align: left;\n }\n\n :host([dir="rtl"]) [part="input-field"] ::slotted(input)::placeholder {\n direction: rtl;\n text-align: left;\n }\n\n :host([dir="rtl"]) [part="value"]:-ms-input-placeholder,\n :host([dir="rtl"]) [part="input-field"] ::slotted(input):-ms-input-placeholder {\n direction: rtl;\n text-align: left;\n }\n </style>\n </template>\n</dom-module>',document.head.appendChild(Ts.content);class js extends z{static get is(){return"vaadin-date-picker-text-field"}}customElements.define(js.is,js);
|
|
605
|
-
/**
|
|
606
|
-
@license
|
|
607
|
-
Copyright (c) 2017 Vaadin Ltd.
|
|
608
|
-
This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
609
|
-
*/
|
|
610
|
-
class Os extends(d(R)){static get is(){return"vaadin-date-picker-overlay"}}customElements.define(Os.is,Os);
|
|
611
|
-
/**
|
|
612
|
-
@license
|
|
613
|
-
Copyright (c) 2017 Vaadin Ltd.
|
|
614
|
-
This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
615
|
-
*/
|
|
616
|
-
const Vs=class{static _getISOWeekNumber(e){var t=e.getDay();0===t&&(t=7);var s=4-t,i=new Date(e.getTime()+24*s*3600*1e3),a=new Date(0,0);a.setFullYear(i.getFullYear());var n=i.getTime()-a.getTime(),r=Math.round(n/864e5);return Math.floor(r/7+1)}static _dateEquals(e,t){return e instanceof Date&&t instanceof Date&&e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}static _dateAllowed(e,t,s){return(!t||e>=t)&&(!s||e<=s)}static _getClosestDate(e,t){return t.filter((e=>void 0!==e)).reduce(((t,s)=>s?t?Math.abs(e.getTime()-s.getTime())<Math.abs(t.getTime()-e.getTime())?s:t:s:t))}static _extractDateParts(e){return{day:e.getDate(),month:e.getMonth(),year:e.getFullYear()}}};
|
|
617
|
-
/**
|
|
618
|
-
@license
|
|
619
|
-
Copyright (c) 2017 Vaadin Ltd.
|
|
620
|
-
This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
621
|
-
*/class Fs extends(v(H(W))){static get template(){return L`
|
|
622
|
-
<style>
|
|
623
|
-
:host {
|
|
624
|
-
display: block;
|
|
625
|
-
}
|
|
626
|
-
|
|
627
|
-
[part="weekdays"],
|
|
628
|
-
#days {
|
|
629
|
-
display: flex;
|
|
630
|
-
flex-wrap: wrap;
|
|
631
|
-
flex-grow: 1;
|
|
632
|
-
}
|
|
633
|
-
|
|
634
|
-
#days-container,
|
|
635
|
-
#weekdays-container {
|
|
636
|
-
display: flex;
|
|
637
|
-
}
|
|
638
|
-
|
|
639
|
-
[part="week-numbers"] {
|
|
640
|
-
display: flex;
|
|
641
|
-
flex-direction: column;
|
|
642
|
-
justify-content: space-between;
|
|
643
|
-
flex-shrink: 0;
|
|
644
|
-
}
|
|
645
|
-
|
|
646
|
-
[part="week-numbers"][hidden],
|
|
647
|
-
[part="weekday"][hidden] {
|
|
648
|
-
display: none;
|
|
649
|
-
}
|
|
650
|
-
|
|
651
|
-
[part="weekday"],
|
|
652
|
-
[part="date"] {
|
|
653
|
-
/* Would use calc(100% / 7) but it doesn't work nice on IE */
|
|
654
|
-
width: 14.285714286%;
|
|
655
|
-
}
|
|
656
|
-
|
|
657
|
-
[part="weekday"]:empty,
|
|
658
|
-
[part="week-numbers"] {
|
|
659
|
-
width: 12.5%;
|
|
660
|
-
flex-shrink: 0;
|
|
661
|
-
}
|
|
662
|
-
</style>
|
|
663
|
-
|
|
664
|
-
<div part="month-header" role="heading">[[_getTitle(month, i18n.monthNames)]]</div>
|
|
665
|
-
<div id="monthGrid" on-tap="_handleTap" on-touchend="_preventDefault" on-touchstart="_onMonthGridTouchStart">
|
|
666
|
-
<div id="weekdays-container">
|
|
667
|
-
<div hidden="[[!_showWeekSeparator(showWeekNumbers, i18n.firstDayOfWeek)]]" part="weekday"></div>
|
|
668
|
-
<div part="weekdays">
|
|
669
|
-
<template is="dom-repeat" items="[[_getWeekDayNames(i18n.weekdays, i18n.weekdaysShort, showWeekNumbers, i18n.firstDayOfWeek)]]">
|
|
670
|
-
<div part="weekday" role="heading" aria-label\$="[[item.weekDay]]">[[item.weekDayShort]]</div>
|
|
671
|
-
</template>
|
|
672
|
-
</div>
|
|
673
|
-
</div>
|
|
674
|
-
<div id="days-container">
|
|
675
|
-
<div part="week-numbers" hidden="[[!_showWeekSeparator(showWeekNumbers, i18n.firstDayOfWeek)]]">
|
|
676
|
-
<template is="dom-repeat" items="[[_getWeekNumbers(_days)]]">
|
|
677
|
-
<div part="week-number" role="heading" aria-label\$="[[i18n.week]] [[item]]">[[item]]</div>
|
|
678
|
-
</template>
|
|
679
|
-
</div>
|
|
680
|
-
<div id="days">
|
|
681
|
-
<template is="dom-repeat" items="[[_days]]">
|
|
682
|
-
<div part="date" today\$="[[_isToday(item)]]" selected\$="[[_dateEquals(item, selectedDate)]]" focused\$="[[_dateEquals(item, focusedDate)]]" date="[[item]]" disabled\$="[[!_dateAllowed(item, minDate, maxDate)]]" role\$="[[_getRole(item)]]" aria-label\$="[[_getAriaLabel(item)]]" aria-disabled\$="[[_getAriaDisabled(item, minDate, maxDate)]]">[[_getDate(item)]]</div>
|
|
683
|
-
</template>
|
|
684
|
-
</div>
|
|
685
|
-
</div>
|
|
686
|
-
</div>
|
|
687
|
-
`}static get is(){return"vaadin-month-calendar"}static get properties(){return{month:{type:Date,value:new Date},selectedDate:{type:Date,notify:!0},focusedDate:Date,showWeekNumbers:{type:Boolean,value:!1},i18n:{type:Object},ignoreTaps:Boolean,_notTapping:Boolean,minDate:{type:Date,value:null},maxDate:{type:Date,value:null},_days:{type:Array,computed:"_getDays(month, i18n.firstDayOfWeek, minDate, maxDate)"},disabled:{type:Boolean,reflectToAttribute:!0,computed:"_isDisabled(month, minDate, maxDate)"}}}static get observers(){return["_showWeekNumbersChanged(showWeekNumbers, i18n.firstDayOfWeek)"]}_dateEquals(e,t){return Vs._dateEquals(e,t)}_dateAllowed(e,t,s){return Vs._dateAllowed(e,t,s)}_isDisabled(e,t,s){var i=new Date(0,0);i.setFullYear(e.getFullYear()),i.setMonth(e.getMonth()),i.setDate(1);var a=new Date(0,0);return a.setFullYear(e.getFullYear()),a.setMonth(e.getMonth()+1),a.setDate(0),!(t&&s&&t.getMonth()===s.getMonth()&&t.getMonth()===e.getMonth()&&s.getDate()-t.getDate()>=0)&&(!this._dateAllowed(i,t,s)&&!this._dateAllowed(a,t,s))}_getTitle(e,t){if(void 0!==e&&void 0!==t)return this.i18n.formatTitle(t[e.getMonth()],e.getFullYear())}_onMonthGridTouchStart(){this._notTapping=!1,setTimeout((()=>this._notTapping=!0),300)}_dateAdd(e,t){e.setDate(e.getDate()+t)}_applyFirstDayOfWeek(e,t){if(void 0!==e&&void 0!==t)return e.slice(t).concat(e.slice(0,t))}_getWeekDayNames(e,t,s,i){if(void 0!==e&&void 0!==t&&void 0!==s&&void 0!==i)return e=this._applyFirstDayOfWeek(e,i),t=this._applyFirstDayOfWeek(t,i),e=e.map(((e,s)=>({weekDay:e,weekDayShort:t[s]})))}_getDate(e){return e?e.getDate():""}_showWeekNumbersChanged(e,t){e&&1===t?this.setAttribute("week-numbers",""):this.removeAttribute("week-numbers")}_showWeekSeparator(e,t){return e&&1===t}_isToday(e){return this._dateEquals(new Date,e)}_getDays(e,t){if(void 0!==e&&void 0!==t){var s=new Date(0,0);for(s.setFullYear(e.getFullYear()),s.setMonth(e.getMonth()),s.setDate(1);s.getDay()!==t;)this._dateAdd(s,-1);for(var i=[],a=s.getMonth(),n=e.getMonth();s.getMonth()===n||s.getMonth()===a;)i.push(s.getMonth()===n?new Date(s.getTime()):null),this._dateAdd(s,1);return i}}_getWeekNumber(e,t){if(void 0!==e&&void 0!==t)return e||(e=t.reduce(((e,t)=>!e&&t?t:e))),Vs._getISOWeekNumber(e)}_getWeekNumbers(e){return e.map((t=>this._getWeekNumber(t,e))).filter(((e,t,s)=>s.indexOf(e)===t))}_handleTap(e){this.ignoreTaps||this._notTapping||!e.target.date||e.target.hasAttribute("disabled")||(this.selectedDate=e.target.date,this.dispatchEvent(new CustomEvent("date-tap",{bubbles:!0,composed:!0})))}_preventDefault(e){e.preventDefault()}_getRole(e){return e?"button":"presentation"}_getAriaLabel(e){if(!e)return"";var t=this._getDate(e)+" "+this.i18n.monthNames[e.getMonth()]+" "+e.getFullYear()+", "+this.i18n.weekdays[e.getDay()];return this._isToday(e)&&(t+=", "+this.i18n.today),t}_getAriaDisabled(e,t,s){if(void 0!==e&&void 0!==t&&void 0!==s)return this._dateAllowed(e,t,s)?"false":"true"}}customElements.define(Fs.is,Fs);
|
|
688
|
-
/**
|
|
689
|
-
@license
|
|
690
|
-
Copyright (c) 2017 Vaadin Ltd.
|
|
691
|
-
This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
692
|
-
*/
|
|
693
|
-
class Rs extends W{static get template(){return L`
|
|
694
|
-
<style>
|
|
695
|
-
:host {
|
|
696
|
-
display: block;
|
|
697
|
-
overflow: hidden;
|
|
698
|
-
height: 500px;
|
|
699
|
-
}
|
|
700
|
-
|
|
701
|
-
#scroller {
|
|
702
|
-
position: relative;
|
|
703
|
-
height: 100%;
|
|
704
|
-
overflow: auto;
|
|
705
|
-
outline: none;
|
|
706
|
-
margin-right: -40px;
|
|
707
|
-
-webkit-overflow-scrolling: touch;
|
|
708
|
-
-ms-overflow-style: none;
|
|
709
|
-
overflow-x: hidden;
|
|
710
|
-
}
|
|
711
|
-
|
|
712
|
-
#scroller.notouchscroll {
|
|
713
|
-
-webkit-overflow-scrolling: auto;
|
|
714
|
-
}
|
|
715
|
-
|
|
716
|
-
#scroller::-webkit-scrollbar {
|
|
717
|
-
display: none;
|
|
718
|
-
}
|
|
719
|
-
|
|
720
|
-
.buffer {
|
|
721
|
-
position: absolute;
|
|
722
|
-
width: var(--vaadin-infinite-scroller-buffer-width, 100%);
|
|
723
|
-
box-sizing: border-box;
|
|
724
|
-
padding-right: 40px;
|
|
725
|
-
top: var(--vaadin-infinite-scroller-buffer-offset, 0);
|
|
726
|
-
animation: fadein 0.2s;
|
|
727
|
-
}
|
|
728
|
-
|
|
729
|
-
@keyframes fadein {
|
|
730
|
-
from { opacity: 0; }
|
|
731
|
-
to { opacity: 1; }
|
|
732
|
-
}
|
|
733
|
-
</style>
|
|
734
|
-
|
|
735
|
-
<div id="scroller" on-scroll="_scroll">
|
|
736
|
-
<div class="buffer"></div>
|
|
737
|
-
<div class="buffer"></div>
|
|
738
|
-
<div id="fullHeight"></div>
|
|
739
|
-
</div>
|
|
740
|
-
`}static get is(){return"vaadin-infinite-scroller"}static get properties(){return{bufferSize:{type:Number,value:20},_initialScroll:{value:5e5},_initialIndex:{value:0},_buffers:Array,_preventScrollEvent:Boolean,_mayHaveMomentum:Boolean,_initialized:Boolean,active:{type:Boolean,observer:"_activated"}}}ready(){super.ready(),this._buffers=Array.prototype.slice.call(this.root.querySelectorAll(".buffer")),this.$.fullHeight.style.height=2*this._initialScroll+"px";var e=this.querySelector("template");this._TemplateClass=h(e,this,{forwardHostProp:function(e,t){"index"!==e&&this._buffers.forEach((s=>{[].forEach.call(s.children,(s=>{s._itemWrapper.instance[e]=t}))}))}}),navigator.userAgent.toLowerCase().indexOf("firefox")>-1&&(this.$.scroller.tabIndex=-1)}_activated(e){e&&!this._initialized&&(this._createPool(),this._initialized=!0)}_finishInit(){this._initDone||(this._buffers.forEach((e=>{[].forEach.call(e.children,(e=>this._ensureStampedInstance(e._itemWrapper)))}),this),this._buffers[0].translateY||this._reset(),this._initDone=!0)}_translateBuffer(e){var t=e?1:0;this._buffers[t].translateY=this._buffers[t?0:1].translateY+this._bufferHeight*(t?-1:1),this._buffers[t].style.transform="translate3d(0, "+this._buffers[t].translateY+"px, 0)",this._buffers[t].updated=!1,this._buffers.reverse()}_scroll(){if(!this._scrollDisabled){var e=this.$.scroller.scrollTop;(e<this._bufferHeight||e>2*this._initialScroll-this._bufferHeight)&&(this._initialIndex=~~this.position,this._reset());var t=this.root.querySelector(".buffer").offsetTop,s=e>this._buffers[1].translateY+this.itemHeight+t,i=e<this._buffers[0].translateY+this.itemHeight+t;(s||i)&&(this._translateBuffer(i),this._updateClones()),this._preventScrollEvent||(this.dispatchEvent(new CustomEvent("custom-scroll",{bubbles:!1,composed:!0})),this._mayHaveMomentum=!0),this._preventScrollEvent=!1,this._debouncerScrollFinish=U.debounce(this._debouncerScrollFinish,X.after(200),(()=>{var e=this.$.scroller.getBoundingClientRect();this._isVisible(this._buffers[0],e)||this._isVisible(this._buffers[1],e)||(this.position=this.position)}))}}set position(e){this._preventScrollEvent=!0,e>this._firstIndex&&e<this._firstIndex+2*this.bufferSize?this.$.scroller.scrollTop=this.itemHeight*(e-this._firstIndex)+this._buffers[0].translateY:(this._initialIndex=~~e,this._reset(),this._scrollDisabled=!0,this.$.scroller.scrollTop+=e%1*this.itemHeight,this._scrollDisabled=!1),this._mayHaveMomentum&&(this.$.scroller.classList.add("notouchscroll"),this._mayHaveMomentum=!1,setTimeout((()=>{this.$.scroller.classList.remove("notouchscroll")}),10))}get position(){return(this.$.scroller.scrollTop-this._buffers[0].translateY)/this.itemHeight+this._firstIndex}get itemHeight(){if(!this._itemHeightVal){window.ShadyCSS&&window.ShadyCSS.nativeCss||this.updateStyles();const e=window.ShadyCSS?window.ShadyCSS.getComputedStyleValue(this,"--vaadin-infinite-scroller-item-height"):getComputedStyle(this).getPropertyValue("--vaadin-infinite-scroller-item-height"),t="background-position";this.$.fullHeight.style.setProperty(t,e);const s=getComputedStyle(this.$.fullHeight).getPropertyValue(t);this.$.fullHeight.style.removeProperty(t),this._itemHeightVal=parseFloat(s)}return this._itemHeightVal}get _bufferHeight(){return this.itemHeight*this.bufferSize}_reset(){this._scrollDisabled=!0,this.$.scroller.scrollTop=this._initialScroll,this._buffers[0].translateY=this._initialScroll-this._bufferHeight,this._buffers[1].translateY=this._initialScroll,this._buffers.forEach((e=>{e.style.transform="translate3d(0, "+e.translateY+"px, 0)"})),this._buffers[0].updated=this._buffers[1].updated=!1,this._updateClones(!0),this._debouncerUpdateClones=U.debounce(this._debouncerUpdateClones,X.after(200),(()=>{this._buffers[0].updated=this._buffers[1].updated=!1,this._updateClones()})),this._scrollDisabled=!1}_createPool(){var e=this.getBoundingClientRect();this._buffers.forEach((t=>{for(var s=0;s<this.bufferSize;s++){const s=document.createElement("div");s.style.height=this.itemHeight+"px",s.instance={};const i="vaadin-infinite-scroller-item-content-"+(Rs._contentIndex=Rs._contentIndex+1||0),a=document.createElement("slot");a.setAttribute("name",i),a._itemWrapper=s,t.appendChild(a),s.setAttribute("slot",i),this.appendChild(s),u(),setTimeout((()=>{this._isVisible(s,e)&&this._ensureStampedInstance(s)}),1)}}),this),setTimeout((()=>{P(this,this._finishInit.bind(this))}),1)}_ensureStampedInstance(e){if(!e.firstElementChild){var t=e.instance;e.instance=new this._TemplateClass({}),e.appendChild(e.instance.root),Object.keys(t).forEach((s=>{e.instance.set(s,t[s])}))}}_updateClones(e){this._firstIndex=~~((this._buffers[0].translateY-this._initialScroll)/this.itemHeight)+this._initialIndex;var t=e?this.$.scroller.getBoundingClientRect():void 0;this._buffers.forEach(((s,i)=>{if(!s.updated){var a=this._firstIndex+this.bufferSize*i;[].forEach.call(s.children,((s,i)=>{const n=s._itemWrapper;e&&!this._isVisible(n,t)||(n.instance.index=a+i)})),s.updated=!0}}),this)}_isVisible(e,t){var s=e.getBoundingClientRect();return s.bottom>t.top&&s.top<t.bottom}}customElements.define(Rs.is,Rs);const Ps=document.createElement("template");Ps.innerHTML='<dom-module id="vaadin-date-picker-overlay-styles" theme-for="vaadin-date-picker-overlay">\n <template>\n <style>\n :host {\n align-items: flex-start;\n justify-content: flex-start;\n }\n\n :host([bottom-aligned]) {\n justify-content: flex-end;\n }\n\n :host([right-aligned]) {\n align-items: flex-end;\n }\n\n :host([dir="rtl"]) {\n align-items: flex-end;\n }\n\n :host([dir="rtl"][right-aligned]) {\n align-items: flex-start;\n }\n\n [part="overlay"] {\n display: flex;\n flex: auto;\n }\n\n [part~="content"] {\n flex: auto;\n }\n </style>\n </template>\n</dom-module>',document.head.appendChild(Ps.content);
|
|
741
|
-
/**
|
|
742
|
-
@license
|
|
743
|
-
Copyright (c) 2017 Vaadin Ltd.
|
|
744
|
-
This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
745
|
-
*/
|
|
746
|
-
class Ns extends(v(f(H(W)))){static get template(){return L`
|
|
747
|
-
<style>
|
|
748
|
-
:host {
|
|
749
|
-
display: flex;
|
|
750
|
-
flex-direction: column;
|
|
751
|
-
height: 100%;
|
|
752
|
-
width: 100%;
|
|
753
|
-
outline: none;
|
|
754
|
-
background: #fff;
|
|
755
|
-
}
|
|
756
|
-
|
|
757
|
-
[part="overlay-header"] {
|
|
758
|
-
display: flex;
|
|
759
|
-
flex-shrink: 0;
|
|
760
|
-
flex-wrap: nowrap;
|
|
761
|
-
align-items: center;
|
|
762
|
-
}
|
|
763
|
-
|
|
764
|
-
:host(:not([fullscreen])) [part="overlay-header"] {
|
|
765
|
-
display: none;
|
|
766
|
-
}
|
|
767
|
-
|
|
768
|
-
[part="label"] {
|
|
769
|
-
flex-grow: 1;
|
|
770
|
-
}
|
|
771
|
-
|
|
772
|
-
[part="clear-button"]:not([showclear]) {
|
|
773
|
-
display: none;
|
|
774
|
-
}
|
|
775
|
-
|
|
776
|
-
[part="years-toggle-button"] {
|
|
777
|
-
display: flex;
|
|
778
|
-
}
|
|
779
|
-
|
|
780
|
-
[part="years-toggle-button"][desktop] {
|
|
781
|
-
display: none;
|
|
782
|
-
}
|
|
783
|
-
|
|
784
|
-
:host(:not([years-visible])) [part="years-toggle-button"]::before {
|
|
785
|
-
transform: rotate(180deg);
|
|
786
|
-
}
|
|
787
|
-
|
|
788
|
-
#scrollers {
|
|
789
|
-
display: flex;
|
|
790
|
-
height: 100%;
|
|
791
|
-
width: 100%;
|
|
792
|
-
position: relative;
|
|
793
|
-
overflow: hidden;
|
|
794
|
-
}
|
|
795
|
-
|
|
796
|
-
[part="months"],
|
|
797
|
-
[part="years"] {
|
|
798
|
-
height: 100%;
|
|
799
|
-
}
|
|
800
|
-
|
|
801
|
-
[part="months"] {
|
|
802
|
-
--vaadin-infinite-scroller-item-height: 270px;
|
|
803
|
-
position: absolute;
|
|
804
|
-
top: 0;
|
|
805
|
-
left: 0;
|
|
806
|
-
right: 0;
|
|
807
|
-
bottom: 0;
|
|
808
|
-
}
|
|
809
|
-
|
|
810
|
-
#scrollers[desktop] [part="months"] {
|
|
811
|
-
right: 50px;
|
|
812
|
-
transform: none !important;
|
|
813
|
-
}
|
|
814
|
-
|
|
815
|
-
[part="years"] {
|
|
816
|
-
--vaadin-infinite-scroller-item-height: 80px;
|
|
817
|
-
width: 50px;
|
|
818
|
-
position: absolute;
|
|
819
|
-
right: 0;
|
|
820
|
-
transform: translateX(100%);
|
|
821
|
-
-webkit-tap-highlight-color: transparent;
|
|
822
|
-
-webkit-user-select: none;
|
|
823
|
-
-moz-user-select: none;
|
|
824
|
-
-ms-user-select: none;
|
|
825
|
-
user-select: none;
|
|
826
|
-
/* Center the year scroller position. */
|
|
827
|
-
--vaadin-infinite-scroller-buffer-offset: 50%;
|
|
828
|
-
}
|
|
829
|
-
|
|
830
|
-
#scrollers[desktop] [part="years"] {
|
|
831
|
-
position: absolute;
|
|
832
|
-
transform: none !important;
|
|
833
|
-
}
|
|
834
|
-
|
|
835
|
-
[part="years"]::before {
|
|
836
|
-
content: '';
|
|
837
|
-
display: block;
|
|
838
|
-
background: transparent;
|
|
839
|
-
width: 0;
|
|
840
|
-
height: 0;
|
|
841
|
-
position: absolute;
|
|
842
|
-
left: 0;
|
|
843
|
-
top: 50%;
|
|
844
|
-
transform: translateY(-50%);
|
|
845
|
-
border-width: 6px;
|
|
846
|
-
border-style: solid;
|
|
847
|
-
border-color: transparent;
|
|
848
|
-
border-left-color: #000;
|
|
849
|
-
}
|
|
850
|
-
|
|
851
|
-
:host(.animate) [part="months"],
|
|
852
|
-
:host(.animate) [part="years"] {
|
|
853
|
-
transition: all 200ms;
|
|
854
|
-
}
|
|
855
|
-
|
|
856
|
-
[part="toolbar"] {
|
|
857
|
-
display: flex;
|
|
858
|
-
justify-content: space-between;
|
|
859
|
-
z-index: 2;
|
|
860
|
-
flex-shrink: 0;
|
|
861
|
-
}
|
|
862
|
-
|
|
863
|
-
[part~="overlay-header"]:not([desktop]) {
|
|
864
|
-
padding-bottom: 40px;
|
|
865
|
-
}
|
|
866
|
-
|
|
867
|
-
[part~="years-toggle-button"] {
|
|
868
|
-
position: absolute;
|
|
869
|
-
top: auto;
|
|
870
|
-
right: 8px;
|
|
871
|
-
bottom: 0;
|
|
872
|
-
z-index: 1;
|
|
873
|
-
padding: 8px;
|
|
874
|
-
}
|
|
875
|
-
|
|
876
|
-
#announcer {
|
|
877
|
-
display: inline-block;
|
|
878
|
-
position: fixed;
|
|
879
|
-
clip: rect(0, 0, 0, 0);
|
|
880
|
-
clip-path: inset(100%);
|
|
881
|
-
}
|
|
882
|
-
</style>
|
|
883
|
-
|
|
884
|
-
<div id="announcer" role="alert" aria-live="polite">
|
|
885
|
-
[[i18n.calendar]]
|
|
886
|
-
</div>
|
|
887
|
-
|
|
888
|
-
<div part="overlay-header" on-touchend="_preventDefault" desktop\$="[[_desktopMode]]" aria-hidden="true">
|
|
889
|
-
<div part="label">[[_formatDisplayed(selectedDate, i18n.formatDate, label)]]</div>
|
|
890
|
-
<div part="clear-button" on-tap="_clear" showclear\$="[[_showClear(selectedDate)]]"></div>
|
|
891
|
-
<div part="toggle-button" on-tap="_cancel"></div>
|
|
892
|
-
|
|
893
|
-
<div part="years-toggle-button" desktop\$="[[_desktopMode]]" on-tap="_toggleYearScroller" aria-hidden="true">
|
|
894
|
-
[[_yearAfterXMonths(_visibleMonthIndex)]]
|
|
895
|
-
</div>
|
|
896
|
-
</div>
|
|
897
|
-
|
|
898
|
-
<div id="scrollers" desktop\$="[[_desktopMode]]" on-track="_track">
|
|
899
|
-
<vaadin-infinite-scroller id="monthScroller" on-custom-scroll="_onMonthScroll" on-touchstart="_onMonthScrollTouchStart" buffer-size="3" active="[[initialPosition]]" part="months">
|
|
900
|
-
<template>
|
|
901
|
-
<vaadin-month-calendar i18n="[[i18n]]" month="[[_dateAfterXMonths(index)]]" selected-date="{{selectedDate}}" focused-date="[[focusedDate]]" ignore-taps="[[_ignoreTaps]]" show-week-numbers="[[showWeekNumbers]]" min-date="[[minDate]]" max-date="[[maxDate]]" focused\$="[[_focused]]" part="month" theme\$="[[theme]]">
|
|
902
|
-
</vaadin-month-calendar>
|
|
903
|
-
</template>
|
|
904
|
-
</vaadin-infinite-scroller>
|
|
905
|
-
<vaadin-infinite-scroller id="yearScroller" on-tap="_onYearTap" on-custom-scroll="_onYearScroll" on-touchstart="_onYearScrollTouchStart" buffer-size="12" active="[[initialPosition]]" part="years">
|
|
906
|
-
<template>
|
|
907
|
-
<div part="year-number" role="button" current\$="[[_isCurrentYear(index)]]" selected\$="[[_isSelectedYear(index, selectedDate)]]">
|
|
908
|
-
[[_yearAfterXYears(index)]]
|
|
909
|
-
</div>
|
|
910
|
-
<div part="year-separator" aria-hidden="true"></div>
|
|
911
|
-
</template>
|
|
912
|
-
</vaadin-infinite-scroller>
|
|
913
|
-
</div>
|
|
914
|
-
|
|
915
|
-
<div on-touchend="_preventDefault" role="toolbar" part="toolbar">
|
|
916
|
-
<vaadin-button id="todayButton" theme="tertiary" part="today-button" disabled="[[!_isTodayAllowed(minDate, maxDate)]]" on-tap="_onTodayTap">
|
|
917
|
-
[[i18n.today]]
|
|
918
|
-
</vaadin-button>
|
|
919
|
-
<vaadin-button id="cancelButton" theme="tertiary" part="cancel-button" on-tap="_cancel">
|
|
920
|
-
[[i18n.cancel]]
|
|
921
|
-
</vaadin-button>
|
|
922
|
-
</div>
|
|
923
|
-
|
|
924
|
-
<iron-media-query query="(min-width: 375px)" query-matches="{{_desktopMode}}"></iron-media-query>
|
|
925
|
-
`}static get is(){return"vaadin-date-picker-overlay-content"}static get properties(){return{selectedDate:{type:Date,notify:!0},focusedDate:{type:Date,notify:!0,observer:"_focusedDateChanged"},_focusedMonthDate:Number,initialPosition:{type:Date,observer:"_initialPositionChanged"},_originDate:{value:new Date},_visibleMonthIndex:Number,_desktopMode:Boolean,_translateX:{observer:"_translateXChanged"},_yearScrollerWidth:{value:50},i18n:{type:Object},showWeekNumbers:{type:Boolean},_ignoreTaps:Boolean,_notTapping:Boolean,minDate:Date,maxDate:Date,_focused:Boolean,label:String}}get __isRTL(){return"rtl"===this.getAttribute("dir")}ready(){super.ready(),this.setAttribute("tabindex",0),this.addEventListener("keydown",this._onKeydown.bind(this)),K(this,"tap",this._stopPropagation),this.addEventListener("focus",this._onOverlayFocus.bind(this)),this.addEventListener("blur",this._onOverlayBlur.bind(this))}connectedCallback(){super.connectedCallback(),this._closeYearScroller(),this._toggleAnimateClass(!0),Q(this.$.scrollers,"pan-y"),N.requestAvailability()}announceFocusedDate(){var e=this._currentlyFocusedDate(),t=[];Vs._dateEquals(e,new Date)&&t.push(this.i18n.today),t=t.concat([this.i18n.weekdays[e.getDay()],e.getDate(),this.i18n.monthNames[e.getMonth()],e.getFullYear()]),this.showWeekNumbers&&1===this.i18n.firstDayOfWeek&&(t.push(this.i18n.week),t.push(Vs._getISOWeekNumber(e))),this.dispatchEvent(new CustomEvent("iron-announce",{bubbles:!0,composed:!0,detail:{text:t.join(" ")}}))}focusCancel(){this.$.cancelButton.focus()}scrollToDate(e,t){this._scrollToPosition(this._differenceInMonths(e,this._originDate),t)}_focusedDateChanged(e){this.revealDate(e)}_isCurrentYear(e){return 0===e}_isSelectedYear(e,t){if(t)return t.getFullYear()===this._originDate.getFullYear()+e}revealDate(e){if(e){var t=this._differenceInMonths(e,this._originDate),s=this.$.monthScroller.position>t,i=this.$.monthScroller.clientHeight/this.$.monthScroller.itemHeight,a=this.$.monthScroller.position+i-1<t;s?this._scrollToPosition(t,!0):a&&this._scrollToPosition(t-i+1,!0)}}_onOverlayFocus(){this._focused=!0}_onOverlayBlur(){this._focused=!1}_initialPositionChanged(e){this.scrollToDate(e)}_repositionYearScroller(){this._visibleMonthIndex=Math.floor(this.$.monthScroller.position),this.$.yearScroller.position=(this.$.monthScroller.position+this._originDate.getMonth())/12}_repositionMonthScroller(){this.$.monthScroller.position=12*this.$.yearScroller.position-this._originDate.getMonth(),this._visibleMonthIndex=Math.floor(this.$.monthScroller.position)}_onMonthScroll(){this._repositionYearScroller(),this._doIgnoreTaps()}_onYearScroll(){this._repositionMonthScroller(),this._doIgnoreTaps()}_onYearScrollTouchStart(){this._notTapping=!1,setTimeout((()=>this._notTapping=!0),300),this._repositionMonthScroller()}_onMonthScrollTouchStart(){this._repositionYearScroller()}_doIgnoreTaps(){this._ignoreTaps=!0,this._debouncer=U.debounce(this._debouncer,X.after(300),(()=>this._ignoreTaps=!1))}_formatDisplayed(e,t,s){return e?t(Vs._extractDateParts(e)):s}_onTodayTap(){var e=new Date;Math.abs(this.$.monthScroller.position-this._differenceInMonths(e,this._originDate))<.001?(this.selectedDate=e,this._close()):this._scrollToCurrentMonth()}_scrollToCurrentMonth(){this.focusedDate&&(this.focusedDate=new Date),this.scrollToDate(new Date,!0)}_showClear(e){return!!e}_onYearTap(e){if(!this._ignoreTaps&&!this._notTapping){var t=(e.detail.y-(this.$.yearScroller.getBoundingClientRect().top+this.$.yearScroller.clientHeight/2))/this.$.yearScroller.itemHeight;this._scrollToPosition(this.$.monthScroller.position+12*t,!0)}}_scrollToPosition(e,t){if(void 0===this._targetPosition){if(!t)return this.$.monthScroller.position=e,this._targetPosition=void 0,void this._repositionYearScroller();this._targetPosition=e;var s=t?300:0,i=0,a=this.$.monthScroller.position,n=e=>{var t,r,o,l=e-(i=i||e);if(l<s){var d=(t=l,r=a,o=this._targetPosition-a,(t/=s/2)<1?o/2*t*t+r:-o/2*(--t*(t-2)-1)+r);this.$.monthScroller.position=d,window.requestAnimationFrame(n)}else this.dispatchEvent(new CustomEvent("scroll-animation-finished",{bubbles:!0,composed:!0,detail:{position:this._targetPosition,oldPosition:a}})),this.$.monthScroller.position=this._targetPosition,this._targetPosition=void 0;setTimeout(this._repositionYearScroller.bind(this),1)};window.requestAnimationFrame(n)}else this._targetPosition=e}_limit(e,t){return Math.min(t.max,Math.max(t.min,e))}_handleTrack(e){if(!(Math.abs(e.detail.dx)<10||Math.abs(e.detail.ddy)>10)){Math.abs(e.detail.ddx)>this._yearScrollerWidth/3&&this._toggleAnimateClass(!0);var t=this._translateX+e.detail.ddx;this._translateX=this._limit(t,{min:0,max:this._yearScrollerWidth})}}_track(e){if(!this._desktopMode)switch(e.detail.state){case"start":this._toggleAnimateClass(!1);break;case"track":this._handleTrack(e);break;case"end":this._toggleAnimateClass(!0),this._translateX>=this._yearScrollerWidth/2?this._closeYearScroller():this._openYearScroller()}}_toggleAnimateClass(e){e?this.classList.add("animate"):this.classList.remove("animate")}_toggleYearScroller(){this._isYearScrollerVisible()?this._closeYearScroller():this._openYearScroller()}_openYearScroller(){this._translateX=0,this.setAttribute("years-visible","")}_closeYearScroller(){this.removeAttribute("years-visible"),this._translateX=this._yearScrollerWidth}_isYearScrollerVisible(){return this._translateX<this._yearScrollerWidth/2}_translateXChanged(e){this._desktopMode||(this.$.monthScroller.style.transform="translateX("+(e-this._yearScrollerWidth)+"px)",this.$.yearScroller.style.transform="translateX("+e+"px)")}_yearAfterXYears(e){var t=new Date(this._originDate);return t.setFullYear(parseInt(e)+this._originDate.getFullYear()),t.getFullYear()}_yearAfterXMonths(e){return this._dateAfterXMonths(e).getFullYear()}_dateAfterXMonths(e){var t=new Date(this._originDate);return t.setDate(1),t.setMonth(parseInt(e)+this._originDate.getMonth()),t}_differenceInMonths(e,t){return 12*(e.getFullYear()-t.getFullYear())-t.getMonth()+e.getMonth()}_differenceInYears(e,t){return this._differenceInMonths(e,t)/12}_clear(){this.selectedDate=""}_close(){const e=this.getRootNode().host,t=e?e.getRootNode().host:null;t&&(t.opened=!1),this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))}_cancel(){this.focusedDate=this.selectedDate,this._close()}_preventDefault(e){e.preventDefault()}_eventKey(e){for(var t=["down","up","right","left","enter","space","home","end","pageup","pagedown","tab","esc"],s=0;s<t.length;s++){var i=t[s];if(B.keyboardEventMatchesKeys(e,i))return i}}_onKeydown(e){var t=this._currentlyFocusedDate();const s=e.composedPath().indexOf(this.$.todayButton)>=0,i=e.composedPath().indexOf(this.$.cancelButton)>=0,a=!s&&!i;var n=this._eventKey(e);if("tab"===n){e.stopPropagation();const t=this.hasAttribute("fullscreen"),n=e.shiftKey;t?e.preventDefault():n&&a||!n&&i?(e.preventDefault(),this.dispatchEvent(new CustomEvent("focus-input",{bubbles:!0,composed:!0}))):n&&s?(this._focused=!0,setTimeout((()=>this.revealDate(this.focusedDate)),1)):this._focused=!1}else if(n)switch(e.preventDefault(),e.stopPropagation(),n){case"down":this._moveFocusByDays(7),this.focus();break;case"up":this._moveFocusByDays(-7),this.focus();break;case"right":a&&this._moveFocusByDays(this.__isRTL?-1:1);break;case"left":a&&this._moveFocusByDays(this.__isRTL?1:-1);break;case"enter":a||i?this._close():s&&this._onTodayTap();break;case"space":if(i)this._close();else if(s)this._onTodayTap();else{var r=this.focusedDate;Vs._dateEquals(r,this.selectedDate)?(this.selectedDate="",this.focusedDate=r):this.selectedDate=r}break;case"home":this._moveFocusInsideMonth(t,"minDate");break;case"end":this._moveFocusInsideMonth(t,"maxDate");break;case"pagedown":this._moveFocusByMonths(e.shiftKey?12:1);break;case"pageup":this._moveFocusByMonths(e.shiftKey?-12:-1);break;case"esc":this._cancel()}}_currentlyFocusedDate(){return this.focusedDate||this.selectedDate||this.initialPosition||new Date}_focusDate(e){this.focusedDate=e,this._focusedMonthDate=e.getDate()}_focusClosestDate(e){this._focusDate(Vs._getClosestDate(e,[this.minDate,this.maxDate]))}_moveFocusByDays(e){var t=this._currentlyFocusedDate(),s=new Date(0,0);s.setFullYear(t.getFullYear()),s.setMonth(t.getMonth()),s.setDate(t.getDate()+e),this._dateAllowed(s,this.minDate,this.maxDate)?this._focusDate(s):this._dateAllowed(t,this.minDate,this.maxDate)?e>0?this._focusDate(this.maxDate):this._focusDate(this.minDate):this._focusClosestDate(t)}_moveFocusByMonths(e){var t=this._currentlyFocusedDate(),s=new Date(0,0);s.setFullYear(t.getFullYear()),s.setMonth(t.getMonth()+e);var i=s.getMonth();s.setDate(this._focusedMonthDate||(this._focusedMonthDate=t.getDate())),s.getMonth()!==i&&s.setDate(0),this._dateAllowed(s,this.minDate,this.maxDate)?this.focusedDate=s:this._dateAllowed(t,this.minDate,this.maxDate)?e>0?this._focusDate(this.maxDate):this._focusDate(this.minDate):this._focusClosestDate(t)}_moveFocusInsideMonth(e,t){var s=new Date(0,0);s.setFullYear(e.getFullYear()),"minDate"===t?(s.setMonth(e.getMonth()),s.setDate(1)):(s.setMonth(e.getMonth()+1),s.setDate(0)),this._dateAllowed(s,this.minDate,this.maxDate)?this._focusDate(s):this._dateAllowed(e,this.minDate,this.maxDate)?this._focusDate(this[t]):this._focusClosestDate(e)}_dateAllowed(e,t,s){return(!t||e>=t)&&(!s||e<=s)}_isTodayAllowed(e,t){var s=new Date,i=new Date(0,0);return i.setFullYear(s.getFullYear()),i.setMonth(s.getMonth()),i.setDate(s.getDate()),this._dateAllowed(i,e,t)}_stopPropagation(e){e.stopPropagation()}}customElements.define(Ns.is,Ns);
|
|
926
|
-
/**
|
|
927
|
-
@license
|
|
928
|
-
Copyright (c) 2017 Vaadin Ltd.
|
|
929
|
-
This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
930
|
-
*/
|
|
931
|
-
const Bs=e=>class extends(c([q],e)){static get properties(){return{_selectedDate:{type:Date},_focusedDate:Date,value:{type:String,observer:"_valueChanged",notify:!0,value:""},required:{type:Boolean,value:!1},name:{type:String},initialPosition:String,label:String,opened:{type:Boolean,reflectToAttribute:!0,notify:!0,observer:"_openedChanged"},autoOpenDisabled:Boolean,showWeekNumbers:{type:Boolean},_fullscreen:{value:!1,observer:"_fullscreenChanged"},_fullscreenMediaQuery:{value:"(max-width: 420px), (max-height: 420px)"},_touchPrevented:Array,i18n:{type:Object,value:()=>({monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],firstDayOfWeek:0,week:"Week",calendar:"Calendar",clear:"Clear",today:"Today",cancel:"Cancel",formatDate:e=>{const t=String(e.year).replace(/\d+/,(e=>"0000".substr(e.length)+e));return[e.month+1,e.day,t].join("/")},parseDate:e=>{const t=e.split("/"),s=new Date;let i,a=s.getMonth(),n=s.getFullYear();if(3===t.length?(n=parseInt(t[2]),t[2].length<3&&n>=0&&(n+=n<50?2e3:1900),a=parseInt(t[0])-1,i=parseInt(t[1])):2===t.length?(a=parseInt(t[0])-1,i=parseInt(t[1])):1===t.length&&(i=parseInt(t[0])),void 0!==i)return{day:i,month:a,year:n}},formatTitle:(e,t)=>e+" "+t})},min:{type:String,observer:"_minChanged"},max:{type:String,observer:"_maxChanged"},_minDate:{type:Date,value:""},_maxDate:{type:Date,value:""},_noInput:{type:Boolean,computed:"_isNoInput(_fullscreen, _ios, i18n, i18n.*)"},_ios:{type:Boolean,value:navigator.userAgent.match(/iP(?:hone|ad;(?: U;)? CPU) OS (\d+)/)},_webkitOverflowScroll:{type:Boolean,value:""===document.createElement("div").style.webkitOverflowScrolling},_ignoreAnnounce:{value:!0},_focusOverlayOnOpen:Boolean,_overlayInitialized:Boolean}}static get observers(){return["_updateHasValue(value)","_selectedDateChanged(_selectedDate, i18n.formatDate)","_focusedDateChanged(_focusedDate, i18n.formatDate)","_announceFocusedDate(_focusedDate, opened, _ignoreAnnounce)"]}ready(){super.ready(),this._boundOnScroll=this._onScroll.bind(this),this._boundFocus=this._focus.bind(this),this._boundUpdateAlignmentAndPosition=this._updateAlignmentAndPosition.bind(this);const e=e=>{const t=e.composedPath(),s=t.indexOf(this._inputElement);return 1===t.slice(0,s).filter((e=>e.getAttribute&&"clear-button"===e.getAttribute("part"))).length};K(this,"tap",(t=>{e(t)||this.autoOpenDisabled&&!this._noInput||this.open()})),this.addEventListener("touchend",(t=>{e(t)||t.preventDefault()})),this.addEventListener("keydown",this._onKeydown.bind(this)),this.addEventListener("input",this._onUserInput.bind(this)),this.addEventListener("focus",(e=>this._noInput&&e.target.blur())),this.addEventListener("blur",(e=>{if(!this.opened){if(this.autoOpenDisabled){const e=this._getParsedDate();this._isValidDate(e)&&(this._selectedDate=e)}""===this._inputElement.value&&this.__dispatchChange?(this.validate(),this.value="",this.__dispatchChange=!1):this.validate()}}))}_initOverlay(){this.$.overlay.removeAttribute("disable-upgrade"),this._overlayInitialized=!0,this.$.overlay.addEventListener("opened-changed",(e=>this.opened=e.detail.value)),this._overlayContent.addEventListener("close",this._close.bind(this)),this._overlayContent.addEventListener("focus-input",this._focusAndSelect.bind(this)),this.$.overlay.addEventListener("vaadin-overlay-escape-press",this._boundFocus),this._overlayContent.addEventListener("focus",(()=>this.focusElement._setFocused(!0))),this.$.overlay.addEventListener("vaadin-overlay-close",this._onVaadinOverlayClose.bind(this));const e=e=>{this.$.overlay.bringToFront&&requestAnimationFrame((()=>{this.$.overlay.bringToFront()}))};this.addEventListener("mousedown",e),this.addEventListener("touchstart",e)}disconnectedCallback(){super.disconnectedCallback(),this._overlayInitialized&&this.$.overlay.removeEventListener("vaadin-overlay-escape-press",this._boundFocus),this.opened=!1}open(){this.disabled||this.readonly||(this.opened=!0)}_close(e){e&&e.stopPropagation(),this._focus(),this.close()}close(){(this._overlayInitialized||this.autoOpenDisabled)&&this.$.overlay.close()}get _inputElement(){return this._input()}get _nativeInput(){if(this._inputElement)return this._inputElement.focusElement?this._inputElement.focusElement:this._inputElement.inputElement?this._inputElement.inputElement:window.unwrap?window.unwrap(this._inputElement):this._inputElement}_parseDate(e){var t=/^([-+]\d{1}|\d{2,4}|[-+]\d{6})-(\d{1,2})-(\d{1,2})$/.exec(e);if(t){var s=new Date(0,0);return s.setFullYear(parseInt(t[1],10)),s.setMonth(parseInt(t[2],10)-1),s.setDate(parseInt(t[3],10)),s}}_isNoInput(e,t,s){return!this._inputElement||e||t||!s.parseDate}_formatISO(e){if(!(e instanceof Date))return"";const t=(e,t="00")=>(t+e).substr((t+e).length-t.length);let s="",i="0000",a=e.getFullYear();a<0?(a=-a,s="-",i="000000"):e.getFullYear()>=1e4&&(s="+",i="000000");return[s+t(a,i),t(e.getMonth()+1),t(e.getDate())].join("-")}_openedChanged(e){e&&!this._overlayInitialized&&this._initOverlay(),this._overlayInitialized&&(this.$.overlay.opened=e),e&&this._updateAlignmentAndPosition()}_selectedDateChanged(e,t){if(void 0===e||void 0===t)return;this.__userInputOccurred&&(this.__dispatchChange=!0);const s=this._formatISO(e);this.__keepInputValue||this._applyInputValue(e),s!==this.value&&(this.validate(),this.value=s),this.__userInputOccurred=!1,this.__dispatchChange=!1,this._ignoreFocusedDateChange=!0,this._focusedDate=e,this._ignoreFocusedDateChange=!1}_focusedDateChanged(e,t){void 0!==e&&void 0!==t&&(this.__userInputOccurred=!0,this._ignoreFocusedDateChange||this._noInput||this._applyInputValue(e))}_updateHasValue(e){e?this.setAttribute("has-value",""):this.removeAttribute("has-value")}__getOverlayTheme(e,t){if(t)return e}_handleDateChange(e,t,s){if(t){var i=this._parseDate(t);i?Vs._dateEquals(this[e],i)||(this[e]=i,this.value&&this.validate()):this.value=s}else this[e]=""}_valueChanged(e,t){this.__dispatchChange&&this.dispatchEvent(new CustomEvent("change",{bubbles:!0})),this._handleDateChange("_selectedDate",e,t)}_minChanged(e,t){this._handleDateChange("_minDate",e,t)}_maxChanged(e,t){this._handleDateChange("_maxDate",e,t)}_updateAlignmentAndPosition(){if(this._overlayInitialized){if(!this._fullscreen){const e=this._inputElement.getBoundingClientRect(),t=e.top>window.innerHeight/2;if(e.left+this.clientWidth/2>window.innerWidth/2){const t=Math.min(window.innerWidth,document.documentElement.clientWidth);this.$.overlay.setAttribute("right-aligned",""),this.$.overlay.style.removeProperty("left"),this.$.overlay.style.right=t-e.right+"px"}else this.$.overlay.removeAttribute("right-aligned"),this.$.overlay.style.removeProperty("right"),this.$.overlay.style.left=e.left+"px";if(t){const t=Math.min(window.innerHeight,document.documentElement.clientHeight);this.$.overlay.setAttribute("bottom-aligned",""),this.$.overlay.style.removeProperty("top"),this.$.overlay.style.bottom=t-e.top+"px"}else this.$.overlay.removeAttribute("bottom-aligned"),this.$.overlay.style.removeProperty("bottom"),this.$.overlay.style.top=e.bottom+"px"}this.$.overlay.setAttribute("dir",getComputedStyle(this._inputElement).getPropertyValue("direction")),this._overlayContent._repositionYearScroller()}}_fullscreenChanged(){this._overlayInitialized&&this.$.overlay.opened&&this._updateAlignmentAndPosition()}_onOverlayOpened(){this._openedWithFocusRing=this.hasAttribute("focus-ring")||this.focusElement&&this.focusElement.hasAttribute("focus-ring");var e=this._parseDate(this.initialPosition),t=this._selectedDate||this._overlayContent.initialPosition||e||new Date;e||Vs._dateAllowed(t,this._minDate,this._maxDate)?this._overlayContent.initialPosition=t:this._overlayContent.initialPosition=Vs._getClosestDate(t,[this._minDate,this._maxDate]),this._overlayContent.scrollToDate(this._overlayContent.focusedDate||this._overlayContent.initialPosition),this._ignoreFocusedDateChange=!0,this._overlayContent.focusedDate=this._overlayContent.focusedDate||this._overlayContent.initialPosition,this._ignoreFocusedDateChange=!1,window.addEventListener("scroll",this._boundOnScroll,!0),this.addEventListener("iron-resize",this._boundUpdateAlignmentAndPosition),this._webkitOverflowScroll&&(this._touchPrevented=this._preventWebkitOverflowScrollingTouch(this.parentElement)),this._focusOverlayOnOpen?(this._overlayContent.focus(),this._focusOverlayOnOpen=!1):this._focus(),this._noInput&&this.focusElement&&this.focusElement.blur(),this.updateStyles(),this._ignoreAnnounce=!1}_preventWebkitOverflowScrollingTouch(e){for(var t=[];e;){if("touch"===window.getComputedStyle(e).webkitOverflowScrolling){var s=e.style.webkitOverflowScrolling;e.style.webkitOverflowScrolling="auto",t.push({element:e,oldInlineValue:s})}e=e.parentElement}return t}_selectParsedOrFocusedDate(){if(this._ignoreFocusedDateChange=!0,this.i18n.parseDate){const e=this._inputValue||"",t=this._getParsedDate(e);this._isValidDate(t)?this._selectedDate=t:(this.__keepInputValue=!0,this._selectedDate=null,this.__keepInputValue=!1)}else this._focusedDate&&(this._selectedDate=this._focusedDate);this._ignoreFocusedDateChange=!1}_onOverlayClosed(){this._ignoreAnnounce=!0,window.removeEventListener("scroll",this._boundOnScroll,!0),this.removeEventListener("iron-resize",this._boundUpdateAlignmentAndPosition),this._touchPrevented&&(this._touchPrevented.forEach((e=>e.element.style.webkitOverflowScrolling=e.oldInlineValue)),this._touchPrevented=[]),this.updateStyles(),this._selectParsedOrFocusedDate(),this._nativeInput&&this._nativeInput.selectionStart&&(this._nativeInput.selectionStart=this._nativeInput.selectionEnd),this.value||this.validate()}validate(){return!(this.invalid=!this.checkValidity(this._inputValue))}checkValidity(){const e=!this._inputValue||this._selectedDate&&this._inputValue===this._getFormattedDate(this.i18n.formatDate,this._selectedDate),t=!this._selectedDate||Vs._dateAllowed(this._selectedDate,this._minDate,this._maxDate);let s=!0;return this._inputElement&&(this._inputElement.checkValidity?(this._inputElement.__forceCheckValidity=!0,s=this._inputElement.checkValidity(),this._inputElement.__forceCheckValidity=!1):this._inputElement.validate&&(s=this._inputElement.validate())),e&&t&&s}_onScroll(e){e.target!==window&&this._overlayContent.contains(e.target)||this._updateAlignmentAndPosition()}_focus(){this._noInput?this._overlayInitialized&&this._overlayContent.focus():this._inputElement.focus()}_focusAndSelect(){this._focus(),this._setSelectionRange(0,this._inputValue.length)}_applyInputValue(e){this._inputValue=e?this._getFormattedDate(this.i18n.formatDate,e):""}_getFormattedDate(e,t){return e(Vs._extractDateParts(t))}_setSelectionRange(e,t){this._nativeInput&&this._nativeInput.setSelectionRange&&this._nativeInput.setSelectionRange(e,t)}_eventKey(e){for(var t=["down","up","enter","esc","tab"],s=0;s<t.length;s++){var i=t[s];if(B.keyboardEventMatchesKeys(e,i))return i}}_isValidDate(e){return e&&!isNaN(e.getTime())}_onKeydown(e){if(this._noInput){-1===[9].indexOf(e.keyCode)&&e.preventDefault()}switch(this._eventKey(e)){case"down":case"up":e.preventDefault(),this.opened?(this._overlayContent.focus(),this._overlayContent._onKeydown(e)):(this._focusOverlayOnOpen=!0,this.open());break;case"enter":{const e=this._getParsedDate(),t=this._isValidDate(e);if(this.opened)this._overlayInitialized&&this._overlayContent.focusedDate&&t&&(this._selectedDate=this._overlayContent.focusedDate),this.close();else if(t||""===this._inputElement.value){const e=this.value;this._selectParsedOrFocusedDate(),e===this.value&&this.validate()}else this.validate();break}case"esc":this.opened?(this._focusedDate=this._selectedDate,this._close()):this.autoOpenDisabled?(""===this._inputElement.value&&(this._selectedDate=null),this._applyInputValue(this._selectedDate)):(this._focusedDate=this._selectedDate,this._selectParsedOrFocusedDate());break;case"tab":this.opened&&(e.preventDefault(),this._setSelectionRange(0,0),e.shiftKey?this._overlayContent.focusCancel():(this._overlayContent.focus(),this._overlayContent.revealDate(this._focusedDate)))}}_getParsedDate(e=this._inputValue){const t=this.i18n.parseDate&&this.i18n.parseDate(e);return t&&this._parseDate(t.year+"-"+(t.month+1)+"-"+t.day)}_onUserInput(e){this.opened||!this._inputElement.value||this.autoOpenDisabled||this.open(),this._userInputValueChanged(),e.__fromClearButton&&(this.validate(),this.__dispatchChange=!0,this.value="",this.__dispatchChange=!1)}_userInputValueChanged(e){if(this.opened&&this._inputValue){const e=this._getParsedDate();this._isValidDate(e)&&(this._ignoreFocusedDateChange=!0,Vs._dateEquals(e,this._focusedDate)||(this._focusedDate=e),this._ignoreFocusedDateChange=!1)}}_announceFocusedDate(e,t,s){t&&!s&&this._overlayContent.announceFocusedDate()}get _overlayContent(){return this.$.overlay.content.querySelector("#overlay-content")}}
|
|
932
|
-
/**
|
|
933
|
-
@license
|
|
934
|
-
Copyright (c) 2017 Vaadin Ltd.
|
|
935
|
-
This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
936
|
-
*/;class qs extends(g(y(v(Bs(H(W)))))){static get template(){return L`
|
|
937
|
-
<style>
|
|
938
|
-
:host {
|
|
939
|
-
display: inline-block;
|
|
940
|
-
}
|
|
941
|
-
|
|
942
|
-
:host([hidden]) {
|
|
943
|
-
display: none !important;
|
|
944
|
-
}
|
|
945
|
-
|
|
946
|
-
:host([opened]) {
|
|
947
|
-
pointer-events: auto;
|
|
948
|
-
}
|
|
949
|
-
|
|
950
|
-
[part="text-field"] {
|
|
951
|
-
width: 100%;
|
|
952
|
-
min-width: 0;
|
|
953
|
-
}
|
|
954
|
-
</style>
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
<vaadin-date-picker-text-field id="input" role="application" autocomplete="off" on-focus="_focus" value="{{_userInputValue}}" invalid="[[invalid]]" label="[[label]]" name="[[name]]" placeholder="[[placeholder]]" required="[[required]]" disabled="[[disabled]]" readonly="[[readonly]]" error-message="[[errorMessage]]" clear-button-visible="[[clearButtonVisible]]" aria-label\$="[[label]]" part="text-field" helper-text="[[helperText]]" theme\$="[[theme]]">
|
|
958
|
-
<slot name="prefix" slot="prefix"></slot>
|
|
959
|
-
<slot name="helper" slot="helper">[[helperText]]</slot>
|
|
960
|
-
<div part="toggle-button" slot="suffix" on-tap="_toggle" role="button" aria-label\$="[[i18n.calendar]]" aria-expanded\$="[[_getAriaExpanded(opened)]]"></div>
|
|
961
|
-
</vaadin-date-picker-text-field>
|
|
962
|
-
|
|
963
|
-
<vaadin-date-picker-overlay id="overlay" fullscreen\$="[[_fullscreen]]" theme\$="[[__getOverlayTheme(theme, _overlayInitialized)]]" on-vaadin-overlay-open="_onOverlayOpened" on-vaadin-overlay-close="_onOverlayClosed" disable-upgrade="">
|
|
964
|
-
<template>
|
|
965
|
-
<vaadin-date-picker-overlay-content id="overlay-content" i18n="[[i18n]]" fullscreen\$="[[_fullscreen]]" label="[[label]]" selected-date="{{_selectedDate}}" slot="dropdown-content" focused-date="{{_focusedDate}}" show-week-numbers="[[showWeekNumbers]]" min-date="[[_minDate]]" max-date="[[_maxDate]]" role="dialog" on-date-tap="_close" part="overlay-content" theme\$="[[__getOverlayTheme(theme, _overlayInitialized)]]">
|
|
966
|
-
</vaadin-date-picker-overlay-content>
|
|
967
|
-
</template>
|
|
968
|
-
</vaadin-date-picker-overlay>
|
|
969
|
-
|
|
970
|
-
<iron-media-query query="[[_fullscreenMediaQuery]]" query-matches="{{_fullscreen}}">
|
|
971
|
-
</iron-media-query>
|
|
972
|
-
`}static get is(){return"vaadin-date-picker"}static get version(){return"4.4.1"}static get properties(){return{clearButtonVisible:{type:Boolean,value:!1},disabled:{type:Boolean,value:!1,reflectToAttribute:!0},errorMessage:String,placeholder:String,helperText:{type:String,value:""},readonly:{type:Boolean,value:!1,reflectToAttribute:!0},invalid:{type:Boolean,reflectToAttribute:!0,notify:!0,value:!1},_userInputValue:String}}static get observers(){return["_userInputValueChanged(_userInputValue)","_setClearButtonLabel(i18n.clear)"]}ready(){super.ready(),P(this,(()=>this._inputElement.validate=()=>{})),this._inputElement.addEventListener("change",(e=>{""!==this._inputElement.value||e.__fromClearButton||(this.__dispatchChange=!0)}))}_onVaadinOverlayClose(e){this._openedWithFocusRing&&this.hasAttribute("focused")?this.focusElement.setAttribute("focus-ring",""):this.hasAttribute("focused")||this.focusElement.blur(),e.detail.sourceEvent&&-1!==e.detail.sourceEvent.composedPath().indexOf(this)&&e.preventDefault()}_toggle(e){e.stopPropagation(),this[this._overlayInitialized&&this.$.overlay.opened?"close":"open"]()}_input(){return this.$.input}set _inputValue(e){this._inputElement.value=e}get _inputValue(){return this._inputElement.value}_getAriaExpanded(e){return Boolean(e).toString()}get focusElement(){return this._input()||this}_setClearButtonLabel(e){this._inputElement.shadowRoot.querySelector('[part="clear-button"]').setAttribute("aria-label",e)}}customElements.define(qs.is,qs);class zs extends ct{}let Ys,Ls,Ws,Hs,Us=e=>e;class Xs extends w{constructor(){super(...arguments),this.value=[],this.disabled=!1,this.__startValue="",this.__endValue=""}static get scopedElements(){return{"vaadin-date-picker":qs,"vaadin-button":p,"x-skeleton":T,"iron-icon":customElements.get("iron-icon"),"x-i18n":A,"x-list":gt}}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 r(Ys||(Ys=Us` <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?r(Ls||(Ls=Us`<span slot="${0}" class="truncate">${0}</span>`),t,bs(e,this.lang)):r(Ws||(Ws=Us`<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?r(Hs||(Hs=Us` <x-i18n .ns="${0}" .lang="${0}" key="ndmod.add_range_hint" class="${0}"> </x-i18n> `),this.ns,this.lang,Y({"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=ke(this.__endValue),s=ke(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 zs(this.value))}}class Ks extends CustomEvent{constructor(e){super("change",{detail:e})}}let Qs,Gs,Js=e=>e;class Zs extends w{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":Qt,"x-choice":C,"x-group":xe,"x-i18n":A}}static get properties(){return n(n({},super.properties),{},{disabled:{type:Boolean},value:{type:String},type:{type:String}})}render(){return r(Qs||(Qs=Js` <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]?r(Gs||(Gs=Js` <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}=we(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 Ks(this.value))}}class ei extends CustomEvent{constructor(e){super("change",{detail:e})}}class ti extends CustomEvent{constructor(){super("remove")}}let si,ii,ai,ni,ri,oi,li,di,hi,ui=e=>e;class ci extends w{constructor(){super("customer-portal-settings"),this.disabled=!1,this.value={jsonataQuery:"*"},this.open=!1}static get scopedElements(){return{"x-disallowed-dates":Xs,"x-jsonata-input":ls,"x-offset-input":Zs,"x-allowed-days":Ss,"iron-icon":customElements.get("iron-icon"),"x-warning":De,"x-group":xe,"x-i18n":A}}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,o=e||t,l=s&&s.days.length>0,d=a&&a.length>0,h=this.open?"":"rounded-b-l";return r(si||(si=ui` <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> `),Y({"font-lumo":!0,"pointer-events-none":!this._isI18nReady}),this.open,(()=>this.open=!this.open),h,this.ns,this.lang,`ndmod.${"*"===i?"all":"some"}Title`,"*"!==i?this.__renderJSONataSummary(i):"",o||l||d?r(ii||(ii=ui` <div> ${0} </div> `),V(o&&this.__renderMinMaxSummary(e,t),l&&this.__renderAllowedSummary(s),d&&this.__renderDisallowedSummary(a))):"",this.disabled||!this._isI18nReady,Ht((()=>this.dispatchEvent(new ti))),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)?r(ai||(ai=ui` <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 ei(this.value))}__getEstimatedDaysFrom(e){const{count:t,units:s}=we(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 r(ni||(ni=ui` <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 r(ri||(ri=ui` ${0} <x-i18n .ns="${0}" .lang="${0}" key="${0}" .opts="${0}"></x-i18n> `),t,this.ns,this.lang,s,{count:t})}return r(oi||(oi=ui`<x-i18n .ns="${0}" .lang="${0}" key="ndmod.any"></x-i18n>`),this.ns,this.lang)}__renderMinMaxSummary(e,t){return r(li||(li=ui` <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?we(e):void 0),this.__renderMinMaxContent(t?we(t):void 0))}__renderAllowedSummary({type:e,days:t}){return r(di||(di=ui` <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=>F(e,this.lang,"short"))).join(", "):"")}__renderDisallowedSummary(e){return r(hi||(hi=ui` <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=>bs(e,this.lang))).join("; "))}}class pi extends CustomEvent{constructor(e){super("change",{detail:e})}}let _i,mi,gi,vi=e=>e;class fi extends w{constructor(){super("customer-portal-settings"),this.disabled=!1,this.value=!1}static get scopedElements(){return{"x-next-date-modification-rule":ci,"vaadin-button":customElements.get("vaadin-button"),"x-section":Et,"iron-icon":customElements.get("iron-icon"),"x-switch":Tt,"x-i18n":A}}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 r(_i||(_i=vi` <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?r(mi||(mi=vi` ${0} `),this.__normalizedValue.map(((e,t,s)=>r(gi||(gi=vi` <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,Y({"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 pi(this.value))}}class yi extends ct{}let bi,xi,wi,$i=e=>e;class ki extends w{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":T,"iron-icon":customElements.get("iron-icon"),"x-group":xe,"x-list":gt,"x-i18n":A}}static get properties(){return n(n({},super.properties),{},{value:{type:Array},invalid:{type:Boolean},disabled:{type:Boolean}})}render(){return r(bi||(bi=$i` <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?r(xi||(xi=$i` <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):r(wi||(wi=$i`<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,Y({"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 yi(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 Di extends CustomEvent{constructor(e){super("change",{detail:e})}}let Si,Ci=e=>e;class Ei extends w{constructor(){super("customer-portal-settings"),this.disabled=!1,this.value=!1}static get scopedElements(){return{"x-section":Et,"x-switch":Tt,"x-i18n":A}}static get properties(){return n(n({},super.properties),{},{disabled:{type:Boolean},value:{type:Array}})}render(){return r(Si||(Si=Ci` <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 Di(this.value))}}const Ii=E.assign({error:(e,t)=>t.data.type}),Ai=E.assign({oldResource:(e,t)=>t.data.resource,newResource:(e,t)=>t.data.resource,store:(e,t)=>t.data.store}),Mi=E.assign({oldResource:e=>e.newResource}),Ti=E.assign({invalid:[],newResource:({oldResource:e})=>e}),ji=E.assign({invalid:[],newResource:e=>({allowedOrigins:[],subscriptions:{allowFrequencyModification:[],allowNextDateModification:!1},jwtSharedSecret:ut(72,(()=>dt(35).toString(36))).join(""),sessionLifespanInMinutes:40320,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"]}})}),Oi=E.assign({newResource:null}),Vi=E.assign({error:"setup_needed"}),Fi=E.assign({newResource:({newResource:e},t)=>{const s=t.value;return n(n({},e),{},{allowedOrigins:s})}}),Ri=E.assign({newResource:({newResource:e},t)=>{const s=t.value;return n(n({},e),{},{subscriptions:n(n({},e.subscriptions),{},{allowFrequencyModification:s})})}}),Pi=E.assign({newResource:({newResource:e},t)=>{const s=t.value;return n(n({},e),{},{subscriptions:n(n({},e.subscriptions),{},{allowNextDateModification:s})})}}),Ni=E.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})}}),Bi=E.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})}}),qi=E.assign({oldResource:null,newResource:null,store:null,error:null,href:(e,t)=>t.data}),zi=E.assign({newResource:({newResource:e},t)=>{const s=t.value;return n(n({},e),{},{sso:s})}}),Yi={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_FREQUENCY_MODIFICATION:{target:"#cps.idle",actions:"setFrequencyModification"},SET_NEXT_DATE_MODIFICATION:{target:"#cps.idle",actions:"setNextDateModification"}},Li={initial:"unknown",states:{unknown:{always:[{target:"invalid",cond:"isInvalid"},{target:"valid"}]},invalid:{},valid:{}}},Wi=ye({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:Yi},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:Yi},Li),updated:n({on:Yi},Li),deleted:{}}}}}},on:{SET_HREF:{actions:"setHref",target:"unknown"}}},{guards:{isClean:e=>be(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:Ri,setNextDateModification:Pi,setOrigins:Fi,setSession:Ni,setSecret:Bi,setHref:qi,setSSO:zi,handleLoadingSuccess:Ai,handleSavingSuccess:Mi,handleError:Ii,create:ji,reset:Ti,remove:Oi,requireSetup:Vi}});let Hi,Ui,Xi,Ki,Qi=e=>e;function Gi(e){if(!e.ok)throw new m(401===e.status?"unauthorized":"unknown")}class Ji extends CustomEvent{constructor(){super("ready")}}class Zi extends CustomEvent{constructor(){super("update")}}class ea extends w{constructor(){super("customer-portal-settings"),this.rel="customer_portal_settings",this.__machine=Wi.withConfig({services:{load:()=>this.__load(),save:()=>this.__save()}}),this.__service=Se(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":ys,"x-next-date-modification":fi,"x-session-duration":qt,"x-session-secret":Wt,"x-loading-screen":bt,"x-error-screen":_,"x-origins-list":ki,"x-sso-switch":Ei,"x-skeleton":T,"x-section":Et,"x-switch":Tt,"x-i18n":A,"x-page":kt}}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,o;if(this.__service.state.matches("error"))return r(Hi||(Hi=Qi` <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:l}=this.__service.state.context,d=this.__service.state.matches("idle.dirty.created"),h=this.__service.state.matches("idle.dirty.deleted"),u=this.__service.state.matches("idle.dirty.updated"),c=this.__service.state.matches("idle.clean.enabled"),p=this.__service.state.matches("idle.dirty.updated.invalid")||this.__service.state.matches("idle.dirty.created.invalid");return r(Ui||(Ui=Qi` <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-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,c||d||u,(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==l?void 0:l.allowedOrigins)&&void 0!==e?e:[],!l,(e=>{this.__service.send({type:"SET_ORIGINS",value:e.detail})}),this.lang,this.ns,null!==(t=null==l?void 0:l.subscriptions.allowFrequencyModification)&&void 0!==t?t:[],!l,(e=>{this.__service.send({type:"SET_FREQUENCY_MODIFICATION",value:e.detail})}),this.lang,this.ns,null!==(s=null==l?void 0:l.subscriptions.allowNextDateModification)&&void 0!==s&&s,!l,(e=>{this.__service.send({type:"SET_NEXT_DATE_MODIFICATION",value:e.detail})}),this.lang,this.ns,null!==(i=null==l?void 0:l.sso)&&void 0!==i&&i,!l,(e=>{this.__service.send({type:"SET_SSO",value:e.detail})}),this.ns,this.lang,this.ns,this.lang,!l||!this._isI18nReady,null!==(a=null==l?void 0:l.sessionLifespanInMinutes)&&void 0!==a?a:1,this.lang,this.ns,(({detail:e})=>{this.__service.send(n({type:"SET_SESSION"},e))}),!l||!this._isI18nReady,null!==(o=null==l?void 0:l.jwtSharedSecret)&&void 0!==o?o:"",this.lang,this.ns,(({detail:e})=>{this.__service.send(n({type:"SET_SECRET"},e))}),this.__service.state.matches("idle.dirty")?r(Xi||(Xi=Qi` <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> `),h?"error":"success",p,(()=>this.__service.send("SAVE")),this.lang,this.ns,d?"create":h?"delete":"update",(()=>this.__service.send("RESET")),this.lang):this.__service.state.matches("busy")?r(Ki||(Ki=Qi`<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 m("setup_needed");try{await this.updateComplete;const e=await Ot.emit({source:this,init:[this.href]});let t,s;if(e.status.toString().startsWith("4")){t=null;const e=await Ot.emit({source:this,init:["/"]});Gi(e);const i=(await e.json())._links["fx:store"].href,a=await Ot.emit({source:this,init:[i]});Gi(a),s=await a.json()}else{Gi(e),t=await e.json();const i=t._links["fx:store"].href,a=await Ot.emit({source:this,init:[i]});Gi(a),s=await a.json()}return{store:s,resource:t}}catch(e){if(e instanceof m)throw e;if(e instanceof jt)throw new m("setup_needed");throw new m("unknown")}finally{await this.updateComplete,this.dispatchEvent(new Ji)}}async __save(){try{const e=this.__service.state.context,t=it(e.newResource,5),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};Gi(await Ot.emit({source:this,init:[this.href,i]}))}catch(e){if(e instanceof m)throw e;if(e instanceof jt)throw new m("setup_needed");throw new m("unknown")}finally{await this.updateComplete,this.dispatchEvent(new Zi)}}}customElements.define("foxy-customer-portal-settings",ea);export{ea as CustomerPortalSettings};
|
|
169
|
+
`}static get is(){return"vaadin-custom-field"}static get version(){return"1.3.0"}static get properties(){return{label:{type:String,value:"",observer:"_labelChanged"},name:String,required:{type:Boolean,reflectToAttribute:!0},value:{type:String,observer:"__valueChanged",notify:!0},invalid:{type:Boolean,reflectToAttribute:!0,notify:!0,value:!1,observer:"__invalidChanged"},errorMessage:{type:String,value:"",observer:"__errorMessageChanged"},helperText:{type:String,value:"",observer:"__helperTextChanged"}}}static get observers(){return["__getActiveErrorId(invalid, errorMessage, __errorId, helperText, __helperTextId, __hasSlottedHelper)","__getActiveLabelId(label, __labelId)","__toggleHasValue(value)"]}__invalidChanged(e){this.__setOrToggleAttribute("aria-invalid",e,this)}__errorMessageChanged(e){this.__setOrToggleAttribute("has-error-message",!!e,this)}__helperTextChanged(e){this.__setOrToggleAttribute("has-helper",!!e,this)}__toggleHasValue(e){null!==e&&""!==e.trim()?this.setAttribute("has-value",""):this.removeAttribute("has-value")}_labelChanged(e){""!==e&&null!=e?this.setAttribute("has-label",""):this.removeAttribute("has-label")}validate(){return!(this.invalid=!this.checkValidity())}checkValidity(){return!(this.inputs.filter((e=>!(e.validate||e.checkValidity).call(e))).length||this.required&&!this.value.trim())}__setOrToggleAttribute(e,t,s){e&&s&&s.hasAttribute(e)===!t&&(t?s.setAttribute(e,"boolean"==typeof t?"":t):s.removeAttribute(e))}__getActiveErrorId(e,t,s,i,a,n){const r=[];(i||n)&&r.push(a),t&&e&&r.push(s),r.length>0?this.setAttribute("aria-describedby",r.join(" ")):this.removeAttribute("aria-describedby")}__getActiveLabelId(e,t){this.__setOrToggleAttribute("aria-labelledby",e?t:void 0,this)}__getErrorMessageAriaHidden(e,t,s){return(!(t&&e?s:void 0)).toString()}}customElements.define(yt.is,yt);let $t,wt=e=>e;class kt extends CustomEvent{constructor(e){super("change",{detail:e})}}class Et extends v{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":R,"vaadin-custom-field":yt,"vaadin-select":$,"x-i18n":w}}static get properties(){return n(n({},super.properties),{},{disabled:{attribute:!1},value:{attribute:!1}})}render(){var e;return r($t||($t=wt` <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(),V({"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 kt({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 jt,St=e=>e;class Ct extends CustomEvent{constructor(e){super("change",{detail:e})}}class It extends v{constructor(){super(...arguments),this.disabled=!1,this.value="",this.__errorMessage=""}static get scopedElements(){return{"vaadin-password-field":T,"vaadin-button":d,"iron-icon":customElements.get("iron-icon"),"x-i18n":w}}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 r(jt||(jt=St` <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=Ge(72,(()=>Je(35).toString(36))).join(""),this.dispatchEvent(new Ct({value:this.value,invalid:!1}))}__handleInput(e){this.value=e.target.value,this.dispatchEvent(new Ct({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 Rt(e){return t=>{t.preventDefault(),e(t)}}class Vt extends x{}let At,Mt=e=>e;class Tt extends v{constructor(){super("customer-portal-settings"),this.disabled=!1,this.value=Tt.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":k}}static get properties(){return n(n({},super.properties),{},{disabled:{type:Boolean},value:{type:String}})}render(){return r(At||(At=Mt` <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 ne(null!==(e=this.value)&&void 0!==e?e:"").count}get __unitsValue(){var e;return ne(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 Vt(this.value))}}Tt.defaultValue="1w";class Ot extends Ye{}let qt,Nt,Dt,Ft,Lt=e=>e;class Ut extends v{constructor(){super("customer-portal-settings"),this.value=[],this.disabled=!1,this.__newValue=Tt.defaultValue}static get scopedElements(){return{"iron-icon":customElements.get("iron-icon"),"vaadin-button":customElements.get("vaadin-button"),"x-frequency-input":Tt,"x-skeleton":E,"x-list":et,"x-i18n":w}}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 r(qt||(qt=Lt` <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?r(Nt||(Nt=Lt`<span slot="${0}">${0}</span>`),t,this.__getText(e)):r(Dt||(Dt=Lt`<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?r(Ft||(Ft=Lt` <x-i18n .ns="${0}" .lang="${0}" key="fmod.add_option_hint" class="${0}"> </x-i18n> `),this.ns,this.lang,V({"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=Tt.defaultValue,this.__sendChange()}__sendChange(){this.dispatchEvent(new Ot(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 zt extends b{}let Bt,Pt,Ht=e=>e;class Qt extends v{constructor(){super(...arguments),this.disabled=!1,this.value="*",this.__errorMessage="",this.__items=["all","some"],this.__handleNewValueChange=m((e=>{try{re(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":f,"x-i18n":w}}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 r(Bt||(Bt=Ht` <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]?r(Pt||(Pt=Ht` <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 zt(this.value))}}class Jt extends CustomEvent{constructor(e){super("change",{detail:e})}}class Wt extends CustomEvent{constructor(){super("remove")}}let Gt,Yt,Kt=e=>e;class Xt extends v{constructor(){super(...arguments),this.open=!1,this.value={jsonataQuery:"*",values:[]},this.disabled=!1}static get scopedElements(){return{"x-frequency-list":Ut,"x-jsonata-input":Qt,"iron-icon":customElements.get("iron-icon"),"x-group":ae,"x-i18n":w}}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 r(Gt||(Gt=Kt` <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> `),V({"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,Rt((()=>{this.dispatchEvent(new Wt)})),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}=ne(e);return this._t("frequency",{units:this._t(s,{count:t}),count:t})}__renderJSONataSummary(e){return r(Yt||(Yt=Kt` <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 Jt(this.value))}}class Zt extends CustomEvent{constructor(e){super("change",{detail:e})}}let es,ts,ss=e=>e;class is extends v{constructor(){super(...arguments),this.value=[],this.disabled=!1}static get scopedElements(){return{"x-frequency-modification-rule":Xt,"vaadin-button":customElements.get("vaadin-button"),"x-section":ct,"iron-icon":customElements.get("iron-icon"),"x-group":ae,"x-i18n":w}}static get properties(){return n(n({},super.properties),{},{value:{type:Array},disabled:{type:Boolean}})}render(){const{ns:e,lang:t}=this;return r(es||(es=ss` <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)=>r(ts||(ts=ss` <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,V({"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 Zt(this.value))}}function as(e,t){const s=(new Date).getFullYear(),i={month:"long",day:"numeric"};return e.split("..").map((e=>{const a=le(e),r=(null==a?void 0:a.getFullYear())===s?void 0:"numeric";return null==a?void 0:a.toLocaleDateString(t,n({year:r},i))})).join(" – ")}class ns extends CustomEvent{constructor(e){super("change",{detail:e})}}let rs,ls,os,ds=e=>e;class hs extends v{constructor(){super("customer-portal-settings"),this.disabled=!1,this.__items=["all","month","day"]}static get scopedElements(){return{"x-monthday-picker":j,"x-weekday-picker":S,"x-choice":f,"x-i18n":w}}static get properties(){return n(n({},super.properties),{},{disabled:{type:Boolean},value:{type:Object}})}render(){var e,t,s,i;return r(rs||(rs=ds` <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)?r(ls||(ls=ds` <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)?r(os||(os=ds` <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 ns(this.value))}}class us extends Ye{}let cs,ps,_s,gs,vs=e=>e;class ms extends v{constructor(){super(...arguments),this.value=[],this.disabled=!1,this.__startValue="",this.__endValue=""}static get scopedElements(){return{"vaadin-date-picker":de,"vaadin-button":d,"x-skeleton":E,"iron-icon":customElements.get("iron-icon"),"x-i18n":w,"x-list":et}}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 r(cs||(cs=vs` <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?r(ps||(ps=vs`<span slot="${0}" class="truncate">${0}</span>`),t,as(e,this.lang)):r(_s||(_s=vs`<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?r(gs||(gs=vs` <x-i18n .ns="${0}" .lang="${0}" key="ndmod.add_range_hint" class="${0}"> </x-i18n> `),this.ns,this.lang,V({"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=le(this.__endValue),s=le(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 us(this.value))}}class xs extends CustomEvent{constructor(e){super("change",{detail:e})}}let bs,fs,ys=e=>e;class $s extends v{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":Tt,"x-choice":f,"x-group":ae,"x-i18n":w}}static get properties(){return n(n({},super.properties),{},{disabled:{type:Boolean},value:{type:String},type:{type:String}})}render(){return r(bs||(bs=ys` <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]?r(fs||(fs=ys` <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}=ne(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 xs(this.value))}}class ws extends CustomEvent{constructor(e){super("change",{detail:e})}}class ks extends CustomEvent{constructor(){super("remove")}}let Es,js,Ss,Cs,Is,Rs,Vs,As,Ms,Ts=e=>e;class Os extends v{constructor(){super("customer-portal-settings"),this.disabled=!1,this.value={jsonataQuery:"*"},this.open=!1}static get scopedElements(){return{"x-disallowed-dates":ms,"x-jsonata-input":Qt,"x-offset-input":$s,"x-allowed-days":hs,"iron-icon":customElements.get("iron-icon"),"x-warning":oe,"x-group":ae,"x-i18n":w}}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,o=s&&s.days.length>0,d=a&&a.length>0,h=this.open?"":"rounded-b-l";return r(Es||(Es=Ts` <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> `),V({"font-lumo":!0,"pointer-events-none":!this._isI18nReady}),this.open,(()=>this.open=!this.open),h,this.ns,this.lang,`ndmod.${"*"===i?"all":"some"}Title`,"*"!==i?this.__renderJSONataSummary(i):"",l||o||d?r(js||(js=Ts` <div> ${0} </div> `),C(l&&this.__renderMinMaxSummary(e,t),o&&this.__renderAllowedSummary(s),d&&this.__renderDisallowedSummary(a))):"",this.disabled||!this._isI18nReady,Rt((()=>this.dispatchEvent(new ks))),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)?r(Ss||(Ss=Ts` <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 ws(this.value))}__getEstimatedDaysFrom(e){const{count:t,units:s}=ne(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 r(Cs||(Cs=Ts` <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 r(Is||(Is=Ts` ${0} <x-i18n .ns="${0}" .lang="${0}" key="${0}" .opts="${0}"></x-i18n> `),t,this.ns,this.lang,s,{count:t})}return r(Rs||(Rs=Ts`<x-i18n .ns="${0}" .lang="${0}" key="ndmod.any"></x-i18n>`),this.ns,this.lang)}__renderMinMaxSummary(e,t){return r(Vs||(Vs=Ts` <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?ne(e):void 0),this.__renderMinMaxContent(t?ne(t):void 0))}__renderAllowedSummary({type:e,days:t}){return r(As||(As=Ts` <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=>I(e,this.lang,"short"))).join(", "):"")}__renderDisallowedSummary(e){return r(Ms||(Ms=Ts` <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=>as(e,this.lang))).join("; "))}}class qs extends CustomEvent{constructor(e){super("change",{detail:e})}}let Ns,Ds,Fs,Ls=e=>e;class Us extends v{constructor(){super("customer-portal-settings"),this.disabled=!1,this.value=!1}static get scopedElements(){return{"x-next-date-modification-rule":Os,"vaadin-button":customElements.get("vaadin-button"),"x-section":ct,"iron-icon":customElements.get("iron-icon"),"x-switch":vt,"x-i18n":w}}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 r(Ns||(Ns=Ls` <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?r(Ds||(Ds=Ls` ${0} `),this.__normalizedValue.map(((e,t,s)=>r(Fs||(Fs=Ls` <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,V({"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 qs(this.value))}}class zs extends Ye{}let Bs,Ps,Hs,Qs=e=>e;class Js extends v{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":E,"iron-icon":customElements.get("iron-icon"),"x-group":ae,"x-list":et,"x-i18n":w}}static get properties(){return n(n({},super.properties),{},{value:{type:Array},invalid:{type:Boolean},disabled:{type:Boolean}})}render(){return r(Bs||(Bs=Qs` <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?r(Ps||(Ps=Qs` <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):r(Hs||(Hs=Qs`<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,V({"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 zs(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 Ws extends CustomEvent{constructor(e){super("change",{detail:e})}}let Gs,Ys=e=>e;class Ks extends v{constructor(){super("customer-portal-settings"),this.disabled=!1,this.value=!1}static get scopedElements(){return{"x-section":ct,"x-switch":vt,"x-i18n":w}}static get properties(){return n(n({},super.properties),{},{disabled:{type:Boolean},value:{type:Array}})}render(){return r(Gs||(Gs=Ys` <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 Ws(this.value))}}const Xs=y.assign({error:(e,t)=>t.data.type}),Zs=y.assign({oldResource:(e,t)=>t.data.resource,newResource:(e,t)=>t.data.resource,store:(e,t)=>t.data.store}),ei=y.assign({oldResource:e=>e.newResource}),ti=y.assign({invalid:[],newResource:({oldResource:e})=>e}),si=y.assign({invalid:[],newResource:e=>({allowedOrigins:[],subscriptions:{allowFrequencyModification:[],allowNextDateModification:!1},jwtSharedSecret:Ge(72,(()=>Je(35).toString(36))).join(""),sessionLifespanInMinutes:40320,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"]}})}),ii=y.assign({newResource:null}),ai=y.assign({error:"setup_needed"}),ni=y.assign({newResource:({newResource:e},t)=>{const s=t.value;return n(n({},e),{},{allowedOrigins:s})}}),ri=y.assign({newResource:({newResource:e},t)=>{const s=t.value;return n(n({},e),{},{subscriptions:n(n({},e.subscriptions),{},{allowFrequencyModification:s})})}}),li=y.assign({newResource:({newResource:e},t)=>{const s=t.value;return n(n({},e),{},{subscriptions:n(n({},e.subscriptions),{},{allowNextDateModification:s})})}}),oi=y.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})}}),di=y.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})}}),hi=y.assign({oldResource:null,newResource:null,store:null,error:null,href:(e,t)=>t.data}),ui=y.assign({newResource:({newResource:e},t)=>{const s=t.value;return n(n({},e),{},{sso:s})}}),ci={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_FREQUENCY_MODIFICATION:{target:"#cps.idle",actions:"setFrequencyModification"},SET_NEXT_DATE_MODIFICATION:{target:"#cps.idle",actions:"setNextDateModification"}},pi={initial:"unknown",states:{unknown:{always:[{target:"invalid",cond:"isInvalid"},{target:"valid"}]},invalid:{},valid:{}}},_i=se({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:ci},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:ci},pi),updated:n({on:ci},pi),deleted:{}}}}}},on:{SET_HREF:{actions:"setHref",target:"unknown"}}},{guards:{isClean:e=>ie(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:ri,setNextDateModification:li,setOrigins:ni,setSession:oi,setSecret:di,setHref:hi,setSSO:ui,handleLoadingSuccess:Zs,handleSavingSuccess:ei,handleError:Xs,create:si,reset:ti,remove:ii,requireSetup:ai}});let gi,vi,mi,xi,bi=e=>e;function fi(e){if(!e.ok)throw new u(401===e.status?"unauthorized":"unknown")}class yi extends CustomEvent{constructor(){super("ready")}}class $i extends CustomEvent{constructor(){super("update")}}class wi extends v{constructor(){super("customer-portal-settings"),this.rel="customer_portal_settings",this.__machine=_i.withConfig({services:{load:()=>this.__load(),save:()=>this.__save()}}),this.__service=he(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":is,"x-next-date-modification":Us,"x-session-duration":Et,"x-session-secret":It,"x-loading-screen":at,"x-error-screen":h,"x-origins-list":Js,"x-sso-switch":Ks,"x-skeleton":E,"x-section":ct,"x-switch":vt,"x-i18n":w,"x-page":ot}}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 r(gi||(gi=bi` <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:o}=this.__service.state.context,d=this.__service.state.matches("idle.dirty.created"),h=this.__service.state.matches("idle.dirty.deleted"),u=this.__service.state.matches("idle.dirty.updated"),c=this.__service.state.matches("idle.clean.enabled"),p=this.__service.state.matches("idle.dirty.updated.invalid")||this.__service.state.matches("idle.dirty.created.invalid");return r(vi||(vi=bi` <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-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,c||d||u,(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==o?void 0:o.allowedOrigins)&&void 0!==e?e:[],!o,(e=>{this.__service.send({type:"SET_ORIGINS",value:e.detail})}),this.lang,this.ns,null!==(t=null==o?void 0:o.subscriptions.allowFrequencyModification)&&void 0!==t?t:[],!o,(e=>{this.__service.send({type:"SET_FREQUENCY_MODIFICATION",value:e.detail})}),this.lang,this.ns,null!==(s=null==o?void 0:o.subscriptions.allowNextDateModification)&&void 0!==s&&s,!o,(e=>{this.__service.send({type:"SET_NEXT_DATE_MODIFICATION",value:e.detail})}),this.lang,this.ns,null!==(i=null==o?void 0:o.sso)&&void 0!==i&&i,!o,(e=>{this.__service.send({type:"SET_SSO",value:e.detail})}),this.ns,this.lang,this.ns,this.lang,!o||!this._isI18nReady,null!==(a=null==o?void 0:o.sessionLifespanInMinutes)&&void 0!==a?a:1,this.lang,this.ns,(({detail:e})=>{this.__service.send(n({type:"SET_SESSION"},e))}),!o||!this._isI18nReady,null!==(l=null==o?void 0:o.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")?r(mi||(mi=bi` <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> `),h?"error":"success",p,(()=>this.__service.send("SAVE")),this.lang,this.ns,d?"create":h?"delete":"update",(()=>this.__service.send("RESET")),this.lang):this.__service.state.matches("busy")?r(xi||(xi=bi`<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 u("setup_needed");try{await this.updateComplete;const e=await xt.emit({source:this,init:[this.href]});let t,s;if(e.status.toString().startsWith("4")){t=null;const e=await xt.emit({source:this,init:["/"]});fi(e);const i=(await e.json())._links["fx:store"].href,a=await xt.emit({source:this,init:[i]});fi(a),s=await a.json()}else{fi(e),t=await e.json();const i=t._links["fx:store"].href,a=await xt.emit({source:this,init:[i]});fi(a),s=await a.json()}return{store:s,resource:t}}catch(e){if(e instanceof u)throw e;if(e instanceof mt)throw new u("setup_needed");throw new u("unknown")}finally{await this.updateComplete,this.dispatchEvent(new yi)}}async __save(){try{const e=this.__service.state.context,t=Ue(e.newResource,5),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};fi(await xt.emit({source:this,init:[this.href,i]}))}catch(e){if(e instanceof u)throw e;if(e instanceof mt)throw new u("setup_needed");throw new u("unknown")}finally{await this.updateComplete,this.dispatchEvent(new $i)}}}customElements.define("foxy-customer-portal-settings",wi);export{wi as CustomerPortalSettings};
|