@foxy.io/elements 1.49.0-beta.2 → 1.49.0-beta.3

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.
Files changed (78) hide show
  1. package/dist/cdn/foxy-address-form.js +1 -1
  2. package/dist/cdn/foxy-admin-subscription-form.js +1 -1
  3. package/dist/cdn/foxy-api-browser.js +1 -1
  4. package/dist/cdn/foxy-applied-coupon-code-form.js +1 -1
  5. package/dist/cdn/foxy-attribute-form.js +1 -1
  6. package/dist/cdn/foxy-cart-form.js +2 -2
  7. package/dist/cdn/foxy-client-form.js +1 -1
  8. package/dist/cdn/foxy-copy-to-clipboard.js +1 -1
  9. package/dist/cdn/foxy-coupon-code-form.js +1 -1
  10. package/dist/cdn/foxy-coupon-codes-form.js +1 -1
  11. package/dist/cdn/foxy-coupon-form.js +1 -1
  12. package/dist/cdn/foxy-custom-field-form.js +1 -1
  13. package/dist/cdn/foxy-customer-form.js +1 -1
  14. package/dist/cdn/foxy-customer-portal-settings-form.js +1 -1
  15. package/dist/cdn/foxy-customer-portal.js +1 -1
  16. package/dist/cdn/foxy-customer.js +1 -1
  17. package/dist/cdn/foxy-downloadable-form.js +1 -1
  18. package/dist/cdn/foxy-email-template-form.js +1 -1
  19. package/dist/cdn/foxy-experimental-add-to-cart-builder.js +1 -1
  20. package/dist/cdn/foxy-filter-attribute-form.js +1 -1
  21. package/dist/cdn/foxy-generate-codes-form.js +1 -1
  22. package/dist/cdn/foxy-gift-card-code-form.js +1 -1
  23. package/dist/cdn/foxy-gift-card-codes-form.js +1 -1
  24. package/dist/cdn/foxy-gift-card-form.js +1 -1
  25. package/dist/cdn/foxy-integration-form.js +1 -1
  26. package/dist/cdn/foxy-item-category-form.js +1 -1
  27. package/dist/cdn/foxy-item-form.js +1 -1
  28. package/dist/cdn/foxy-item-option-form.js +1 -1
  29. package/dist/cdn/foxy-native-integration-form.js +1 -1
  30. package/dist/cdn/foxy-passkey-form.js +1 -1
  31. package/dist/cdn/foxy-payment-method-card.js +1 -1
  32. package/dist/cdn/foxy-payments-api-fraud-protection-form.js +1 -1
  33. package/dist/cdn/foxy-payments-api-payment-method-form.js +1 -1
  34. package/dist/cdn/foxy-payments-api-payment-preset-form.js +1 -1
  35. package/dist/cdn/foxy-query-builder.js +1 -1
  36. package/dist/cdn/foxy-store-form.js +1 -1
  37. package/dist/cdn/foxy-store-shipping-method-form.js +1 -1
  38. package/dist/cdn/foxy-store-transaction-folder-form.js +1 -1
  39. package/dist/cdn/foxy-subscription-form.js +1 -1
  40. package/dist/cdn/foxy-subscription-settings-form.js +1 -1
  41. package/dist/cdn/foxy-tax-form.js +1 -1
  42. package/dist/cdn/foxy-template-config-form.js +1 -1
  43. package/dist/cdn/foxy-template-form.js +1 -1
  44. package/dist/cdn/foxy-template-set-form.js +1 -1
  45. package/dist/cdn/foxy-transaction.js +1 -1
  46. package/dist/cdn/foxy-update-payment-method-form.js +1 -1
  47. package/dist/cdn/foxy-user-form.js +1 -1
  48. package/dist/cdn/foxy-user-invitation-form.js +1 -1
  49. package/dist/cdn/foxy-users-table.js +1 -1
  50. package/dist/cdn/foxy-webhook-form.js +1 -1
  51. package/dist/cdn/shared-462566b0.js +1 -0
  52. package/dist/cdn/{shared-063c93be.js → shared-4dc0bd88.js} +1 -1
  53. package/dist/cdn/{shared-ec1daff0.js → shared-4ffaa9b7.js} +7 -7
  54. package/dist/cdn/{shared-07268049.js → shared-7c5881c1.js} +1 -1
  55. package/dist/cdn/translations/store-form/en.json +5 -1
  56. package/dist/elements/internal/InternalPasswordControl/InternalPasswordControl.d.ts +3 -0
  57. package/dist/elements/internal/InternalPasswordControl/InternalPasswordControl.js +11 -0
  58. package/dist/elements/internal/InternalPasswordControl/InternalPasswordControl.js.map +1 -1
  59. package/dist/elements/internal/InternalPasswordControl/index.d.ts +1 -0
  60. package/dist/elements/internal/InternalPasswordControl/index.js +1 -0
  61. package/dist/elements/internal/InternalPasswordControl/index.js.map +1 -1
  62. package/dist/elements/public/CopyToClipboard/CopyToClipboard.d.ts +1 -1
  63. package/dist/elements/public/CopyToClipboard/CopyToClipboard.js +19 -5
  64. package/dist/elements/public/CopyToClipboard/CopyToClipboard.js.map +1 -1
  65. package/dist/elements/public/QueryBuilder/QueryBuilder.d.ts +4 -2
  66. package/dist/elements/public/QueryBuilder/QueryBuilder.js +27 -7
  67. package/dist/elements/public/QueryBuilder/QueryBuilder.js.map +1 -1
  68. package/dist/elements/public/QueryBuilder/components/SimpleDateRule.js +3 -1
  69. package/dist/elements/public/QueryBuilder/components/SimpleDateRule.js.map +1 -1
  70. package/dist/elements/public/QueryBuilder/components/SimpleNumberRule.js +15 -11
  71. package/dist/elements/public/QueryBuilder/components/SimpleNumberRule.js.map +1 -1
  72. package/dist/elements/public/QueryBuilder/types.d.ts +1 -0
  73. package/dist/elements/public/QueryBuilder/types.js.map +1 -1
  74. package/dist/elements/public/StoreForm/StoreForm.js +1 -0
  75. package/dist/elements/public/StoreForm/StoreForm.js.map +1 -1
  76. package/package.json +1 -1
  77. package/dist/cdn/shared-759f65d8.js +0 -1
  78. /package/dist/cdn/{shared-eadf0d23.js → shared-084e1772.js} +0 -0
@@ -1,4 +1,4 @@
1
- import"./shared-b0453b08.js";import"./shared-18e301f2.js";import"./shared-591ee1bf.js";import"./shared-26b55da2.js";import{_ as e}from"./shared-8f9014ff.js";import{R as l,T as a,a as n}from"./shared-328aa161.js";import{C as t}from"./shared-41c9c53f.js";import{s as r,h as o,c as s,L as i}from"./shared-ba5c42c7.js";import{I as u}from"./shared-930e68b7.js";import{O as d,T as v}from"./shared-8874ec69.js";import{o as c}from"./shared-63c32024.js";import{c as p}from"./shared-4e709717.js";import{r as h}from"./shared-5fd5805c.js";import{i as f}from"./shared-53e42a77.js";import{s as b}from"./shared-2061be9a.js";import{p as g}from"./shared-f0fa0a88.js";let m;const y=r(m||(m=(e=>e)`
1
+ import"./shared-b0453b08.js";import"./shared-18e301f2.js";import"./shared-591ee1bf.js";import"./shared-26b55da2.js";import{_ as e}from"./shared-8f9014ff.js";import{R as l,T as a,a as n}from"./shared-328aa161.js";import{C as t}from"./shared-41c9c53f.js";import{s as r,h as o,c as s,L as i}from"./shared-ba5c42c7.js";import{I as u}from"./shared-930e68b7.js";import{O as d,T as v}from"./shared-8874ec69.js";import{o as c}from"./shared-63c32024.js";import{c as p}from"./shared-4e709717.js";import{r as h}from"./shared-5fd5805c.js";import{i as f}from"./shared-53e42a77.js";import{s as b}from"./shared-2061be9a.js";import{p as g}from"./shared-f0fa0a88.js";let y;const m=r(y||(y=(e=>e)`
2
2
  <svg class="w-full h-full" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
3
3
  <path d="M26.4 14.7399C26.4 15.2922 25.9523 15.7399 25.4 15.7399H10.6C10.0477 15.7399 9.60001 15.2922 9.60001 14.7399V14.2C9.60001 13.6477 10.0477 13.2 10.6 13.2H25.4C25.9523 13.2 26.4 13.6477 26.4 14.2V14.7399ZM26.4 21.8C26.4 22.3523 25.9523 22.8 25.4 22.8H10.6C10.0477 22.8 9.60001 22.3523 9.60001 21.8V21.2601C9.60001 20.7078 10.0477 20.2601 10.6 20.2601H25.4C25.9523 20.2601 26.4 20.7078 26.4 21.2601V21.8Z" class="fill-current"/>
4
4
  </svg>
@@ -6,12 +6,12 @@ import"./shared-b0453b08.js";import"./shared-18e301f2.js";import"./shared-591ee1
6
6
  <svg class="w-full h-full" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
7
7
  <path d="M12.8656 14.6695C12.3425 14.4581 12 13.9503 12 13.386C12 12.3748 13.0489 11.7048 13.9663 12.1299L23.8937 16.7295C24.5323 17.0254 24.941 17.6652 24.941 18.369C24.941 19.0735 24.5316 19.7137 23.8921 20.0092L13.971 24.5938C13.0509 25.019 12 24.347 12 23.3334C12 22.7709 12.3394 22.264 12.8594 22.0496L21.341 18.3046L12.8656 14.6695Z" class="fill-current"/>
8
8
  </svg>
9
- `));let C;const w=r(C||(C=(e=>e)`
9
+ `));let C;const _=r(C||(C=(e=>e)`
10
10
  <svg class="w-full h-full" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
11
11
  <path d="M12.5 9.8C11.0088 9.8 9.8 11.0088 9.8 12.5V23.5C9.8 24.9912 11.0088 26.2 12.5 26.2H14C14.6627 26.2 15.2 25.6627 15.2 25C15.2 24.3373 14.6627 23.8 14 23.8H13.5C12.782 23.8 12.2 23.218 12.2 22.5V13.5C12.2 12.782 12.782 12.2 13.5 12.2H14C14.6627 12.2 15.2 11.6627 15.2 11C15.2 10.3373 14.6627 9.8 14 9.8H12.5Z" class="fill-current"/>
12
12
  <path d="M22 9.8C21.3373 9.8 20.8 10.3373 20.8 11C20.8 11.6627 21.3373 12.2 22 12.2H22.5C23.218 12.2 23.8 12.782 23.8 13.5V22.5C23.8 23.218 23.218 23.8 22.5 23.8H22C21.3373 23.8 20.8 24.3373 20.8 25C20.8 25.6627 21.3373 26.2 22 26.2H23.5C24.9912 26.2 26.2 24.9912 26.2 23.5V12.5C26.2 11.0088 24.9912 9.8 23.5 9.8H22Z" class="fill-current"/>
13
13
  </svg>
14
- `));let _;const L=r(_||(_=(e=>e)`
14
+ `));let w;const L=r(w||(w=(e=>e)`
15
15
  <svg class="w-full h-full" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
16
16
  <path fill-rule="evenodd" clip-rule="evenodd" d="M20.05 23.58L20.04 23.59L17.64 21.19L18.7 20.13L20.05 21.48L22.54 19L23.6 20.06L20.06 23.6L20.05 23.58ZM18 8C12.5 8 8 12.5 8 18C8 23.5 12.5 28 18 28C23.5 28 28 23.5 28 18C28 12.5 23.5 8 18 8ZM13.34 12.28L14.75 13.69L16.16 12.28L17.22 13.34L15.81 14.75L17.22 16.16L16.16 17.22L14.75 15.81L13.34 17.22L12.28 16.16L13.69 14.75L12.28 13.34L13.34 12.28ZM18 26C15.8 26 13.8 25.1 12.3 23.7L23.7 12.3C25.1 13.8 26 15.8 26 18C26 22.4 22.4 26 18 26Z" class="fill-current"/>
17
17
  </svg>
@@ -19,12 +19,12 @@ import"./shared-b0453b08.js";import"./shared-18e301f2.js";import"./shared-591ee1
19
19
  <svg class="w-full h-full" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
20
20
  <path d="M22.8754 22.054C23.3985 22.2655 23.741 22.7733 23.741 23.3375C23.741 24.3487 22.6922 25.0187 21.7747 24.5936L11.8473 19.994C11.2087 19.6981 10.8 19.0583 10.8 18.3545C10.8 17.65 11.2094 17.0098 11.8489 16.7143L21.7701 12.1297C22.6902 11.7045 23.741 12.3765 23.741 13.3902C23.741 13.9526 23.4017 14.4596 22.8816 14.6739L14.4 18.4189L22.8754 22.054Z" class="fill-current"/>
21
21
  </svg>
22
- `));let k;const O=r(k||(k=(e=>e)`
22
+ `));let k;const A=r(k||(k=(e=>e)`
23
23
  <svg class="w-full h-full" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
24
24
  <path d="M22.8754 19.654C23.3985 19.8655 23.741 20.3733 23.741 20.9375C23.741 21.9487 22.6922 22.6187 21.7747 22.1936L11.8473 17.594C11.2087 17.2981 10.8 16.6584 10.8 15.9545C10.8 15.25 11.2094 14.6098 11.8489 14.3143L21.7701 9.72971C22.6902 9.30453 23.741 9.97655 23.741 10.9902C23.741 11.5527 23.4017 12.0596 22.8816 12.2739L14.4 16.0189L22.8754 19.654Z" class="fill-current"/>
25
25
  <path fill-rule="evenodd" clip-rule="evenodd" d="M10.9169 20.9941C11.2134 20.3281 11.9937 20.0286 12.6597 20.3251L22.8548 24.8643C23.5208 25.1608 23.8203 25.9411 23.5238 26.6071C23.2273 27.2731 22.447 27.5726 21.781 27.2761L11.5859 22.7369C10.9199 22.4404 10.6204 21.6601 10.9169 20.9941Z" class="fill-current"/>
26
26
  </svg>
27
- `));let S;const H=r(S||(S=(e=>e)`
27
+ `));let O;const S=r(O||(O=(e=>e)`
28
28
  <svg class="w-full h-full" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
29
29
  <path fill-rule="evenodd" clip-rule="evenodd" d="M24.0049 7.11C24.6649 7.49107 24.8911 8.33507 24.51 8.99511L13.1621 28.6503C12.781 29.3103 11.937 29.5365 11.277 29.1554C10.6169 28.7743 10.3908 27.9303 10.7719 27.2703L22.1198 7.61511C22.5009 6.95507 23.3448 6.72892 24.0049 7.11Z" class="fill-current"/>
30
30
  <path d="M17.5097 13.2H10.8C10.1373 13.2 9.60001 13.7373 9.60001 14.4V14.5399C9.60001 15.2026 10.1373 15.7399 10.8 15.7399H16.0433L17.5097 13.2Z" class="fill-current"/>
@@ -32,9 +32,9 @@ import"./shared-b0453b08.js";import"./shared-18e301f2.js";import"./shared-591ee1
32
32
  <path d="M17.9254 22.8H25.2C25.8627 22.8 26.4 22.2627 26.4 21.6V21.4601C26.4 20.7973 25.8627 20.2601 25.2 20.2601H19.3918L17.9254 22.8Z" class="fill-current"/>
33
33
  <path d="M22.0015 15.7399H25.2C25.8627 15.7399 26.4 15.2026 26.4 14.5399V14.4C26.4 13.7373 25.8627 13.2 25.2 13.2H23.468L22.0015 15.7399Z" class="fill-current"/>
34
34
  </svg>
35
- `));let A;const D=r(A||(A=(e=>e)`
35
+ `));let H;const D=r(H||(H=(e=>e)`
36
36
  <svg class="w-full h-full" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
37
37
  <path fill-rule="evenodd" clip-rule="evenodd" d="M18 8C12.48 8 8 12.48 8 18C8 23.52 12.48 28 18 28C23.52 28 28 23.52 28 18C28 12.48 23.52 8 18 8ZM18 26C13.59 26 10 22.41 10 18C10 13.59 13.59 10 18 10C22.41 10 26 13.59 26 18C26 22.41 22.41 26 18 26Z" class="fill-current"/>
38
38
  <path fill-rule="evenodd" clip-rule="evenodd" d="M19.49 17.38C19.92 16.16 19.66 14.74 18.68 13.76C17.57 12.65 15.89 12.46 14.58 13.17L16.93 15.52L15.52 16.93L13.17 14.58C12.46 15.9 12.65 17.57 13.76 18.68C14.74 19.66 16.16 19.92 17.38 19.49L20.79 22.9C20.99 23.1 21.3 23.1 21.5 22.9L22.9 21.5C23.1 21.3 23.1 20.99 22.9 20.79L19.49 17.38Z" class="fill-current"/>
39
39
  </svg>
40
- `));let j,Z=e=>e;let I,T,N=e=>e;function z(e){return o(I||(I=N` <label class="relative flex items-center cursor-text group text-tertiary"> <div class="relative flex-1 min-w-0 overflow-hidden"> <input placeholder="${0}" class="${0}" .value="${0}" ?disabled="${0}" @keydown="${0}" @input="${0}"> </div> <span class="${0}"> ${0} </span> ${0} </label> `),e.t(e.label),p({"bg-base relative flex h-m px-s font-medium w-full":!0,"text-body":!e.disabled&&!e.readonly,"text-disabled":e.disabled,"text-secondary":e.readonly,"flex max-w-full whitespace-nowrap":!0,"focus-outline-none":!0}),e.value,e.disabled||e.readonly,(e=>"|"===e.key&&e.preventDefault()),(l=>{const a=l.currentTarget;e.onChange(a.value.replace(/\|/gi,""))}),p({"font-tnum text-xs font-medium border border-current mr-s px-xs rounded-s":!0,"inline-block":!!e.value,"sr-only":!e.value,"text-body":!e.disabled&&!e.readonly,"text-disabled":e.disabled,"text-secondary":e.readonly}),e.t(e.label),e.disabled||e.readonly?"":o(T||(T=N` <div class="absolute inset-0 transition-colors bg-transparent group-hover-bg-contrast-5 pointer-events-none"></div> `)))}let B,V,E=e=>e;function G(l){var a,n;const{isFullSize:t,isNested:r,disableOr:s,readonly:i,disabled:u,rule:v}=l,{t:h,onConvert:f,onDelete:b,onChange:g}=l;return o(B||(B=E` <div class="flex items-center space-x-s" aria-label="${0}"> <div class="${0}"> <div class="bg-contrast-10"> <div class="grid gap-1px grid-vertical sm-grid-horizontal"> <div class="bg-base"> <div aria-hidden="true" class="${0}"> ${0} </div> </div> <div class="bg-base"> ${0} </div> <div class="bg-base">${0}</div> <div class="bg-base"> ${0} </div> </div> </div> </div> <div class="${0}"> <button aria-label="${0}" class="${0}" ?disabled="${0}" @click="${0}"> <iron-icon aria-hidden="true" class="m-auto icon-inline text-xl" icon="icons:remove-circle-outline"> </iron-icon> </button> <button aria-label="${0}" class="${0}" ?disabled="${0}" ?hidden="${0}" @click="${0}"> <iron-icon aria-hidden="true" class="m-auto icon-inline text-xl" icon="icons:add-circle-outline"> </iron-icon> </button> </div> </div> `),h("query_builder_rule"),p({"flex-1 bg-base rounded overflow-hidden border":!0,"border-contrast-10":!r&&!i,"border-contrast-50":!!r||i,"border-dashed":i,"border-solid":!i}),p({"text-tertiary":!i&&!u,"text-disabled":i||u,"w-m h-m":!0}),D,v.path&&v.name?o(V||(V=E` <div class="bg-contrast-10 grid gap-1px grid-cols-1 sm-grid-cols-2"> <div class="bg-base"> ${0} </div> <div class="bg-base"> ${0} </div> </div> `),z(e(e({},l),{},{value:v.path,label:"field",onChange:e=>{g({operator:null,value:"",path:e})}})),z(e(e({},l),{},{value:null!==(a=v.name)&&void 0!==a?a:"",label:"name",onChange:l=>g(e(e({},v),{},{name:l}))}))):z(e(e({},l),{},{value:v.path,label:"field",onChange:e=>g({operator:null,value:"",path:e})})),function(l){const{rule:a,operators:n,disabled:t,readonly:r,t:s,onChange:i}=l,{operator:u,value:v,path:h,name:f}=a,b={[d.GreaterThan]:$,[d.GreaterThanOrEqual]:c,[d.In]:w,[d.IsDefined]:L,[d.LessThan]:q,[d.LessThanOrEqual]:O,[d.Not]:H},g=Object.values(d).filter((e=>n.includes(e)&&(!!f||e!==d.IsDefined))),m=t||r||!g.length||!h;return o(j||(j=Z` <button title="${0}" class="${0}" ?disabled="${0}" @click="${0}"> <div aria-hidden="true">${0}</div> </button> `),s(`operator_${null!=u?u:"equal"}`),p({"flex items-center justify-center w-m h-m transition-colors":!0,"focus-outline-none focus-ring-2 focus-ring-inset focus-ring-primary-50":!0,"text-body hover-bg-contrast-5":!m&&g.length>1,"cursor-default text-tertiary":!m&&g.length<=1,"text-disabled cursor-default":m}),m||g.length<=1,(()=>{var l;const n=u?g.indexOf(u):-1,t=null!==(l=g[n+1])&&void 0!==l?l:null;i(e(e({},a),{},{operator:t,value:v}))}),u?b[u]:y)}(l),z(e(e({},l),{},{disabled:u||!v.path,value:null!==(n=v.value)&&void 0!==n?n:"",label:"value",onChange:l=>g(e(e({},v),{},{value:l}))})),p({"-mr-s self-start flex-col sm-flex-row flex-shrink-0 items-center":!0,"border-t border-b border-transparent divide-y divide-transparent":!0,hidden:!!t||i,flex:!t}),h("delete"),p({"box-content flex w-m h-m rounded-full transition-colors":!0,"text-secondary hover-bg-contrast-5 hover-text-error":!u,"cursor-default text-disabled":u,"focus-outline-none focus-ring-2 ring-primary-50":!0,"opacity-0 pointer-events-none":!v.path}),u||i||!v.path,b,h("add_or_clause"),p({"box-content flex w-m h-m rounded-full transition-colors":!0,"text-success hover-bg-contrast-5":!u,"cursor-default text-disabled":u,"focus-outline-none focus-ring-2 ring-primary-50":!0,"opacity-0 pointer-events-none":!v.path||!!r||s}),u||i||!v.path||!!r||s,s,f)}let P,R,F,U,W=e=>e;function Q(l){const a=l.rules.some((e=>Array.isArray(e))),n=o(P||(P=W`<div class="${0}"></div>`),a?"h-xs":"mt-s"),t=o(R||(R=W` <div class="flex items-center h-s"> <div class="w-m text-center leading-none uppercase font-medium text-xs text-contrast-30"> ${0} </div> <div class="flex-1 border-t border-contrast-20"></div> <div class="w-m ml-s flex-shrink-0"></div> <div class="hidden sm-block w-m flex-shrink-0"></div> </div> `),l.t("or"));return o(F||(F=W` <div aria-label="${0}"> ${0} </div> `),l.t("query_builder_group"),h([...l.rules,null],((e,l)=>String(l)),((a,r)=>{const s=r>0?l.isNested?t:n:"";return null===a?[s,G(e(e({},l),{},{rule:{path:"",operator:null,value:""},isFullSize:!l.isNested&&0===l.rules.length,onChange:e=>l.onChange([...l.rules,e])}))]:Array.isArray(a)?[s,o(U||(U=W` <div class="bg-contrast-10 rounded-t-l rounded-b-l p-s -m-s"> ${0} </div> `),Q(e(e({},l),{},{rules:a,isNested:!0,onChange:e=>{const a=[...l.rules],n=e;a[r]=e.length>1?n:n[0],l.onChange(a)}})))]:[s,G(e(e({},l),{},{rule:a,onChange:e=>{const a=[...l.rules];a[r]=e,l.onChange(a)},onDelete:()=>{const e=l.rules.filter(((e,l)=>l!==r));l.onChange(e)},onConvert:()=>{const n=[...l.rules];n[r]=[a,e(e({},a),{},{operator:null,value:""})],l.onChange(n)}}))]})))}let J,K,X,Y,ee,le,ae=e=>e;function ne(e){const{t:l,disabled:a,readonly:n,current:t,options:s,onChange:i}=e;return o(J||(J=ae` <div class="${0}"> ${0} ${0} </div> `),p({"relative flex items-center gap-xs leading-m px-xs -m-xs rounded-s transition-colors":!0,"focus-within-ring-2 focus-within-ring-primary-50":!0,"text-contrast":!a&&!n,"hover-text-contrast-80":!a&&!n,"text-disabled":a,"text-contrast-80":n,"font-medium":!n}),"label"in t?o(K||(K=ae`<foxy-i18n infer="" key="${0}"></foxy-i18n>`),t.label):o(X||(X=ae`<span>${0}</span>`),t.rawLabel),n?"":o(Y||(Y=ae` ${0} <select class="${0}" ?disabled="${0}" @change="${0}"> ${0} </select> `),r(ee||(ee=ae`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="flex-shrink-0" style="width: 1em; height: 1em; transform: scale(1.25)"><path fill-rule="evenodd" d="M10.53 3.47a.75.75 0 0 0-1.06 0L6.22 6.72a.75.75 0 0 0 1.06 1.06L10 5.06l2.72 2.72a.75.75 0 1 0 1.06-1.06l-3.25-3.25Zm-4.31 9.81 3.25 3.25a.75.75 0 0 0 1.06 0l3.25-3.25a.75.75 0 1 0-1.06-1.06L10 14.94l-2.72-2.72a.75.75 0 0 0-1.06 1.06Z" clip-rule="evenodd" /></svg>`)),p({"absolute inset-0 opacity-0 focus-outline-none":!0,"cursor-pointer":!a,"cursor-default":a}),a,(e=>i(e.target.value)),s.map((e=>o(le||(le=ae` <option value="${0}" ?selected="${0}"> ${0} </option> `),e.value,e.value===t.value,"label"in e?l(e.label):e.rawLabel)))))}let te,re,oe,se=e=>e;function ie(e){const{disabled:l,readonly:a,layout:n,label:t,value:r,type:s,min:i,t:u,onChange:d}=e;return o(te||(te=se` <label class="flex-shrink-0 flex items-center gap-s relative" style="min-width:${0}rem;max-width:50%"> <foxy-i18n infer="" class="${0}" key="${0}"> </foxy-i18n> <span class="${0}" ?hidden="${0}">${0}</span> ${0} </label> `),"number"===s?"4":"date"===s?"6":"8",p({"sr-only":"fixed"!==n}),t,p({"relative block whitespace-pre text-m":!0,"px-s py-xs -my-xs font-medium opacity-0":!a,"text-contrast-80":a}),"auto-grow"!==n&&!a,r||o(re||(re=se`<foxy-i18n infer="" key="value_empty"></foxy-i18n>`)),a?"":o(oe||(oe=se` <input placeholder="${0}" class="${0}" ?disabled="${0}" type="${0}" min="${0}" .value="${0}" @keydown="${0}" @input="${0}"> `),u("value_empty"),p({"appearance-none transition-all text-body text-m font-medium rounded-s":!0,"bg-base px-s py-xs -my-xs":!0,"opacity-50":l,"absolute inset-0":"auto-grow"===n,"focus-outline-none focus-ring-2 focus-ring-primary-50":!0}),l,f(s),f(i),r,(e=>"|"===e.key&&e.preventDefault()),(e=>{const l=e.currentTarget;d(l.value.replace(/\|/gi,""))})))}let ue,de=e=>e;const ve=e=>{var l;const{operator:a,value:n,name:t}=null!==(l=e.rule)&&void 0!==l?l:{},{disabled:r,readonly:s,t:i}=e,u=d.Not,v=p({"text-disabled":r,"text-contrast-80":s}),c=null===a?"equal":a===u?u:null;return o(ue||(ue=de` <foxy-i18n class="${0}" infer="" key="name"></foxy-i18n> ${0} <foxy-i18n class="${0}" infer="" key="value"></foxy-i18n> ${0} ${0} `),v,ie({layout:"auto-grow",value:t||"",label:"name",type:"text",disabled:r,readonly:s,t:i,onChange:l=>{if(!l)return e.onChange(null);n?e.onChange({name:l}):e.onChange({name:l,operator:d.IsDefined,value:"true"})}}),v,ne({current:{label:c?`operator_${c}`:"value_any",value:null!=c?c:"any"},options:[{label:"value_any",value:"any"},{label:"operator_equal",value:"equal"},{label:"operator_not",value:u}],disabled:r,readonly:s,t:i,onChange:l=>{if("any"!==l)return e.onChange({operator:"equal"===l?null:l,value:a===d.IsDefined?"":null!=n?n:"",name:null!=t?t:""});e.onChange(t?{operator:d.IsDefined,value:"true"}:null)}}),void 0===n||a===d.IsDefined?"":ie({layout:"auto-grow",label:"value",value:n||"",type:"text",disabled:r,readonly:s,t:i,onChange:l=>e.onChange({value:l})}))},ce=l=>{var a;const n=[{label:"value_any",value:"any"},{label:`${l.option.label}_true`,value:"true"},{label:`${l.option.label}_false`,value:"false"}];return ne(e(e({},l),{},{onChange:e=>l.onChange("any"===e?null:{value:e}),current:null!==(a=n.find((e=>{var a;return e.value===(null===(a=l.rule)||void 0===a?void 0:a.value)})))&&void 0!==a?a:n[0],options:n}))};let pe,he,fe=e=>e;const be=e=>{const{disabled:l,readonly:a,option:n,rule:t,t:r,onChange:s}=e,{min:i,label:u}=n,v=null==t?void 0:t.operator,c=null==t?void 0:t.value.includes(".."),p=null!=v?v:c?"range":"equal",h=void 0===v?"value_any":"range"===p?"range":`operator_${p}`;return o(pe||(pe=fe` ${0} ${0} `),ne({disabled:l,readonly:a,current:{label:h,value:void 0===v?"any":p},options:[{label:"value_any",value:"any"},{label:"operator_equal",value:"equal"},{label:"operator_not",value:d.Not},{label:"operator_lessthanorequal",value:d.LessThanOrEqual},{label:"operator_lessthan",value:d.LessThan},{label:"operator_greaterthanorequal",value:d.GreaterThanOrEqual},{label:"operator_greaterthan",value:d.GreaterThan},{label:"range",value:"range"}],t:r,onChange:e=>{var l,a,r,o;if("any"===e)return s(null);if("range"===e){let e=parseFloat(null!==(l=null==t?void 0:t.value)&&void 0!==l?l:"");return isNaN(e)&&(e=0),s({operator:null,value:`${e}..${e+10}`})}return s({operator:"equal"===e?null:e,value:null!==(o=null!==(a=null==t?void 0:t.value)&&void 0!==a?a:null===(r=n.min)||void 0===r?void 0:r.toString())&&void 0!==o?o:"0"})}}),void 0===(null==t?void 0:t.value)?"":c?o(he||(he=fe` <foxy-i18n infer="" key="range_from"></foxy-i18n> ${0} <foxy-i18n infer="" key="range_to"></foxy-i18n> ${0} `),ie({disabled:l,readonly:a,layout:"auto-grow",label:"range_from",value:null==t?void 0:t.value.split("..")[0],type:"number",min:i,t:r,onChange:e=>{const l=null==t?void 0:t.value.split("..")[1];s({value:`${e||"0"}..${l}`})}}),ie({disabled:l,readonly:a,layout:"auto-grow",label:"range_to",value:null==t?void 0:t.value.split("..")[1],type:"number",min:i,t:r,onChange:e=>{const l=null==t?void 0:t.value.split("..")[0];s({value:`${l}..${e||"0"}`})}})):ie({disabled:l,readonly:a,layout:"auto-grow",label:u,value:(null==t?void 0:t.value)||"",type:"number",min:i,t:r,onChange:e=>s({value:e})}))};let ge,me=e=>e;const ye=e=>{const{disabled:l,readonly:a,option:n,rule:t,t:r,onChange:s}=e,{operator:i}=null!=t?t:{},{label:u}=n;return o(ge||(ge=me` ${0} ${0} `),ne({disabled:l,readonly:a,current:{label:void 0===i?"value_any":`operator_${null!=i?i:"equal"}`,value:void 0===i?"any":null!=i?i:"equal"},options:[{label:"value_any",value:"any"},{label:"operator_equal",value:"equal"},{label:"operator_not",value:d.Not}],t:r,onChange:e=>{var l;return s("any"===e?null:{operator:"equal"===e?null:e,value:null!==(l=null==t?void 0:t.value)&&void 0!==l?l:""})}}),void 0===(null==t?void 0:t.value)?"":ie({disabled:l,readonly:a,layout:"auto-grow",label:u,value:(null==t?void 0:t.value)||"",t:r,onChange:e=>s({value:e})}))};let xe,$e,Ce=e=>e;const we=e=>{var l;const{operator:a,value:n}=null!==(l=e.rule)&&void 0!==l?l:{},{min:t,label:r}=e.option,{disabled:s,readonly:i,t:u,onChange:v}=e,c=null==n?void 0:n.includes(".."),p=null!=a?a:c?"range":"equal",h=void 0===a?"value_any":"range"===p?"range":`operator_${p}`;return o(xe||(xe=Ce` ${0} ${0} `),ne({disabled:s,readonly:i,t:u,current:{label:h,value:void 0===a?"any":p},options:[{label:"value_any",value:"any"},{label:"operator_equal",value:"equal"},{label:"operator_not",value:d.Not},{label:"operator_lessthanorequal",value:d.LessThanOrEqual},{label:"operator_lessthan",value:d.LessThan},{label:"operator_greaterthanorequal",value:d.GreaterThanOrEqual},{label:"operator_greaterthan",value:d.GreaterThan},{label:"range",value:"range"}],onChange:e=>{if("any"===e)return v(null);if("range"===e){const e=new Date(null!=n?n:(new Date).toISOString()),l=new Date(e);e.setMonth(e.getMonth()-1),e.setHours(0,0,0,0),l.setHours(23,59,59,999);const a=e.toISOString(),t=l.toISOString();return v({operator:null,value:`${a}..${t}`})}return v({operator:"equal"===e?null:e,value:null!=n?n:(new Date).toISOString()})}}),void 0===n?"":c?o($e||($e=Ce` ${0} ${0} `),ie({disabled:s,readonly:i,layout:"fixed",label:"range_from",value:b(new Date(n.split("..")[0])),type:"date",min:t,t:u,onChange:e=>{var l,a;const t=null!==(l=g(e))&&void 0!==l?l:new Date,r=new Date(null!==(a=n.split("..")[1])&&void 0!==a?a:Date.now());t.setHours(0,0,0,0),r.setHours(23,59,59,999),v({value:`${t.toISOString()}..${r.toISOString()}`})}}),ie({disabled:s,readonly:i,layout:"fixed",label:"range_to",value:b(new Date(n.split("..")[1])),type:"date",min:t,t:u,onChange:e=>{var l,a;const t=new Date(null!==(l=n.split("..")[0])&&void 0!==l?l:Date.now()),r=null!==(a=g(e))&&void 0!==a?a:new Date;t.setHours(0,0,0,0),r.setHours(23,59,59,999),v({value:`${t.toISOString()}..${r.toISOString()}`})}})):ie({disabled:s,readonly:i,label:r,value:b(new Date(null!=n?n:Date.now())),type:"date",min:t,t:u,onChange:e=>{var l;v({value:(null!==(l=g(e))&&void 0!==l?l:new Date).toISOString()})}}))};let _e,Le=e=>e;const Me=e=>{const{disabled:l,readonly:a,option:n,rule:t,t:r,onChange:s}=e,{list:i}=n,u=null==i?void 0:i.find((e=>e.value===(null==t?void 0:t.value))),v=null==t?void 0:t.operator;return o(_e||(_e=Le` ${0} ${0} `),ne({disabled:l,readonly:a,current:{label:void 0===v?"value_any":`operator_${null!=v?v:"equal"}`,value:void 0===v?"any":null!=v?v:"equal"},options:[{label:"value_any",value:"any"},{label:"operator_equal",value:"equal"},{label:"operator_not",value:d.Not}],t:r,onChange:e=>{var l,a,n;return s("any"===e?null:{operator:"equal"===e?null:e,value:null!==(n=null!==(l=null==t?void 0:t.value)&&void 0!==l?l:null===(a=null==i?void 0:i[0])||void 0===a?void 0:a.value)&&void 0!==n?n:""})}}),void 0===(null==t?void 0:t.value)?"":ne({disabled:l,readonly:a,current:null!=u?u:{label:"value_any",value:""},options:null!=i?i:[],t:r,onChange:e=>s({value:e})}))};let qe,ke,Oe=e=>e;function Se(e){const l=new Set,a=e=>{let a;if("string"==typeof e.name)a=e.path;else{const l=e.path.lastIndexOf(":");if(-1===l)return;a=e.path.substring(0,l)}a.length>0&&l.add(a)};for(const l of e)if(Array.isArray(l))for(const e of l)a(e);else a(l);return Array.from(l).join()}function He(e){let l=e.path;return e.name&&(l+=`:name[${e.name}]`),e.operator&&(l+=`:${e.operator}`),[l,e.value]}function Ae(e,l=!1){const a=new URLSearchParams;for(const l of e)if(Array.isArray(l)){const[e,...n]=l.map(He);if(e&&e[0]){const l=[e[1],...n.map((e=>e.join("=")))];a.append(e[0],l.join("|"))}}else{const[e,n]=He(l);e&&a.append(e,n)}if(!l){const l=Se(e);l?a.set("zoom",l):a.delete("zoom")}return a.toString()}let De;const je=s(De||(De=(e=>e)`.gap-1px{gap:1px}.grid-vertical{grid-template:auto/var(--lumo-size-m) 1fr}:host([sm]) .sm-grid-horizontal{grid-template:auto/var(--lumo-size-m) 1fr var(--lumo-size-m) 1fr}input::-webkit-contacts-auto-fill-button{visibility:hidden;display:none!important;pointer-events:none;position:absolute;right:0}input::-webkit-inner-spin-button,input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}input{-moz-appearance:textfield}foxy-internal-summary-control[layout=details][count]:not([open]){--lumo-contrast-5pct:var(--lumo-primary-color-10pct);color:var(--lumo-primary-text-color)}`));function Ze(e,l){var a;const n=null!==(a=Object.values(d).find((l=>e.endsWith(`:${l}`))))&&void 0!==a?a:null;let t,r=e.substring(0,n?e.lastIndexOf(":"):void 0);const o=e.lastIndexOf("[");return r.endsWith("]")&&-1!==o&&(t=r.substring(o+1,r.length-1),r=r.substring(0,o),r.endsWith(":name")&&(r=r.substring(0,r.length-5))),{name:t,path:r,value:l,operator:n}}function Ie(e){const l=new URLSearchParams(e),a=[];for(const[e,n]of l.entries())n.includes("|")?a.push(n.split("|").map(((l,a)=>0===a?Ze(e,l):Ze(...l.split("="))))):a.push(Ze(e,n));return a}let Te,Ne,ze=e=>e;const Be=t(l(a(n(u(i),"query-builder"))));class Ve extends Be{constructor(){super(...arguments),this.reservedPaths=["zoom","limit","offset","order","fields"],this.disableZoom=!1,this.disableOr=!1,this.operators=Object.values(d),this.docsHref=null,this.options=null,this.value=null,this.__isAdvancedMode=!1}static zoom(e){return Se(Ie(e))}static get properties(){return e(e({},super.properties),{},{reservedPaths:{type:Array,attribute:"reserved-paths"},disableZoom:{type:Boolean,attribute:"disable-zoom"},disableOr:{type:Boolean,attribute:"disable-or"},operators:{type:Array},docsHref:{attribute:"docs-href"},options:{type:Array},value:{},__isAdvancedMode:{attribute:!1}})}static get styles(){return[super.styles,je]}render(){var l,a,n,t,r,s;const i=this.__isSimpleModeSupported,u=Ie(null!==(l=this.value)&&void 0!==l?l:""),d=null!==(a=this.operators)&&void 0!==a?a:[],c=null!==(n=this.options)&&void 0!==n?n:[],h=this.t.bind(this),b=e=>{this.value=Ae(e,this.disableZoom),this.dispatchEvent(new Ve.ChangeEvent("change"))};return i||this.__isAdvancedMode||(this.__isAdvancedMode=!0),o(Te||(Te=ze` <div class="space-y-m"> <div class="grid grid-cols-2 gap-xs p-xs bg-contrast-5 rounded" ?hidden="${0}"> <label class="${0}"> <foxy-i18n infer="" key="mode_simple${0}"> </foxy-i18n> <input class="sr-only" type="radio" name="mode" ?disabled="${0}" ?checked="${0}" @change="${0}"> </label> <label class="${0}"> <foxy-i18n infer="" key="mode_advanced"></foxy-i18n> <input class="sr-only" type="radio" name="mode" ?checked="${0}" @change="${0}"> </label> </div> ${0} </div> `),!(null===(t=this.options)||void 0===t?void 0:t.length),p({"p-xs rounded-s text-center font-medium transition-colors":!0,"bg-base ring-1 ring-contrast-5":!this.__isAdvancedMode&&i,"hover-bg-contrast-5":this.__isAdvancedMode&&i,"focus-within-ring-2 focus-within-ring-inset focus-within-ring-primary-50":!0,"cursor-pointer":i,"text-disabled":!i}),i?"":"_unsupported",!i,!this.__isAdvancedMode,(()=>this.__isAdvancedMode=!1),p({"p-xs rounded-s text-center font-medium cursor-pointer transition-colors":!0,"bg-base ring-1 ring-contrast-5":this.__isAdvancedMode,"hover-bg-contrast-5":!this.__isAdvancedMode,"focus-within-ring-2 focus-within-ring-inset focus-within-ring-primary-50":!0}),this.__isAdvancedMode,(()=>this.__isAdvancedMode=!0),this.__isAdvancedMode||!i?o(Ne||(Ne=ze` <p class="leading-s text-tertiary" ?hidden="${0}"> <foxy-i18n infer="" key="advanced_mode_notice"></foxy-i18n> <a target="_blank" class="cursor-pointer rounded-s text-secondary font-medium hover-underline focus-outline-none focus-ring-2 focus-ring-primary-50" href="${0}" rel="nofollow noreferrer noopener"> <foxy-i18n infer="" key="api_reference_link"></foxy-i18n> </a> </p> ${0} `),null===this.docsHref,f(null!==(r=this.docsHref)&&void 0!==r?r:void 0),Q({disableOr:this.disableOr,disabled:this.disabled,readonly:this.readonly,rules:u,operators:d,onChange:b,options:c,t:h})):null===(s=this.__simpleModeOptions)||void 0===s?void 0:s.map((l=>function(l){var a;const{options:n,layout:t,rules:r,name:s,disabled:i,readonly:u,t:d,onChange:c}=l,h=n.filter((e=>r.find((l=>l.path===e.path)))),b=r.find((e=>"order"===e.path)),g=null===(a=null==b?void 0:b.value)||void 0===a?void 0:a.split(",").map((e=>{const[l,a="asc"]=decodeURIComponent(e).split(" ");return{path:l.trim(),order:a.trim()}}));return o(qe||(qe=Oe` <foxy-internal-summary-control aria-label="${0}" helper-text="" layout="${0}" label="${0}" count="${0}" infer=""> ${0} </foxy-internal-summary-control> `),l.t("query_builder_group"),f(t),t&&s?d(s):"",f(h.length||void 0),n.map((l=>{var a;const{type:n,label:t,list:s,path:h}=l,f={[v.Attribute]:ve,[v.Boolean]:ce,[v.String]:ye,[v.Number]:be,[v.Date]:we,[v.Any]:ye},b=s?Me:f[n],m=null===(a=null==g?void 0:g.find((e=>e.path===h)))||void 0===a?void 0:a.order,y=r.find((e=>e.path===h)),x=!!y||!!m;return o(ke||(ke=Oe` <div aria-label="${0}" class="${0}"> <foxy-i18n infer="" key="${0}"></foxy-i18n> <span class="transform scale-150 mr-auto ${0}">&bull;</span> ${0} ${0} </div> `),d("query_builder_rule"),p({"flex flex-wrap items-center justify-end gap-s":!0,"bg-primary-10 text-primary":x}),t,x?"":"opacity-0",b({disabled:i,readonly:u,option:l,rule:y,t:d,onChange:l=>{if(l&&y)return Object.assign(y,l),c(r);if(l){const a={path:h,value:"",operator:null};return c([...r,e(e({},a),l)])}return c(r.filter((e=>e.path!==h)))}}),n===v.Date||n===v.Number?ne({disabled:i,readonly:u,t:d,current:{label:`order_${null!=m?m:"none"}${m?`_${n}`:""}`,value:null!=m?m:"none"},options:[{label:"order_none",value:"none"},{label:`order_asc_${n}`,value:"asc"},{label:`order_desc_${n}`,value:"desc"}],onChange:e=>{const l=(null!=g?g:[]).filter((e=>e.path!==h)).concat([{path:h,order:e}]).filter((e=>"none"!==e.order)).map((e=>`${e.path} ${e.order}`)).join(),a=r.filter((e=>"order"!==e.path));l&&a.push({path:"order",value:l,operator:null}),c(a)}}):"")})))}(e(e({},l),{},{disabled:this.disabled,readonly:this.readonly,rules:u,onChange:b,t:h})))))}get __isSimpleModeSupported(){var e;if(null===this.options)return!1;if(0===this.options.length)return!1;const l=Ie(null!==(e=this.value)&&void 0!==e?e:"");return 0===l.length||l.every((e=>{var l;return!Array.isArray(e)&&(e.operator!==d.In&&((e.operator!==d.IsDefined||"true"===e.value)&&!(!this.reservedPaths.includes(e.path)&&!(null===(l=this.options)||void 0===l?void 0:l.find((l=>l.path===e.path))))))}))}get __simpleModeOptions(){var l;return null===(l=this.options)||void 0===l?void 0:l.reduce(((l,a)=>{const n=l.find((e=>{var l;return e.name===(null===(l=a.group)||void 0===l?void 0:l.name)}));return n?n.options.push(a):l.push(e(e({},a.group),{},{options:[a]})),l}),[])}}Ve.ChangeEvent=class extends CustomEvent{},Ve.Operator=d,Ve.Type=v,customElements.define("foxy-query-builder",Ve);export{Ve as Q,Ie as p,Ae as s};
40
+ `));let j,Z=e=>e;let V,I,T=e=>e;function N(e){return o(V||(V=T` <label class="relative flex items-center cursor-text group text-tertiary"> <div class="relative flex-1 min-w-0 overflow-hidden"> <input placeholder="${0}" class="${0}" .value="${0}" ?disabled="${0}" @keydown="${0}" @input="${0}"> </div> <span class="${0}"> ${0} </span> ${0} </label> `),e.t(e.label),p({"bg-base relative flex h-m px-s font-medium w-full":!0,"text-body":!e.disabled&&!e.readonly,"text-disabled":e.disabled,"text-secondary":e.readonly,"flex max-w-full whitespace-nowrap":!0,"focus-outline-none":!0}),e.value,e.disabled||e.readonly,(e=>"|"===e.key&&e.preventDefault()),(l=>{const a=l.currentTarget;e.onChange(a.value.replace(/\|/gi,""))}),p({"font-tnum text-xs font-medium border border-current mr-s px-xs rounded-s":!0,"inline-block":!!e.value,"sr-only":!e.value,"text-body":!e.disabled&&!e.readonly,"text-disabled":e.disabled,"text-secondary":e.readonly}),e.t(e.label),e.disabled||e.readonly?"":o(I||(I=T` <div class="absolute inset-0 transition-colors bg-transparent group-hover-bg-contrast-5 pointer-events-none"></div> `)))}let z,B,E=e=>e;function G(l){var a,n;const{isFullSize:t,isNested:r,disableOr:s,readonly:i,disabled:u,rule:v}=l,{t:h,onConvert:f,onDelete:b,onChange:g}=l;return o(z||(z=E` <div class="flex items-center space-x-s" aria-label="${0}"> <div class="${0}"> <div class="bg-contrast-10"> <div class="grid gap-1px grid-vertical sm-grid-horizontal"> <div class="bg-base"> <div aria-hidden="true" class="${0}"> ${0} </div> </div> <div class="bg-base"> ${0} </div> <div class="bg-base">${0}</div> <div class="bg-base"> ${0} </div> </div> </div> </div> <div class="${0}"> <button aria-label="${0}" class="${0}" ?disabled="${0}" @click="${0}"> <iron-icon aria-hidden="true" class="m-auto icon-inline text-xl" icon="icons:remove-circle-outline"> </iron-icon> </button> <button aria-label="${0}" class="${0}" ?disabled="${0}" ?hidden="${0}" @click="${0}"> <iron-icon aria-hidden="true" class="m-auto icon-inline text-xl" icon="icons:add-circle-outline"> </iron-icon> </button> </div> </div> `),h("query_builder_rule"),p({"flex-1 bg-base rounded overflow-hidden border":!0,"border-contrast-10":!r&&!i,"border-contrast-50":!!r||i,"border-dashed":i,"border-solid":!i}),p({"text-tertiary":!i&&!u,"text-disabled":i||u,"w-m h-m":!0}),D,v.path&&v.name?o(B||(B=E` <div class="bg-contrast-10 grid gap-1px grid-cols-1 sm-grid-cols-2"> <div class="bg-base"> ${0} </div> <div class="bg-base"> ${0} </div> </div> `),N(e(e({},l),{},{value:v.path,label:"field",onChange:e=>{g({operator:null,value:"",path:e})}})),N(e(e({},l),{},{value:null!==(a=v.name)&&void 0!==a?a:"",label:"name",onChange:l=>g(e(e({},v),{},{name:l}))}))):N(e(e({},l),{},{value:v.path,label:"field",onChange:e=>g({operator:null,value:"",path:e})})),function(l){const{rule:a,operators:n,disabled:t,readonly:r,t:s,onChange:i}=l,{operator:u,value:v,path:h,name:f}=a,b={[d.GreaterThan]:$,[d.GreaterThanOrEqual]:c,[d.In]:_,[d.IsDefined]:L,[d.LessThan]:q,[d.LessThanOrEqual]:A,[d.Not]:S},g=Object.values(d).filter((e=>n.includes(e)&&(!!f||e!==d.IsDefined))),y=t||r||!g.length||!h;return o(j||(j=Z` <button title="${0}" class="${0}" ?disabled="${0}" @click="${0}"> <div aria-hidden="true">${0}</div> </button> `),s(`operator_${null!=u?u:"equal"}`),p({"flex items-center justify-center w-m h-m transition-colors":!0,"focus-outline-none focus-ring-2 focus-ring-inset focus-ring-primary-50":!0,"text-body hover-bg-contrast-5":!y&&g.length>1,"cursor-default text-tertiary":!y&&g.length<=1,"text-disabled cursor-default":y}),y||g.length<=1,(()=>{var l;const n=u?g.indexOf(u):-1,t=null!==(l=g[n+1])&&void 0!==l?l:null;i(e(e({},a),{},{operator:t,value:v}))}),u?b[u]:m)}(l),N(e(e({},l),{},{disabled:u||!v.path,value:null!==(n=v.value)&&void 0!==n?n:"",label:"value",onChange:l=>g(e(e({},v),{},{value:l}))})),p({"-mr-s self-start flex-col sm-flex-row flex-shrink-0 items-center":!0,"border-t border-b border-transparent divide-y divide-transparent":!0,hidden:!!t||i,flex:!t}),h("delete"),p({"box-content flex w-m h-m rounded-full transition-colors":!0,"text-secondary hover-bg-contrast-5 hover-text-error":!u,"cursor-default text-disabled":u,"focus-outline-none focus-ring-2 ring-primary-50":!0,"opacity-0 pointer-events-none":!v.path}),u||i||!v.path,b,h("add_or_clause"),p({"box-content flex w-m h-m rounded-full transition-colors":!0,"text-success hover-bg-contrast-5":!u,"cursor-default text-disabled":u,"focus-outline-none focus-ring-2 ring-primary-50":!0,"opacity-0 pointer-events-none":!v.path||!!r||s}),u||i||!v.path||!!r||s,s,f)}let P,R,F,U,W=e=>e;function Q(l){const a=l.rules.some((e=>Array.isArray(e))),n=o(P||(P=W`<div class="${0}"></div>`),a?"h-xs":"mt-s"),t=o(R||(R=W` <div class="flex items-center h-s"> <div class="w-m text-center leading-none uppercase font-medium text-xs text-contrast-30"> ${0} </div> <div class="flex-1 border-t border-contrast-20"></div> <div class="w-m ml-s flex-shrink-0"></div> <div class="hidden sm-block w-m flex-shrink-0"></div> </div> `),l.t("or"));return o(F||(F=W` <div aria-label="${0}"> ${0} </div> `),l.t("query_builder_group"),h([...l.rules,null],((e,l)=>String(l)),((a,r)=>{const s=r>0?l.isNested?t:n:"";return null===a?[s,G(e(e({},l),{},{rule:{path:"",operator:null,value:""},isFullSize:!l.isNested&&0===l.rules.length,onChange:e=>l.onChange([...l.rules,e])}))]:Array.isArray(a)?[s,o(U||(U=W` <div class="bg-contrast-10 rounded-t-l rounded-b-l p-s -m-s"> ${0} </div> `),Q(e(e({},l),{},{rules:a,isNested:!0,onChange:e=>{const a=[...l.rules],n=e;a[r]=e.length>1?n:n[0],l.onChange(a)}})))]:[s,G(e(e({},l),{},{rule:a,onChange:e=>{const a=[...l.rules];a[r]=e,l.onChange(a)},onDelete:()=>{const e=l.rules.filter(((e,l)=>l!==r));l.onChange(e)},onConvert:()=>{const n=[...l.rules];n[r]=[a,e(e({},a),{},{operator:null,value:""})],l.onChange(n)}}))]})))}let J,K,X,Y,ee,le,ae=e=>e;function ne(e){const{t:l,disabled:a,readonly:n,current:t,options:s,onChange:i}=e;return o(J||(J=ae` <div class="${0}"> ${0} ${0} </div> `),p({"relative flex items-center gap-xs leading-m px-xs -m-xs rounded-s transition-colors":!0,"focus-within-ring-2 focus-within-ring-primary-50":!0,"text-contrast":!a&&!n,"hover-text-contrast-80":!a&&!n,"text-disabled":a,"text-contrast-80":n,"font-medium":!n}),"label"in t?o(K||(K=ae`<foxy-i18n infer="" key="${0}"></foxy-i18n>`),t.label):o(X||(X=ae`<span>${0}</span>`),t.rawLabel),n?"":o(Y||(Y=ae` ${0} <select class="${0}" ?disabled="${0}" @change="${0}"> ${0} </select> `),r(ee||(ee=ae`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="flex-shrink-0" style="width: 1em; height: 1em; transform: scale(1.25)"><path fill-rule="evenodd" d="M10.53 3.47a.75.75 0 0 0-1.06 0L6.22 6.72a.75.75 0 0 0 1.06 1.06L10 5.06l2.72 2.72a.75.75 0 1 0 1.06-1.06l-3.25-3.25Zm-4.31 9.81 3.25 3.25a.75.75 0 0 0 1.06 0l3.25-3.25a.75.75 0 1 0-1.06-1.06L10 14.94l-2.72-2.72a.75.75 0 0 0-1.06 1.06Z" clip-rule="evenodd" /></svg>`)),p({"absolute inset-0 opacity-0 focus-outline-none":!0,"cursor-pointer":!a,"cursor-default":a}),a,(e=>i(e.target.value)),s.map((e=>o(le||(le=ae` <option value="${0}" ?selected="${0}"> ${0} </option> `),e.value,e.value===t.value,"label"in e?l(e.label):e.rawLabel)))))}let te,re,oe,se=e=>e;function ie(e){const{disabled:l,readonly:a,layout:n,label:t,value:r,type:s,min:i,t:u,onChange:d}=e;return o(te||(te=se` <label class="flex-shrink-0 flex items-center gap-s relative" style="min-width:${0}rem;max-width:50%"> <foxy-i18n infer="" class="${0}" key="${0}"> </foxy-i18n> <span class="${0}" ?hidden="${0}">${0}</span> ${0} </label> `),"number"===s?"4":"date"===s?"6":"8",p({"sr-only":"fixed"!==n}),t,p({"relative block whitespace-pre text-m":!0,"px-s py-xs -my-xs font-medium opacity-0":!a,"text-contrast-80":a}),"auto-grow"!==n&&!a,r||o(re||(re=se`<foxy-i18n infer="" key="value_empty"></foxy-i18n>`)),a?"":o(oe||(oe=se` <input placeholder="${0}" class="${0}" ?disabled="${0}" type="${0}" min="${0}" .value="${0}" @keydown="${0}" @input="${0}"> `),u("value_empty"),p({"appearance-none transition-all text-body text-m font-medium rounded-s":!0,"bg-base px-s py-xs -my-xs":!0,"opacity-50":l,"absolute inset-0":"auto-grow"===n,"focus-outline-none focus-ring-2 focus-ring-primary-50":!0}),l,f(s),f(i),r,(e=>"|"===e.key&&e.preventDefault()),(e=>{const l=e.currentTarget;d(l.value.replace(/\|/gi,""))})))}let ue,de=e=>e;const ve=e=>{var l;const{operator:a,value:n,name:t}=null!==(l=e.rule)&&void 0!==l?l:{},{disabled:r,readonly:s,t:i}=e,u=d.Not,v=p({"text-disabled":r,"text-contrast-80":s}),c=null===a?"equal":a===u?u:null;return o(ue||(ue=de` <foxy-i18n class="${0}" infer="" key="name"></foxy-i18n> ${0} <foxy-i18n class="${0}" infer="" key="value"></foxy-i18n> ${0} ${0} `),v,ie({layout:"auto-grow",value:t||"",label:"name",type:"text",disabled:r,readonly:s,t:i,onChange:l=>{if(!l)return e.onChange(null);n?e.onChange({name:l}):e.onChange({name:l,operator:d.IsDefined,value:"true"})}}),v,ne({current:{label:c?`operator_${c}`:"value_any",value:null!=c?c:"any"},options:[{label:"value_any",value:"any"},{label:"operator_equal",value:"equal"},{label:"operator_not",value:u}],disabled:r,readonly:s,t:i,onChange:l=>{if("any"!==l)return e.onChange({operator:"equal"===l?null:l,value:a===d.IsDefined?"":null!=n?n:"",name:null!=t?t:""});e.onChange(t?{operator:d.IsDefined,value:"true"}:null)}}),void 0===n||a===d.IsDefined?"":ie({layout:"auto-grow",label:"value",value:n||"",type:"text",disabled:r,readonly:s,t:i,onChange:l=>e.onChange({value:l})}))},ce=l=>{var a;const n=[{label:"value_any",value:"any"},{label:`${l.option.label}_true`,value:"true"},{label:`${l.option.label}_false`,value:"false"}];return ne(e(e({},l),{},{onChange:e=>l.onChange("any"===e?null:{value:e}),current:null!==(a=n.find((e=>{var a;return e.value===(null===(a=l.rule)||void 0===a?void 0:a.value)})))&&void 0!==a?a:n[0],options:n}))};let pe,he,fe=e=>e;const be=e=>{const{disabled:l,readonly:a,option:n,rule:t,t:r,onChange:s}=e,{min:i,label:u}=n,v=null==t?void 0:t.operator,c=null==t?void 0:t.value.includes(".."),p=null!=v?v:c?"range":"equal",h=void 0===v?"value_any":"range"===p?"range":`operator_${p}`;return o(pe||(pe=fe` ${0} ${0} `),ne({disabled:l,readonly:a,current:{label:h,value:void 0===v?"any":p},options:[{label:"value_any",value:"any"},{label:"operator_equal",value:"equal"},{label:"operator_not",value:d.Not},{label:"operator_lessthanorequal",value:d.LessThanOrEqual},{label:"operator_lessthan",value:d.LessThan},{label:"operator_greaterthanorequal",value:d.GreaterThanOrEqual},{label:"operator_greaterthan",value:d.GreaterThan},{label:"range",value:"range"}],t:r,onChange:e=>{var l,a,r,o;if("any"===e)return s(null);if("range"===e){const e=parseFloat(null!==(l=null==t?void 0:t.value)&&void 0!==l?l:"");return isNaN(e)?s({operator:null,value:"..",invalid:!0}):s({operator:null,value:`${e}..${e+10}`})}const i=null!==(o=null!==(a=null==t?void 0:t.value)&&void 0!==a?a:null===(r=n.min)||void 0===r?void 0:r.toString())&&void 0!==o?o:"",u=i.includes("..")&&"range"!==e;return s({operator:"equal"===e?null:e,invalid:!i,value:u?i.split("..")[0]:i})}}),void 0===(null==t?void 0:t.value)?"":c?o(he||(he=fe` <foxy-i18n infer="" key="range_from"></foxy-i18n> ${0} <foxy-i18n infer="" key="range_to"></foxy-i18n> ${0} `),ie({disabled:l,readonly:a,layout:"auto-grow",label:"range_from",value:null==t?void 0:t.value.split("..")[0],type:"number",min:i,t:r,onChange:e=>{var l;const a=null!==(l=null==t?void 0:t.value.split("..")[1])&&void 0!==l?l:"";s({value:`${e}..${a}`,invalid:!e||!a})}}),ie({disabled:l,readonly:a,layout:"auto-grow",label:"range_to",value:null==t?void 0:t.value.split("..")[1],type:"number",min:i,t:r,onChange:e=>{const l=null==t?void 0:t.value.split("..")[0];s({value:`${l}..${e}`,invalid:!l||!e})}})):ie({disabled:l,readonly:a,layout:"auto-grow",label:u,value:(null==t?void 0:t.value)||"",type:"number",min:i,t:r,onChange:e=>s({value:e,invalid:!e})}))};let ge,ye=e=>e;const me=e=>{const{disabled:l,readonly:a,option:n,rule:t,t:r,onChange:s}=e,{operator:i}=null!=t?t:{},{label:u}=n;return o(ge||(ge=ye` ${0} ${0} `),ne({disabled:l,readonly:a,current:{label:void 0===i?"value_any":`operator_${null!=i?i:"equal"}`,value:void 0===i?"any":null!=i?i:"equal"},options:[{label:"value_any",value:"any"},{label:"operator_equal",value:"equal"},{label:"operator_not",value:d.Not}],t:r,onChange:e=>{var l;return s("any"===e?null:{operator:"equal"===e?null:e,value:null!==(l=null==t?void 0:t.value)&&void 0!==l?l:""})}}),void 0===(null==t?void 0:t.value)?"":ie({disabled:l,readonly:a,layout:"auto-grow",label:u,value:(null==t?void 0:t.value)||"",t:r,onChange:e=>s({value:e})}))};let xe,$e,Ce=e=>e;const _e=e=>{var l;const{operator:a,value:n}=null!==(l=e.rule)&&void 0!==l?l:{},{min:t,label:r}=e.option,{disabled:s,readonly:i,t:u,onChange:v}=e,c=null==n?void 0:n.includes(".."),p=null!=a?a:c?"range":"equal",h=void 0===a?"value_any":"range"===p?"range":`operator_${p}`;return o(xe||(xe=Ce` ${0} ${0} `),ne({disabled:s,readonly:i,t:u,current:{label:h,value:void 0===a?"any":p},options:[{label:"value_any",value:"any"},{label:"operator_equal",value:"equal"},{label:"operator_not",value:d.Not},{label:"operator_lessthanorequal",value:d.LessThanOrEqual},{label:"operator_lessthan",value:d.LessThan},{label:"operator_greaterthanorequal",value:d.GreaterThanOrEqual},{label:"operator_greaterthan",value:d.GreaterThan},{label:"range",value:"range"}],onChange:e=>{if("any"===e)return v(null);if("range"===e){const e=new Date(null!=n?n:(new Date).toISOString()),l=new Date(e);e.setMonth(e.getMonth()-1),e.setHours(0,0,0,0),l.setHours(23,59,59,999);const a=e.toISOString(),t=l.toISOString();return v({operator:null,value:`${a}..${t}`})}const l=null!=n?n:(new Date).toISOString(),a=l.includes("..")&&"range"!==e;return v({operator:"equal"===e?null:e,value:a?l.split("..")[0]:l})}}),void 0===n?"":c?o($e||($e=Ce` ${0} ${0} `),ie({disabled:s,readonly:i,layout:"fixed",label:"range_from",value:b(new Date(n.split("..")[0])),type:"date",min:t,t:u,onChange:e=>{var l,a;const t=null!==(l=g(e))&&void 0!==l?l:new Date,r=new Date(null!==(a=n.split("..")[1])&&void 0!==a?a:Date.now());t.setHours(0,0,0,0),r.setHours(23,59,59,999),v({value:`${t.toISOString()}..${r.toISOString()}`})}}),ie({disabled:s,readonly:i,layout:"fixed",label:"range_to",value:b(new Date(n.split("..")[1])),type:"date",min:t,t:u,onChange:e=>{var l,a;const t=new Date(null!==(l=n.split("..")[0])&&void 0!==l?l:Date.now()),r=null!==(a=g(e))&&void 0!==a?a:new Date;t.setHours(0,0,0,0),r.setHours(23,59,59,999),v({value:`${t.toISOString()}..${r.toISOString()}`})}})):ie({disabled:s,readonly:i,label:r,value:b(new Date(null!=n?n:Date.now())),type:"date",min:t,t:u,onChange:e=>{var l;v({value:(null!==(l=g(e))&&void 0!==l?l:new Date).toISOString()})}}))};let we,Le=e=>e;const Me=e=>{const{disabled:l,readonly:a,option:n,rule:t,t:r,onChange:s}=e,{list:i}=n,u=null==i?void 0:i.find((e=>e.value===(null==t?void 0:t.value))),v=null==t?void 0:t.operator;return o(we||(we=Le` ${0} ${0} `),ne({disabled:l,readonly:a,current:{label:void 0===v?"value_any":`operator_${null!=v?v:"equal"}`,value:void 0===v?"any":null!=v?v:"equal"},options:[{label:"value_any",value:"any"},{label:"operator_equal",value:"equal"},{label:"operator_not",value:d.Not}],t:r,onChange:e=>{var l,a,n;return s("any"===e?null:{operator:"equal"===e?null:e,value:null!==(n=null!==(l=null==t?void 0:t.value)&&void 0!==l?l:null===(a=null==i?void 0:i[0])||void 0===a?void 0:a.value)&&void 0!==n?n:""})}}),void 0===(null==t?void 0:t.value)?"":ne({disabled:l,readonly:a,current:null!=u?u:{label:"value_any",value:""},options:null!=i?i:[],t:r,onChange:e=>s({value:e})}))};let qe,ke,Ae=e=>e;function Oe(e){const l=new Set,a=e=>{let a;if("string"==typeof e.name)a=e.path;else{const l=e.path.lastIndexOf(":");if(-1===l)return;a=e.path.substring(0,l)}a.length>0&&l.add(a)};for(const l of e)if(Array.isArray(l))for(const e of l)a(e);else a(l);return Array.from(l).join()}function Se(e){let l=e.path;return e.name&&(l+=`:name[${e.name}]`),e.operator&&(l+=`:${e.operator}`),[l,e.value]}function He(e,l=!1){const a=new URLSearchParams;for(const l of e)if(Array.isArray(l)){const[e,...n]=l.map(Se);if(e&&e[0]){const l=[e[1],...n.map((e=>e.join("=")))];a.append(e[0],l.join("|"))}}else{const[e,n]=Se(l);e&&a.append(e,n)}if(!l){const l=Oe(e);l?a.set("zoom",l):a.delete("zoom")}return a.toString()}let De;const je=s(De||(De=(e=>e)`.gap-1px{gap:1px}.grid-vertical{grid-template:auto/var(--lumo-size-m) 1fr}:host([sm]) .sm-grid-horizontal{grid-template:auto/var(--lumo-size-m) 1fr var(--lumo-size-m) 1fr}input::-webkit-contacts-auto-fill-button{visibility:hidden;display:none!important;pointer-events:none;position:absolute;right:0}input::-webkit-inner-spin-button,input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}input{-moz-appearance:textfield}foxy-internal-summary-control[layout=details][count]:not([open]){--lumo-contrast-5pct:var(--lumo-primary-color-10pct);color:var(--lumo-primary-text-color)}`));function Ze(e,l){var a;const n=null!==(a=Object.values(d).find((l=>e.endsWith(`:${l}`))))&&void 0!==a?a:null;let t,r=e.substring(0,n?e.lastIndexOf(":"):void 0);const o=e.lastIndexOf("[");return r.endsWith("]")&&-1!==o&&(t=r.substring(o+1,r.length-1),r=r.substring(0,o),r.endsWith(":name")&&(r=r.substring(0,r.length-5))),{name:t,path:r,value:l,operator:n}}function Ve(e){const l=new URLSearchParams(e),a=[];for(const[e,n]of l.entries())n.includes("|")?a.push(n.split("|").map(((l,a)=>0===a?Ze(e,l):Ze(...l.split("="))))):a.push(Ze(e,n));return a}let Ie,Te,Ne=e=>e;const ze=t(l(a(n(u(i),"query-builder"))));class Be extends ze{constructor(){super(...arguments),this.reservedPaths=["zoom","limit","offset","order","fields"],this.disableZoom=!1,this.disableOr=!1,this.operators=Object.values(d),this.docsHref=null,this.options=null,this.__isAdvancedMode=!1,this.__reportedValue=null,this.__displayedValue=null}static zoom(e){return Oe(Ve(e))}static get properties(){return e(e({},super.properties),{},{reservedPaths:{type:Array,attribute:"reserved-paths"},disableZoom:{type:Boolean,attribute:"disable-zoom"},disableOr:{type:Boolean,attribute:"disable-or"},operators:{type:Array},docsHref:{attribute:"docs-href"},options:{type:Array},value:{noAccessor:!0},__reportedValue:{attribute:!1},__displayedValue:{attribute:!1},__isAdvancedMode:{attribute:!1}})}static get styles(){return[super.styles,je]}get value(){return this.__reportedValue}set value(e){this.__reportedValue=e,this.__displayedValue=e}render(){var l,a,n,t,r,s;const i=this.__isSimpleModeSupported,u=Ve(null!==(l=this.__displayedValue)&&void 0!==l?l:""),d=null!==(a=this.operators)&&void 0!==a?a:[],c=null!==(n=this.options)&&void 0!==n?n:[],h=this.t.bind(this),b=e=>{this.__displayedValue=He(e,this.disableZoom);e.every((e=>Array.isArray(e)?e.every((e=>!e.invalid)):!e.invalid))&&(this.__reportedValue=this.__displayedValue,this.dispatchEvent(new Be.ChangeEvent("change")))};return i||this.__isAdvancedMode||(this.__isAdvancedMode=!0),o(Ie||(Ie=Ne` <div class="space-y-m"> <div class="grid grid-cols-2 gap-xs p-xs bg-contrast-5 rounded" ?hidden="${0}"> <label class="${0}"> <foxy-i18n infer="" key="mode_simple${0}"> </foxy-i18n> <input class="sr-only" type="radio" name="mode" ?disabled="${0}" ?checked="${0}" @change="${0}"> </label> <label class="${0}"> <foxy-i18n infer="" key="mode_advanced"></foxy-i18n> <input class="sr-only" type="radio" name="mode" ?checked="${0}" @change="${0}"> </label> </div> ${0} </div> `),!(null===(t=this.options)||void 0===t?void 0:t.length),p({"p-xs rounded-s text-center font-medium transition-colors":!0,"bg-base ring-1 ring-contrast-5":!this.__isAdvancedMode&&i,"hover-bg-contrast-5":this.__isAdvancedMode&&i,"focus-within-ring-2 focus-within-ring-inset focus-within-ring-primary-50":!0,"cursor-pointer":i,"text-disabled":!i}),i?"":"_unsupported",!i,!this.__isAdvancedMode,(()=>this.__isAdvancedMode=!1),p({"p-xs rounded-s text-center font-medium cursor-pointer transition-colors":!0,"bg-base ring-1 ring-contrast-5":this.__isAdvancedMode,"hover-bg-contrast-5":!this.__isAdvancedMode,"focus-within-ring-2 focus-within-ring-inset focus-within-ring-primary-50":!0}),this.__isAdvancedMode,(()=>this.__isAdvancedMode=!0),this.__isAdvancedMode||!i?o(Te||(Te=Ne` <p class="leading-s text-tertiary" ?hidden="${0}"> <foxy-i18n infer="" key="advanced_mode_notice"></foxy-i18n> <a target="_blank" class="cursor-pointer rounded-s text-secondary font-medium hover-underline focus-outline-none focus-ring-2 focus-ring-primary-50" href="${0}" rel="nofollow noreferrer noopener"> <foxy-i18n infer="" key="api_reference_link"></foxy-i18n> </a> </p> ${0} `),null===this.docsHref,f(null!==(r=this.docsHref)&&void 0!==r?r:void 0),Q({disableOr:this.disableOr,disabled:this.disabled,readonly:this.readonly,rules:u,operators:d,onChange:b,options:c,t:h})):null===(s=this.__simpleModeOptions)||void 0===s?void 0:s.map((l=>function(l){var a;const{options:n,layout:t,rules:r,name:s,disabled:i,readonly:u,t:d,onChange:c}=l,h=n.filter((e=>r.find((l=>l.path===e.path)))),b=r.find((e=>"order"===e.path)),g=null===(a=null==b?void 0:b.value)||void 0===a?void 0:a.split(",").map((e=>{const[l,a="asc"]=decodeURIComponent(e).split(" ");return{path:l.trim(),order:a.trim()}}));return o(qe||(qe=Ae` <foxy-internal-summary-control aria-label="${0}" helper-text="" layout="${0}" label="${0}" count="${0}" infer=""> ${0} </foxy-internal-summary-control> `),l.t("query_builder_group"),f(t),t&&s?d(s):"",f(h.length||void 0),n.map((l=>{var a;const{type:n,label:t,list:s,path:h}=l,f={[v.Attribute]:ve,[v.Boolean]:ce,[v.String]:me,[v.Number]:be,[v.Date]:_e,[v.Any]:me},b=s?Me:f[n],y=null===(a=null==g?void 0:g.find((e=>e.path===h)))||void 0===a?void 0:a.order,m=r.find((e=>e.path===h)),x=!!m||!!y;return o(ke||(ke=Ae` <div aria-label="${0}" class="${0}"> <foxy-i18n infer="" key="${0}"></foxy-i18n> <span class="transform scale-150 mr-auto ${0}">&bull;</span> ${0} ${0} </div> `),d("query_builder_rule"),p({"flex flex-wrap items-center justify-end gap-s":!0,"bg-primary-10 text-primary":x}),t,x?"":"opacity-0",b({disabled:i,readonly:u,option:l,rule:m,t:d,onChange:l=>{if(l&&m)return Object.assign(m,l),c(r);if(l){const a={path:h,value:"",operator:null};return c([...r,e(e({},a),l)])}return c(r.filter((e=>e.path!==h)))}}),n===v.Date||n===v.Number?ne({disabled:i,readonly:u,t:d,current:{label:`order_${null!=y?y:"none"}${y?`_${n}`:""}`,value:null!=y?y:"none"},options:[{label:"order_none",value:"none"},{label:`order_asc_${n}`,value:"asc"},{label:`order_desc_${n}`,value:"desc"}],onChange:e=>{const l=(null!=g?g:[]).filter((e=>e.path!==h)).concat([{path:h,order:e}]).filter((e=>"none"!==e.order)).map((e=>`${e.path} ${e.order}`)).join(),a=r.filter((e=>"order"!==e.path));l&&a.push({path:"order",value:l,operator:null}),c(a)}}):"")})))}(e(e({},l),{},{disabled:this.disabled,readonly:this.readonly,rules:u,onChange:b,t:h})))))}get __isSimpleModeSupported(){var e;if(null===this.options)return!1;if(0===this.options.length)return!1;const l=Ve(null!==(e=this.__displayedValue)&&void 0!==e?e:"");return 0===l.length||l.every((e=>{var l;return!Array.isArray(e)&&(e.operator!==d.In&&((e.operator!==d.IsDefined||"true"===e.value)&&!(!this.reservedPaths.includes(e.path)&&!(null===(l=this.options)||void 0===l?void 0:l.find((l=>l.path===e.path))))))}))}get __simpleModeOptions(){var l;return null===(l=this.options)||void 0===l?void 0:l.reduce(((l,a)=>{const n=l.find((e=>{var l;return e.name===(null===(l=a.group)||void 0===l?void 0:l.name)}));return n?n.options.push(a):l.push(e(e({},a.group),{},{options:[a]})),l}),[])}}Be.ChangeEvent=class extends CustomEvent{},Be.Operator=d,Be.Type=v,customElements.define("foxy-query-builder",Be);export{Be as Q,Ve as p,He as s};
@@ -1 +1 @@
1
- import"./shared-a6b2bd14.js";import"./shared-7a5d645f.js";import"./shared-759f65d8.js";import"./shared-a9a8eb7c.js";import{I as e}from"./shared-eadf0d23.js";import{a as t}from"./shared-9a454e09.js";import"./shared-26b55da2.js";import{i as s}from"./shared-53e42a77.js";import{h as o}from"./shared-ba5c42c7.js";import{c as r,_ as n,B as i}from"./shared-8f9014ff.js";import{S as a,a as l}from"./shared-328aa161.js";import{v as d}from"./shared-b738ee96.js";import{c}from"./shared-4e709717.js";let h,p=e=>e;customElements.define("foxy-internal-customer-form-legal-notice-control",class extends t{renderControl(){var e,t;const r=this.nucleon;return o(h||(h=p` <p class="leading-s text-xs text-secondary"> <foxy-i18n infer="" key="text"></foxy-i18n> <a class="font-medium text-body rounded hover-underline focus-outline-none focus-ring-2 focus-ring-primary-50" target="_blank" href="${0}" rel="noopener noreferrer"> <foxy-i18n infer="" key="link"></foxy-i18n> </a> </p> `),s(null===(t=null===(e=null==r?void 0:r.settings)||void 0===e?void 0:e.tos_checkbox_settings)||void 0===t?void 0:t.url))}});var u=r((function(e){!function(){const t=[{id:0,value:"Too weak",minDiversity:0,minLength:0},{id:1,value:"Weak",minDiversity:2,minLength:6},{id:2,value:"Medium",minDiversity:4,minLength:8},{id:3,value:"Strong",minDiversity:4,minLength:10}],s=(e,s=t,o="!\"#$%&'()*+,-./:;<=>?@[\\\\\\]^_`{|}~")=>{let r=e||"";s[0].minDiversity=0,s[0].minLength=0;const n=[{regex:"[a-z]",message:"lowercase"},{regex:"[A-Z]",message:"uppercase"},{regex:"[0-9]",message:"number"}];o&&n.push({regex:`[${o}]`,message:"symbol"});let i={};i.contains=n.filter((e=>new RegExp(`${e.regex}`).test(r))).map((e=>e.message)),i.length=r.length;let a=s.filter((e=>i.contains.length>=e.minDiversity)).filter((e=>i.length>=e.minLength)).sort(((e,t)=>t.id-e.id)).map((e=>({id:e.id,value:e.value})));return Object.assign(i,a[0]),i};e.exports={passwordStrength:s,defaultOptions:t}}()}));let m,f,_=e=>e;const g=a(l(e,"customer-form")),x=u.passwordStrength;class v extends g{constructor(){super(...arguments),this.passwordless=!1,this.settings=null,this.__passwordGeneratorOptions={checkStrength:e=>x(e).id>=2},this.__isAnonymousGetValue=()=>{var e;return!1===(null===(e=this.form)||void 0===e?void 0:e.is_anonymous)?"false":"true"},this.__isAnonymousSetValue=e=>{const t="true"===e;this.edit({is_anonymous:t}),t&&this.form.password&&this.edit({password:""}),t&&this.form.password_old&&this.edit({password_old:""}),t&&this.form.forgot_password&&this.edit({forgot_password:""})},this.__isAnonymousOptions=[{value:"true",label:"option_true"},{value:"false",label:"option_false"}],this.__refreshInterval=null}static get scopedElements(){return{"foxy-internal-customer-form-legal-notice-control":customElements.get("foxy-internal-customer-form-legal-notice-control"),"foxy-internal-radio-group-control":customElements.get("foxy-internal-radio-group-control"),"foxy-internal-timestamps-control":customElements.get("foxy-internal-timestamps-control"),"foxy-internal-password-control":customElements.get("foxy-internal-password-control"),"foxy-internal-submit-control":customElements.get("foxy-internal-submit-control"),"foxy-internal-delete-control":customElements.get("foxy-internal-delete-control"),"foxy-internal-text-control":customElements.get("foxy-internal-text-control"),"foxy-internal-undo-control":customElements.get("foxy-internal-undo-control"),"foxy-copy-to-clipboard":customElements.get("foxy-copy-to-clipboard"),"foxy-spinner":customElements.get("foxy-spinner"),"vcf-tooltip":customElements.get("vcf-tooltip"),"foxy-i18n":customElements.get("foxy-i18n"),"h-captcha":customElements.get("h-captcha"),"vaadin-button":customElements.get("vaadin-button")}}static get properties(){return n(n({},super.properties),{},{passwordless:{type:Boolean},settings:{type:Object}})}static get v8n(){return[({password:e,_links:t,is_anonymous:s=!0},o)=>!!o.passwordless||(!!(t||s||e)||"password:v8n_required"),({password_old:e,password:t,_links:s},o)=>{var r;return!s||(void 0===(null===(r=o.settings)||void 0===r?void 0:r.sign_up)||(!(t&&!e)||"password-old:v8n_required"))},({first_name:e})=>!e||e.length<=50||"first-name:v8n_too_long",({last_name:e})=>!e||e.length<=50||"last-name:v8n_too_long",({password:e})=>!e||x(e).id>=2||"password:v8n_too_weak",({password:e})=>!e||e.length<=50||"password:v8n_too_long",({tax_id:e})=>!e||e.length<=50||"tax-id:v8n_too_long",({email:e})=>e&&e.length>0||"email:v8n_required",({email:e})=>!e||e.length<=100||"email:v8n_too_long",({email:e})=>!e||d(e)||"email:v8n_invalid_email"]}get hiddenSelector(){const e=new Set(super.hiddenSelector.toString().split(" "));return this.settings?(e.add("forgot-password"),e.add("is-anonymous"),this.form.password||e.add("password-old"),"none"===this.settings.tos_checkbox_settings.usage&&e.add("legal-notice")):(!1!==this.form.is_anonymous&&(e.add("forgot-password"),e.add("password")),e.add("password-old"),e.add("legal-notice")),this.href&&(e.add("is-anonymous"),e.add("legal-notice")),new i(Array.from(e).join(" ").trim())}get headerTitleOptions(){var e,t;const s=this.data;return!s||(null===(e=s.first_name)||void 0===e?void 0:e.trim())||(null===(t=s.last_name)||void 0===t?void 0:t.trim())?super.headerTitleOptions:n(n({},super.headerTitleOptions),{},{context:"no_name"})}get headerSubtitleKey(){var e;return(null===(e=this.data)||void 0===e?void 0:e.is_anonymous)?"subtitle_anonymous":"subtitle_registered"}get headerSubtitleOptions(){return n(n({},super.headerSubtitleOptions),{},{id:this.headerCopyIdValue})}disconnectedCallback(){super.disconnectedCallback();const e=this.__refreshInterval;e&&clearInterval(e)}connectedCallback(){super.connectedCallback();const e=setInterval((()=>this.requestUpdate()),6e4);this.__refreshInterval=e}renderBody(){var e,t,s,r;const n=this.hiddenSelector.matches("first-name",!0),i=this.hiddenSelector.matches("last-name",!0);return o(m||(m=_` ${0} <div class="${0}"> <foxy-internal-text-control infer="first-name"></foxy-internal-text-control> <foxy-internal-text-control infer="last-name"></foxy-internal-text-control> </div> <foxy-internal-text-control helper-text="${0}" infer="email"> </foxy-internal-text-control> <foxy-internal-radio-group-control infer="is-anonymous" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-radio-group-control> <foxy-internal-password-control placeholder="${0}" helper-text="${0}" infer="password" show-generator .generatorOptions="${0}"> </foxy-internal-password-control> <foxy-internal-password-control infer="password-old"></foxy-internal-password-control> <foxy-internal-password-control helper-text="${0}" infer="forgot-password" show-generator> </foxy-internal-password-control> <foxy-internal-text-control infer="tax-id"></foxy-internal-text-control> <foxy-internal-customer-form-legal-notice-control infer="legal-notice"> </foxy-internal-customer-form-legal-notice-control> ${0} ${0} `),this.renderHeader(),c({"grid-cols-2":!n&&!i,hidden:n&&i,"gap-m":!0,grid:!n||!i}),this.__emailHelperText,this.__isAnonymousGetValue,this.__isAnonymousSetValue,this.__isAnonymousOptions,this.__passwordPlaceholder,this.__passwordHelperText,this.__passwordGeneratorOptions,this.__forgotPasswordHelperText,!this.data&&(null===(t=null===(e=this.settings)||void 0===e?void 0:e.sign_up)||void 0===t?void 0:t.enabled)&&"hcaptcha"===(null===(r=null===(s=this.settings)||void 0===s?void 0:s.sign_up)||void 0===r?void 0:r.verification.type)?o(f||(f=_` <h-captcha site-key="${0}" class="hidden" size="invisible" hl="${0}" @verified="${0}"> </h-captcha> `),this.settings.sign_up.verification.site_key,this.lang,(({token:e})=>{this.edit({verification:{type:"hcaptcha",token:e}}),super.submit()})):"",super.renderBody())}submit(){var e,t,s,o,r;"hcaptcha"!==(null===(s=null===(t=null===(e=this.settings)||void 0===e?void 0:e.sign_up)||void 0===t?void 0:t.verification)||void 0===s?void 0:s.type)||this.data?super.submit():(null===(o=this.__hcaptcha)||void 0===o||o.reset(),null===(r=this.__hcaptcha)||void 0===r||r.execute())}async _sendPatch(e){const t=await super._sendPatch(e);if(e.password){const e={key:"password_change_success",options:{email:t.email}};this.status=e}return t}async _sendGet(){return this.status=null,await super._sendGet()}async _fetch(...e){try{return await super._fetch(...e)}catch(e){let t;try{t=(await e.json())._embedded["fx:errors"][0].message}catch(t){throw e}throw"Conflict"===t||t.startsWith("This email address is already in use")?["error:email_already_used"]:t.startsWith("Customer registration is disabled")?["error:registration_disabled"]:t.startsWith("Client verification failed")?["error:verification_failed"]:t.startsWith("Provided password is incorrect")?["error:old_password_incorrect"]:e}}get __forgotPasswordHelperText(){var e,t;const s=null===(e=this.data)||void 0===e?void 0:e.forgot_password_timestamp,o="forgot-password.helper_text";if((null===(t=this.data)||void 0===t?void 0:t.forgot_password)&&s){const e=new Date(new Date(s).getTime()+18e5),t=Math.floor((e.getTime()-Date.now())/1e3/60);return t<=0?this.t(`${o}_expired_on`,{expiresOn:e}):this.t(`${o}_expires_in`,{expiresInMin:`${t}minutes`})}return this.t(o)}get __passwordPlaceholder(){return this.data?this.t("password.placeholder_new"):this.t("password.placeholder")}get __passwordHelperText(){return this.data?this.t("password.helper_text_new"):this.t("password.helper_text")}get __emailHelperText(){var e;return(null===(e=this.data)||void 0===e?void 0:e.last_login_date)?this.t("email.helper_text_last_login_date",{date:this.data.last_login_date}):this.t("email.helper_text")}get __hcaptcha(){return this.renderRoot.querySelector("h-captcha")}}customElements.define("foxy-customer-form",v);export{v as C,u};
1
+ import"./shared-a6b2bd14.js";import"./shared-7a5d645f.js";import"./shared-462566b0.js";import"./shared-a9a8eb7c.js";import{I as e}from"./shared-084e1772.js";import{a as t}from"./shared-9a454e09.js";import"./shared-26b55da2.js";import{i as s}from"./shared-53e42a77.js";import{h as o}from"./shared-ba5c42c7.js";import{c as r,_ as n,B as i}from"./shared-8f9014ff.js";import{S as a,a as l}from"./shared-328aa161.js";import{v as d}from"./shared-b738ee96.js";import{c}from"./shared-4e709717.js";let h,p=e=>e;customElements.define("foxy-internal-customer-form-legal-notice-control",class extends t{renderControl(){var e,t;const r=this.nucleon;return o(h||(h=p` <p class="leading-s text-xs text-secondary"> <foxy-i18n infer="" key="text"></foxy-i18n> <a class="font-medium text-body rounded hover-underline focus-outline-none focus-ring-2 focus-ring-primary-50" target="_blank" href="${0}" rel="noopener noreferrer"> <foxy-i18n infer="" key="link"></foxy-i18n> </a> </p> `),s(null===(t=null===(e=null==r?void 0:r.settings)||void 0===e?void 0:e.tos_checkbox_settings)||void 0===t?void 0:t.url))}});var u=r((function(e){!function(){const t=[{id:0,value:"Too weak",minDiversity:0,minLength:0},{id:1,value:"Weak",minDiversity:2,minLength:6},{id:2,value:"Medium",minDiversity:4,minLength:8},{id:3,value:"Strong",minDiversity:4,minLength:10}],s=(e,s=t,o="!\"#$%&'()*+,-./:;<=>?@[\\\\\\]^_`{|}~")=>{let r=e||"";s[0].minDiversity=0,s[0].minLength=0;const n=[{regex:"[a-z]",message:"lowercase"},{regex:"[A-Z]",message:"uppercase"},{regex:"[0-9]",message:"number"}];o&&n.push({regex:`[${o}]`,message:"symbol"});let i={};i.contains=n.filter((e=>new RegExp(`${e.regex}`).test(r))).map((e=>e.message)),i.length=r.length;let a=s.filter((e=>i.contains.length>=e.minDiversity)).filter((e=>i.length>=e.minLength)).sort(((e,t)=>t.id-e.id)).map((e=>({id:e.id,value:e.value})));return Object.assign(i,a[0]),i};e.exports={passwordStrength:s,defaultOptions:t}}()}));let m,f,_=e=>e;const g=a(l(e,"customer-form")),x=u.passwordStrength;class v extends g{constructor(){super(...arguments),this.passwordless=!1,this.settings=null,this.__passwordGeneratorOptions={checkStrength:e=>x(e).id>=2},this.__isAnonymousGetValue=()=>{var e;return!1===(null===(e=this.form)||void 0===e?void 0:e.is_anonymous)?"false":"true"},this.__isAnonymousSetValue=e=>{const t="true"===e;this.edit({is_anonymous:t}),t&&this.form.password&&this.edit({password:""}),t&&this.form.password_old&&this.edit({password_old:""}),t&&this.form.forgot_password&&this.edit({forgot_password:""})},this.__isAnonymousOptions=[{value:"true",label:"option_true"},{value:"false",label:"option_false"}],this.__refreshInterval=null}static get scopedElements(){return{"foxy-internal-customer-form-legal-notice-control":customElements.get("foxy-internal-customer-form-legal-notice-control"),"foxy-internal-radio-group-control":customElements.get("foxy-internal-radio-group-control"),"foxy-internal-timestamps-control":customElements.get("foxy-internal-timestamps-control"),"foxy-internal-password-control":customElements.get("foxy-internal-password-control"),"foxy-internal-submit-control":customElements.get("foxy-internal-submit-control"),"foxy-internal-delete-control":customElements.get("foxy-internal-delete-control"),"foxy-internal-text-control":customElements.get("foxy-internal-text-control"),"foxy-internal-undo-control":customElements.get("foxy-internal-undo-control"),"foxy-copy-to-clipboard":customElements.get("foxy-copy-to-clipboard"),"foxy-spinner":customElements.get("foxy-spinner"),"vcf-tooltip":customElements.get("vcf-tooltip"),"foxy-i18n":customElements.get("foxy-i18n"),"h-captcha":customElements.get("h-captcha"),"vaadin-button":customElements.get("vaadin-button")}}static get properties(){return n(n({},super.properties),{},{passwordless:{type:Boolean},settings:{type:Object}})}static get v8n(){return[({password:e,_links:t,is_anonymous:s=!0},o)=>!!o.passwordless||(!!(t||s||e)||"password:v8n_required"),({password_old:e,password:t,_links:s},o)=>{var r;return!s||(void 0===(null===(r=o.settings)||void 0===r?void 0:r.sign_up)||(!(t&&!e)||"password-old:v8n_required"))},({first_name:e})=>!e||e.length<=50||"first-name:v8n_too_long",({last_name:e})=>!e||e.length<=50||"last-name:v8n_too_long",({password:e})=>!e||x(e).id>=2||"password:v8n_too_weak",({password:e})=>!e||e.length<=50||"password:v8n_too_long",({tax_id:e})=>!e||e.length<=50||"tax-id:v8n_too_long",({email:e})=>e&&e.length>0||"email:v8n_required",({email:e})=>!e||e.length<=100||"email:v8n_too_long",({email:e})=>!e||d(e)||"email:v8n_invalid_email"]}get hiddenSelector(){const e=new Set(super.hiddenSelector.toString().split(" "));return this.settings?(e.add("forgot-password"),e.add("is-anonymous"),this.form.password||e.add("password-old"),"none"===this.settings.tos_checkbox_settings.usage&&e.add("legal-notice")):(!1!==this.form.is_anonymous&&(e.add("forgot-password"),e.add("password")),e.add("password-old"),e.add("legal-notice")),this.href&&(e.add("is-anonymous"),e.add("legal-notice")),new i(Array.from(e).join(" ").trim())}get headerTitleOptions(){var e,t;const s=this.data;return!s||(null===(e=s.first_name)||void 0===e?void 0:e.trim())||(null===(t=s.last_name)||void 0===t?void 0:t.trim())?super.headerTitleOptions:n(n({},super.headerTitleOptions),{},{context:"no_name"})}get headerSubtitleKey(){var e;return(null===(e=this.data)||void 0===e?void 0:e.is_anonymous)?"subtitle_anonymous":"subtitle_registered"}get headerSubtitleOptions(){return n(n({},super.headerSubtitleOptions),{},{id:this.headerCopyIdValue})}disconnectedCallback(){super.disconnectedCallback();const e=this.__refreshInterval;e&&clearInterval(e)}connectedCallback(){super.connectedCallback();const e=setInterval((()=>this.requestUpdate()),6e4);this.__refreshInterval=e}renderBody(){var e,t,s,r;const n=this.hiddenSelector.matches("first-name",!0),i=this.hiddenSelector.matches("last-name",!0);return o(m||(m=_` ${0} <div class="${0}"> <foxy-internal-text-control infer="first-name"></foxy-internal-text-control> <foxy-internal-text-control infer="last-name"></foxy-internal-text-control> </div> <foxy-internal-text-control helper-text="${0}" infer="email"> </foxy-internal-text-control> <foxy-internal-radio-group-control infer="is-anonymous" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-radio-group-control> <foxy-internal-password-control placeholder="${0}" helper-text="${0}" infer="password" show-generator .generatorOptions="${0}"> </foxy-internal-password-control> <foxy-internal-password-control infer="password-old"></foxy-internal-password-control> <foxy-internal-password-control helper-text="${0}" infer="forgot-password" show-generator> </foxy-internal-password-control> <foxy-internal-text-control infer="tax-id"></foxy-internal-text-control> <foxy-internal-customer-form-legal-notice-control infer="legal-notice"> </foxy-internal-customer-form-legal-notice-control> ${0} ${0} `),this.renderHeader(),c({"grid-cols-2":!n&&!i,hidden:n&&i,"gap-m":!0,grid:!n||!i}),this.__emailHelperText,this.__isAnonymousGetValue,this.__isAnonymousSetValue,this.__isAnonymousOptions,this.__passwordPlaceholder,this.__passwordHelperText,this.__passwordGeneratorOptions,this.__forgotPasswordHelperText,!this.data&&(null===(t=null===(e=this.settings)||void 0===e?void 0:e.sign_up)||void 0===t?void 0:t.enabled)&&"hcaptcha"===(null===(r=null===(s=this.settings)||void 0===s?void 0:s.sign_up)||void 0===r?void 0:r.verification.type)?o(f||(f=_` <h-captcha site-key="${0}" class="hidden" size="invisible" hl="${0}" @verified="${0}"> </h-captcha> `),this.settings.sign_up.verification.site_key,this.lang,(({token:e})=>{this.edit({verification:{type:"hcaptcha",token:e}}),super.submit()})):"",super.renderBody())}submit(){var e,t,s,o,r;"hcaptcha"!==(null===(s=null===(t=null===(e=this.settings)||void 0===e?void 0:e.sign_up)||void 0===t?void 0:t.verification)||void 0===s?void 0:s.type)||this.data?super.submit():(null===(o=this.__hcaptcha)||void 0===o||o.reset(),null===(r=this.__hcaptcha)||void 0===r||r.execute())}async _sendPatch(e){const t=await super._sendPatch(e);if(e.password){const e={key:"password_change_success",options:{email:t.email}};this.status=e}return t}async _sendGet(){return this.status=null,await super._sendGet()}async _fetch(...e){try{return await super._fetch(...e)}catch(e){let t;try{t=(await e.json())._embedded["fx:errors"][0].message}catch(t){throw e}throw"Conflict"===t||t.startsWith("This email address is already in use")?["error:email_already_used"]:t.startsWith("Customer registration is disabled")?["error:registration_disabled"]:t.startsWith("Client verification failed")?["error:verification_failed"]:t.startsWith("Provided password is incorrect")?["error:old_password_incorrect"]:e}}get __forgotPasswordHelperText(){var e,t;const s=null===(e=this.data)||void 0===e?void 0:e.forgot_password_timestamp,o="forgot-password.helper_text";if((null===(t=this.data)||void 0===t?void 0:t.forgot_password)&&s){const e=new Date(new Date(s).getTime()+18e5),t=Math.floor((e.getTime()-Date.now())/1e3/60);return t<=0?this.t(`${o}_expired_on`,{expiresOn:e}):this.t(`${o}_expires_in`,{expiresInMin:`${t}minutes`})}return this.t(o)}get __passwordPlaceholder(){return this.data?this.t("password.placeholder_new"):this.t("password.placeholder")}get __passwordHelperText(){return this.data?this.t("password.helper_text_new"):this.t("password.helper_text")}get __emailHelperText(){var e;return(null===(e=this.data)||void 0===e?void 0:e.last_login_date)?this.t("email.helper_text_last_login_date",{date:this.data.last_login_date}):this.t("email.helper_text")}get __hcaptcha(){return this.renderRoot.querySelector("h-captcha")}}customElements.define("foxy-customer-form",v);export{v as C,u};
@@ -296,7 +296,11 @@
296
296
  "label": "Unified order entry password",
297
297
  "placeholder": "None",
298
298
  "helper_text": "Set a master password here if you would like to be able to check out as your customers without having to know their password.",
299
- "v8n_required": "Please reduce your UOE password to 100 characters"
299
+ "v8n_required": "Please reduce your UOE password to 100 characters",
300
+ "click_to_copy": "Click to copy",
301
+ "copying": "Copying",
302
+ "done": "Done",
303
+ "failed_to_copy": "Failed to copy"
300
304
  },
301
305
  "use-single-sign-on": {
302
306
  "label": "Enable SSO",
@@ -10,11 +10,14 @@ import { InternalEditableControl } from '../InternalEditableControl/InternalEdit
10
10
  export declare class InternalPasswordControl extends InternalEditableControl {
11
11
  static get properties(): PropertyDeclarations;
12
12
  generatorOptions: null | GeneratorOptions;
13
+ /** Password visibility toggle mode, "reveal" by default which shows Reveal Password button. If set to "copy", shows "Copy Password" button instead. */
14
+ visibilityToggle: 'reveal' | 'copy' | null;
13
15
  /** If true, renders the password generator button. */
14
16
  showGenerator: boolean;
15
17
  layout: 'standalone' | 'summary-item' | null;
16
18
  renderControl(): TemplateResult;
17
19
  protected get _value(): string;
18
20
  protected set _value(newValue: string);
21
+ private __renderCopyButton;
19
22
  private __renderGenerator;
20
23
  }
@@ -13,6 +13,8 @@ export class InternalPasswordControl extends InternalEditableControl {
13
13
  constructor() {
14
14
  super(...arguments);
15
15
  this.generatorOptions = null;
16
+ /** Password visibility toggle mode, "reveal" by default which shows Reveal Password button. If set to "copy", shows "Copy Password" button instead. */
17
+ this.visibilityToggle = null;
16
18
  /** If true, renders the password generator button. */
17
19
  this.showGenerator = false;
18
20
  this.layout = null;
@@ -21,6 +23,7 @@ export class InternalPasswordControl extends InternalEditableControl {
21
23
  return {
22
24
  ...super.properties,
23
25
  generatorOptions: { type: Object, attribute: 'generator-options' },
26
+ visibilityToggle: { attribute: 'visibility-toggle' },
24
27
  showGenerator: { type: Boolean, attribute: 'show-generator' },
25
28
  layout: {},
26
29
  };
@@ -35,6 +38,7 @@ export class InternalPasswordControl extends InternalEditableControl {
35
38
  label=${this.label}
36
39
  theme=${ifDefined((_a = this.layout) !== null && _a !== void 0 ? _a : void 0)}
37
40
  class="w-full"
41
+ ?reveal-button-hidden=${this.visibilityToggle === 'copy'}
38
42
  ?disabled=${this.disabled}
39
43
  ?readonly=${this.readonly}
40
44
  .checkValidity=${this._checkValidity}
@@ -46,6 +50,7 @@ export class InternalPasswordControl extends InternalEditableControl {
46
50
  }}
47
51
  >
48
52
  ${this.showGenerator ? this.__renderGenerator() : ''}
53
+ ${this.visibilityToggle === 'copy' ? this.__renderCopyButton() : ''}
49
54
  </vaadin-password-field>
50
55
  `;
51
56
  }
@@ -56,6 +61,12 @@ export class InternalPasswordControl extends InternalEditableControl {
56
61
  set _value(newValue) {
57
62
  super._value = newValue;
58
63
  }
64
+ __renderCopyButton() {
65
+ return html `
66
+ <foxy-copy-to-clipboard layout="icon-inline" infer="" slot="suffix" text=${this._value}>
67
+ </foxy-copy-to-clipboard>
68
+ `;
69
+ }
59
70
  __renderGenerator() {
60
71
  return html `
61
72
  <div
@@ -1 +1 @@
1
- {"version":3,"file":"InternalPasswordControl.js","sourceRoot":"","sources":["../../../../src/elements/internal/InternalPasswordControl/InternalPasswordControl.ts"],"names":[],"mappings":"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","sourcesContent":["import type { PropertyDeclarations, TemplateResult } from 'lit-element';\nimport type { PasswordFieldElement } from '@vaadin/vaadin-text-field/vaadin-password-field';\nimport type { GeneratorOptions } from './generateRandomPassword';\n\nimport { InternalEditableControl } from '../InternalEditableControl/InternalEditableControl';\nimport { generateRandomPassword } from './generateRandomPassword';\nimport { ifDefined } from 'lit-html/directives/if-defined';\nimport { html, svg } from 'lit-element';\nimport { classMap } from '../../../utils/class-map';\n\n/**\n * Internal control displaying a basic password box.\n *\n * @since 1.17.0\n * @element foxy-internal-password-field-control\n */\nexport class InternalPasswordControl extends InternalEditableControl {\n static get properties(): PropertyDeclarations {\n return {\n ...super.properties,\n generatorOptions: { type: Object, attribute: 'generator-options' },\n showGenerator: { type: Boolean, attribute: 'show-generator' },\n layout: {},\n };\n }\n\n generatorOptions: null | GeneratorOptions = null;\n\n /** If true, renders the password generator button. */\n showGenerator = false;\n\n layout: 'standalone' | 'summary-item' | null = null;\n\n renderControl(): TemplateResult {\n return html`\n <vaadin-password-field\n error-message=${ifDefined(this._errorMessage)}\n helper-text=${this.helperText}\n placeholder=${this.placeholder}\n label=${this.label}\n theme=${ifDefined(this.layout ?? void 0)}\n class=\"w-full\"\n ?disabled=${this.disabled}\n ?readonly=${this.readonly}\n .checkValidity=${this._checkValidity}\n .value=${this._value}\n @keydown=${(evt: KeyboardEvent) => evt.key === 'Enter' && this.nucleon?.submit()}\n @input=${(evt: CustomEvent) => {\n const area = evt.currentTarget as PasswordFieldElement;\n this._value = area.value;\n }}\n >\n ${this.showGenerator ? this.__renderGenerator() : ''}\n </vaadin-password-field>\n `;\n }\n\n protected get _value(): string {\n return (super._value as string | undefined) ?? '';\n }\n\n protected set _value(newValue: string) {\n super._value = newValue as unknown | undefined;\n }\n\n private __renderGenerator(): TemplateResult {\n return html`\n <div\n data-testid=\"generator\"\n class=${classMap({\n 'w-s h-s flex items-center justify-center cursor-default transition-colors': true,\n 'text-contrast-60 hover-text-contrast-80': !this.disabled && !this.readonly,\n 'text-contrast-20': this.disabled || this.readonly,\n })}\n slot=\"suffix\"\n @click=${() => {\n let isStrong = false;\n let newValue: string;\n let attempts = 0;\n\n do {\n newValue = generateRandomPassword(this.generatorOptions ?? void 0);\n isStrong = this.generatorOptions?.checkStrength?.(newValue) ?? true;\n attempts++;\n } while (!isStrong && attempts < 100);\n\n if (isStrong) {\n this._value = newValue;\n } else {\n throw new Error('Failed to generate a strong password.');\n }\n\n const field = this.renderRoot.querySelector('vaadin-password-field');\n // @ts-expect-error: this is a private method but it's ok since the version is fixed\n field?._setPasswordVisible(true);\n }}\n >\n ${svg`<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\" fill=\"currentColor\" style=\"width: 1.15em; height: 1.15em\"><path d=\"M15.98 1.804a1 1 0 00-1.96 0l-.24 1.192a1 1 0 01-.784.785l-1.192.238a1 1 0 000 1.962l1.192.238a1 1 0 01.785.785l.238 1.192a1 1 0 001.962 0l.238-1.192a1 1 0 01.785-.785l1.192-.238a1 1 0 000-1.962l-1.192-.238a1 1 0 01-.785-.785l-.238-1.192zM6.949 5.684a1 1 0 00-1.898 0l-.683 2.051a1 1 0 01-.633.633l-2.051.683a1 1 0 000 1.898l2.051.684a1 1 0 01.633.632l.683 2.051a1 1 0 001.898 0l.683-2.051a1 1 0 01.633-.633l2.051-.683a1 1 0 000-1.898l-2.051-.683a1 1 0 01-.633-.633L6.95 5.684zM13.949 13.684a1 1 0 00-1.898 0l-.184.551a1 1 0 01-.632.633l-.551.183a1 1 0 000 1.898l.551.183a1 1 0 01.633.633l.183.551a1 1 0 001.898 0l.184-.551a1 1 0 01.632-.633l.551-.183a1 1 0 000-1.898l-.551-.184a1 1 0 01-.633-.632l-.183-.551z\" /></svg>`}\n </div>\n `;\n }\n}\n"]}
1
+ {"version":3,"file":"InternalPasswordControl.js","sourceRoot":"","sources":["../../../../src/elements/internal/InternalPasswordControl/InternalPasswordControl.ts"],"names":[],"mappings":"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","sourcesContent":["import type { PropertyDeclarations, TemplateResult } from 'lit-element';\nimport type { PasswordFieldElement } from '@vaadin/vaadin-text-field/vaadin-password-field';\nimport type { GeneratorOptions } from './generateRandomPassword';\n\nimport { InternalEditableControl } from '../InternalEditableControl/InternalEditableControl';\nimport { generateRandomPassword } from './generateRandomPassword';\nimport { ifDefined } from 'lit-html/directives/if-defined';\nimport { html, svg } from 'lit-element';\nimport { classMap } from '../../../utils/class-map';\n\n/**\n * Internal control displaying a basic password box.\n *\n * @since 1.17.0\n * @element foxy-internal-password-field-control\n */\nexport class InternalPasswordControl extends InternalEditableControl {\n static get properties(): PropertyDeclarations {\n return {\n ...super.properties,\n generatorOptions: { type: Object, attribute: 'generator-options' },\n visibilityToggle: { attribute: 'visibility-toggle' },\n showGenerator: { type: Boolean, attribute: 'show-generator' },\n layout: {},\n };\n }\n\n generatorOptions: null | GeneratorOptions = null;\n\n /** Password visibility toggle mode, \"reveal\" by default which shows Reveal Password button. If set to \"copy\", shows \"Copy Password\" button instead. */\n visibilityToggle: 'reveal' | 'copy' | null = null;\n\n /** If true, renders the password generator button. */\n showGenerator = false;\n\n layout: 'standalone' | 'summary-item' | null = null;\n\n renderControl(): TemplateResult {\n return html`\n <vaadin-password-field\n error-message=${ifDefined(this._errorMessage)}\n helper-text=${this.helperText}\n placeholder=${this.placeholder}\n label=${this.label}\n theme=${ifDefined(this.layout ?? void 0)}\n class=\"w-full\"\n ?reveal-button-hidden=${this.visibilityToggle === 'copy'}\n ?disabled=${this.disabled}\n ?readonly=${this.readonly}\n .checkValidity=${this._checkValidity}\n .value=${this._value}\n @keydown=${(evt: KeyboardEvent) => evt.key === 'Enter' && this.nucleon?.submit()}\n @input=${(evt: CustomEvent) => {\n const area = evt.currentTarget as PasswordFieldElement;\n this._value = area.value;\n }}\n >\n ${this.showGenerator ? this.__renderGenerator() : ''}\n ${this.visibilityToggle === 'copy' ? this.__renderCopyButton() : ''}\n </vaadin-password-field>\n `;\n }\n\n protected get _value(): string {\n return (super._value as string | undefined) ?? '';\n }\n\n protected set _value(newValue: string) {\n super._value = newValue as unknown | undefined;\n }\n\n private __renderCopyButton(): TemplateResult {\n return html`\n <foxy-copy-to-clipboard layout=\"icon-inline\" infer=\"\" slot=\"suffix\" text=${this._value}>\n </foxy-copy-to-clipboard>\n `;\n }\n\n private __renderGenerator(): TemplateResult {\n return html`\n <div\n data-testid=\"generator\"\n class=${classMap({\n 'w-s h-s flex items-center justify-center cursor-default transition-colors': true,\n 'text-contrast-60 hover-text-contrast-80': !this.disabled && !this.readonly,\n 'text-contrast-20': this.disabled || this.readonly,\n })}\n slot=\"suffix\"\n @click=${() => {\n let isStrong = false;\n let newValue: string;\n let attempts = 0;\n\n do {\n newValue = generateRandomPassword(this.generatorOptions ?? void 0);\n isStrong = this.generatorOptions?.checkStrength?.(newValue) ?? true;\n attempts++;\n } while (!isStrong && attempts < 100);\n\n if (isStrong) {\n this._value = newValue;\n } else {\n throw new Error('Failed to generate a strong password.');\n }\n\n const field = this.renderRoot.querySelector('vaadin-password-field');\n // @ts-expect-error: this is a private method but it's ok since the version is fixed\n field?._setPasswordVisible(true);\n }}\n >\n ${svg`<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\" fill=\"currentColor\" style=\"width: 1.15em; height: 1.15em\"><path d=\"M15.98 1.804a1 1 0 00-1.96 0l-.24 1.192a1 1 0 01-.784.785l-1.192.238a1 1 0 000 1.962l1.192.238a1 1 0 01.785.785l.238 1.192a1 1 0 001.962 0l.238-1.192a1 1 0 01.785-.785l1.192-.238a1 1 0 000-1.962l-1.192-.238a1 1 0 01-.785-.785l-.238-1.192zM6.949 5.684a1 1 0 00-1.898 0l-.683 2.051a1 1 0 01-.633.633l-2.051.683a1 1 0 000 1.898l2.051.684a1 1 0 01.633.632l.683 2.051a1 1 0 001.898 0l.683-2.051a1 1 0 01.633-.633l2.051-.683a1 1 0 000-1.898l-2.051-.683a1 1 0 01-.633-.633L6.95 5.684zM13.949 13.684a1 1 0 00-1.898 0l-.184.551a1 1 0 01-.632.633l-.551.183a1 1 0 000 1.898l.551.183a1 1 0 01.633.633l.183.551a1 1 0 001.898 0l.184-.551a1 1 0 01.632-.633l.551-.183a1 1 0 000-1.898l-.551-.184a1 1 0 01-.633-.632l-.183-.551z\" /></svg>`}\n </div>\n `;\n }\n}\n"]}
@@ -1,4 +1,5 @@
1
1
  import '@vaadin/vaadin-text-field/vaadin-password-field';
2
+ import '../../public/CopyToClipboard/index';
2
3
  import '../InternalEditableControl/index';
3
4
  import './vaadinStyles';
4
5
  import { InternalPasswordControl as Control } from './InternalPasswordControl';
@@ -1,4 +1,5 @@
1
1
  import '@vaadin/vaadin-text-field/vaadin-password-field';
2
+ import "../../public/CopyToClipboard/index.js";
2
3
  import "../InternalEditableControl/index.js";
3
4
  import "./vaadinStyles.js";
4
5
  import { InternalPasswordControl as Control } from "./InternalPasswordControl.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/elements/internal/InternalPasswordControl/index.ts"],"names":[],"mappings":"AAAA,OAAO,iDAAiD,CAAC;AACzD,6CAA0C;AAC1C,2BAAwB;AAExB,OAAO,EAAE,uBAAuB,IAAI,OAAO,EAAE,qCAAkC;AAE/E,cAAc,CAAC,MAAM,CAAC,gCAAgC,EAAE,OAAO,CAAC,CAAC;AAEjE,OAAO,EAAE,OAAO,IAAI,uBAAuB,EAAE,CAAC","sourcesContent":["import '@vaadin/vaadin-text-field/vaadin-password-field';\nimport '../InternalEditableControl/index';\nimport './vaadinStyles';\n\nimport { InternalPasswordControl as Control } from './InternalPasswordControl';\n\ncustomElements.define('foxy-internal-password-control', Control);\n\nexport { Control as InternalPasswordControl };\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/elements/internal/InternalPasswordControl/index.ts"],"names":[],"mappings":"AAAA,OAAO,iDAAiD,CAAC;AACzD,+CAA4C;AAC5C,6CAA0C;AAC1C,2BAAwB;AAExB,OAAO,EAAE,uBAAuB,IAAI,OAAO,EAAE,qCAAkC;AAE/E,cAAc,CAAC,MAAM,CAAC,gCAAgC,EAAE,OAAO,CAAC,CAAC;AAEjE,OAAO,EAAE,OAAO,IAAI,uBAAuB,EAAE,CAAC","sourcesContent":["import '@vaadin/vaadin-text-field/vaadin-password-field';\nimport '../../public/CopyToClipboard/index';\nimport '../InternalEditableControl/index';\nimport './vaadinStyles';\n\nimport { InternalPasswordControl as Control } from './InternalPasswordControl';\n\ncustomElements.define('foxy-internal-password-control', Control);\n\nexport { Control as InternalPasswordControl };\n"]}
@@ -16,7 +16,7 @@ export declare class CopyToClipboard extends Base {
16
16
  static get properties(): PropertyDeclarations;
17
17
  static get styles(): CSSResult;
18
18
  /** Icon or text UI. Icon UI by default. */
19
- layout: 'complete' | 'text' | 'icon' | null;
19
+ layout: 'complete' | 'text' | 'icon' | 'icon-inline' | null;
20
20
  /** VaadinButton theme for text layout. */
21
21
  theme: string | null;
22
22
  /** Default icon. */
@@ -3,6 +3,7 @@ import { TranslatableMixin } from "../../../mixins/translatable.js";
3
3
  import { ConfigurableMixin } from "../../../mixins/configurable.js";
4
4
  import { InferrableMixin } from "../../../mixins/inferrable.js";
5
5
  import { ifDefined } from 'lit-html/directives/if-defined';
6
+ import { classMap } from "../../../utils/class-map.js";
6
7
  const NS = 'copy-to-clipboard';
7
8
  const Base = ConfigurableMixin(TranslatableMixin(InferrableMixin(LitElement), NS));
8
9
  /**
@@ -50,9 +51,17 @@ export class CopyToClipboard extends Base {
50
51
  display:flex;
51
52
  justify-content:center;
52
53
  align-items:center;
54
+ transition:color 0.15s ease;
53
55
  }
54
56
 
55
- .icon-button::before{
57
+ .icon-button.inline{
58
+ width:var(--lumo-size-s);
59
+ height:var(--lumo-size-s);
60
+ margin-left:calc(0px - ((var(--lumo-size-s) - 1em) / 4));
61
+ margin-right:calc(0px - ((var(--lumo-size-s) - 1em) / 2));
62
+ }
63
+
64
+ .icon-button:not(.inline)::before{
56
65
  position:absolute;
57
66
  inset:0;
58
67
  content:' ';
@@ -74,11 +83,16 @@ export class CopyToClipboard extends Base {
74
83
  }
75
84
 
76
85
  @media (hover: hover){
77
- .icon-button:not(:disabled):hover{
86
+ .icon-button:not(:disabled):not(.inline):hover{
78
87
  cursor:pointer;
79
88
  }
80
89
 
81
- .icon-button:not(:disabled):hover::before{
90
+ .icon-button.inline:not(:disabled):hover{
91
+ color:var(--lumo-body-text-color);
92
+ cursor:default;
93
+ }
94
+
95
+ .icon-button:not(:disabled):not(.inline):hover::before{
82
96
  opacity:0.16;
83
97
  }
84
98
  }
@@ -111,11 +125,11 @@ iron-icon{
111
125
  icon = (_b = this.icon) !== null && _b !== void 0 ? _b : 'icons:content-copy';
112
126
  }
113
127
  return html `
114
- ${layout === 'icon'
128
+ ${layout === 'icon' || layout === 'icon-inline'
115
129
  ? html `
116
130
  <button
117
131
  id="trigger"
118
- class="icon-button"
132
+ class=${classMap({ 'icon-button': true, 'inline': layout === 'icon-inline' })}
119
133
  ?disabled=${this.disabled}
120
134
  @click=${this.__copy}
121
135
  >
@@ -1 +1 @@
1
- {"version":3,"file":"CopyToClipboard.js","sourceRoot":"","sources":["../../../../src/elements/public/CopyToClipboard/CopyToClipboard.ts"],"names":[],"mappings":"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","sourcesContent":["import type { CSSResult, PropertyDeclarations, TemplateResult } from 'lit-element';\n\nimport { LitElement, css, html } from 'lit-element';\nimport { TranslatableMixin } from '../../../mixins/translatable';\nimport { ConfigurableMixin } from '../../../mixins/configurable';\nimport { InferrableMixin } from '../../../mixins/inferrable';\nimport { ifDefined } from 'lit-html/directives/if-defined';\n\nconst NS = 'copy-to-clipboard';\nconst Base = ConfigurableMixin(TranslatableMixin(InferrableMixin(LitElement), NS));\n\n/**\n * A simple \"click to copy\" button that takes the size of the font\n * your text is written in (considering that the font styles are applied to container).\n *\n * @element foxy-copy-to-clipboard\n * @since 1.17.0\n */\nexport class CopyToClipboard extends Base {\n static get properties(): PropertyDeclarations {\n return {\n ...super.properties,\n layout: {},\n theme: {},\n text: { type: String },\n icon: { type: String },\n __state: { attribute: false },\n };\n }\n\n static get styles(): CSSResult {\n return css`\n .icon-button {\n position: relative;\n appearance: none;\n background: none;\n border: none;\n border-radius: var(--lumo-border-radius-s);\n color: inherit;\n font-size: inherit;\n padding: 0;\n width: 1.5em;\n height: 1.5em;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n\n .icon-button::before {\n position: absolute;\n inset: 0;\n content: ' ';\n display: block;\n background: currentColor;\n opacity: 0.08;\n transition: opacity 0.15s ease;\n border-radius: var(--lumo-border-radius-s);\n }\n\n .icon-button:focus {\n outline: none;\n box-shadow: 0 0 0 2px currentColor;\n }\n\n .icon-button:disabled {\n opacity: 0.5;\n cursor: default;\n }\n\n @media (hover: hover) {\n .icon-button:not(:disabled):hover {\n cursor: pointer;\n }\n\n .icon-button:not(:disabled):hover::before {\n opacity: 0.16;\n }\n }\n\n iron-icon {\n --iron-icon-height: 1em;\n --iron-icon-width: 1em;\n }\n `;\n }\n\n /** Icon or text UI. Icon UI by default. */\n layout: 'complete' | 'text' | 'icon' | null = null;\n\n /** VaadinButton theme for text layout. */\n theme: string | null = null;\n\n /** Default icon. */\n icon: string | null = null;\n\n /** Text to copy. */\n text: string | null = null;\n\n private __state: 'idle' | 'busy' | 'fail' | 'done' = 'idle';\n\n render(): TemplateResult {\n const layout = this.layout ?? 'icon';\n let label = '';\n let icon = '';\n\n if (this.__state === 'busy') {\n label = 'copying';\n icon = 'icons:hourglass-empty';\n } else if (this.__state === 'fail') {\n label = 'failed_to_copy';\n icon = 'icons:error-outline';\n } else if (this.__state === 'done') {\n label = 'done';\n icon = 'icons:done';\n } else {\n label = 'click_to_copy';\n icon = this.icon ?? 'icons:content-copy';\n }\n\n return html`\n ${layout === 'icon'\n ? html`\n <button\n id=\"trigger\"\n class=\"icon-button\"\n ?disabled=${this.disabled}\n @click=${this.__copy}\n >\n <iron-icon icon=${icon}></iron-icon>\n </button>\n <vcf-tooltip\n position=\"bottom\"\n style=\"--lumo-base-color: black\"\n theme=\"light\"\n for=\"trigger\"\n >\n <span class=\"text-s\" style=\"color: white\">\n <foxy-i18n infer=\"\" key=${label}></foxy-i18n>\n </span>\n </vcf-tooltip>\n `\n : html`\n <vaadin-button\n theme=${ifDefined(this.theme ?? void 0)}\n ?disabled=${this.disabled}\n @click=${this.__copy}\n >\n <foxy-i18n infer=\"\" key=${label}></foxy-i18n>\n ${layout === 'complete'\n ? html`\n <iron-icon\n style=\"--lumo-icon-size-m: 1em; transform: translateY(-0.1em)\"\n icon=${icon}\n >\n </iron-icon>\n `\n : ''}\n </vaadin-button>\n `}\n `;\n }\n\n private __copy() {\n if (this.__state === 'idle') {\n this.__state = 'busy';\n\n navigator.clipboard\n .writeText(this.text ?? '')\n .then(() => (this.__state = 'done'))\n .catch(() => (this.__state = 'fail'))\n .then(() => setTimeout(() => (this.__state = 'idle'), 2000));\n }\n }\n}\n"]}
1
+ {"version":3,"file":"CopyToClipboard.js","sourceRoot":"","sources":["../../../../src/elements/public/CopyToClipboard/CopyToClipboard.ts"],"names":[],"mappings":"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","sourcesContent":["import type { CSSResult, PropertyDeclarations, TemplateResult } from 'lit-element';\n\nimport { LitElement, css, html } from 'lit-element';\nimport { TranslatableMixin } from '../../../mixins/translatable';\nimport { ConfigurableMixin } from '../../../mixins/configurable';\nimport { InferrableMixin } from '../../../mixins/inferrable';\nimport { ifDefined } from 'lit-html/directives/if-defined';\nimport { classMap } from '../../../utils/class-map';\n\nconst NS = 'copy-to-clipboard';\nconst Base = ConfigurableMixin(TranslatableMixin(InferrableMixin(LitElement), NS));\n\n/**\n * A simple \"click to copy\" button that takes the size of the font\n * your text is written in (considering that the font styles are applied to container).\n *\n * @element foxy-copy-to-clipboard\n * @since 1.17.0\n */\nexport class CopyToClipboard extends Base {\n static get properties(): PropertyDeclarations {\n return {\n ...super.properties,\n layout: {},\n theme: {},\n text: { type: String },\n icon: { type: String },\n __state: { attribute: false },\n };\n }\n\n static get styles(): CSSResult {\n return css`\n .icon-button {\n position: relative;\n appearance: none;\n background: none;\n border: none;\n border-radius: var(--lumo-border-radius-s);\n color: inherit;\n font-size: inherit;\n padding: 0;\n width: 1.5em;\n height: 1.5em;\n display: flex;\n justify-content: center;\n align-items: center;\n transition: color 0.15s ease;\n }\n\n .icon-button.inline {\n width: var(--lumo-size-s);\n height: var(--lumo-size-s);\n margin-left: calc(0px - ((var(--lumo-size-s) - 1em) / 4));\n margin-right: calc(0px - ((var(--lumo-size-s) - 1em) / 2));\n }\n\n .icon-button:not(.inline)::before {\n position: absolute;\n inset: 0;\n content: ' ';\n display: block;\n background: currentColor;\n opacity: 0.08;\n transition: opacity 0.15s ease;\n border-radius: var(--lumo-border-radius-s);\n }\n\n .icon-button:focus {\n outline: none;\n box-shadow: 0 0 0 2px currentColor;\n }\n\n .icon-button:disabled {\n opacity: 0.5;\n cursor: default;\n }\n\n @media (hover: hover) {\n .icon-button:not(:disabled):not(.inline):hover {\n cursor: pointer;\n }\n\n .icon-button.inline:not(:disabled):hover {\n color: var(--lumo-body-text-color);\n cursor: default;\n }\n\n .icon-button:not(:disabled):not(.inline):hover::before {\n opacity: 0.16;\n }\n }\n\n iron-icon {\n --iron-icon-height: 1em;\n --iron-icon-width: 1em;\n }\n `;\n }\n\n /** Icon or text UI. Icon UI by default. */\n layout: 'complete' | 'text' | 'icon' | 'icon-inline' | null = null;\n\n /** VaadinButton theme for text layout. */\n theme: string | null = null;\n\n /** Default icon. */\n icon: string | null = null;\n\n /** Text to copy. */\n text: string | null = null;\n\n private __state: 'idle' | 'busy' | 'fail' | 'done' = 'idle';\n\n render(): TemplateResult {\n const layout = this.layout ?? 'icon';\n let label = '';\n let icon = '';\n\n if (this.__state === 'busy') {\n label = 'copying';\n icon = 'icons:hourglass-empty';\n } else if (this.__state === 'fail') {\n label = 'failed_to_copy';\n icon = 'icons:error-outline';\n } else if (this.__state === 'done') {\n label = 'done';\n icon = 'icons:done';\n } else {\n label = 'click_to_copy';\n icon = this.icon ?? 'icons:content-copy';\n }\n\n return html`\n ${layout === 'icon' || layout === 'icon-inline'\n ? html`\n <button\n id=\"trigger\"\n class=${classMap({ 'icon-button': true, 'inline': layout === 'icon-inline' })}\n ?disabled=${this.disabled}\n @click=${this.__copy}\n >\n <iron-icon icon=${icon}></iron-icon>\n </button>\n <vcf-tooltip\n position=\"bottom\"\n style=\"--lumo-base-color: black\"\n theme=\"light\"\n for=\"trigger\"\n >\n <span class=\"text-s\" style=\"color: white\">\n <foxy-i18n infer=\"\" key=${label}></foxy-i18n>\n </span>\n </vcf-tooltip>\n `\n : html`\n <vaadin-button\n theme=${ifDefined(this.theme ?? void 0)}\n ?disabled=${this.disabled}\n @click=${this.__copy}\n >\n <foxy-i18n infer=\"\" key=${label}></foxy-i18n>\n ${layout === 'complete'\n ? html`\n <iron-icon\n style=\"--lumo-icon-size-m: 1em; transform: translateY(-0.1em)\"\n icon=${icon}\n >\n </iron-icon>\n `\n : ''}\n </vaadin-button>\n `}\n `;\n }\n\n private __copy() {\n if (this.__state === 'idle') {\n this.__state = 'busy';\n\n navigator.clipboard\n .writeText(this.text ?? '')\n .then(() => (this.__state = 'done'))\n .catch(() => (this.__state = 'fail'))\n .then(() => setTimeout(() => (this.__state = 'idle'), 2000));\n }\n }\n}\n"]}
@@ -67,9 +67,11 @@ export declare class QueryBuilder extends Base {
67
67
  docsHref: string | null;
68
68
  /** Filter options in Simple Mode and autocomplete suggestions in Advanced Mode. */
69
69
  options: Option[] | null;
70
- /** Current value as hAPI filter string. */
71
- value: string | null;
72
70
  private __isAdvancedMode;
71
+ private __reportedValue;
72
+ private __displayedValue;
73
+ get value(): string | null;
74
+ set value(newValue: string | null);
73
75
  render(): TemplateResult;
74
76
  private get __isSimpleModeSupported();
75
77
  private get __simpleModeOptions();
@@ -38,9 +38,9 @@ export class QueryBuilder extends Base {
38
38
  this.docsHref = null;
39
39
  /** Filter options in Simple Mode and autocomplete suggestions in Advanced Mode. */
40
40
  this.options = null;
41
- /** Current value as hAPI filter string. */
42
- this.value = null;
43
41
  this.__isAdvancedMode = false;
42
+ this.__reportedValue = null;
43
+ this.__displayedValue = null;
44
44
  }
45
45
  /** Returns zoom value for a filter query. */
46
46
  static zoom(value) {
@@ -55,23 +55,43 @@ export class QueryBuilder extends Base {
55
55
  operators: { type: Array },
56
56
  docsHref: { attribute: 'docs-href' },
57
57
  options: { type: Array },
58
- value: {},
58
+ value: { noAccessor: true },
59
+ __reportedValue: { attribute: false },
60
+ __displayedValue: { attribute: false },
59
61
  __isAdvancedMode: { attribute: false },
60
62
  };
61
63
  }
62
64
  static get styles() {
63
65
  return [super.styles, styles];
64
66
  }
67
+ get value() {
68
+ return this.__reportedValue;
69
+ }
70
+ set value(newValue) {
71
+ this.__reportedValue = newValue;
72
+ this.__displayedValue = newValue;
73
+ }
65
74
  render() {
66
75
  var _a, _b, _c, _d, _e, _f;
67
76
  const isSimpleModeSupported = this.__isSimpleModeSupported;
68
- const parsedValue = parse((_a = this.value) !== null && _a !== void 0 ? _a : '');
77
+ const parsedValue = parse((_a = this.__displayedValue) !== null && _a !== void 0 ? _a : '');
69
78
  const operators = (_b = this.operators) !== null && _b !== void 0 ? _b : [];
70
79
  const options = (_c = this.options) !== null && _c !== void 0 ? _c : [];
71
80
  const t = this.t.bind(this);
72
81
  const onChange = (newParsedValue) => {
73
- this.value = stringify(newParsedValue, this.disableZoom);
74
- this.dispatchEvent(new QueryBuilder.ChangeEvent('change'));
82
+ this.__displayedValue = stringify(newParsedValue, this.disableZoom);
83
+ const isValid = newParsedValue.every(ruleOrGroup => {
84
+ if (Array.isArray(ruleOrGroup)) {
85
+ return ruleOrGroup.every(rule => !rule.invalid);
86
+ }
87
+ else {
88
+ return !ruleOrGroup.invalid;
89
+ }
90
+ });
91
+ if (isValid) {
92
+ this.__reportedValue = this.__displayedValue;
93
+ this.dispatchEvent(new QueryBuilder.ChangeEvent('change'));
94
+ }
75
95
  };
76
96
  // This will trigger a re-render but is necessary to stay in the advanced mode once the support
77
97
  // for simple mode is available again.
@@ -168,7 +188,7 @@ export class QueryBuilder extends Base {
168
188
  return false;
169
189
  if (this.options.length === 0)
170
190
  return false;
171
- const parsedValue = parse((_a = this.value) !== null && _a !== void 0 ? _a : '');
191
+ const parsedValue = parse((_a = this.__displayedValue) !== null && _a !== void 0 ? _a : '');
172
192
  if (parsedValue.length === 0)
173
193
  return true;
174
194
  return parsedValue.every(entry => {