@warp-ds/elements 2.9.1-next.1 → 2.9.1-next.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 (108) hide show
  1. package/dist/custom-elements.json +21 -23
  2. package/dist/docs/attention/api.md +6 -3
  3. package/dist/docs/attention/attention.md +6 -3
  4. package/dist/docs/slider-thumb/api.md +0 -24
  5. package/dist/docs/slider-thumb/slider-thumb.md +0 -24
  6. package/dist/index.d.ts +0 -18
  7. package/dist/packages/affix/affix.js +11 -12
  8. package/dist/packages/affix/affix.js.map +4 -4
  9. package/dist/packages/alert/alert.d.ts +1 -1
  10. package/dist/packages/alert/alert.js.map +1 -1
  11. package/dist/packages/attention/attention.d.ts +3 -2
  12. package/dist/packages/attention/attention.js +27 -28
  13. package/dist/packages/attention/attention.js.map +4 -4
  14. package/dist/packages/breadcrumbs/breadcrumbs.js +7 -8
  15. package/dist/packages/breadcrumbs/breadcrumbs.js.map +4 -4
  16. package/dist/packages/button/button.d.ts +4 -2
  17. package/dist/packages/button/button.js +14 -15
  18. package/dist/packages/button/button.js.map +4 -4
  19. package/dist/packages/card/card.js +8 -9
  20. package/dist/packages/card/card.js.map +4 -4
  21. package/dist/packages/checkbox/checkbox.d.ts +2 -0
  22. package/dist/packages/checkbox/checkbox.js +3 -3
  23. package/dist/packages/checkbox/checkbox.js.map +2 -2
  24. package/dist/packages/checkbox/checkbox.test.js +20 -0
  25. package/dist/packages/checkbox-group/checkbox-group.d.ts +2 -0
  26. package/dist/packages/checkbox-group/checkbox-group.js +15 -16
  27. package/dist/packages/checkbox-group/checkbox-group.js.map +4 -4
  28. package/dist/packages/checkbox-group/locales/da/messages.mjs +1 -1
  29. package/dist/packages/checkbox-group/locales/en/messages.mjs +1 -1
  30. package/dist/packages/checkbox-group/locales/fi/messages.mjs +1 -1
  31. package/dist/packages/checkbox-group/locales/nb/messages.mjs +1 -1
  32. package/dist/packages/checkbox-group/locales/sv/messages.mjs +1 -1
  33. package/dist/packages/combobox/combobox.js +13 -14
  34. package/dist/packages/combobox/combobox.js.map +4 -4
  35. package/dist/packages/combobox/locales/da/messages.mjs +1 -1
  36. package/dist/packages/combobox/locales/en/messages.mjs +1 -1
  37. package/dist/packages/combobox/locales/fi/messages.mjs +1 -1
  38. package/dist/packages/combobox/locales/nb/messages.mjs +1 -1
  39. package/dist/packages/combobox/locales/sv/messages.mjs +1 -1
  40. package/dist/packages/datepicker/datepicker.d.ts +2 -0
  41. package/dist/packages/datepicker/datepicker.js +51 -52
  42. package/dist/packages/datepicker/datepicker.js.map +4 -4
  43. package/dist/packages/datepicker/datepicker.stories.js +8 -1
  44. package/dist/packages/datepicker/datepicker.test.js +23 -1
  45. package/dist/packages/datepicker/locales/da/messages.mjs +1 -1
  46. package/dist/packages/datepicker/locales/en/messages.mjs +1 -1
  47. package/dist/packages/datepicker/locales/fi/messages.mjs +1 -1
  48. package/dist/packages/datepicker/locales/nb/messages.mjs +1 -1
  49. package/dist/packages/datepicker/locales/sv/messages.mjs +1 -1
  50. package/dist/packages/link/link.d.ts +2 -0
  51. package/dist/packages/modal-header/modal-header.js +13 -14
  52. package/dist/packages/modal-header/modal-header.js.map +4 -4
  53. package/dist/packages/page-indicator/page-indicator.js +7 -8
  54. package/dist/packages/page-indicator/page-indicator.js.map +4 -4
  55. package/dist/packages/pagination/locales/da/messages.mjs +1 -1
  56. package/dist/packages/pagination/locales/en/messages.mjs +1 -1
  57. package/dist/packages/pagination/locales/fi/messages.mjs +1 -1
  58. package/dist/packages/pagination/locales/nb/messages.mjs +1 -1
  59. package/dist/packages/pagination/locales/sv/messages.mjs +1 -1
  60. package/dist/packages/pagination/pagination.js +31 -32
  61. package/dist/packages/pagination/pagination.js.map +4 -4
  62. package/dist/packages/pill/pill.js +11 -12
  63. package/dist/packages/pill/pill.js.map +4 -4
  64. package/dist/packages/radio/radio.d.ts +2 -0
  65. package/dist/packages/radio/radio.js +2 -2
  66. package/dist/packages/radio/radio.js.map +2 -2
  67. package/dist/packages/radio/radio.test.js +21 -1
  68. package/dist/packages/radio-group/radio-group.d.ts +2 -0
  69. package/dist/packages/radio-group/radio-group.js +17 -18
  70. package/dist/packages/radio-group/radio-group.js.map +4 -4
  71. package/dist/packages/select/select.js +19 -20
  72. package/dist/packages/select/select.js.map +4 -4
  73. package/dist/packages/select/select.stories.js +7 -5
  74. package/dist/packages/select/select.test.js +23 -2
  75. package/dist/packages/slider/locales/da/messages.mjs +1 -1
  76. package/dist/packages/slider/locales/en/messages.mjs +1 -1
  77. package/dist/packages/slider/locales/fi/messages.mjs +1 -1
  78. package/dist/packages/slider/locales/nb/messages.mjs +1 -1
  79. package/dist/packages/slider/locales/sv/messages.mjs +1 -1
  80. package/dist/packages/slider/slider.d.ts +2 -0
  81. package/dist/packages/slider/slider.js +22 -23
  82. package/dist/packages/slider/slider.js.map +4 -4
  83. package/dist/packages/slider/slider.stories.js +6 -3
  84. package/dist/packages/slider-thumb/slider-thumb.d.ts +5 -0
  85. package/dist/packages/slider-thumb/slider-thumb.js +33 -34
  86. package/dist/packages/slider-thumb/slider-thumb.js.map +4 -4
  87. package/dist/packages/step/locales/da/messages.mjs +1 -1
  88. package/dist/packages/step/locales/en/messages.mjs +1 -1
  89. package/dist/packages/step/locales/fi/messages.mjs +1 -1
  90. package/dist/packages/step/locales/nb/messages.mjs +1 -1
  91. package/dist/packages/step/locales/sv/messages.mjs +1 -1
  92. package/dist/packages/step/step.js +11 -12
  93. package/dist/packages/step/step.js.map +4 -4
  94. package/dist/packages/switch/switch.d.ts +2 -0
  95. package/dist/packages/tab/tab.d.ts +2 -0
  96. package/dist/packages/tabs/tabs.js +1 -1
  97. package/dist/packages/tabs/tabs.js.map +3 -3
  98. package/dist/packages/textarea/textarea.d.ts +2 -0
  99. package/dist/packages/textarea/textarea.js +20 -21
  100. package/dist/packages/textarea/textarea.js.map +4 -4
  101. package/dist/packages/textfield/textfield.d.ts +2 -0
  102. package/dist/packages/textfield/textfield.js +9 -8
  103. package/dist/packages/textfield/textfield.js.map +3 -3
  104. package/dist/packages/textfield/textfield.test.js +17 -0
  105. package/dist/packages/toast/toast.js +13 -14
  106. package/dist/packages/toast/toast.js.map +4 -4
  107. package/dist/web-types.json +6 -6
  108. package/package.json +19 -19
@@ -1,7 +1,8 @@
1
1
  import { html } from 'lit';
2
- import { expect, test } from 'vitest';
2
+ import { expect, test, vi } from 'vitest';
3
3
  import { render } from 'vitest-browser-lit';
4
4
  import './radio.js';
5
+ import { userEvent } from '@vitest/browser/context';
5
6
  test('checks on click and remains checked on subsequent clicks', async () => {
6
7
  render(html `<w-radio value="alpha">Alpha</w-radio>`);
7
8
  const radio = document.querySelector('w-radio');
@@ -190,3 +191,22 @@ test('required radio reports validity based on checked state', async () => {
190
191
  await expect.poll(() => radio.reportValidity()).toBe(true);
191
192
  expect(radio.invalid).toBe(false);
192
193
  });
194
+ test('submits the associated form when radio has focus and user presses Enter', async () => {
195
+ const screen = render(html `
196
+ <form>
197
+ <w-radio name="group" value="one">One</w-radio>
198
+ <w-radio name="group" value="two">Two</w-radio>
199
+ <button type="submit">Submit</button>
200
+ </form>
201
+ `);
202
+ const onSubmit = vi.fn();
203
+ const form = document.querySelector('form');
204
+ form.addEventListener('submit', (event) => {
205
+ event.preventDefault();
206
+ onSubmit();
207
+ });
208
+ await userEvent.click(screen.getByText('One'));
209
+ await userEvent.keyboard('{Space}');
210
+ await userEvent.keyboard('{Enter}');
211
+ expect(onSubmit).toHaveBeenCalled();
212
+ });
@@ -26,6 +26,8 @@ export declare class WRadioGroup extends WRadioGroup_base {
26
26
  private unsubscribeI18n?;
27
27
  static shadowRootOptions: {
28
28
  delegatesFocus: boolean;
29
+ clonable?: boolean;
30
+ customElementRegistry?: CustomElementRegistry;
29
31
  mode: ShadowRootMode;
30
32
  serializable?: boolean;
31
33
  slotAssignment?: SlotAssignmentMode;
@@ -1,13 +1,12 @@
1
- var Be=Object.create;var se=Object.defineProperty;var ge=Object.getOwnPropertyDescriptor;var We=Object.getOwnPropertyNames;var Ze=Object.getPrototypeOf,Ge=Object.prototype.hasOwnProperty;var ve=o=>{throw TypeError(o)};var fe=(o,r)=>()=>(r||o((r={exports:{}}).exports,r),r.exports);var Ke=(o,r,e,t)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of We(r))!Ge.call(o,a)&&a!==e&&se(o,a,{get:()=>r[a],enumerable:!(t=ge(r,a))||t.enumerable});return o};var Je=(o,r,e)=>(e=o!=null?Be(Ze(o)):{},Ke(r||!o||!o.__esModule?se(e,"default",{value:o,enumerable:!0}):e,o));var f=(o,r,e,t)=>{for(var a=t>1?void 0:t?ge(r,e):r,i=o.length-1,n;i>=0;i--)(n=o[i])&&(a=(t?n(r,e,a):n(a))||a);return t&&a&&se(r,e,a),a};var me=(o,r,e)=>r.has(o)||ve("Cannot "+e);var H=(o,r,e)=>(me(o,r,"read from private field"),e?e.call(o):r.get(o)),Z=(o,r,e)=>r.has(o)?ve("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(o):r.set(o,e),I=(o,r,e,t)=>(me(o,r,"write to private field"),t?t.call(o,e):r.set(o,e),e);var we=fe(O=>{"use strict";Object.defineProperty(O,"__esModule",{value:!0});O.errorMessages=O.ErrorType=void 0;var j;(function(o){o.MalformedUnicode="MALFORMED_UNICODE",o.MalformedHexadecimal="MALFORMED_HEXADECIMAL",o.CodePointLimit="CODE_POINT_LIMIT",o.OctalDeprecation="OCTAL_DEPRECATION",o.EndOfString="END_OF_STRING"})(j=O.ErrorType||(O.ErrorType={}));O.errorMessages=new Map([[j.MalformedUnicode,"malformed Unicode character escape sequence"],[j.MalformedHexadecimal,"malformed hexadecimal character escape sequence"],[j.CodePointLimit,"Unicode codepoint must not be greater than 0x10FFFF in escape sequence"],[j.OctalDeprecation,'"0"-prefixed octal literals and octal escape sequences are deprecated; for octal literals use the "0o" prefix instead'],[j.EndOfString,"malformed escape sequence at end of string"]])});var ye=fe(V=>{"use strict";Object.defineProperty(V,"__esModule",{value:!0});V.unraw=V.errorMessages=V.ErrorType=void 0;var w=we();Object.defineProperty(V,"ErrorType",{enumerable:!0,get:function(){return w.ErrorType}});Object.defineProperty(V,"errorMessages",{enumerable:!0,get:function(){return w.errorMessages}});function Qe(o){return!o.match(/[^a-f0-9]/i)?parseInt(o,16):NaN}function G(o,r,e){let t=Qe(o);if(Number.isNaN(t)||e!==void 0&&e!==o.length)throw new SyntaxError(w.errorMessages.get(r));return t}function er(o){let r=G(o,w.ErrorType.MalformedHexadecimal,2);return String.fromCharCode(r)}function xe(o,r){let e=G(o,w.ErrorType.MalformedUnicode,4);if(r!==void 0){let t=G(r,w.ErrorType.MalformedUnicode,4);return String.fromCharCode(e,t)}return String.fromCharCode(e)}function rr(o){return o.charAt(0)==="{"&&o.charAt(o.length-1)==="}"}function tr(o){if(!rr(o))throw new SyntaxError(w.errorMessages.get(w.ErrorType.MalformedUnicode));let r=o.slice(1,-1),e=G(r,w.ErrorType.MalformedUnicode);try{return String.fromCodePoint(e)}catch(t){throw t instanceof RangeError?new SyntaxError(w.errorMessages.get(w.ErrorType.CodePointLimit)):t}}function or(o,r=!1){if(r)throw new SyntaxError(w.errorMessages.get(w.ErrorType.OctalDeprecation));let e=parseInt(o,8);return String.fromCharCode(e)}var ar=new Map([["b","\b"],["f","\f"],["n",`
2
- `],["r","\r"],["t"," "],["v","\v"],["0","\0"]]);function ir(o){return ar.get(o)||o}var sr=/\\(?:(\\)|x([\s\S]{0,2})|u(\{[^}]*\}?)|u([\s\S]{4})\\u([^{][\s\S]{0,3})|u([\s\S]{0,4})|([0-3]?[0-7]{1,2})|([\s\S])|$)/g;function ke(o,r=!1){return o.replace(sr,function(e,t,a,i,n,s,l,u,b){if(t!==void 0)return"\\";if(a!==void 0)return er(a);if(i!==void 0)return tr(i);if(n!==void 0)return xe(n,s);if(l!==void 0)return xe(l);if(u==="0")return"\0";if(u!==void 0)return or(u,!r);if(b!==void 0)return ir(b);throw new SyntaxError(w.errorMessages.get(w.ErrorType.EndOfString))})}V.unraw=ke;V.default=ke});import{html as te,LitElement as Ye}from"lit";var Ee=Je(ye(),1);var F=o=>typeof o=="string",nr=o=>typeof o=="function",_e=new Map,Me="en";function ce(o){return[...Array.isArray(o)?o:[o],Me]}function he(o,r,e){let t=ce(o);e||(e="default");let a;if(typeof e=="string")switch(a={day:"numeric",month:"short",year:"numeric"},e){case"full":a.weekday="long";case"long":a.month="long";break;case"short":a.month="numeric";break}else a=e;return K(()=>J("date",t,e),()=>new Intl.DateTimeFormat(t,a)).format(F(r)?new Date(r):r)}function lr(o,r,e){let t;if(e||(e="default"),typeof e=="string")switch(t={second:"numeric",minute:"numeric",hour:"numeric"},e){case"full":case"long":t.timeZoneName="short";break;case"short":delete t.second}else t=e;return he(o,r,t)}function ne(o,r,e){let t=ce(o);return K(()=>J("number",t,e),()=>new Intl.NumberFormat(t,e)).format(r)}function Ce(o,r,e,{offset:t=0,...a}){var s,l;let i=ce(o),n=r?K(()=>J("plural-ordinal",i),()=>new Intl.PluralRules(i,{type:"ordinal"})):K(()=>J("plural-cardinal",i),()=>new Intl.PluralRules(i,{type:"cardinal"}));return(l=(s=a[e])!=null?s:a[n.select(e-t)])!=null?l:a.other}function K(o,r){let e=o(),t=_e.get(e);return t||(t=r(),_e.set(e,t)),t}function J(o,r,e){let t=r.join("-");return`${o}-${t}-${JSON.stringify(e)}`}var ze=/\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/,Ve="%__lingui_octothorpe__%",dr=(o,r,e={})=>{let t=r||o,a=n=>typeof n=="object"?n:e[n],i=(n,s)=>{let l=Object.keys(e).length?a("number"):void 0,u=ne(t,n,l);return s.replace(new RegExp(Ve,"g"),u)};return{plural:(n,s)=>{let{offset:l=0}=s,u=Ce(t,!1,n,s);return i(n-l,u)},selectordinal:(n,s)=>{let{offset:l=0}=s,u=Ce(t,!0,n,s);return i(n-l,u)},select:cr,number:(n,s)=>ne(t,n,a(s)||{style:s}),date:(n,s)=>he(t,n,a(s)||s),time:(n,s)=>lr(t,n,a(s)||s)}},cr=(o,r)=>{var e;return(e=r[o])!=null?e:r.other};function hr(o,r,e){return(t={},a)=>{let i=dr(r,e,a),n=(l,u=!1)=>Array.isArray(l)?l.reduce((b,p)=>{if(p==="#"&&u)return b+Ve;if(F(p))return b+p;let[T,x,M]=p,S={};x==="plural"||x==="selectordinal"||x==="select"?Object.entries(M).forEach(([L,$])=>{S[L]=n($,x==="plural"||x==="selectordinal")}):S=M;let k;if(x){let L=i[x];k=L(t[T],S)}else k=t[T];return k==null?b:b+k},""):l,s=n(o);return F(s)&&ze.test(s)?(0,Ee.unraw)(s):F(s)?s:s?String(s):""}}var ur=Object.defineProperty,br=(o,r,e)=>r in o?ur(o,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[r]=e,pr=(o,r,e)=>(br(o,typeof r!="symbol"?r+"":r,e),e),le=class{constructor(){pr(this,"_events",{})}on(r,e){var a;var t;return(a=(t=this._events)[r])!=null||(t[r]=[]),this._events[r].push(e),()=>this.removeListener(r,e)}removeListener(r,e){let t=this._getListeners(r);if(!t)return;let a=t.indexOf(e);~a&&t.splice(a,1)}emit(r,...e){let t=this._getListeners(r);t&&t.map(a=>a.apply(this,e))}_getListeners(r){let e=this._events[r];return Array.isArray(e)?e:!1}},gr=Object.defineProperty,vr=(o,r,e)=>r in o?gr(o,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[r]=e,N=(o,r,e)=>(vr(o,typeof r!="symbol"?r+"":r,e),e),de=class extends le{constructor(r){var e;super(),N(this,"_locale",""),N(this,"_locales"),N(this,"_localeData",{}),N(this,"_messages",{}),N(this,"_missing"),N(this,"_messageCompiler"),N(this,"t",this._.bind(this)),r.missing!=null&&(this._missing=r.missing),r.messages!=null&&this.load(r.messages),r.localeData!=null&&this.loadLocaleData(r.localeData),(typeof r.locale=="string"||r.locales)&&this.activate((e=r.locale)!=null?e:Me,r.locales)}get locale(){return this._locale}get locales(){return this._locales}get messages(){var r;return(r=this._messages[this._locale])!=null?r:{}}get localeData(){var r;return(r=this._localeData[this._locale])!=null?r:{}}_loadLocaleData(r,e){let t=this._localeData[r];t?Object.assign(t,e):this._localeData[r]=e}setMessagesCompiler(r){return this._messageCompiler=r,this}loadLocaleData(r,e){typeof r=="string"?this._loadLocaleData(r,e):Object.keys(r).forEach(t=>this._loadLocaleData(t,r[t])),this.emit("change")}_load(r,e){let t=this._messages[r];t?Object.assign(t,e):this._messages[r]=e}load(r,e){typeof r=="string"&&typeof e=="object"?this._load(r,e):Object.entries(r).forEach(([t,a])=>this._load(t,a)),this.emit("change")}loadAndActivate({locale:r,locales:e,messages:t}){this._locale=r,this._locales=e||void 0,this._messages[this._locale]=t,this.emit("change")}activate(r,e){this._locale=r,this._locales=e,this.emit("change")}_(r,e,t){if(!this.locale)throw new Error("Lingui: Attempted to call a translation function without setting a locale.\nMake sure to call `i18n.activate(locale)` before using Lingui functions.\nThis issue may also occur due to a race condition in your initialization logic.");let a=t==null?void 0:t.message;r||(r=""),F(r)||(e=r.values||e,a=r.message,r=r.id);let i=this.messages[r],n=i===void 0,s=this._missing;if(s&&n)return nr(s)?s(this._locale,r):s;n&&this.emit("missing",{id:r,locale:this._locale});let l=i||a||r;return F(l)&&(this._messageCompiler?l=this._messageCompiler(l):console.warn(`Uncompiled message detected! Message:
1
+ var Le=Object.defineProperty;var Ne=Object.getOwnPropertyDescriptor;var de=a=>{throw TypeError(a)};var m=(a,r,e,t)=>{for(var o=t>1?void 0:t?Ne(r,e):r,i=a.length-1,n;i>=0;i--)(n=a[i])&&(o=(t?n(r,e,o):n(o))||o);return t&&o&&Le(r,e,o),o};var ce=(a,r,e)=>r.has(a)||de("Cannot "+e);var O=(a,r,e)=>(ce(a,r,"read from private field"),e?e.call(a):r.get(a)),U=(a,r,e)=>r.has(a)?de("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(a):r.set(a,e),I=(a,r,e,t)=>(ce(a,r,"write to private field"),t?t.call(a,e):r.set(a,e),e);import{html as K,LitElement as Ae}from"lit";var S=a=>typeof a=="string",De=a=>typeof a=="function",he=new Map,be="en";function ae(a){return[...Array.isArray(a)?a:[a],be]}function ie(a,r,e){let t=ae(a);e||(e="default");let o;if(typeof e=="string")switch(o={day:"numeric",month:"short",year:"numeric"},e){case"full":o.weekday="long";case"long":o.month="long";break;case"short":o.month="numeric";break}else o=e;return X(()=>W("date",t,e),()=>new Intl.DateTimeFormat(t,o)).format(S(r)?new Date(r):r)}function Oe(a,r,e){let t;if(e||(e="default"),typeof e=="string")switch(t={second:"numeric",minute:"numeric",hour:"numeric"},e){case"full":case"long":t.timeZoneName="short";break;case"short":delete t.second}else t=e;return ie(a,r,t)}function re(a,r,e){let t=ae(a);return X(()=>W("number",t,e),()=>new Intl.NumberFormat(t,e)).format(r)}function ue(a,r,e,{offset:t=0,...o}){var s,d;let i=ae(a),n=r?X(()=>W("plural-ordinal",i),()=>new Intl.PluralRules(i,{type:"ordinal"})):X(()=>W("plural-cardinal",i),()=>new Intl.PluralRules(i,{type:"cardinal"}));return(d=(s=o[e])!=null?s:o[n.select(e-t)])!=null?d:o.other}function X(a,r){let e=a(),t=he.get(e);return t||(t=r(),he.set(e,t)),t}function W(a,r,e){let t=r.join("-");return`${a}-${t}-${JSON.stringify(e)}`}var pe=/\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/,ge=a=>a.replace(/\\u([a-fA-F0-9]{4})|\\x([a-fA-F0-9]{2})/g,(r,e,t)=>{if(e){let o=parseInt(e,16);return String.fromCharCode(o)}else{let o=parseInt(t,16);return String.fromCharCode(o)}}),ve="%__lingui_octothorpe__%",qe=(a,r,e={})=>{let t=r||a,o=n=>typeof n=="object"?n:e[n],i=(n,s)=>{let d=Object.keys(e).length?o("number"):void 0,u=re(t,n,d);return s.replace(new RegExp(ve,"g"),u)};return{plural:(n,s)=>{let{offset:d=0}=s,u=ue(t,!1,n,s);return i(n-d,u)},selectordinal:(n,s)=>{let{offset:d=0}=s,u=ue(t,!0,n,s);return i(n-d,u)},select:Pe,number:(n,s)=>re(t,n,o(s)||{style:s}),date:(n,s)=>ie(t,n,o(s)||s),time:(n,s)=>Oe(t,n,o(s)||s)}},Pe=(a,r)=>{var e;return(e=r[a])!=null?e:r.other};function je(a,r,e){return(t={},o)=>{let i=qe(r,e,o),n=(d,u=!1)=>Array.isArray(d)?d.reduce((b,p)=>{if(p==="#"&&u)return b+ve;if(S(p))return b+p;let[V,w,E]=p,M={};w==="plural"||w==="selectordinal"||w==="select"?Object.entries(E).forEach(([A,P])=>{M[A]=n(P,w==="plural"||w==="selectordinal")}):M=E;let x;if(w){let A=i[w];x=A(t[V],M)}else x=t[V];return x==null?b:b+x},""):d,s=n(a);return S(s)&&pe.test(s)?ge(s):S(s)?s:s?String(s):""}}var $e=Object.defineProperty,Ye=(a,r,e)=>r in a?$e(a,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[r]=e,He=(a,r,e)=>(Ye(a,typeof r!="symbol"?r+"":r,e),e),te=class{constructor(){He(this,"_events",{})}on(r,e){var o;var t;return(o=(t=this._events)[r])!=null||(t[r]=[]),this._events[r].push(e),()=>this.removeListener(r,e)}removeListener(r,e){let t=this._getListeners(r);if(!t)return;let o=t.indexOf(e);~o&&t.splice(o,1)}emit(r,...e){let t=this._getListeners(r);t&&t.map(o=>o.apply(this,e))}_getListeners(r){let e=this._events[r];return Array.isArray(e)?e:!1}},Ue=Object.defineProperty,Xe=(a,r,e)=>r in a?Ue(a,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[r]=e,R=(a,r,e)=>(Xe(a,typeof r!="symbol"?r+"":r,e),e),oe=class extends te{constructor(r){var e;super(),R(this,"_locale",""),R(this,"_locales"),R(this,"_localeData",{}),R(this,"_messages",{}),R(this,"_missing"),R(this,"_messageCompiler"),R(this,"t",this._.bind(this)),r.missing!=null&&(this._missing=r.missing),r.messages!=null&&this.load(r.messages),r.localeData!=null&&this.loadLocaleData(r.localeData),(typeof r.locale=="string"||r.locales)&&this.activate((e=r.locale)!=null?e:be,r.locales)}get locale(){return this._locale}get locales(){return this._locales}get messages(){var r;return(r=this._messages[this._locale])!=null?r:{}}get localeData(){var r;return(r=this._localeData[this._locale])!=null?r:{}}_loadLocaleData(r,e){let t=this._localeData[r];t?Object.assign(t,e):this._localeData[r]=e}setMessagesCompiler(r){return this._messageCompiler=r,this}loadLocaleData(r,e){typeof r=="string"?this._loadLocaleData(r,e):Object.keys(r).forEach(t=>this._loadLocaleData(t,r[t])),this.emit("change")}_load(r,e){let t=this._messages[r];t?Object.assign(t,e):this._messages[r]=e}load(r,e){typeof r=="string"&&typeof e=="object"?this._load(r,e):Object.entries(r).forEach(([t,o])=>this._load(t,o)),this.emit("change")}loadAndActivate({locale:r,locales:e,messages:t}){this._locale=r,this._locales=e||void 0,this._messages[this._locale]=t,this.emit("change")}activate(r,e){this._locale=r,this._locales=e,this.emit("change")}_(r,e,t){if(!this.locale)throw new Error("Lingui: Attempted to call a translation function without setting a locale.\nMake sure to call `i18n.activate(locale)` before using Lingui functions.\nThis issue may also occur due to a race condition in your initialization logic.");let o=t==null?void 0:t.message;r||(r=""),S(r)||(e=r.values||e,o=r.message,r=r.id);let i=this.messages[r],n=i===void 0,s=this._missing;if(s&&n)return De(s)?s(this._locale,r):s;n&&this.emit("missing",{id:r,locale:this._locale});let d=i||o||r;return S(d)&&(this._messageCompiler?d=this._messageCompiler(d):console.warn(`Uncompiled message detected! Message:
3
2
 
4
- > ${l}
3
+ > ${d}
5
4
 
6
5
  That means you use raw catalog or your catalog doesn't have a translation for the message and fallback was used.
7
6
  ICU features such as interpolation and plurals will not work properly for that message.
8
7
 
9
8
  Please compile your catalog first.
10
- `)),F(l)&&ze.test(l)?JSON.parse(`"${l}"`):F(l)?l:hr(l,this._locale,this._locales)(e,t==null?void 0:t.formats)}date(r,e){return he(this._locales||this._locale,r,e)}number(r,e){return ne(this._locales||this._locale,r,e)}};function fr(o={}){return new de(o)}var y=fr();var h=function(o,r,e,t){if(e==="a"&&!t)throw new TypeError("Private accessor was defined without a getter");if(typeof r=="function"?o!==r||!t:!r.has(o))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?t:e==="a"?t.call(o):t?t.value:r.get(o)},v=function(o,r,e,t,a){if(t==="m")throw new TypeError("Private method is not writable");if(t==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof r=="function"?o!==r||!a:!r.has(o))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t==="a"?a.call(o,e):a?a.value=e:r.set(o,e),e};function Q(o){var r,e,t,a,i,n,s,l,u,b,p,T,x,M,S,k,L,$,oe;class Xe extends o{constructor(...d){var c,g,m;super(...d),r.add(this),this.internals=this.attachInternals(),e.set(this,!1),t.set(this,!1),a.set(this,!1),i.set(this,void 0),n.set(this,void 0),s.set(this,!0),u.set(this,""),b.set(this,()=>{v(this,a,!0,"f"),v(this,e,!0,"f"),h(this,r,"m",k).call(this)}),p.set(this,()=>{v(this,e,!1,"f"),h(this,r,"m",L).call(this,this.shouldFormValueUpdate()?h(this,u,"f"):""),!this.validity.valid&&h(this,a,"f")&&v(this,t,!0,"f");let z=h(this,r,"m",k).call(this);this.validationMessageCallback&&this.validationMessageCallback(z?this.internals.validationMessage:"")}),T.set(this,()=>{var z;h(this,s,"f")&&this.validationTarget&&(this.internals.setValidity(this.validity,this.validationMessage,this.validationTarget),v(this,s,!1,"f")),v(this,a,!0,"f"),v(this,t,!0,"f"),h(this,r,"m",k).call(this),(z=this===null||this===void 0?void 0:this.validationMessageCallback)===null||z===void 0||z.call(this,this.showError?this.internals.validationMessage:"")}),x.set(this,void 0),M.set(this,!1),S.set(this,Promise.resolve()),(c=this.addEventListener)===null||c===void 0||c.call(this,"focus",h(this,b,"f")),(g=this.addEventListener)===null||g===void 0||g.call(this,"blur",h(this,p,"f")),(m=this.addEventListener)===null||m===void 0||m.call(this,"invalid",h(this,T,"f")),this.setValue(null)}static get formAssociated(){return!0}static get validators(){return this.formControlValidators||[]}static get observedAttributes(){let d=this.validators.map(m=>m.attribute).flat(),c=super.observedAttributes||[];return[...new Set([...c,...d])]}static getValidator(d){return this.validators.find(c=>c.attribute===d)||null}static getValidators(d){return this.validators.filter(c=>{var g;if(c.attribute===d||!((g=c.attribute)===null||g===void 0)&&g.includes(d))return!0})}get form(){return this.internals.form}get showError(){return h(this,r,"m",k).call(this)}checkValidity(){return this.internals.checkValidity()}get validity(){return this.internals.validity}get validationMessage(){return this.internals.validationMessage}attributeChangedCallback(d,c,g){var m;(m=super.attributeChangedCallback)===null||m===void 0||m.call(this,d,c,g);let X=this.constructor.getValidators(d);X!=null&&X.length&&this.validationTarget&&this.setValue(h(this,u,"f"))}setValue(d){var c;v(this,t,!1,"f"),(c=this.validationMessageCallback)===null||c===void 0||c.call(this,""),v(this,u,d,"f");let m=this.shouldFormValueUpdate()?d:null;this.internals.setFormValue(m),h(this,r,"m",L).call(this,m),this.valueChangedCallback&&this.valueChangedCallback(m),h(this,r,"m",k).call(this)}shouldFormValueUpdate(){return!0}get validationComplete(){return new Promise(d=>d(h(this,S,"f")))}formResetCallback(){var d,c;v(this,a,!1,"f"),v(this,t,!1,"f"),h(this,r,"m",k).call(this),(d=this.resetFormControl)===null||d===void 0||d.call(this),(c=this.validationMessageCallback)===null||c===void 0||c.call(this,h(this,r,"m",k).call(this)?this.validationMessage:"")}}return e=new WeakMap,t=new WeakMap,a=new WeakMap,i=new WeakMap,n=new WeakMap,s=new WeakMap,u=new WeakMap,b=new WeakMap,p=new WeakMap,T=new WeakMap,x=new WeakMap,M=new WeakMap,S=new WeakMap,r=new WeakSet,l=function(){let d=this.getRootNode(),c=`${this.localName}[name="${this.getAttribute("name")}"]`;return d.querySelectorAll(c)},k=function(){if(this.hasAttribute("disabled"))return!1;let d=h(this,t,"f")||h(this,a,"f")&&!this.validity.valid&&!h(this,e,"f");return d&&this.internals.states?this.internals.states.add("--show-error"):this.internals.states&&this.internals.states.delete("--show-error"),d},L=function(d){let c=this.constructor,g={},m=c.validators,z=[],X=m.some(E=>E.isValid instanceof Promise);h(this,M,"f")||(v(this,S,new Promise(E=>{v(this,x,E,"f")}),"f"),v(this,M,!0,"f")),h(this,i,"f")&&(h(this,i,"f").abort(),v(this,n,h(this,i,"f"),"f"));let B=new AbortController;v(this,i,B,"f");let W,pe=!1;m.length&&(m.forEach(E=>{let ae=E.key||"customError",P=E.isValid(this,d,B.signal);P instanceof Promise?(z.push(P),P.then(ie=>{ie!=null&&(g[ae]=!ie,W=h(this,r,"m",oe).call(this,E,d),h(this,r,"m",$).call(this,g,W))})):(g[ae]=!P,this.validity[ae]!==!P&&(pe=!0),!P&&!W&&(W=h(this,r,"m",oe).call(this,E,d)))}),Promise.allSettled(z).then(()=>{var E;B!=null&&B.signal.aborted||(v(this,M,!1,"f"),(E=h(this,x,"f"))===null||E===void 0||E.call(this))}),(pe||!X)&&h(this,r,"m",$).call(this,g,W))},$=function(d,c){if(this.validationTarget)this.internals.setValidity(d,c,this.validationTarget),v(this,s,!1,"f");else{if(this.internals.setValidity(d,c),this.internals.validity.valid)return;v(this,s,!0,"f")}},oe=function(d,c){if(this.validityCallback){let g=this.validityCallback(d.key||"customError");if(g)return g}return d.message instanceof Function?d.message(this,c):d.message},Xe}import{property as q,state as zr}from"lit/decorators.js";import{ifDefined as be}from"lit/directives/if-defined.js";import{html as xr,LitElement as Fe}from"lit";import{property as A}from"lit/decorators.js";import{css as Te}from"lit";var Se=Te`
9
+ `)),S(d)&&pe.test(d)?ge(d):S(d)?d:je(d,this._locale,this._locales)(e,t==null?void 0:t.formats)}date(r,e){return ie(this._locales||this._locale,r,e)}number(r,e){return re(this._locales||this._locale,r,e)}};function We(a={}){return new oe(a)}var k=We();var h=function(a,r,e,t){if(e==="a"&&!t)throw new TypeError("Private accessor was defined without a getter");if(typeof r=="function"?a!==r||!t:!r.has(a))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?t:e==="a"?t.call(a):t?t.value:r.get(a)},v=function(a,r,e,t,o){if(t==="m")throw new TypeError("Private method is not writable");if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof r=="function"?a!==r||!o:!r.has(a))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t==="a"?o.call(a,e):o?o.value=e:r.set(a,e),e};function B(a){var r,e,t,o,i,n,s,d,u,b,p,V,w,E,M,x,A,P,J;class Re extends a{constructor(...l){var c,g,f;super(...l),r.add(this),this.internals=this.attachInternals(),e.set(this,!1),t.set(this,!1),o.set(this,!1),i.set(this,void 0),n.set(this,void 0),s.set(this,!0),u.set(this,""),b.set(this,()=>{v(this,o,!0,"f"),v(this,e,!0,"f"),h(this,r,"m",x).call(this)}),p.set(this,()=>{v(this,e,!1,"f"),h(this,r,"m",A).call(this,this.shouldFormValueUpdate()?h(this,u,"f"):""),!this.validity.valid&&h(this,o,"f")&&v(this,t,!0,"f");let z=h(this,r,"m",x).call(this);this.validationMessageCallback&&this.validationMessageCallback(z?this.internals.validationMessage:"")}),V.set(this,()=>{var z;h(this,s,"f")&&this.validationTarget&&(this.internals.setValidity(this.validity,this.validationMessage,this.validationTarget),v(this,s,!1,"f")),v(this,o,!0,"f"),v(this,t,!0,"f"),h(this,r,"m",x).call(this),(z=this===null||this===void 0?void 0:this.validationMessageCallback)===null||z===void 0||z.call(this,this.showError?this.internals.validationMessage:"")}),w.set(this,void 0),E.set(this,!1),M.set(this,Promise.resolve()),(c=this.addEventListener)===null||c===void 0||c.call(this,"focus",h(this,b,"f")),(g=this.addEventListener)===null||g===void 0||g.call(this,"blur",h(this,p,"f")),(f=this.addEventListener)===null||f===void 0||f.call(this,"invalid",h(this,V,"f")),this.setValue(null)}static get formAssociated(){return!0}static get validators(){return this.formControlValidators||[]}static get observedAttributes(){let l=this.validators.map(f=>f.attribute).flat(),c=super.observedAttributes||[];return[...new Set([...c,...l])]}static getValidator(l){return this.validators.find(c=>c.attribute===l)||null}static getValidators(l){return this.validators.filter(c=>{var g;if(c.attribute===l||!((g=c.attribute)===null||g===void 0)&&g.includes(l))return!0})}get form(){return this.internals.form}get showError(){return h(this,r,"m",x).call(this)}checkValidity(){return this.internals.checkValidity()}get validity(){return this.internals.validity}get validationMessage(){return this.internals.validationMessage}attributeChangedCallback(l,c,g){var f;(f=super.attributeChangedCallback)===null||f===void 0||f.call(this,l,c,g);let $=this.constructor.getValidators(l);$!=null&&$.length&&this.validationTarget&&this.setValue(h(this,u,"f"))}setValue(l){var c;v(this,t,!1,"f"),(c=this.validationMessageCallback)===null||c===void 0||c.call(this,""),v(this,u,l,"f");let f=this.shouldFormValueUpdate()?l:null;this.internals.setFormValue(f),h(this,r,"m",A).call(this,f),this.valueChangedCallback&&this.valueChangedCallback(f),h(this,r,"m",x).call(this)}shouldFormValueUpdate(){return!0}get validationComplete(){return new Promise(l=>l(h(this,M,"f")))}formResetCallback(){var l,c;v(this,o,!1,"f"),v(this,t,!1,"f"),h(this,r,"m",x).call(this),(l=this.resetFormControl)===null||l===void 0||l.call(this),(c=this.validationMessageCallback)===null||c===void 0||c.call(this,h(this,r,"m",x).call(this)?this.validationMessage:"")}}return e=new WeakMap,t=new WeakMap,o=new WeakMap,i=new WeakMap,n=new WeakMap,s=new WeakMap,u=new WeakMap,b=new WeakMap,p=new WeakMap,V=new WeakMap,w=new WeakMap,E=new WeakMap,M=new WeakMap,r=new WeakSet,d=function(){let l=this.getRootNode(),c=`${this.localName}[name="${this.getAttribute("name")}"]`;return l.querySelectorAll(c)},x=function(){if(this.hasAttribute("disabled"))return!1;let l=h(this,t,"f")||h(this,o,"f")&&!this.validity.valid&&!h(this,e,"f");return l&&this.internals.states?this.internals.states.add("--show-error"):this.internals.states&&this.internals.states.delete("--show-error"),l},A=function(l){let c=this.constructor,g={},f=c.validators,z=[],$=f.some(C=>C.isValid instanceof Promise);h(this,E,"f")||(v(this,M,new Promise(C=>{v(this,w,C,"f")}),"f"),v(this,E,!0,"f")),h(this,i,"f")&&(h(this,i,"f").abort(),v(this,n,h(this,i,"f"),"f"));let Y=new AbortController;v(this,i,Y,"f");let H,le=!1;f.length&&(f.forEach(C=>{let Q=C.key||"customError",D=C.isValid(this,l,Y.signal);D instanceof Promise?(z.push(D),D.then(ee=>{ee!=null&&(g[Q]=!ee,H=h(this,r,"m",J).call(this,C,l),h(this,r,"m",P).call(this,g,H))})):(g[Q]=!D,this.validity[Q]!==!D&&(le=!0),!D&&!H&&(H=h(this,r,"m",J).call(this,C,l)))}),Promise.allSettled(z).then(()=>{var C;Y!=null&&Y.signal.aborted||(v(this,E,!1,"f"),(C=h(this,w,"f"))===null||C===void 0||C.call(this))}),(le||!$)&&h(this,r,"m",P).call(this,g,H))},P=function(l,c){if(this.validationTarget)this.internals.setValidity(l,c,this.validationTarget),v(this,s,!1,"f");else{if(this.internals.setValidity(l,c),this.internals.validity.valid)return;v(this,s,!0,"f")}},J=function(l,c){if(this.validityCallback){let g=this.validityCallback(l.key||"customError");if(g)return g}return l.message instanceof Function?l.message(this,c):l.message},Re}import{property as N,state as or}from"lit/decorators.js";import{ifDefined as ne}from"lit/directives/if-defined.js";import{html as Ge,LitElement as xe}from"lit";import{property as T}from"lit/decorators.js";import{css as me}from"lit";var fe=me`
11
10
  *,
12
11
  :before,
13
12
  :after {
@@ -280,7 +279,7 @@ Please compile your catalog first.
280
279
  svg {
281
280
  pointer-events: none;
282
281
  }
283
- `,Or=Te`*, :before, :after {
282
+ `,cr=me`*, :before, :after {
284
283
  --w-rotate: 0;
285
284
  --w-rotate-x: 0;
286
285
  --w-rotate-y: 0;
@@ -2446,7 +2445,7 @@ Please compile your catalog first.
2446
2445
  display: none
2447
2446
  }
2448
2447
  }
2449
- `;import{css as mr}from"lit";var ee=mr`
2448
+ `;import{css as Be}from"lit";var Z=Be`
2450
2449
  :host {
2451
2450
  box-sizing: border-box !important;
2452
2451
  }
@@ -2456,7 +2455,7 @@ Please compile your catalog first.
2456
2455
  :host *::after {
2457
2456
  box-sizing: inherit !important;
2458
2457
  }
2459
- `;import{css as wr}from"lit";var Ie=wr`
2458
+ `;import{css as Ze}from"lit";var we=Ze`
2460
2459
  :host {
2461
2460
  display: inline-flex;
2462
2461
  align-items: center;
@@ -2616,12 +2615,12 @@ Please compile your catalog first.
2616
2615
  border-color: var(--_border-color-disabled);
2617
2616
  }
2618
2617
  }
2619
- `;var U,D,R,_=class extends Q(Fe){constructor(){super();this.value=null;this.checked=!1;this.disabled=!1;this.required=!1;this.invalid=!1;Z(this,U,!1);Z(this,D,!1);Z(this,R,!1);this.handleClick=()=>{this.isInGroup()||this.disabled||(I(this,R,!0),!this.checked&&(this.checked=!0,this.updateComplete.then(()=>{this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))})))};this.handleInvalid=()=>{I(this,R,!0),this.updateValidity()};this.handleKeyDown=e=>{var t,a;if(!this.isInGroup()&&!this.disabled&&!e.defaultPrevented){if(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(e.key)){let i=this.getStandaloneNamedRadios().filter(p=>!p.disabled);if(i.length<=1)return;e.preventDefault();let n=(a=(t=i.find(p=>p.checked))!=null?t:i.find(p=>p===this))!=null?a:i[0],s=e.key==="ArrowUp"||e.key==="ArrowLeft"?-1:1,u=(i.indexOf(n)+s+i.length)%i.length,b=i[u];I(b,R,!0),b.checked||(b.checked=!0,b.updateComplete.then(()=>{b.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))})),b.focus();return}e.key!==" "&&e.key!=="Spacebar"&&e.key!=="Enter"||(e.preventDefault(),this.click())}};this.addEventListener("click",this.handleClick),this.addEventListener("invalid",this.handleInvalid),this.addEventListener("keydown",this.handleKeyDown)}get tabIndex(){return this._internalTabIndex}set tabIndex(e){this._groupTabIndex=e}connectedCallback(){var e;super.connectedCallback(),this.value=(e=this.getAttribute("value"))!=null?e:"on",I(this,U,this.hasAttribute("checked")),this.checked=H(this,U),this.internals.role="radio",this.syncAriaDisabled(),this.syncFormValue(),this.updateValidity()}syncAriaDisabled(){this.internals.ariaDisabled=this.disabled?"true":"false"}syncAriaChecked(){this.internals.ariaChecked=this.checked?"true":"false"}willUpdate(e){this.shouldSyncFormState(e)&&(this.syncFormValue(),this.updateValidity())}updated(e){super.updated(e),e.has("checked")&&(this.syncAriaChecked(),this.checked&&!this.isInGroup()&&(this.uncheckOtherRadios(),this.syncStandaloneTabOrder())),e.has("disabled")&&(this.syncAriaDisabled(),this.isInGroup()||this.syncStandaloneTabOrder()),e.has("invalid")&&(this.internals.ariaInvalid=this.invalid?"true":null),e.has("name")&&this.checked&&!this.isInGroup()&&this.uncheckOtherRadios()}resetFormControl(){this.checked=H(this,U),this.syncFormValue(),this.updateValidity()}get validationMessage(){return this.internals.validationMessage}get validity(){return this.internals.validity}checkValidity(){return this.updateValidity(),this.internals.checkValidity()}reportValidity(){return I(this,R,!0),this.updateValidity(),this.internals.checkValidity()}isInGroup(){return!!this.closest("w-radio-group")}getRadioScope(){var e,t;return(t=(e=this.internals.form)!=null?e:this.closest("form"))!=null?t:document}getStandaloneNamedRadios(){if(!this.name)return[this];let e=this.getRadioScope();return Array.from(e.querySelectorAll(`w-radio[name="${this.name}"]`)).filter(t=>!t.closest("w-radio-group"))}syncStandaloneTabOrder(){var n;let e=this.getStandaloneNamedRadios(),t=e.filter(s=>!s.disabled),a=t.find(s=>s.checked),i=(n=a!=null?a:t[0])!=null?n:null;e.forEach(s=>{s._standaloneTabIndex=s===i?0:-1})}get _internalTabIndex(){return this.disabled?-1:this._groupTabIndex!==void 0?this._groupTabIndex:this._standaloneTabIndex!==void 0?this._standaloneTabIndex:0}firstUpdated(){this.isInGroup()||this.syncStandaloneTabOrder()}uncheckOtherRadios(){if(!this.name)return;let e=this.getRadioScope();Array.from(e.querySelectorAll(`w-radio[name="${this.name}"]`)).forEach(a=>{a!==this&&(a.closest("w-radio-group")||a.checked&&(a.checked=!1))})}updateValidity(){if(this.disabled||this.isInGroup()){this.internals.setValidity({});return}let e=this.required&&!this.checked,t=this.invalid&&!H(this,D);if(e){I(this,D,!0),this.invalid=H(this,R),this.internals.setValidity({valueMissing:!0},this.internals.validationMessage||" ");return}if(H(this,D)&&(this.invalid=!1,I(this,D,!1)),t){this.internals.setValidity({customError:!0},this.internals.validationMessage||" ");return}this.internals.setValidity({})}syncFormValue(){if(this.disabled){this.setValue(null);return}this.setValue(this.checked?this.value:null)}shouldSyncFormState(e){return e.has("checked")||e.has("value")||e.has("disabled")||e.has("required")||e.has("invalid")}render(){return xr`
2618
+ `;var q,L,F,y=class extends B(xe){constructor(){super();this.value=null;this.checked=!1;this.disabled=!1;this.required=!1;this.invalid=!1;U(this,q,!1);U(this,L,!1);U(this,F,!1);this.handleClick=()=>{this.isInGroup()||this.disabled||(I(this,F,!0),!this.checked&&(this.checked=!0,this.updateComplete.then(()=>{this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))})))};this.handleInvalid=()=>{I(this,F,!0),this.updateValidity()};this.handleKeyDown=e=>{var t,o;if(!this.isInGroup()&&!this.disabled&&!e.defaultPrevented){if(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(e.key)){let i=this.getStandaloneNamedRadios().filter(p=>!p.disabled);if(i.length<=1)return;e.preventDefault();let n=(o=(t=i.find(p=>p.checked))!=null?t:i.find(p=>p===this))!=null?o:i[0],s=e.key==="ArrowUp"||e.key==="ArrowLeft"?-1:1,u=(i.indexOf(n)+s+i.length)%i.length,b=i[u];I(b,F,!0),b.checked||(b.checked=!0,b.updateComplete.then(()=>{b.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))})),b.focus();return}if(!(e.key!==" "&&e.key!=="Spacebar"&&e.key!=="Enter")){if(e.key==="Enter"&&this.internals.form){this.internals.form.requestSubmit();return}e.preventDefault(),this.click()}}};this.addEventListener("click",this.handleClick),this.addEventListener("invalid",this.handleInvalid),this.addEventListener("keydown",this.handleKeyDown)}get tabIndex(){return this._internalTabIndex}set tabIndex(e){this._groupTabIndex=e}connectedCallback(){var e;super.connectedCallback(),this.value=(e=this.getAttribute("value"))!=null?e:"on",I(this,q,this.hasAttribute("checked")),this.checked=O(this,q),this.internals.role="radio",this.syncAriaDisabled(),this.syncFormValue(),this.updateValidity()}syncAriaDisabled(){this.internals.ariaDisabled=this.disabled?"true":"false"}syncAriaChecked(){this.internals.ariaChecked=this.checked?"true":"false"}willUpdate(e){this.shouldSyncFormState(e)&&(this.syncFormValue(),this.updateValidity())}updated(e){super.updated(e),e.has("checked")&&(this.syncAriaChecked(),this.checked&&!this.isInGroup()&&(this.uncheckOtherRadios(),this.syncStandaloneTabOrder())),e.has("disabled")&&(this.syncAriaDisabled(),this.isInGroup()||this.syncStandaloneTabOrder()),e.has("invalid")&&(this.internals.ariaInvalid=this.invalid?"true":null),e.has("name")&&this.checked&&!this.isInGroup()&&this.uncheckOtherRadios()}resetFormControl(){this.checked=O(this,q),this.syncFormValue(),this.updateValidity()}get validationMessage(){return this.internals.validationMessage}get validity(){return this.internals.validity}checkValidity(){return this.updateValidity(),this.internals.checkValidity()}reportValidity(){return I(this,F,!0),this.updateValidity(),this.internals.checkValidity()}isInGroup(){return!!this.closest("w-radio-group")}getRadioScope(){var e,t;return(t=(e=this.internals.form)!=null?e:this.closest("form"))!=null?t:document}getStandaloneNamedRadios(){if(!this.name)return[this];let e=this.getRadioScope();return Array.from(e.querySelectorAll(`w-radio[name="${this.name}"]`)).filter(t=>!t.closest("w-radio-group"))}syncStandaloneTabOrder(){var n;let e=this.getStandaloneNamedRadios(),t=e.filter(s=>!s.disabled),o=t.find(s=>s.checked),i=(n=o!=null?o:t[0])!=null?n:null;e.forEach(s=>{s._standaloneTabIndex=s===i?0:-1})}get _internalTabIndex(){return this.disabled?-1:this._groupTabIndex!==void 0?this._groupTabIndex:this._standaloneTabIndex!==void 0?this._standaloneTabIndex:0}firstUpdated(){this.isInGroup()||this.syncStandaloneTabOrder()}uncheckOtherRadios(){if(!this.name)return;let e=this.getRadioScope();Array.from(e.querySelectorAll(`w-radio[name="${this.name}"]`)).forEach(o=>{o!==this&&(o.closest("w-radio-group")||o.checked&&(o.checked=!1))})}updateValidity(){if(this.disabled||this.isInGroup()){this.internals.setValidity({});return}let e=this.required&&!this.checked,t=this.invalid&&!O(this,L);if(e){I(this,L,!0),this.invalid=O(this,F),this.internals.setValidity({valueMissing:!0},this.internals.validationMessage||" ");return}if(O(this,L)&&(this.invalid=!1,I(this,L,!1)),t){this.internals.setValidity({customError:!0},this.internals.validationMessage||" ");return}this.internals.setValidity({})}syncFormValue(){if(this.disabled){this.setValue(null);return}this.setValue(this.checked?this.value:null)}shouldSyncFormState(e){return e.has("checked")||e.has("value")||e.has("disabled")||e.has("required")||e.has("invalid")}render(){return Ge`
2620
2619
  <div class="wrapper" tabindex="${this._internalTabIndex}">
2621
2620
  <div part="control" class="control"></div>
2622
2621
  <slot part="label" class="label"></slot>
2623
2622
  </div>
2624
- `}};U=new WeakMap,D=new WeakMap,R=new WeakMap,_.styles=[ee,Se,Ie],_.shadowRootOptions={...Fe.shadowRootOptions,delegatesFocus:!0},f([A({reflect:!0})],_.prototype,"name",2),f([A({reflect:!0})],_.prototype,"value",2),f([A({type:Boolean,reflect:!0})],_.prototype,"checked",2),f([A({type:Boolean,reflect:!0})],_.prototype,"disabled",2),f([A({type:Boolean,reflect:!0})],_.prototype,"required",2),f([A({type:Boolean,reflect:!0})],_.prototype,"invalid",2),f([A({attribute:!1})],_.prototype,"_groupTabIndex",2),f([A({attribute:!1})],_.prototype,"_standaloneTabIndex",2);customElements.get("w-radio")||customElements.define("w-radio",_);var kr=["en","nb","fi","da","sv"],ue="en",re=o=>kr.find(r=>o===r||o.toLowerCase().includes(r))||ue;function Le(){if(typeof window=="undefined"){let o=process.env.NMP_LANGUAGE||Intl.DateTimeFormat().resolvedOptions().locale;return re(o)}try{let o=Re(document);if(o)return re(o);let r=Er();if(r)return re(r);let e=Re(De());return e?re(e):ue}catch(o){return console.warn("could not detect locale, falling back to source locale",o),ue}}var Oe=(o,r,e,t,a)=>{y.load("en",o),y.load("nb",r),y.load("fi",e),y.load("da",t),y.load("sv",a);let i=Le();y.activate(i),Ne(),_r()},yr="warp-i18n-change";function Ne(){typeof window!="undefined"&&window.dispatchEvent(new Event(yr))}var Ae=!1;function _r(){if(Ae||typeof window=="undefined"||!(document!=null&&document.documentElement))return;Ae=!0;let o=()=>{let a=Le();y.locale!==a&&(y.activate(a),Ne())},r=new MutationObserver(a=>{for(let i of a)if(i.type==="attributes"&&i.attributeName==="lang"){o();break}});r.observe(document.documentElement,{attributes:!0,attributeFilter:["lang"]});let e=De();e&&e.documentElement&&e!==document&&r.observe(e.documentElement,{attributes:!0,attributeFilter:["lang"]});let t=Cr();t&&r.observe(t,{attributes:!0,attributeFilter:["lang"]})}function De(){var o,r;try{return(r=(o=window.parent)==null?void 0:o.document)!=null?r:null}catch(e){return null}}function Re(o){var r,e;try{return(e=(r=o==null?void 0:o.documentElement)==null?void 0:r.lang)!=null?e:""}catch(t){return""}}function Cr(){var o;try{return(o=window.frameElement)!=null?o:null}catch(r){return null}}function Er(){var o,r,e;try{return(e=(r=(o=window.frameElement)==null?void 0:o.getAttribute)==null?void 0:r.call(o,"lang"))!=null?e:""}catch(t){return""}}var qe=JSON.parse('{"radio-group.label.optional":["Valgfri"],"radio-group.validation.required":["V\xE6lg en mulighed."]}');var Pe=JSON.parse('{"radio-group.label.optional":["Optional"],"radio-group.validation.required":["Please select an option."]}');var He=JSON.parse('{"radio-group.label.optional":["Valinnainen"],"radio-group.validation.required":["Valitse vaihtoehto."]}');var je=JSON.parse('{"radio-group.label.optional":["Valgfri"],"radio-group.validation.required":["Velg et alternativ."]}');var Ue=JSON.parse('{"radio-group.label.optional":["Valfritt"],"radio-group.validation.required":["V\xE4lj ett alternativ."]}');import{css as Mr}from"lit";var $e=Mr`
2623
+ `}};q=new WeakMap,L=new WeakMap,F=new WeakMap,y.styles=[Z,fe,we],y.shadowRootOptions={...xe.shadowRootOptions,delegatesFocus:!0},m([T({reflect:!0})],y.prototype,"name",2),m([T({reflect:!0})],y.prototype,"value",2),m([T({type:Boolean,reflect:!0})],y.prototype,"checked",2),m([T({type:Boolean,reflect:!0})],y.prototype,"disabled",2),m([T({type:Boolean,reflect:!0})],y.prototype,"required",2),m([T({type:Boolean,reflect:!0})],y.prototype,"invalid",2),m([T({attribute:!1})],y.prototype,"_groupTabIndex",2),m([T({attribute:!1})],y.prototype,"_standaloneTabIndex",2);customElements.get("w-radio")||customElements.define("w-radio",y);var Ke=["en","nb","fi","da","sv"],se="en",G=a=>Ke.find(r=>a===r||a.toLowerCase().includes(r))||se;function _e(){if(typeof window=="undefined"){let a=process.env.NMP_LANGUAGE||Intl.DateTimeFormat().resolvedOptions().locale;return G(a)}try{let a=ye(document);if(a)return G(a);let r=rr();if(r)return G(r);let e=ye(ze());return e?G(e):se}catch(a){return console.warn("could not detect locale, falling back to source locale",a),se}}var Ce=(a,r,e,t,o)=>{k.load("en",a),k.load("nb",r),k.load("fi",e),k.load("da",t),k.load("sv",o);let i=_e();k.activate(i),Ee(),Qe()},Je="warp-i18n-change";function Ee(){typeof window!="undefined"&&window.dispatchEvent(new Event(Je))}var ke=!1;function Qe(){if(ke||typeof window=="undefined"||!(document!=null&&document.documentElement))return;ke=!0;let a=()=>{let o=_e();k.locale!==o&&(k.activate(o),Ee())},r=new MutationObserver(o=>{for(let i of o)if(i.type==="attributes"&&i.attributeName==="lang"){a();break}});r.observe(document.documentElement,{attributes:!0,attributeFilter:["lang"]});let e=ze();e&&e.documentElement&&e!==document&&r.observe(e.documentElement,{attributes:!0,attributeFilter:["lang"]});let t=er();t&&r.observe(t,{attributes:!0,attributeFilter:["lang"]})}function ze(){var a,r;try{return(r=(a=window.parent)==null?void 0:a.document)!=null?r:null}catch(e){return null}}function ye(a){var r,e;try{return(e=(r=a==null?void 0:a.documentElement)==null?void 0:r.lang)!=null?e:""}catch(t){return""}}function er(){var a;try{return(a=window.frameElement)!=null?a:null}catch(r){return null}}function rr(){var a,r,e;try{return(e=(r=(a=window.frameElement)==null?void 0:a.getAttribute)==null?void 0:r.call(a,"lang"))!=null?e:""}catch(t){return""}}var Ve=JSON.parse('{"radio-group.label.optional":["Valgfri"],"radio-group.validation.required":["V\xE6lg en mulighed."]}');var Me=JSON.parse('{"radio-group.label.optional":["Optional"],"radio-group.validation.required":["Please select an option."]}');var Ie=JSON.parse('{"radio-group.label.optional":["Valinnainen"],"radio-group.validation.required":["Valitse vaihtoehto."]}');var Se=JSON.parse('{"radio-group.label.optional":["Valgfri"],"radio-group.validation.required":["Velg et alternativ."]}');var Te=JSON.parse('{"radio-group.label.optional":["Valfritt"],"radio-group.validation.required":["V\xE4lj ett alternativ."]}');import{css as tr}from"lit";var Fe=tr`
2625
2624
  :host {
2626
2625
  display: block;
2627
2626
 
@@ -2709,30 +2708,30 @@ Please compile your catalog first.
2709
2708
  :host([data-show-error]) [part~='help-text'] {
2710
2709
  color: var(--_help-text-color-error);
2711
2710
  }
2712
- `;Oe(Pe,je,He,qe,Ue);var Vr=()=>y._({id:"radio-group.validation.required",message:"Please select an option.",comment:"Shown when required radio group has no selections"}),C=class extends Q(Ye){constructor(){super();this.hasInteracted=!1;this.hasWarnedMissingName=!1;this.autoTabIndex=!1;this.label="";this.helpText="";this.optional=!1;this.invalid=!1;this.name=null;this.disabled=!1;this.required=!1;this.defaultCheckedValue=void 0;this.slottedHelpText=null;this.nameManagedRadios=new WeakSet;this.disabledManagedRadios=new WeakSet;this.handleRadioClick=e=>{let t=e.target.closest("w-radio");if(!t||t.disabled||this.disabled)return;let a=this.getCheckedValue(),i=this.getAllRadios();this.selectSingleRadio(t,i),this.getCheckedValue()!==a&&this.updateComplete.then(this.emitSelectionChange)};this.handleInvalid=e=>{e.preventDefault(),this.hasInteracted=!0,this.updateValidity()};this.handleHelpTextSlotChange=()=>{this.syncSlottedHelpText(),this.requestUpdate()};this.handleI18nChange=()=>{this.requestUpdate()};this.emitSelectionChange=()=>{this.hasInteracted=!0,this.syncFormValue(),this.updateValidity(),this.requestUpdate(),this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))};this.captureDefaultSelection=()=>{this.defaultCheckedValue===void 0&&(this.defaultCheckedValue=this.getCheckedValue())};this.addEventListener("keydown",this.handleKeyDown),this.addEventListener("click",this.handleRadioClick),this.addEventListener("invalid",this.handleInvalid)}get validationTarget(){let e=this.querySelector(":is(w-radio):not([disabled])");return e!=null?e:void 0}connectedCallback(){super.connectedCallback(),this.syncSlottedHelpText(),this.syncFormValue(),this.updateValidity(),this.unsubscribeI18n=y.on("change",this.handleI18nChange),this.warnIfMissingName(),this.updateComplete.then(this.captureDefaultSelection)}disconnectedCallback(){var e;(e=this.unsubscribeI18n)==null||e.call(this),this.unsubscribeI18n=void 0,super.disconnectedCallback()}async updated(e){(e.has("disabled")||e.has("name")||e.has("required")||e.has("invalid")||e.has("helpText"))&&(this.syncFormValue(),this.updateValidity(),this.syncRadioElements(),this.syncFormValue(),this.updateValidity())}resetFormControl(){var t;let e=(t=this.defaultCheckedValue)!=null?t:null;this.getAllRadios().forEach(a=>{a.checked=e?a.value===e:!1}),this.syncRadioElements(),this.syncFormValue(),this.updateValidity()}getAllRadios(){return[...this.querySelectorAll("w-radio")]}getCheckedValue(){var t;let e=this.getAllRadios().find(a=>a.checked);return(t=e==null?void 0:e.value)!=null?t:null}getEnabledRadios(e=this.getAllRadios()){return e.filter(t=>!t.disabled)}selectSingleRadio(e,t=this.getAllRadios()){t.forEach(a=>{let i=a===e;a.checked=i,a._groupTabIndex=i?0:-1})}handleLabelClick(){this.focus()}async syncRadioElements(){let e=this.getAllRadios();e.forEach((t,a)=>{t.toggleAttribute("data-w-radio-first",a===0),t.toggleAttribute("data-w-radio-inner",a!==0&&a!==e.length-1),t.toggleAttribute("data-w-radio-last",a===e.length-1),this.syncRadioDisabledState(t),this.name?(!t.getAttribute("name")||this.nameManagedRadios.has(t))&&(t.setAttribute("name",this.name),this.nameManagedRadios.add(t)):this.nameManagedRadios.has(t)&&(t.removeAttribute("name"),this.nameManagedRadios.delete(t))}),await Promise.all(e.map(async t=>t.updateComplete)),this.normalizeCheckedRadios(e),this.syncTabOrder(e)}syncRadioDisabledState(e){if(this.disabled){e.disabled||(e.disabled=!0,this.disabledManagedRadios.add(e));return}this.disabledManagedRadios.has(e)&&(e.disabled=!1,this.disabledManagedRadios.delete(e))}syncTabOrder(e){if(this.disabled){e.forEach(i=>i._groupTabIndex=-1);return}let t=this.getEnabledRadios(e),a=t.find(i=>i.checked);t.length>0&&(a?t.forEach(i=>i._groupTabIndex=i.checked?0:-1):t.forEach((i,n)=>i._groupTabIndex=n===0?0:-1)),e.filter(i=>i.disabled).forEach(i=>i._groupTabIndex=-1)}handleKeyDown(e){var b;if(!["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"," "].includes(e.key)||this.disabled)return;let t=this.getAllRadios(),a=this.getEnabledRadios(t);if(a.length<=0)return;e.preventDefault();let i=this.getCheckedValue(),n=(b=a.find(p=>p.checked))!=null?b:a[0],s=e.key===" "?0:["ArrowUp","ArrowLeft"].includes(e.key)?-1:1,l=a.indexOf(n)+s;l<0&&(l=a.length-1),l>=a.length&&(l=0),this.selectSingleRadio(a[l],t),a[l].focus(),this.getCheckedValue()!==i&&this.updateComplete.then(this.emitSelectionChange)}focus(e){if(this.disabled)return;let t=this.getAllRadios(),a=t.find(s=>s.checked),i=t.find(s=>!s.disabled),n=a||i;n&&n.focus(e)}checkValidity(){return this.updateValidity(),this.internals.checkValidity()}reportValidity(){return this.hasInteracted=!0,this.updateValidity(),this.internals.checkValidity()}hasSlottedContent(e){var a;if(this.querySelector(`[slot="${e}"]`))return!0;let t=(a=this.shadowRoot)==null?void 0:a.querySelector(`slot[name="${e}"]`);return t?t.assignedNodes({flatten:!0}).some(i=>{var n;return i.nodeType===Node.ELEMENT_NODE?!0:i.nodeType===Node.TEXT_NODE?!!((n=i.textContent)!=null&&n.trim()):!1}):!1}syncFormValue(){this.setValue(null)}syncSlottedHelpText(){var t;let e=this.querySelector('[slot="help-text"]');this.slottedHelpText=((t=e==null?void 0:e.textContent)==null?void 0:t.trim())||null}updateValidity(){this.warnIfMissingName();let e=this.required&&!this.getCheckedValue(),t=e&&this.hasInteracted,a=this.invalid||this.hasAttribute("invalid"),i=a||t;if(this.toggleAttribute("data-show-error",i),this.disabled){this.internals.setValidity({}),this.syncChildInvalid(!1),this.syncHostTabIndex(!1);return}if(this.syncHostTabIndex(i),e){this.setValidityState({valueMissing:!0}),this.syncChildInvalid(i);return}if(a){this.setValidityState({customError:!0}),this.syncChildInvalid(!0);return}this.internals.setValidity({}),this.syncChildInvalid(!1)}normalizeCheckedRadios(e){let t=e.find(a=>a.checked);t&&e.forEach(a=>{a!==t&&(a.checked=!1)})}syncChildInvalid(e){this.getAllRadios().forEach(t=>{t.invalid=e})}setValidityState(e){let t=this.validationTarget;this.internals.setValidity(e," ",t!=null?t:void 0)}syncHostTabIndex(e){if(!(this.hasAttribute("tabindex")&&!this.autoTabIndex)){if(e){this.setAttribute("tabindex","0"),this.autoTabIndex=!0;return}this.autoTabIndex&&(this.removeAttribute("tabindex"),this.autoTabIndex=!1)}}warnIfMissingName(){this.hasWarnedMissingName||this.internals.form&&(this.name&&this.name.trim().length>0||(console.warn('w-radio-group: "name" is required for form submission.'),this.hasWarnedMissingName=!0))}render(){let e=this.hasSlottedContent("label"),t=this.hasSlottedContent("help-text"),a=this.label?!0:!!e,i=this.helpText?!0:!!t,s=this.required&&!this.getCheckedValue()&&this.hasInteracted,u=this.invalid||this.hasAttribute("invalid")||s,b=u?Vr():this.helpText,p=u||i,T=a?"label":void 0,x=p?"help-text":void 0,M=this.slottedHelpText||void 0;return te`
2711
+ `;Ce(Me,Se,Ie,Ve,Te);var ar=()=>k._({id:"radio-group.validation.required",message:"Please select an option.",comment:"Shown when required radio group has no selections"}),_=class extends B(Ae){constructor(){super();this.hasInteracted=!1;this.hasWarnedMissingName=!1;this.autoTabIndex=!1;this.label="";this.helpText="";this.optional=!1;this.invalid=!1;this.name=null;this.disabled=!1;this.required=!1;this.defaultCheckedValue=void 0;this.slottedHelpText=null;this.nameManagedRadios=new WeakSet;this.disabledManagedRadios=new WeakSet;this.handleRadioClick=e=>{let t=e.target.closest("w-radio");if(!t||t.disabled||this.disabled)return;let o=this.getCheckedValue(),i=this.getAllRadios();this.selectSingleRadio(t,i),this.getCheckedValue()!==o&&this.updateComplete.then(this.emitSelectionChange)};this.handleInvalid=e=>{e.preventDefault(),this.hasInteracted=!0,this.updateValidity()};this.handleHelpTextSlotChange=()=>{this.syncSlottedHelpText(),this.requestUpdate()};this.handleI18nChange=()=>{this.requestUpdate()};this.emitSelectionChange=()=>{this.hasInteracted=!0,this.syncFormValue(),this.updateValidity(),this.requestUpdate(),this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))};this.captureDefaultSelection=()=>{this.defaultCheckedValue===void 0&&(this.defaultCheckedValue=this.getCheckedValue())};this.addEventListener("keydown",this.handleKeyDown),this.addEventListener("click",this.handleRadioClick),this.addEventListener("invalid",this.handleInvalid)}get validationTarget(){let e=this.querySelector(":is(w-radio):not([disabled])");return e!=null?e:void 0}connectedCallback(){super.connectedCallback(),this.syncSlottedHelpText(),this.syncFormValue(),this.updateValidity(),this.unsubscribeI18n=k.on("change",this.handleI18nChange),this.warnIfMissingName(),this.updateComplete.then(this.captureDefaultSelection)}disconnectedCallback(){var e;(e=this.unsubscribeI18n)==null||e.call(this),this.unsubscribeI18n=void 0,super.disconnectedCallback()}async updated(e){(e.has("disabled")||e.has("name")||e.has("required")||e.has("invalid")||e.has("helpText"))&&(this.syncFormValue(),this.updateValidity(),this.syncRadioElements(),this.syncFormValue(),this.updateValidity())}resetFormControl(){var t;let e=(t=this.defaultCheckedValue)!=null?t:null;this.getAllRadios().forEach(o=>{o.checked=e?o.value===e:!1}),this.syncRadioElements(),this.syncFormValue(),this.updateValidity()}getAllRadios(){return[...this.querySelectorAll("w-radio")]}getCheckedValue(){var t;let e=this.getAllRadios().find(o=>o.checked);return(t=e==null?void 0:e.value)!=null?t:null}getEnabledRadios(e=this.getAllRadios()){return e.filter(t=>!t.disabled)}selectSingleRadio(e,t=this.getAllRadios()){t.forEach(o=>{let i=o===e;o.checked=i,o._groupTabIndex=i?0:-1})}handleLabelClick(){this.focus()}async syncRadioElements(){let e=this.getAllRadios();e.forEach((t,o)=>{t.toggleAttribute("data-w-radio-first",o===0),t.toggleAttribute("data-w-radio-inner",o!==0&&o!==e.length-1),t.toggleAttribute("data-w-radio-last",o===e.length-1),this.syncRadioDisabledState(t),this.name?(!t.getAttribute("name")||this.nameManagedRadios.has(t))&&(t.setAttribute("name",this.name),this.nameManagedRadios.add(t)):this.nameManagedRadios.has(t)&&(t.removeAttribute("name"),this.nameManagedRadios.delete(t))}),await Promise.all(e.map(async t=>t.updateComplete)),this.normalizeCheckedRadios(e),this.syncTabOrder(e)}syncRadioDisabledState(e){if(this.disabled){e.disabled||(e.disabled=!0,this.disabledManagedRadios.add(e));return}this.disabledManagedRadios.has(e)&&(e.disabled=!1,this.disabledManagedRadios.delete(e))}syncTabOrder(e){if(this.disabled){e.forEach(i=>i._groupTabIndex=-1);return}let t=this.getEnabledRadios(e),o=t.find(i=>i.checked);t.length>0&&(o?t.forEach(i=>i._groupTabIndex=i.checked?0:-1):t.forEach((i,n)=>i._groupTabIndex=n===0?0:-1)),e.filter(i=>i.disabled).forEach(i=>i._groupTabIndex=-1)}handleKeyDown(e){var b;if(!["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"," "].includes(e.key)||this.disabled)return;let t=this.getAllRadios(),o=this.getEnabledRadios(t);if(o.length<=0)return;e.preventDefault();let i=this.getCheckedValue(),n=(b=o.find(p=>p.checked))!=null?b:o[0],s=e.key===" "?0:["ArrowUp","ArrowLeft"].includes(e.key)?-1:1,d=o.indexOf(n)+s;d<0&&(d=o.length-1),d>=o.length&&(d=0),this.selectSingleRadio(o[d],t),o[d].focus(),this.getCheckedValue()!==i&&this.updateComplete.then(this.emitSelectionChange)}focus(e){if(this.disabled)return;let t=this.getAllRadios(),o=t.find(s=>s.checked),i=t.find(s=>!s.disabled),n=o||i;n&&n.focus(e)}checkValidity(){return this.updateValidity(),this.internals.checkValidity()}reportValidity(){return this.hasInteracted=!0,this.updateValidity(),this.internals.checkValidity()}hasSlottedContent(e){var o;if(this.querySelector(`[slot="${e}"]`))return!0;let t=(o=this.shadowRoot)==null?void 0:o.querySelector(`slot[name="${e}"]`);return t?t.assignedNodes({flatten:!0}).some(i=>{var n;return i.nodeType===Node.ELEMENT_NODE?!0:i.nodeType===Node.TEXT_NODE?!!((n=i.textContent)!=null&&n.trim()):!1}):!1}syncFormValue(){this.setValue(null)}syncSlottedHelpText(){var t;let e=this.querySelector('[slot="help-text"]');this.slottedHelpText=((t=e==null?void 0:e.textContent)==null?void 0:t.trim())||null}updateValidity(){this.warnIfMissingName();let e=this.required&&!this.getCheckedValue(),t=e&&this.hasInteracted,o=this.invalid||this.hasAttribute("invalid"),i=o||t;if(this.toggleAttribute("data-show-error",i),this.disabled){this.internals.setValidity({}),this.syncChildInvalid(!1),this.syncHostTabIndex(!1);return}if(this.syncHostTabIndex(i),e){this.setValidityState({valueMissing:!0}),this.syncChildInvalid(i);return}if(o){this.setValidityState({customError:!0}),this.syncChildInvalid(!0);return}this.internals.setValidity({}),this.syncChildInvalid(!1)}normalizeCheckedRadios(e){let t=e.find(o=>o.checked);t&&e.forEach(o=>{o!==t&&(o.checked=!1)})}syncChildInvalid(e){this.getAllRadios().forEach(t=>{t.invalid=e})}setValidityState(e){let t=this.validationTarget;this.internals.setValidity(e," ",t!=null?t:void 0)}syncHostTabIndex(e){if(!(this.hasAttribute("tabindex")&&!this.autoTabIndex)){if(e){this.setAttribute("tabindex","0"),this.autoTabIndex=!0;return}this.autoTabIndex&&(this.removeAttribute("tabindex"),this.autoTabIndex=!1)}}warnIfMissingName(){this.hasWarnedMissingName||this.internals.form&&(this.name&&this.name.trim().length>0||(console.warn('w-radio-group: "name" is required for form submission.'),this.hasWarnedMissingName=!0))}render(){let e=this.hasSlottedContent("label"),t=this.hasSlottedContent("help-text"),o=this.label?!0:!!e,i=this.helpText?!0:!!t,s=this.required&&!this.getCheckedValue()&&this.hasInteracted,u=this.invalid||this.hasAttribute("invalid")||s,b=u?ar():this.helpText,p=u||i,V=o?"label":void 0,w=p?"help-text":void 0,E=this.slottedHelpText||void 0;return K`
2713
2712
  <fieldset
2714
2713
  part="form-control"
2715
2714
  role="radiogroup"
2716
- aria-labelledby=${be(T)}
2717
- aria-describedby=${be(x)}
2715
+ aria-labelledby=${ne(V)}
2716
+ aria-describedby=${ne(w)}
2718
2717
  aria-errormessage="error-message"
2719
2718
  aria-invalid=${u?"true":void 0}>
2720
- ${a?te`
2719
+ ${o?K`
2721
2720
  <label part="form-control-label" id="label" @click=${this.handleLabelClick}>
2722
2721
  <slot name="label">${this.label}</slot>
2723
- ${this.optional?te`<span class="optional">
2724
- ${y._({id:"radio-group.label.optional",message:"Optional",comment:"Shown behind label when marked as optional"})}
2722
+ ${this.optional?K`<span class="optional">
2723
+ ${k._({id:"radio-group.label.optional",message:"Optional",comment:"Shown behind label when marked as optional"})}
2725
2724
  </span>`:null}
2726
2725
  </label>
2727
2726
  `:null}
2728
2727
 
2729
2728
  <slot part="form-control-input" @slotchange=${this.syncRadioElements}></slot>
2730
2729
 
2731
- ${p?te`
2732
- <div id="help-text" part="help-text" aria-label=${be(M)}>
2730
+ ${p?K`
2731
+ <div id="help-text" part="help-text" aria-label=${ne(E)}>
2733
2732
  <slot name="help-text" @slotchange=${this.handleHelpTextSlotChange}>${b}</slot>
2734
2733
  </div>
2735
2734
  `:null}
2736
2735
  </fieldset>
2737
- `}};C.styles=[ee,$e],C.shadowRootOptions={...Ye.shadowRootOptions,delegatesFocus:!0},f([zr()],C.prototype,"hasInteracted",2),f([q()],C.prototype,"label",2),f([q({attribute:"help-text"})],C.prototype,"helpText",2),f([q({type:Boolean,reflect:!0})],C.prototype,"optional",2),f([q({type:Boolean,reflect:!0})],C.prototype,"invalid",2),f([q({reflect:!0})],C.prototype,"name",2),f([q({type:Boolean,reflect:!0})],C.prototype,"disabled",2),f([q({type:Boolean,reflect:!0})],C.prototype,"required",2);customElements.get("w-radio-group")||customElements.define("w-radio-group",C);export{C as WRadioGroup};
2736
+ `}};_.styles=[Z,Fe],_.shadowRootOptions={...Ae.shadowRootOptions,delegatesFocus:!0},m([or()],_.prototype,"hasInteracted",2),m([N()],_.prototype,"label",2),m([N({attribute:"help-text"})],_.prototype,"helpText",2),m([N({type:Boolean,reflect:!0})],_.prototype,"optional",2),m([N({type:Boolean,reflect:!0})],_.prototype,"invalid",2),m([N({reflect:!0})],_.prototype,"name",2),m([N({type:Boolean,reflect:!0})],_.prototype,"disabled",2),m([N({type:Boolean,reflect:!0})],_.prototype,"required",2);customElements.get("w-radio-group")||customElements.define("w-radio-group",_);export{_ as WRadioGroup};
2738
2737
  //# sourceMappingURL=radio-group.js.map