@mattilsynet/design 1.3.11 → 1.3.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  import m from "../styles.module.css.js";
2
2
  import { onLoaded as T, onMutation as w, on as r, QUICK_EVENT as p, debounce as _ } from "../utils.js";
3
- import "./app-toggle2.js";
3
+ import "./app-toggle.js";
4
4
  const f = m.app.split(" ")[0], P = m.sticky.split(" ")[0], E = '[data-command="toggle-app-expanded"]', g = `.${f} > dialog,.${f} dialog ~ main`, S = (e) => {
5
5
  document.startViewTransition ? document.startViewTransition(e) : e();
6
6
  }, h = (e) => (
@@ -1,27 +1,11 @@
1
- const t = `if (
2
- typeof window !== "undefined" &&
3
- window.CSSStyleSheet &&
4
- document.adoptedStyleSheets
5
- )
6
- (() => {
7
- const key = "--mtds-app-expanded";
8
- const sheet = new CSSStyleSheet();
9
- const prev = () => !window.localStorage.getItem(key)?.includes("false");
10
-
11
- document.adoptedStyleSheets.push(sheet);
12
- window.mtdsToggleAppExpanded = (force) => {
13
- try {
14
- const next = force ?? !prev();
15
- sheet.replaceSync?.(\`:root { \${key}: var(\${key}--\${next})}\`);
16
- window.localStorage.setItem(key, next);
17
- } catch (_err) {} // localStorage is full or replaceSync is not supported
18
- };
19
-
20
- // Set and store initial state
21
- window.mtdsToggleAppExpanded(prev());
22
- })();
23
- `;
24
- export {
25
- t as default
26
- };
1
+ typeof window < "u" && window.CSSStyleSheet && document.adoptedStyleSheets && (() => {
2
+ const e = "--mtds-app-expanded", d = new CSSStyleSheet(), o = () => !window.localStorage.getItem(e)?.includes("false");
3
+ document.adoptedStyleSheets.push(d), window.mtdsToggleAppExpanded = (n) => {
4
+ try {
5
+ const t = n ?? !o();
6
+ d.replaceSync?.(`:root { ${e}: var(${e}--${t})}`), window.localStorage.setItem(e, t);
7
+ } catch {
8
+ }
9
+ }, window.mtdsToggleAppExpanded(o());
10
+ })();
27
11
  //# sourceMappingURL=app-toggle.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"app-toggle.js","sources":["../../designsystem/app/app-toggle.js?raw"],"sourcesContent":["export default \"if (\\n\\ttypeof window !== \\\"undefined\\\" &&\\n\\twindow.CSSStyleSheet &&\\n\\tdocument.adoptedStyleSheets\\n)\\n\\t(() => {\\n\\t\\tconst key = \\\"--mtds-app-expanded\\\";\\n\\t\\tconst sheet = new CSSStyleSheet();\\n\\t\\tconst prev = () => !window.localStorage.getItem(key)?.includes(\\\"false\\\");\\n\\n\\t\\tdocument.adoptedStyleSheets.push(sheet);\\n\\t\\twindow.mtdsToggleAppExpanded = (force) => {\\n\\t\\t\\ttry {\\n\\t\\t\\t\\tconst next = force ?? !prev();\\n\\t\\t\\t\\tsheet.replaceSync?.(`:root { ${key}: var(${key}--${next})}`);\\n\\t\\t\\t\\twindow.localStorage.setItem(key, next);\\n\\t\\t\\t} catch (_err) {} // localStorage is full or replaceSync is not supported\\n\\t\\t};\\n\\n\\t\\t// Set and store initial state\\n\\t\\twindow.mtdsToggleAppExpanded(prev());\\n\\t})();\\n\""],"names":["script"],"mappings":"AAAA,MAAeA,IAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;"}
1
+ {"version":3,"file":"app-toggle.js","sources":["../../designsystem/app/app-toggle.js"],"sourcesContent":["if (\n\ttypeof window !== \"undefined\" &&\n\twindow.CSSStyleSheet &&\n\tdocument.adoptedStyleSheets\n)\n\t(() => {\n\t\tconst key = \"--mtds-app-expanded\";\n\t\tconst sheet = new CSSStyleSheet();\n\t\tconst prev = () => !window.localStorage.getItem(key)?.includes(\"false\");\n\n\t\tdocument.adoptedStyleSheets.push(sheet);\n\t\twindow.mtdsToggleAppExpanded = (force) => {\n\t\t\ttry {\n\t\t\t\tconst next = force ?? !prev();\n\t\t\t\tsheet.replaceSync?.(`:root { ${key}: var(${key}--${next})}`);\n\t\t\t\twindow.localStorage.setItem(key, next);\n\t\t\t} catch (_err) {} // localStorage is full or replaceSync is not supported\n\t\t};\n\n\t\t// Set and store initial state\n\t\twindow.mtdsToggleAppExpanded(prev());\n\t})();\n"],"names":["key","sheet","prev","force","next"],"mappings":"AACC,OAAO,SAAW,OAClB,OAAO,iBACP,SAAS,uBAER,MAAM;AACN,QAAMA,IAAM,uBACNC,IAAQ,IAAI,cAAe,GAC3BC,IAAO,MAAM,CAAC,OAAO,aAAa,QAAQF,CAAG,GAAG,SAAS,OAAO;AAEtE,WAAS,mBAAmB,KAAKC,CAAK,GACtC,OAAO,wBAAwB,CAACE,MAAU;AACzC,QAAI;AACH,YAAMC,IAAOD,KAAS,CAACD,EAAM;AAC7B,MAAAD,EAAM,cAAc,WAAWD,CAAG,SAASA,CAAG,KAAKI,CAAI,IAAI,GAC3D,OAAO,aAAa,QAAQJ,GAAKI,CAAI;AAAA,IACzC,QAAkB;AAAA,IAAE;AAAA,EACjB,GAGD,OAAO,sBAAsBF,GAAM;AACrC,GAAK;"}
@@ -1,11 +1,27 @@
1
- typeof window < "u" && window.CSSStyleSheet && document.adoptedStyleSheets && (() => {
2
- const e = "--mtds-app-expanded", d = new CSSStyleSheet(), o = () => !window.localStorage.getItem(e)?.includes("false");
3
- document.adoptedStyleSheets.push(d), window.mtdsToggleAppExpanded = (n) => {
4
- try {
5
- const t = n ?? !o();
6
- d.replaceSync?.(`:root { ${e}: var(${e}--${t})}`), window.localStorage.setItem(e, t);
7
- } catch {
8
- }
9
- }, window.mtdsToggleAppExpanded(o());
10
- })();
1
+ const t = `if (
2
+ typeof window !== "undefined" &&
3
+ window.CSSStyleSheet &&
4
+ document.adoptedStyleSheets
5
+ )
6
+ (() => {
7
+ const key = "--mtds-app-expanded";
8
+ const sheet = new CSSStyleSheet();
9
+ const prev = () => !window.localStorage.getItem(key)?.includes("false");
10
+
11
+ document.adoptedStyleSheets.push(sheet);
12
+ window.mtdsToggleAppExpanded = (force) => {
13
+ try {
14
+ const next = force ?? !prev();
15
+ sheet.replaceSync?.(\`:root { \${key}: var(\${key}--\${next})}\`);
16
+ window.localStorage.setItem(key, next);
17
+ } catch (_err) {} // localStorage is full or replaceSync is not supported
18
+ };
19
+
20
+ // Set and store initial state
21
+ window.mtdsToggleAppExpanded(prev());
22
+ })();
23
+ `;
24
+ export {
25
+ t as default
26
+ };
11
27
  //# sourceMappingURL=app-toggle2.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"app-toggle2.js","sources":["../../designsystem/app/app-toggle.js"],"sourcesContent":["if (\n\ttypeof window !== \"undefined\" &&\n\twindow.CSSStyleSheet &&\n\tdocument.adoptedStyleSheets\n)\n\t(() => {\n\t\tconst key = \"--mtds-app-expanded\";\n\t\tconst sheet = new CSSStyleSheet();\n\t\tconst prev = () => !window.localStorage.getItem(key)?.includes(\"false\");\n\n\t\tdocument.adoptedStyleSheets.push(sheet);\n\t\twindow.mtdsToggleAppExpanded = (force) => {\n\t\t\ttry {\n\t\t\t\tconst next = force ?? !prev();\n\t\t\t\tsheet.replaceSync?.(`:root { ${key}: var(${key}--${next})}`);\n\t\t\t\twindow.localStorage.setItem(key, next);\n\t\t\t} catch (_err) {} // localStorage is full or replaceSync is not supported\n\t\t};\n\n\t\t// Set and store initial state\n\t\twindow.mtdsToggleAppExpanded(prev());\n\t})();\n"],"names":["key","sheet","prev","force","next"],"mappings":"AACC,OAAO,SAAW,OAClB,OAAO,iBACP,SAAS,uBAER,MAAM;AACN,QAAMA,IAAM,uBACNC,IAAQ,IAAI,cAAe,GAC3BC,IAAO,MAAM,CAAC,OAAO,aAAa,QAAQF,CAAG,GAAG,SAAS,OAAO;AAEtE,WAAS,mBAAmB,KAAKC,CAAK,GACtC,OAAO,wBAAwB,CAACE,MAAU;AACzC,QAAI;AACH,YAAMC,IAAOD,KAAS,CAACD,EAAM;AAC7B,MAAAD,EAAM,cAAc,WAAWD,CAAG,SAASA,CAAG,KAAKI,CAAI,IAAI,GAC3D,OAAO,aAAa,QAAQJ,GAAKI,CAAI;AAAA,IACzC,QAAkB;AAAA,IAAE;AAAA,EACjB,GAGD,OAAO,sBAAsBF,GAAM;AACrC,GAAK;"}
1
+ {"version":3,"file":"app-toggle2.js","sources":["../../designsystem/app/app-toggle.js?raw"],"sourcesContent":["export default \"if (\\n\\ttypeof window !== \\\"undefined\\\" &&\\n\\twindow.CSSStyleSheet &&\\n\\tdocument.adoptedStyleSheets\\n)\\n\\t(() => {\\n\\t\\tconst key = \\\"--mtds-app-expanded\\\";\\n\\t\\tconst sheet = new CSSStyleSheet();\\n\\t\\tconst prev = () => !window.localStorage.getItem(key)?.includes(\\\"false\\\");\\n\\n\\t\\tdocument.adoptedStyleSheets.push(sheet);\\n\\t\\twindow.mtdsToggleAppExpanded = (force) => {\\n\\t\\t\\ttry {\\n\\t\\t\\t\\tconst next = force ?? !prev();\\n\\t\\t\\t\\tsheet.replaceSync?.(`:root { ${key}: var(${key}--${next})}`);\\n\\t\\t\\t\\twindow.localStorage.setItem(key, next);\\n\\t\\t\\t} catch (_err) {} // localStorage is full or replaceSync is not supported\\n\\t\\t};\\n\\n\\t\\t// Set and store initial state\\n\\t\\twindow.mtdsToggleAppExpanded(prev());\\n\\t})();\\n\""],"names":["script"],"mappings":"AAAA,MAAeA,IAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;"}
package/mtds/app/app.js CHANGED
@@ -32,7 +32,7 @@ import "../togglegroup/togglegroup.js";
32
32
  import "../typography/typography.js";
33
33
  import "../validation/validation.js";
34
34
  import a from "../styles.module.css.js";
35
- import d from "./app-toggle.js";
35
+ import d from "./app-toggle2.js";
36
36
  const f = p(function({ as: t, className: r, ...m }, n) {
37
37
  return /* @__PURE__ */ o(t || "div", { className: e(a.app, r), ref: n, ...m });
38
38
  }), u = p(function({ as: t, className: r, ...m }, n) {
@@ -14,7 +14,7 @@ type FieldBaseProps = {
14
14
  readOnly?: boolean;
15
15
  suffix?: string;
16
16
  validation?: React.ReactNode;
17
- value?: string | string[];
17
+ value?: React.ComponentPropsWithRef<"input">["value"];
18
18
  onInput?: (e: React.ChangeEvent<HTMLInputElement>) => void;
19
19
  };
20
20
  export type FieldProps<As extends React.ElementType = "div"> = PolymorphicComponentPropWithRef<As, FieldBaseProps>;
@@ -1 +1 @@
1
- {"version":3,"file":"field.js","sources":["../../designsystem/field/field.tsx"],"sourcesContent":["import type {\n\tReactUcombobox,\n\tUHTMLComboboxElement,\n} from \"@u-elements/u-combobox\";\nimport clsx from \"clsx\";\nimport {\n\tforwardRef,\n\ttype JSX,\n\tuseEffect,\n\tuseImperativeHandle,\n\tuseRef,\n} from \"react\";\nimport { HelpText, Input } from \"../react\";\nimport type {\n\tPolymorphicComponentPropWithRef,\n\tPolymorphicRef,\n} from \"../react-types\";\nimport styles from \"../styles.module.css\";\nimport { type AnchorPosition, toCustomElementProps } from \"../utils\";\n\ntype FieldBaseProps = {\n\tcount?: number;\n\tdescription?: React.ReactNode;\n\terror?: React.ReactNode; // Kept for backwards compatibility\n\thelpText?: React.ReactNode;\n\thelpTextLabel?: string;\n\tlabel?: React.ReactNode;\n\toptions?: string[] | FieldComboboxSelected;\n\tprefix?: string;\n\treadOnly?: boolean; // Allow readoOnly also on <select>\n\tsuffix?: string;\n\tvalidation?: React.ReactNode;\n\tvalue?: string | string[];\n\tonInput?: (e: React.ChangeEvent<HTMLInputElement>) => void;\n};\n\nexport type FieldProps<As extends React.ElementType = \"div\"> =\n\tPolymorphicComponentPropWithRef<As, FieldBaseProps>;\n\ntype FieldComponent = <As extends React.ElementType = \"div\">(\n\tprops: FieldProps<As>,\n) => JSX.Element;\n\nconst toOption = (\n\to: FieldComboboxSelected[number] | string,\n): FieldComboboxSelected[number] =>\n\ttypeof o === \"string\" ? { label: o, value: o } : o;\n\nexport const FieldComp: FieldComponent = forwardRef<null>(function Field<\n\tAs extends React.ElementType = \"div\",\n>(\n\t{\n\t\t\"data-size\": size,\n\t\tas,\n\t\tclassName,\n\t\tcount,\n\t\tdescription,\n\t\terror,\n\t\thelpText,\n\t\thelpTextLabel,\n\t\tlabel,\n\t\tprefix,\n\t\tstyle,\n\t\tsuffix,\n\t\tvalidation,\n\t\t...rest\n\t}: FieldProps<As>,\n\tref?: PolymorphicRef<As>,\n) {\n\tconst Tag = as || \"div\";\n\tconst affixes = !!suffix || !!prefix;\n\tconst valid = validation || error; // error kept for backwards compatibility\n\tconst shared = {\n\t\t\"data-size\": size,\n\t\tclassName: clsx(styles.field, className),\n\t\tstyle,\n\t};\n\n\t// Render options if select\n\tif (as === \"select\" && !rest.children)\n\t\tObject.assign(rest, {\n\t\t\tchildren: (\n\t\t\t\t<>\n\t\t\t\t\t{(rest.options as FieldBaseProps[\"options\"])\n\t\t\t\t\t\t?.map(toOption)\n\t\t\t\t\t\t.map(({ label, value }) => (\n\t\t\t\t\t\t\t<option key={value} value={value}>\n\t\t\t\t\t\t\t\t{label}\n\t\t\t\t\t\t\t</option>\n\t\t\t\t\t\t))}\n\t\t\t\t</>\n\t\t\t),\n\t\t});\n\n\t// Using suppressHydrationWarning to avoid Next.js vs field-observer.ts hydration conflict\n\treturn as ? (\n\t\t<div {...shared}>\n\t\t\t{!!label && <label suppressHydrationWarning>{label}</label>}\n\t\t\t{!!helpText && <HelpText aria-label={helpTextLabel}>{helpText}</HelpText>}\n\t\t\t{!!description && <p>{description}</p>}\n\t\t\t{affixes ? (\n\t\t\t\t<FieldAffixes>\n\t\t\t\t\t{!!prefix && <span>{prefix}</span>}\n\t\t\t\t\t<Tag className={styles.input} ref={ref} {...rest} />\n\t\t\t\t\t{!!suffix && <span>{suffix}</span>}\n\t\t\t\t</FieldAffixes>\n\t\t\t) : (\n\t\t\t\t<Tag\n\t\t\t\t\tclassName={typeof as === \"string\" ? styles.input : undefined}\n\t\t\t\t\tsuppressHydrationWarning\n\t\t\t\t\tref={ref}\n\t\t\t\t\t{...rest}\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t{!!valid && <div className={styles.validation}>{valid}</div>}\n\t\t\t{!!count && <p data-count={count} />}\n\t\t</div>\n\t) : (\n\t\t<div ref={ref} {...shared} {...rest} />\n\t);\n}) as FieldComponent; // Needed to tell Typescript this does not return ReactNode but acutally JSX.Element\n\nconst FieldAffixes = forwardRef<HTMLDivElement, FieldProps>(\n\tfunction FieldAffixes({ className, ...rest }, ref) {\n\t\treturn (\n\t\t\t<div className={clsx(styles.affixes, className)} ref={ref} {...rest} />\n\t\t);\n\t},\n);\n\nexport type FieldDatalistProps = React.ComponentPropsWithoutRef<\"datalist\"> & {\n\t\"data-nofilter\"?: boolean;\n\t\"data-position\"?: AnchorPosition;\n};\n\nconst FieldDatalist = forwardRef<HTMLDataListElement, FieldDatalistProps>(\n\tfunction FieldDatalist(props, ref) {\n\t\treturn <u-datalist ref={ref} {...toCustomElementProps(props)} />;\n\t},\n);\n\nexport type FieldOptionProps = React.ComponentPropsWithoutRef<\"option\">;\n\nconst FieldOption = forwardRef<HTMLOptionElement, FieldOptionProps>(\n\tfunction FieldOption(props, ref) {\n\t\treturn <u-option ref={ref} {...toCustomElementProps(props)} />;\n\t},\n);\n\nexport type FieldComboboxSelected = {\n\tlabel: string;\n\tvalue: string;\n\tchildren?: React.ReactNode;\n}[];\nexport type FieldComboboxProps = ReactUcombobox & {\n\t\"data-creatable\"?: boolean;\n\t\"data-multiple\"?: boolean;\n\tonAfterChange?: (e: CustomEvent<HTMLDataElement>) => void; // Custom event to handle before change\n\tonBeforeChange?: (e: CustomEvent<HTMLDataElement>) => void; // Custom event to handle before change\n\tonBeforeMatch?: (e: CustomEvent<HTMLOptionElement>) => void; // Custom event to handle before change\n} & (\n\t\t| {\n\t\t\t\t\"data-nofilter\"?: boolean;\n\t\t\t\tselected: FieldComboboxSelected; // Allow value to be a string or an array of strings for multiple select\n\t\t\t\toptions: FieldComboboxSelected;\n\t\t\t\tonSelectedChange: (selected: FieldComboboxSelected) => void; // Allow onChange to be a function that returns void\n\t\t }\n\t\t| {\n\t\t\t\t\"data-nofilter\"?: never;\n\t\t\t\tselected?: never;\n\t\t\t\toptions?: never;\n\t\t\t\tonSelectedChange?: never;\n\t\t }\n\t);\n\nconst FieldCombobox = forwardRef<UHTMLComboboxElement, FieldComboboxProps>(\n\tfunction FieldCombobox(\n\t\t{\n\t\t\t\"data-multiple\": multiple,\n\t\t\t\"data-nofilter\": nofilter,\n\t\t\tchildren,\n\t\t\tonAfterChange,\n\t\t\tonBeforeChange,\n\t\t\tonBeforeMatch,\n\t\t\tonSelectedChange,\n\t\t\toptions,\n\t\t\tselected,\n\t\t\t...props\n\t\t},\n\t\tref,\n\t) {\n\t\tconst innerRef = useRef<UHTMLComboboxElement>(null);\n\t\tconst isControlled = selected !== undefined;\n\t\tconst handleSelected = useRef(onSelectedChange);\n\t\thandleSelected.current = onSelectedChange; // Keep the latest onSelectedChange function\n\n\t\tuseImperativeHandle(ref, () => innerRef.current as UHTMLComboboxElement); // Forward innerRef\n\t\tuseEffect(() => {\n\t\t\tconst self = innerRef.current;\n\t\t\tconst handleBeforeChange = (event: CustomEvent<HTMLDataElement>) => {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tconst { isConnected: remove, textContent, value } = event.detail;\n\t\t\t\tconst onSelected = handleSelected.current;\n\t\t\t\tconst label = textContent?.trim() || \"\";\n\t\t\t\tconst prev = selected || [];\n\n\t\t\t\tif (remove) onSelected?.(prev.filter((i) => i.value !== value));\n\t\t\t\telse if (multiple) onSelected?.([...prev, { value, label }]);\n\t\t\t\telse onSelected?.([{ value, label }]);\n\t\t\t};\n\n\t\t\tself?.addEventListener(\"beforechange\", handleBeforeChange);\n\t\t\treturn () =>\n\t\t\t\tself?.removeEventListener(\"beforechange\", handleBeforeChange);\n\t\t}, [multiple, selected]);\n\n\t\treturn (\n\t\t\t<u-combobox\n\t\t\t\t/* @ts-expect-error React 19 supports custom events out of the box */\n\t\t\t\tonbeforechange={onBeforeChange}\n\t\t\t\tonbeforematch={onBeforeMatch}\n\t\t\t\tonafterchange={onAfterChange}\n\t\t\t\tdata-multiple={multiple}\n\t\t\t\tref={innerRef}\n\t\t\t\t{...toCustomElementProps(props)}\n\t\t\t>\n\t\t\t\t{isControlled ? (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{selected?.map(({ children, label, value }) => (\n\t\t\t\t\t\t\t<data key={value} value={value} suppressHydrationWarning>\n\t\t\t\t\t\t\t\t{children ?? label}\n\t\t\t\t\t\t\t</data>\n\t\t\t\t\t\t))}\n\t\t\t\t\t\t<Input />\n\t\t\t\t\t\t<del {...toCustomElementProps({ \"aria-label\": \"Fjern tekst\" })} />\n\t\t\t\t\t\t<FieldDatalist data-nofilter={nofilter || undefined}>\n\t\t\t\t\t\t\t{options?.map(toOption).map(({ children, label, value }) => (\n\t\t\t\t\t\t\t\t<FieldOption key={value} value={value} label={label}>\n\t\t\t\t\t\t\t\t\t{children ?? label}\n\t\t\t\t\t\t\t\t</FieldOption>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t</FieldDatalist>\n\t\t\t\t\t</>\n\t\t\t\t) : (\n\t\t\t\t\tchildren\n\t\t\t\t)}\n\t\t\t</u-combobox>\n\t\t);\n\t},\n);\n\nexport const Field = Object.assign(FieldComp, {\n\tAffixes: FieldAffixes,\n\tCombobox: FieldCombobox,\n\tDatalist: FieldDatalist,\n\tOption: FieldOption,\n});\n"],"names":["toOption","o","FieldComp","forwardRef","size","as","className","count","description","error","helpText","helpTextLabel","label","prefix","style","suffix","validation","rest","ref","Tag","affixes","valid","shared","clsx","styles","value","jsx","jsxs","HelpText","FieldAffixes","FieldDatalist","props","toCustomElementProps","FieldOption","FieldCombobox","multiple","nofilter","children","onAfterChange","onBeforeChange","onBeforeMatch","onSelectedChange","options","selected","innerRef","useRef","isControlled","handleSelected","useImperativeHandle","useEffect","self","handleBeforeChange","event","remove","textContent","onSelected","prev","i","F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AAAzB,GAAO,OAAAa,EAAM,MACvC,gBAAAC,EAAA,QAAA,EAAiB,OAAAD,GAAc,0BAAwB,IACtD,UAAAY,KAAYzB,EAAA,GADHa,CAEX,CACA;AAAA,4BACAkC,GAAM,EAAA;AAAA,UACP,gBAAAjC,EAAC,SAAK,GAAGM,EAAqB,EAAE,cAAc,cAAe,CAAA,GAAG;AAAA,UAChE,gBAAAN,EAACI,GAAc,EAAA,iBAAeM,KAAY,QACxC,UAASM,GAAA,IAAI1C,CAAQ,EAAE,IAAI,CAAC,EAAE,UAAAqC,GAAU,OAAAzB,GAAO,OAAAa,EAC/C,MAAA,gBAAAC,EAACO,GAAwB,EAAA,OAAAR,GAAc,OAAAb,GACrC,UAAAyB,KAAYzB,KADIa,CAElB,CACA,EACF,CAAA;AAAA,QAAA,EAAA,CACD,IAEAY;AAAA,MAAA;AAAA,IAEF;AAAA,EAAA;AAGH,GAEauB,KAAQ,OAAO,OAAO1D,GAAW;AAAA,EAC7C,SAAS2B;AAAA,EACT,UAAUK;AAAA,EACV,UAAUJ;AAAA,EACV,QAAQG;AACT,CAAC;"}
1
+ {"version":3,"file":"field.js","sources":["../../designsystem/field/field.tsx"],"sourcesContent":["import type {\n\tReactUcombobox,\n\tUHTMLComboboxElement,\n} from \"@u-elements/u-combobox\";\nimport clsx from \"clsx\";\nimport {\n\tforwardRef,\n\ttype JSX,\n\tuseEffect,\n\tuseImperativeHandle,\n\tuseRef,\n} from \"react\";\nimport { HelpText, Input } from \"../react\";\nimport type {\n\tPolymorphicComponentPropWithRef,\n\tPolymorphicRef,\n} from \"../react-types\";\nimport styles from \"../styles.module.css\";\nimport { type AnchorPosition, toCustomElementProps } from \"../utils\";\n\ntype FieldBaseProps = {\n\tcount?: number;\n\tdescription?: React.ReactNode;\n\terror?: React.ReactNode; // Kept for backwards compatibility\n\thelpText?: React.ReactNode;\n\thelpTextLabel?: string;\n\tlabel?: React.ReactNode;\n\toptions?: string[] | FieldComboboxSelected;\n\tprefix?: string;\n\treadOnly?: boolean; // Allow readoOnly also on <select>\n\tsuffix?: string;\n\tvalidation?: React.ReactNode;\n\tvalue?: React.ComponentPropsWithRef<\"input\">[\"value\"];\n\tonInput?: (e: React.ChangeEvent<HTMLInputElement>) => void;\n};\n\nexport type FieldProps<As extends React.ElementType = \"div\"> =\n\tPolymorphicComponentPropWithRef<As, FieldBaseProps>;\n\ntype FieldComponent = <As extends React.ElementType = \"div\">(\n\tprops: FieldProps<As>,\n) => JSX.Element;\n\nconst toOption = (\n\to: FieldComboboxSelected[number] | string,\n): FieldComboboxSelected[number] =>\n\ttypeof o === \"string\" ? { label: o, value: o } : o;\n\nexport const FieldComp: FieldComponent = forwardRef<null>(function Field<\n\tAs extends React.ElementType = \"div\",\n>(\n\t{\n\t\t\"data-size\": size,\n\t\tas,\n\t\tclassName,\n\t\tcount,\n\t\tdescription,\n\t\terror,\n\t\thelpText,\n\t\thelpTextLabel,\n\t\tlabel,\n\t\tprefix,\n\t\tstyle,\n\t\tsuffix,\n\t\tvalidation,\n\t\t...rest\n\t}: FieldProps<As>,\n\tref?: PolymorphicRef<As>,\n) {\n\tconst Tag = as || \"div\";\n\tconst affixes = !!suffix || !!prefix;\n\tconst valid = validation || error; // error kept for backwards compatibility\n\tconst shared = {\n\t\t\"data-size\": size,\n\t\tclassName: clsx(styles.field, className),\n\t\tstyle,\n\t};\n\n\t// Render options if select\n\tif (as === \"select\" && !rest.children)\n\t\tObject.assign(rest, {\n\t\t\tchildren: (\n\t\t\t\t<>\n\t\t\t\t\t{(rest.options as FieldBaseProps[\"options\"])\n\t\t\t\t\t\t?.map(toOption)\n\t\t\t\t\t\t.map(({ label, value }) => (\n\t\t\t\t\t\t\t<option key={value} value={value}>\n\t\t\t\t\t\t\t\t{label}\n\t\t\t\t\t\t\t</option>\n\t\t\t\t\t\t))}\n\t\t\t\t</>\n\t\t\t),\n\t\t});\n\n\t// Using suppressHydrationWarning to avoid Next.js vs field-observer.ts hydration conflict\n\treturn as ? (\n\t\t<div {...shared}>\n\t\t\t{!!label && <label suppressHydrationWarning>{label}</label>}\n\t\t\t{!!helpText && <HelpText aria-label={helpTextLabel}>{helpText}</HelpText>}\n\t\t\t{!!description && <p>{description}</p>}\n\t\t\t{affixes ? (\n\t\t\t\t<FieldAffixes>\n\t\t\t\t\t{!!prefix && <span>{prefix}</span>}\n\t\t\t\t\t<Tag className={styles.input} ref={ref} {...rest} />\n\t\t\t\t\t{!!suffix && <span>{suffix}</span>}\n\t\t\t\t</FieldAffixes>\n\t\t\t) : (\n\t\t\t\t<Tag\n\t\t\t\t\tclassName={typeof as === \"string\" ? styles.input : undefined}\n\t\t\t\t\tsuppressHydrationWarning\n\t\t\t\t\tref={ref}\n\t\t\t\t\t{...rest}\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t{!!valid && <div className={styles.validation}>{valid}</div>}\n\t\t\t{!!count && <p data-count={count} />}\n\t\t</div>\n\t) : (\n\t\t<div ref={ref} {...shared} {...rest} />\n\t);\n}) as FieldComponent; // Needed to tell Typescript this does not return ReactNode but acutally JSX.Element\n\nconst FieldAffixes = forwardRef<HTMLDivElement, FieldProps>(\n\tfunction FieldAffixes({ className, ...rest }, ref) {\n\t\treturn (\n\t\t\t<div className={clsx(styles.affixes, className)} ref={ref} {...rest} />\n\t\t);\n\t},\n);\n\nexport type FieldDatalistProps = React.ComponentPropsWithoutRef<\"datalist\"> & {\n\t\"data-nofilter\"?: boolean;\n\t\"data-position\"?: AnchorPosition;\n};\n\nconst FieldDatalist = forwardRef<HTMLDataListElement, FieldDatalistProps>(\n\tfunction FieldDatalist(props, ref) {\n\t\treturn <u-datalist ref={ref} {...toCustomElementProps(props)} />;\n\t},\n);\n\nexport type FieldOptionProps = React.ComponentPropsWithoutRef<\"option\">;\n\nconst FieldOption = forwardRef<HTMLOptionElement, FieldOptionProps>(\n\tfunction FieldOption(props, ref) {\n\t\treturn <u-option ref={ref} {...toCustomElementProps(props)} />;\n\t},\n);\n\nexport type FieldComboboxSelected = {\n\tlabel: string;\n\tvalue: string;\n\tchildren?: React.ReactNode;\n}[];\nexport type FieldComboboxProps = ReactUcombobox & {\n\t\"data-creatable\"?: boolean;\n\t\"data-multiple\"?: boolean;\n\tonAfterChange?: (e: CustomEvent<HTMLDataElement>) => void; // Custom event to handle before change\n\tonBeforeChange?: (e: CustomEvent<HTMLDataElement>) => void; // Custom event to handle before change\n\tonBeforeMatch?: (e: CustomEvent<HTMLOptionElement>) => void; // Custom event to handle before change\n} & (\n\t\t| {\n\t\t\t\t\"data-nofilter\"?: boolean;\n\t\t\t\tselected: FieldComboboxSelected; // Allow value to be a string or an array of strings for multiple select\n\t\t\t\toptions: FieldComboboxSelected;\n\t\t\t\tonSelectedChange: (selected: FieldComboboxSelected) => void; // Allow onChange to be a function that returns void\n\t\t }\n\t\t| {\n\t\t\t\t\"data-nofilter\"?: never;\n\t\t\t\tselected?: never;\n\t\t\t\toptions?: never;\n\t\t\t\tonSelectedChange?: never;\n\t\t }\n\t);\n\nconst FieldCombobox = forwardRef<UHTMLComboboxElement, FieldComboboxProps>(\n\tfunction FieldCombobox(\n\t\t{\n\t\t\t\"data-multiple\": multiple,\n\t\t\t\"data-nofilter\": nofilter,\n\t\t\tchildren,\n\t\t\tonAfterChange,\n\t\t\tonBeforeChange,\n\t\t\tonBeforeMatch,\n\t\t\tonSelectedChange,\n\t\t\toptions,\n\t\t\tselected,\n\t\t\t...props\n\t\t},\n\t\tref,\n\t) {\n\t\tconst innerRef = useRef<UHTMLComboboxElement>(null);\n\t\tconst isControlled = selected !== undefined;\n\t\tconst handleSelected = useRef(onSelectedChange);\n\t\thandleSelected.current = onSelectedChange; // Keep the latest onSelectedChange function\n\n\t\tuseImperativeHandle(ref, () => innerRef.current as UHTMLComboboxElement); // Forward innerRef\n\t\tuseEffect(() => {\n\t\t\tconst self = innerRef.current;\n\t\t\tconst handleBeforeChange = (event: CustomEvent<HTMLDataElement>) => {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tconst { isConnected: remove, textContent, value } = event.detail;\n\t\t\t\tconst onSelected = handleSelected.current;\n\t\t\t\tconst label = textContent?.trim() || \"\";\n\t\t\t\tconst prev = selected || [];\n\n\t\t\t\tif (remove) onSelected?.(prev.filter((i) => i.value !== value));\n\t\t\t\telse if (multiple) onSelected?.([...prev, { value, label }]);\n\t\t\t\telse onSelected?.([{ value, label }]);\n\t\t\t};\n\n\t\t\tself?.addEventListener(\"beforechange\", handleBeforeChange);\n\t\t\treturn () =>\n\t\t\t\tself?.removeEventListener(\"beforechange\", handleBeforeChange);\n\t\t}, [multiple, selected]);\n\n\t\treturn (\n\t\t\t<u-combobox\n\t\t\t\t/* @ts-expect-error React 19 supports custom events out of the box */\n\t\t\t\tonbeforechange={onBeforeChange}\n\t\t\t\tonbeforematch={onBeforeMatch}\n\t\t\t\tonafterchange={onAfterChange}\n\t\t\t\tdata-multiple={multiple}\n\t\t\t\tref={innerRef}\n\t\t\t\t{...toCustomElementProps(props)}\n\t\t\t>\n\t\t\t\t{isControlled ? (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{selected?.map(({ children, label, value }) => (\n\t\t\t\t\t\t\t<data key={value} value={value} suppressHydrationWarning>\n\t\t\t\t\t\t\t\t{children ?? label}\n\t\t\t\t\t\t\t</data>\n\t\t\t\t\t\t))}\n\t\t\t\t\t\t<Input />\n\t\t\t\t\t\t<del {...toCustomElementProps({ \"aria-label\": \"Fjern tekst\" })} />\n\t\t\t\t\t\t<FieldDatalist data-nofilter={nofilter || undefined}>\n\t\t\t\t\t\t\t{options?.map(toOption).map(({ children, label, value }) => (\n\t\t\t\t\t\t\t\t<FieldOption key={value} value={value} label={label}>\n\t\t\t\t\t\t\t\t\t{children ?? label}\n\t\t\t\t\t\t\t\t</FieldOption>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t</FieldDatalist>\n\t\t\t\t\t</>\n\t\t\t\t) : (\n\t\t\t\t\tchildren\n\t\t\t\t)}\n\t\t\t</u-combobox>\n\t\t);\n\t},\n);\n\nexport const Field = Object.assign(FieldComp, {\n\tAffixes: FieldAffixes,\n\tCombobox: FieldCombobox,\n\tDatalist: FieldDatalist,\n\tOption: FieldOption,\n});\n"],"names":["toOption","o","FieldComp","forwardRef","size","as","className","count","description","error","helpText","helpTextLabel","label","prefix","style","suffix","validation","rest","ref","Tag","affixes","valid","shared","clsx","styles","value","jsx","jsxs","HelpText","FieldAffixes","FieldDatalist","props","toCustomElementProps","FieldOption","FieldCombobox","multiple","nofilter","children","onAfterChange","onBeforeChange","onBeforeMatch","onSelectedChange","options","selected","innerRef","useRef","isControlled","handleSelected","useImperativeHandle","useEffect","self","handleBeforeChange","event","remove","textContent","onSelected","prev","i","Fragment","Input","Field"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2CA,MAAMA,IAAW,CAChBC,MAEA,OAAOA,KAAM,WAAW,EAAE,OAAOA,GAAG,OAAOA,EAAA,IAAMA,GAErCC,IAA4BC,EAAiB,SAGzD;AAAA,EACC,aAAaC;AAAA,EACb,IAAAC;AAAA,EACA,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,aAAAC;AAAA,EACA,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,eAAAC;AAAA,EACA,OAAAC;AAAA,EACA,QAAAC;AAAA,EACA,OAAAC;AAAA,EACA,QAAAC;AAAA,EACA,YAAAC;AAAA,EACA,GAAGC;AACJ,GACAC,GACC;AACD,QAAMC,IAAMd,KAAM,OACZe,IAAU,CAAC,CAACL,KAAU,CAAC,CAACF,GACxBQ,IAAQL,KAAcP,GACtBa,IAAS;AAAA,IACd,aAAalB;AAAA,IACb,WAAWmB,EAAKC,EAAO,OAAOlB,CAAS;AAAA,IACvC,OAAAQ;AAAA,EACD;AAGI,SAAAT,MAAO,YAAY,CAACY,EAAK,YAC5B,OAAO,OAAOA,GAAM;AAAA,IACnB,iCAEI,UAAKA,EAAA,SACJ,IAAIjB,CAAQ,EACb,IAAI,CAAC,EAAE,OAAAY,GAAO,OAAAa,E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D;AAEM,aAAAsC,GAAA,iBAAiB,gBAAgBC,CAAkB,GAClD,MACND,GAAM,oBAAoB,gBAAgBC,CAAkB;AAAA,IAAA,GAC3D,CAAChB,GAAUQ,CAAQ,CAAC,GAGtB,gBAAAjB;AAAA,MAAC;AAAA,MAAA;AAAA,QAEA,gBAAgBa;AAAA,QAChB,eAAeC;AAAA,QACf,eAAeF;AAAA,QACf,iBAAeH;AAAA,QACf,KAAKS;AAAA,QACJ,GAAGZ,EAAqBD,CAAK;AAAA,QAE7B,cAEE,gBAAAJ,EAAA+B,GAAA,EAAA,UAAA;AAAA,UAAAf,GAAU,IAAI,CAAC,EAAE,UAAAN,GAAU,OAAAzB,GAAO,OAAAa,EAAM,MACvC,gBAAAC,EAAA,QAAA,EAAiB,OAAAD,GAAc,0BAAwB,IACtD,UAAAY,KAAYzB,EAAA,GADHa,CAEX,CACA;AAAA,4BACAkC,GAAM,EAAA;AAAA,UACP,gBAAAjC,EAAC,SAAK,GAAGM,EAAqB,EAAE,cAAc,cAAe,CAAA,GAAG;AAAA,UAChE,gBAAAN,EAACI,GAAc,EAAA,iBAAeM,KAAY,QACxC,UAASM,GAAA,IAAI1C,CAAQ,EAAE,IAAI,CAAC,EAAE,UAAAqC,GAAU,OAAAzB,GAAO,OAAAa,EAC/C,MAAA,gBAAAC,EAACO,GAAwB,EAAA,OAAAR,GAAc,OAAAb,GACrC,UAAAyB,KAAYzB,KADIa,CAElB,CACA,EACF,CAAA;AAAA,QAAA,EAAA,CACD,IAEAY;AAAA,MAAA;AAAA,IAEF;AAAA,EAAA;AAGH,GAEauB,KAAQ,OAAO,OAAO1D,GAAW;AAAA,EAC7C,SAAS2B;AAAA,EACT,UAAUK;AAAA,EACV,UAAUJ;AAAA,EACV,QAAQG;AACT,CAAC;"}
@@ -5,7 +5,7 @@ var mtds=function($){"use strict";var Et=typeof window<"u"&&typeof window.docume
5
5
  ::slotted(del) { text-decoration: none }
6
6
  ::slotted(data:not([hidden])) { display: inline-block; pointer-events: none }
7
7
  ::slotted(data)::after { content: '\\00D7'; content: '\\00D7' / ''; padding-inline: .5ch; pointer-events: auto }
8
- ::slotted(data:focus) { ${xo} }`))}static get observedAttributes(){return Object.keys(dt).map(t=>`data-sr-${t}`)}connectedCallback(){this._root=Lo(this),rt(this,be,this,!0),Ct(this,{attributeFilter:["value","id"],attributes:!0,characterData:!0,childList:!0,subtree:!0}),setTimeout(pt,0,this),setTimeout(ft,0,this)}attributeChangedCallback(t,e,n){const o=t.split("data-sr-")[1];dt[o]&&(this._texts[o]=n||dt[o])}disconnectedCallback(){Ct(this,!1),ko(this,be,this,!0),this._items=this._clear=this._focus=this._control=void 0,this._list=this._options=this._root=void 0}handleEvent(t){const e=t.target;t.type==="beforeinput"&&(this._value=e?.value||""),t.type==="blur"&&Ro(this),t.type==="click"&&Uo(this,t),t.type==="focus"&&Ho(this,t),t.type==="input"&&qo(this,t),t.type==="keydown"&&Fo(this,t),t.type==="mousedown"&&Lt(t),t.type==="mutation"&&pt(this,t)}get multiple(){var t;return((t=p(this,"data-multiple"))!=null?t:ct)!==ct}set multiple(t){p(this,"data-multiple",t?"":null)}get creatable(){var t;return((t=p(this,"data-creatable"))!=null?t:ct)!==ct}set creatable(t){p(this,"data-creatable",t?"":null)}get control(){var t;return(t=this._control)!=null&&t.isConnected||(this._control=this.querySelector("input")),this._control}get list(){var t;return(t=this._list)!=null&&t.isConnected||(this._list=this.querySelector("u-datalist,datalist")),this._list}get clear(){var t;return(t=this._clear)!=null&&t.isConnected||(this._clear=this.querySelector("del")),this._clear}get items(){return this._items||(this._items=this.getElementsByTagName("data")),this._items}get options(){var t,e;if(!this._options){const n=((t=this.list)==null?void 0:t.nodeName)==="U-DATALIST"?"u-option":"option";this._options=(e=this.list)==null?void 0:e.getElementsByTagName(n)}return this._options}get values(){return[...this.items].map(({value:t})=>t)}},O=t=>{var e;return((e=t?.textContent)==null?void 0:e.trim())||""},At=t=>t instanceof HTMLDataElement,pt=(t,e)=>{var n,o;const{_focus:i,_texts:s,items:r,control:a,list:d,multiple:l}=t;let h=`${O((n=a?.labels)==null?void 0:n[0])}, ${l?r.length?s.found.replace("%d",`${r.length}`):s.empty:""}`;const u=[];for(const{addedNodes:b,removedNodes:I}of e?.detail||[]){for(const m of b)At(m)&&u.unshift(m);for(const m of I)At(m)&&u.push(m)}const T=l?u.length===1:u[0]===i;if(i&&a&&T){const b=p(a,"inputmode"),I=At(i)?a:i;t._speak=`${s[u[0].isConnected?"added":"removed"]} ${O(u[0])}, `,(No||i===a)&&kt(t._speak),a!==I&&(p(a,"aria-expanded",null),p(a,"inputmode","none"),h=" ",a.focus()),setTimeout(()=>{var m;p(a,"aria-expanded","true"),p(a,"inputmode",b),(m=I?.focus)==null||m.call(I),t._speak="",Do?rt(t,"blur",()=>pt(t),ge):setTimeout(pt,100,t)},100)}let w=0;const k=t.querySelector("select");for(const b of r){const I=k?.options[w],m=O(b),A=b.value||m,ee=`${t._speak}${m}, ${s.remove}, ${++w} ${s.of} ${r.length}`;p(b,"role","button"),p(b,"value",A),p(b,"tabindex","-1"),p(b,"aria-label",ee),I?Object.assign(I,{textContent:m,value:A}):k?.appendChild(new Option(m,A,!0,!0))}k&&p(k,"multiple",l?"":null);for(const b of[...k?.options||[]].slice(w))b.remove();!l&&w>1&&console.warn("u-combobox: Multiple <data> found in single mode."),d&&p(d,"aria-multiselectable",`${l}`),a&&p(a,"list",Mo(d)),a&&p(a,"aria-label",`${t._speak}${h}`);const J=O(r[0]);J!==t._item&&ft(t),t._item=J,ye(t),we(t),(o=Ct(t))==null||o.takeRecords()},ye=t=>{var e;t.clear&&p(t.clear,"role","button"),t.clear&&(t.clear.hidden=!((e=t.control)!=null&&e.value))},we=t=>{var e;const{_speak:n,options:o=[],values:i}=t;for(const s of o){const r=(e=p(s,"value"))!=null?e:O(s);p(s,"aria-label",n?`${n}${O(s)}`:null),p(s,"selected",i.includes(r)?"":null)}},ft=t=>{const{multiple:e,control:n,items:o}=t,i=O(o[0]);!e&&n&&i!==n.value&&_e(n,i,i?"insertText":"deleteContent")},Mt=(t,e=!0)=>{var n;const{_texts:o,options:i=[],creatable:s,control:r,items:a,multiple:d}=t,l=((n=r?.value)==null?void 0:n.trim())||"",h=l.toLowerCase()||null;let u=[...i].find(w=>(p(w,"label")||O(w)).trim().toLowerCase()===h);const T={bubbles:!0,cancelable:!0,detail:u};if(t.dispatchEvent(new CustomEvent("beforematch",T))||(u=[...i].find(w=>w.selected)),e)return we(t),u?q(t,u,!1):s&&l?q(t,{value:l},!1):(!d&&!l&&a[0]?q(t,a[0]):ft(t),kt(o.invalid));for(const w of i)w.selected=w===u},q=(t,e,n=!0)=>{const{control:o,items:i,multiple:s}=t,r=lt("data",e.label||e.value,{value:e.value}),a=[...i].find(h=>h.value===e.value),d={bubbles:!0,cancelable:!0,detail:a||r};if(a&&!n)return ft(t);if(t.dispatchEvent(new CustomEvent("beforechange",d))){if(!s)for(const h of[...i])h.remove();a?a.remove():o?.insertAdjacentElement("beforebegin",r),t.dispatchEvent(new CustomEvent("afterchange",d))}},Ho=(t,{target:e})=>{e instanceof HTMLElement&&(t._focus=e),kt()},Ro=t=>Lt()||setTimeout(Bo,0,t),Bo=t=>{var e;!t._focus||t.contains((e=t._root)==null?void 0:e.activeElement)||(t.multiple||Mt(t),t._focus=void 0)},Uo=(t,e)=>{const{clientX:n,clientY:o,target:i}=e,{clear:s,control:r,items:a}=t;if(s?.contains(i))return r&&_e(r,"","deleteContentBackward"),r?.focus();for(const d of a){const{top:l,right:h,bottom:u,left:T}=d.getBoundingClientRect();if(d.contains(i))return q(t,d);if(o>=l&&o<=u&&n>=T&&n<=h)return d.focus()}i===t&&r?.focus()},qo=(t,e)=>{var n;const{options:o=[],control:i,multiple:s}=t,r=((n=i?.value)==null?void 0:n.trim())||"";if(e instanceof InputEvent?!e.inputType||e.inputType==="insertReplacementText":!!r){e.stopImmediatePropagation(),i&&(i.value=t._value);for(const d of o)if(d.value&&d.value===r)return q(t,d,s)}else s||Mt(t,!1);ye(t)},Fo=(t,e)=>{var n;if(e.altKey||e.ctrlKey||e.metaKey||e.shiftKey)return;const{clear:o,control:i,items:s}=t,{key:r,repeat:a,target:d}=e,l=i&&i===d,h=l&&i?.selectionEnd;let u=l?s.length:[...s].indexOf(d);if(l&&r==="Tab"&&o&&!o.hidden&&(e.preventDefault(),o.tabIndex=-1,o.focus(),rt(o,"blur",()=>p(o,"tabindex",null),ge)),!(!l&&Io(e)||u===-1)){if(r==="ArrowRight"&&!l)u+=1;else if(r==="ArrowLeft"&&!h)u-=1;else if(r==="Enter"&&l){const T=p(i,"form");return p(i,"form","#"),requestAnimationFrame(()=>p(i,"form",T)),Mt(t)}else if((r==="Backspace"||r==="Delete")&&!h){if(e.preventDefault(),!a&&s[u])return q(t,s[u]);l&&(u-=1)}else return l||i?.focus();e.preventDefault(),(n=s[Math.max(0,u)]||i)==null||n.focus()}};Oo.define("u-combobox",ut);const Vo="1.3.11",E={capture:!0,passive:!0},K=typeof window<"u"&&typeof document<"u";function Yo(t,e){let n;return(...o)=>{clearTimeout(n),n=setTimeout(()=>t(...o),e)}}function c(t,e,n){return n===void 0?t.getAttribute(e)??null:(n===null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n),null)}let jo=0;const Ko=`${Date.now().toString(36)}${Math.random().toString(36).slice(2,5)}`;function Ot(t){return t.id||(t.id=`${Ko}${++jo}`),t.id}const Wo=(t,e,n)=>{for(const o of n[0].split(","))n[0]=o,e[`${t}EventListener`](...n)},v=(t,...e)=>Wo("add",t,e),W=K?document.createElement("div"):null,ht=new Map,Xo=()=>{for(const[t,e]of ht)e()};W&&(W.style.cssText="position:absolute;padding:1px;top:0;left:0px",v(window,"load,resize,scroll",Xo,E));const F={top:0,right:1,bottom:2,left:3};function P(t,e,n,o){const i=F[n]??Number(n)??F.bottom;if(e===!1||!e.isConnected||!t.isConnected)return ht.delete(t);W?.isConnected||document.body.append(W||""),ht.has(t)||ht.set(t,()=>P(t,e,i,o));const s=e instanceof HTMLElement,{offsetWidth:r,offsetHeight:a}=t,d=s?e.offsetWidth:e.clientWidth,l=s?e.offsetHeight:e.clientHeight,{width:h,height:u,left:T,top:w}=e.getBoundingClientRect(),k=window.visualViewport?.width||window.innerWidth,J=window.visualViewport?.height||window.innerHeight,b=window.pageXOffset||document.documentElement.scrollLeft,I=window.pageYOffset||document.documentElement.scrollTop,m=Math.round(T-(d-h)/2),A=Math.round(w-(l-u)/2),ee=Math.min(Math.max(10,m-(r-d)/2),k-r-10),rs=Math.min(Math.max(10,A-(a-l)/2),J-a-10),as=m-r>0,ls=m+d+r<k,cs=A-a>0,ds=A+l+a<J,uo=i===F.top||i===F.bottom,us=i===F.right&&(o||ls)||!as,po=i===F.bottom&&(o||ds)||!cs,ps=Math.round(uo?ee:us?m+d:m-r),fs=Math.round(uo?po?A+l:A-a:rs);t.style.position="absolute",t.style.left=`${ps+b}px`,t.style.top=`${fs+I}px`,W?.style.setProperty("translate",`0px ${Math.round(po?b+A+l+a+30:0)}px`)}function Ee(t){let e=0;const n=()=>setTimeout(o,200),o=()=>{t([],i),i.takeRecords(),e=0},i=new MutationObserver(()=>{e||(e=requestAnimationFrame(n))});return i}const Pt=new WeakMap,V=(t,e,n)=>{const o=t.getElementsByClassName(e),i=Pt.get(t)||[];i.length||(Pt.set(t,i),Ee((s,r)=>{if(t.isConnected&&i?.length)for(const a of i)a();else r?.disconnect(),Pt.delete(t)}).observe(t,{attributeFilter:["class","hidden"],attributes:!0,childList:!0,subtree:!0})),i.push(()=>n(o))},x=t=>{if(!K)return;const e=()=>requestAnimationFrame(t);document.readyState==="complete"?e():v(window,"load",e)},Dt=t=>t instanceof HTMLElement&&"validity"in t&&!(t instanceof HTMLButtonElement),$e="mattilsynet.matomo.cloud";let Nt=!0;function Go(t,e={}){if(K){if(window._paq||(window._paq=[],window._paq.push(["HeatmapSessionRecording::disable"]),window._paq.push(["enableLinkTracking"]),window._paq.push(["setTrackerUrl",`https://${$e}/matomo.php`]),document.querySelector('script[src*="matomo.js"]')||document.head.append(Object.assign(document.createElement("script"),{async:!0,src:`https://cdn.matomo.cloud/${$e}/matomo.js`}))),t==="init"){const{matomoId:n,enabled:o}=e;Nt=o??window.location.hostname==="localhost",window._paq.push(["setSiteId",n])}if(Nt==="debug")return console.info(`Analytics: "${t}"`,e);if(Nt!==!1)if(t==="pageview"){const{url:n,title:o}=e;window._paq.push(["setCustomUrl",n||location.href]),window._paq.push(["setDocumentTitle",o||document.title]),window._paq.push(["trackPageView"])}else if(t==="event"){const{category:n,action:o,name:i,value:s}=e,r=["trackEvent",n,o,i,s];window._paq.push(r.filter(a=>a!==void 0))}else if(t==="search"){const{query:n,category:o=!1,results:i=!1}=e;window._paq.push(["trackSiteSearch",n,o,i])}else t==="matomo"&&window._paq.push(e)}}const zo=(t,e,n=Number.POSITIVE_INFINITY)=>{const o=(n-1)/2,i=Math.max(Math.min(t-Math.floor(o),e-n+1),1),s=Math.min(Math.max(t+Math.ceil(o),n),e),r=Array.from({length:s+1-i},(a,d)=>d+i);return n>4&&i>1&&r.splice(0,2,1,0),n>3&&s<e&&r.splice(-2,2,0,e),r},Qo=({current:t=1,total:e=10,show:n=7})=>({prev:t>1?t-1:0,next:t<e?t+1:0,pages:zo(t,e,n).map((o,i)=>({current:o===t&&"page",key:`key-${o}-${i}`,page:o}))}),Se="_alert_1run0_1 _ds-alert_im5h3_1",Te="_app_1run0_1",xe="_sticky_1run0_1",Ce="_avatar_1run0_1 _ds-avatar_im5h3_1",ke="_badge_1run0_1",Ie="_breadcrumbs_1run0_1 _ds-breadcrumbs_im5h3_1",Le="_button_1run0_1 _ds-button_im5h3_1",Ae="_card_1run0_1",Me="_group_1run0_1",Oe="_chip_1run0_1 _ds-chip_im5h3_1",Pe="_details_1run0_1 _ds-details_im5h3_1",De="_dialog_1run0_1 _ds-dialog_im5h3_1",Ne="_divider_1run0_1",He="_errorsummary_1run0_1 _ds-error-summary_im5h3_1",Re="__errorsummary_1run0_1",Be="_field_1run0_1 _ds-field_im5h3_1",Ue="__datalist_1run0_1",qe="_affixes_1run0_1 _ds-field-affixes_im5h3_1",Fe="_fieldset_1run0_1 _ds-fieldset_im5h3_1",Ve="_heading_1run0_1 _ds-heading_im5h3_1",Ye="_ingress_1run0_1",je="_muted_1run0_1",Ke="_info_1run0_1",We="_prose_1run0_1",Xe="_helptext_1run0_1 _ds-focus_im5h3_1",Ge="_input_1run0_1 _ds-input_im5h3_1",ze="_grid_1run0_1",Qe="_flex_1run0_1",Je="_link_1run0_1",Ze="_logo_1run0_1",tn="_pagination_1run0_1 _ds-pagination_im5h3_1",en="_popover_1run0_1",nn="_progress_1run0_1",on="__indeterminate_1run0_1",sn="_skeleton_1run0_1 _ds-skeleton_im5h3_1",rn="__skeleton_1run0_1",an="_spinner_1run0_1",ln="_steps_1run0_1",cn="_table_1run0_1 _ds-table_im5h3_1",dn="__scrollShadow_1run0_1",un="_tabs_1run0_1 _ds-tabs_im5h3_1",pn="__scrollMask_1run0_1",fn="_tag_1run0_1 _ds-tag_im5h3_1",hn="_togglegroup_1run0_1",mn="__tooltip_1run0_1",vn="_validation_1run0_1 _ds-validation-message_im5h3_1",_n="_body_1run0_153",bn="__checked_1run0_1",_={alert:Se,app:Te,sticky:xe,avatar:Ce,badge:ke,breadcrumbs:Ie,button:Le,card:Ae,group:Me,chip:Oe,details:Pe,dialog:De,divider:Ne,errorsummary:He,_errorsummary:Re,field:Be,_datalist:Ue,affixes:qe,fieldset:Fe,heading:Ve,ingress:Ye,muted:je,info:Ke,prose:We,helptext:Xe,input:Ge,grid:ze,flex:Qe,link:Je,logo:Ze,pagination:tn,popover:en,progress:nn,_indeterminate:on,skeleton:sn,_skeleton:rn,spinner:an,steps:ln,table:cn,_scrollShadow:dn,tabs:un,_scrollMask:pn,tag:fn,togglegroup:hn,_tooltip:mn,validation:vn,body:_n,_checked:bn},Jo=Object.freeze(Object.defineProperty({__proto__:null,_checked:bn,_datalist:Ue,_errorsummary:Re,_indeterminate:on,_scrollMask:pn,_scrollShadow:dn,_skeleton:rn,_tooltip:mn,affixes:qe,alert:Se,app:Te,avatar:Ce,badge:ke,body:_n,breadcrumbs:Ie,button:Le,card:Ae,chip:Oe,default:_,details:Pe,dialog:De,divider:Ne,errorsummary:He,field:Be,fieldset:Fe,flex:Qe,grid:ze,group:Me,heading:Ve,helptext:Xe,info:Ke,ingress:Ye,input:Ge,link:Je,logo:Ze,muted:je,pagination:tn,popover:en,progress:nn,prose:We,skeleton:sn,spinner:an,steps:ln,sticky:xe,table:cn,tabs:un,tag:fn,togglegroup:hn,validation:vn},Symbol.toStringTag,{value:"Module"}));typeof window<"u"&&window.CSSStyleSheet&&document.adoptedStyleSheets&&(()=>{const t="--mtds-app-expanded",e=new CSSStyleSheet,n=()=>!window.localStorage.getItem(t)?.includes("false");document.adoptedStyleSheets.push(e),window.mtdsToggleAppExpanded=o=>{try{const i=o??!n();e.replaceSync?.(`:root { ${t}: var(${t}--${i})}`),window.localStorage.setItem(t,i)}catch{}},window.mtdsToggleAppExpanded(n())})();const gn=_.app.split(" ")[0],Zo=_.sticky.split(" ")[0],ti='[data-command="toggle-app-expanded"]',yn=`.${gn} > dialog,.${gn} dialog ~ main`,wn=t=>{document.startViewTransition?document.startViewTransition(t):t()},En=t=>wn(()=>window.mtdsToggleAppExpanded?.(t));function ei({target:t,defaultPrevented:e}){if(!(e||!(t instanceof HTMLButtonElement)||!t.matches(ti))){if(getComputedStyle(t).position==="sticky")return En();wn(()=>{const n=document.querySelector(yn);n?.setAttribute("data-closedby","any"),n?.showModal()})}}function ni(){document.querySelector(yn)?.close()}let Ht=0,Y,M=0,g,Rt=0,mt=0,Bt=!1,Ut=0,N=0;function oi([t]){g=t,$n()}function $n(){if(!g?.isConnected)return;const t=window.scrollY,e=t<N;N=t,e!==Y&&(Ht=(g.parentElement?.getBoundingClientRect().top||0)+N,Y=e,Rt=g.offsetHeight,mt=g.getBoundingClientRect().top+N,Bt=g.offsetHeight<=window.innerHeight,Ut=window.innerHeight),!(M===-1&&Bt)&&(M!==-1&&(Bt||Y&&N<=mt)?(g.style.setProperty("--pos","sticky"),g.style.setProperty("--top","0px"),M=-1):M===-1&&!Y?(g.style.setProperty("--pos","relative"),g.style.setProperty("--top",`${Math.max(0,N-Ht)}px`),M=0):M!==1&&!Y&&N+Ut>=mt+Rt?(g.style.setProperty("--pos","sticky"),g.style.setProperty("--top",`${Ut-Rt}px`),M=1):M===1&&Y&&(g.style.setProperty("--pos","relative"),g.style.setProperty("--top",`${mt-Ht}px`),M=0))}x(()=>{V(document.documentElement,Zo,oi),v(document,"click",ei,E),v(window,"resize",Yo(ni,100),E),v(window,"scroll",$n,E)});const ii=_.breadcrumbs.split(" ")[0];function si(t){for(const e of t)e.querySelectorAll("li a").forEach((n,o,{length:i})=>{c(n,"aria-current",o===i-1?"page":null)})}x(()=>V(document.documentElement,ii,si));const ri=_.dialog.split(" ")[0],ai=K?document.getElementsByClassName(ri):[],li=()=>{for(const t of ai)t.isConnected&&t.showModal&&t.close&&(t.matches('[open]:not([data-modal="false"]):not(:modal)')?(c(t,"open",null),t.showModal()):t.matches(":modal:not([open])")&&(c(t,"open",""),t.close()))},ci=({clientX:t,clientY:e,target:n})=>{if(n instanceof HTMLDialogElement&&c(n,"data-closedby")==="any"){const{top:o,right:i,bottom:s,left:r}=n.getBoundingClientRect();o<=e&&e<=s&&r<=t&&t<=i||n.close()}else n instanceof Element&&n.closest('button[data-command="close"]')&&n?.closest("dialog")?.close()};x(()=>{v(document,"click",ci,E),Ee(li).observe(document.documentElement,{attributeFilter:["open"],attributes:!0,childList:!0,subtree:!0})});function di(t){if(t.animationName!==_._errorsummary)return;const e=t.target?.firstElementChild;e instanceof HTMLHeadingElement&&(c(e,"tabindex","-1"),e.focus())}x(()=>v(document,"animationend",di,E));var ui=Object.defineProperty,Sn=Object.getOwnPropertySymbols,pi=Object.prototype.hasOwnProperty,fi=Object.prototype.propertyIsEnumerable,Tn=(t,e,n)=>e in t?ui(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,hi=(t,e)=>{for(var n in e||(e={}))pi.call(e,n)&&Tn(t,n,e[n]);if(Sn)for(var n of Sn(e))fi.call(e,n)&&Tn(t,n,e[n]);return t},X=typeof window<"u"&&typeof window.document<"u"&&typeof window.navigator<"u",vt=X&&/android/i.test(navigator.userAgent),qt=X&&/iPad|iPhone|iPod/.test(navigator.userAgent),xn;X&&/^Mac/i.test(((xn=navigator.userAgentData)==null?void 0:xn.platform)||navigator.platform);var mi=`${vt?"data":"aria"}-labelledby`,vi=":host(:not([hidden])) { display: block }",_i="outline: 1px dotted; outline: 5px auto Highlight; outline: 5px auto -webkit-focus-ring-color",Cn=typeof HTMLElement>"u"?class{}:HTMLElement;function f(t,e,n){return n===void 0?t.getAttribute(e):(n===null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n),null)}var kn=(t,e,n)=>{for(const o of n[0].split(","))n[0]=o,Element.prototype[`${t}EventListener`].apply(e,n)},G=(t,...e)=>kn("add",t,e),_t=(t,...e)=>kn("remove",t,e),bi=(t,e)=>t.attachShadow({mode:"open"}).append(Yt("slot"),Yt("style",e)),bt=new WeakMap,Ft=(t,e)=>{if(e===void 0)return bt.get(t);try{bt.get(t).disconnect(),bt.delete(t)}catch{}if(e){const n=new MutationObserver(o=>t.handleEvent({type:"mutation",detail:o}));n.observe(t,e),bt.set(t,n)}},In=t=>{var e;const n=((e=t.getRootNode)==null?void 0:e.call(t))||t.ownerDocument;return n instanceof Document||n instanceof ShadowRoot?n:document},gi=0,Vt=t=>t?(t.id||(t.id=`:${t.nodeName.toLowerCase()}${(++gi).toString(32)}`),t.id):"",Yt=(t,e,n)=>{const o=document.createElement(t);return e&&(o.textContent=e),o},Ln={define:(t,e)=>!X||window.customElements.get(t)||window.customElements.define(t,e)},H,yi=0,An=t=>{H||(H=Yt("div"),H.style.cssText="position:fixed;overflow:hidden;width:1px;white-space:nowrap",f(H,"aria-live","assertive")),H.isConnected||document.body.append(H),t&&(H.textContent=`${t}${yi++%2?" ":""}`)},wi=(t,e,n="")=>{var o,i;const s={bubbles:!0,composed:!0,data:e,inputType:n},r=HTMLInputElement.prototype;t.dispatchEvent(new InputEvent("beforeinput",s)),(i=(o=Object.getOwnPropertyDescriptor(r,"value"))==null?void 0:o.set)==null||i.call(t,e),t.dispatchEvent(new InputEvent("input",s)),t.dispatchEvent(new Event("change",{bubbles:!0}))},jt=!1,Kt=t=>(t?.type==="mouseup"&&(jt=!1),t?.type==="mousedown"&&(jt=!0,G(document,"mouseup",Kt,{once:!0})),jt),Wt="disabled",z="selected",Ei=class extends Cn{static get observedAttributes(){return[Wt,z]}connectedCallback(){qt||(this.tabIndex=-1),this.hasAttribute("role")||f(this,"role","option"),this.attributeChangedCallback()}attributeChangedCallback(){f(this,"aria-disabled",`${this.disabled}`),f(this,"aria-selected",`${this.selected}`)}get defaultSelected(){return this[z]}set defaultSelected(t){this[z]=t}get disabled(){return f(this,Wt)!==null}set disabled(t){f(this,Wt,t?"":null)}get form(){return this.closest("form")}get index(){var t;return[...((t=this.parentElement)==null?void 0:t.options)||[this]].indexOf(this)}get label(){var t;return(t=f(this,"label"))!=null?t:this.text}set label(t){f(this,"label",t)}get selected(){return f(this,z)!==null}set selected(t){f(this,z,t?"":null)}get text(){var t;return((t=this.textContent)==null?void 0:t.trim())||""}set text(t){this.textContent=t}get value(){var t;return(t=f(this,"value"))!=null?t:this.text}set value(t){f(this,"value",t)}};Ln.define("u-option",Ei);var Mn,On=0,$i=qt||vt,Pn="click,focusout,input,keydown,mousedown,mouseup",Dn="focus,focusin,blur,focusout",gt={singular:"%d hit",plural:"%d hits"},Nn=class extends Cn{constructor(){super(),this._texts=hi({},gt),this._value="",bi(this,`${vi}
8
+ ::slotted(data:focus) { ${xo} }`))}static get observedAttributes(){return Object.keys(dt).map(t=>`data-sr-${t}`)}connectedCallback(){this._root=Lo(this),rt(this,be,this,!0),Ct(this,{attributeFilter:["value","id"],attributes:!0,characterData:!0,childList:!0,subtree:!0}),setTimeout(pt,0,this),setTimeout(ft,0,this)}attributeChangedCallback(t,e,n){const o=t.split("data-sr-")[1];dt[o]&&(this._texts[o]=n||dt[o])}disconnectedCallback(){Ct(this,!1),ko(this,be,this,!0),this._items=this._clear=this._focus=this._control=void 0,this._list=this._options=this._root=void 0}handleEvent(t){const e=t.target;t.type==="beforeinput"&&(this._value=e?.value||""),t.type==="blur"&&Ro(this),t.type==="click"&&Uo(this,t),t.type==="focus"&&Ho(this,t),t.type==="input"&&qo(this,t),t.type==="keydown"&&Fo(this,t),t.type==="mousedown"&&Lt(t),t.type==="mutation"&&pt(this,t)}get multiple(){var t;return((t=p(this,"data-multiple"))!=null?t:ct)!==ct}set multiple(t){p(this,"data-multiple",t?"":null)}get creatable(){var t;return((t=p(this,"data-creatable"))!=null?t:ct)!==ct}set creatable(t){p(this,"data-creatable",t?"":null)}get control(){var t;return(t=this._control)!=null&&t.isConnected||(this._control=this.querySelector("input")),this._control}get list(){var t;return(t=this._list)!=null&&t.isConnected||(this._list=this.querySelector("u-datalist,datalist")),this._list}get clear(){var t;return(t=this._clear)!=null&&t.isConnected||(this._clear=this.querySelector("del")),this._clear}get items(){return this._items||(this._items=this.getElementsByTagName("data")),this._items}get options(){var t,e;if(!this._options){const n=((t=this.list)==null?void 0:t.nodeName)==="U-DATALIST"?"u-option":"option";this._options=(e=this.list)==null?void 0:e.getElementsByTagName(n)}return this._options}get values(){return[...this.items].map(({value:t})=>t)}},O=t=>{var e;return((e=t?.textContent)==null?void 0:e.trim())||""},At=t=>t instanceof HTMLDataElement,pt=(t,e)=>{var n,o;const{_focus:i,_texts:s,items:r,control:a,list:d,multiple:l}=t;let h=`${O((n=a?.labels)==null?void 0:n[0])}, ${l?r.length?s.found.replace("%d",`${r.length}`):s.empty:""}`;const u=[];for(const{addedNodes:b,removedNodes:I}of e?.detail||[]){for(const m of b)At(m)&&u.unshift(m);for(const m of I)At(m)&&u.push(m)}const T=l?u.length===1:u[0]===i;if(i&&a&&T){const b=p(a,"inputmode"),I=At(i)?a:i;t._speak=`${s[u[0].isConnected?"added":"removed"]} ${O(u[0])}, `,(No||i===a)&&kt(t._speak),a!==I&&(p(a,"aria-expanded",null),p(a,"inputmode","none"),h=" ",a.focus()),setTimeout(()=>{var m;p(a,"aria-expanded","true"),p(a,"inputmode",b),(m=I?.focus)==null||m.call(I),t._speak="",Do?rt(t,"blur",()=>pt(t),ge):setTimeout(pt,100,t)},100)}let w=0;const k=t.querySelector("select");for(const b of r){const I=k?.options[w],m=O(b),A=b.value||m,ee=`${t._speak}${m}, ${s.remove}, ${++w} ${s.of} ${r.length}`;p(b,"role","button"),p(b,"value",A),p(b,"tabindex","-1"),p(b,"aria-label",ee),I?Object.assign(I,{textContent:m,value:A}):k?.appendChild(new Option(m,A,!0,!0))}k&&p(k,"multiple",l?"":null);for(const b of[...k?.options||[]].slice(w))b.remove();!l&&w>1&&console.warn("u-combobox: Multiple <data> found in single mode."),d&&p(d,"aria-multiselectable",`${l}`),a&&p(a,"list",Mo(d)),a&&p(a,"aria-label",`${t._speak}${h}`);const J=O(r[0]);J!==t._item&&ft(t),t._item=J,ye(t),we(t),(o=Ct(t))==null||o.takeRecords()},ye=t=>{var e;t.clear&&p(t.clear,"role","button"),t.clear&&(t.clear.hidden=!((e=t.control)!=null&&e.value))},we=t=>{var e;const{_speak:n,options:o=[],values:i}=t;for(const s of o){const r=(e=p(s,"value"))!=null?e:O(s);p(s,"aria-label",n?`${n}${O(s)}`:null),p(s,"selected",i.includes(r)?"":null)}},ft=t=>{const{multiple:e,control:n,items:o}=t,i=O(o[0]);!e&&n&&i!==n.value&&_e(n,i,i?"insertText":"deleteContent")},Mt=(t,e=!0)=>{var n;const{_texts:o,options:i=[],creatable:s,control:r,items:a,multiple:d}=t,l=((n=r?.value)==null?void 0:n.trim())||"",h=l.toLowerCase()||null;let u=[...i].find(w=>(p(w,"label")||O(w)).trim().toLowerCase()===h);const T={bubbles:!0,cancelable:!0,detail:u};if(t.dispatchEvent(new CustomEvent("beforematch",T))||(u=[...i].find(w=>w.selected)),e)return we(t),u?q(t,u,!1):s&&l?q(t,{value:l},!1):(!d&&!l&&a[0]?q(t,a[0]):ft(t),kt(o.invalid));for(const w of i)w.selected=w===u},q=(t,e,n=!0)=>{const{control:o,items:i,multiple:s}=t,r=lt("data",e.label||e.value,{value:e.value}),a=[...i].find(h=>h.value===e.value),d={bubbles:!0,cancelable:!0,detail:a||r};if(a&&!n)return ft(t);if(t.dispatchEvent(new CustomEvent("beforechange",d))){if(!s)for(const h of[...i])h.remove();a?a.remove():o?.insertAdjacentElement("beforebegin",r),t.dispatchEvent(new CustomEvent("afterchange",d))}},Ho=(t,{target:e})=>{e instanceof HTMLElement&&(t._focus=e),kt()},Ro=t=>Lt()||setTimeout(Bo,0,t),Bo=t=>{var e;!t._focus||t.contains((e=t._root)==null?void 0:e.activeElement)||(t.multiple||Mt(t),t._focus=void 0)},Uo=(t,e)=>{const{clientX:n,clientY:o,target:i}=e,{clear:s,control:r,items:a}=t;if(s?.contains(i))return r&&_e(r,"","deleteContentBackward"),r?.focus();for(const d of a){const{top:l,right:h,bottom:u,left:T}=d.getBoundingClientRect();if(d.contains(i))return q(t,d);if(o>=l&&o<=u&&n>=T&&n<=h)return d.focus()}i===t&&r?.focus()},qo=(t,e)=>{var n;const{options:o=[],control:i,multiple:s}=t,r=((n=i?.value)==null?void 0:n.trim())||"";if(e instanceof InputEvent?!e.inputType||e.inputType==="insertReplacementText":!!r){e.stopImmediatePropagation(),i&&(i.value=t._value);for(const d of o)if(d.value&&d.value===r)return q(t,d,s)}else s||Mt(t,!1);ye(t)},Fo=(t,e)=>{var n;if(e.altKey||e.ctrlKey||e.metaKey||e.shiftKey)return;const{clear:o,control:i,items:s}=t,{key:r,repeat:a,target:d}=e,l=i&&i===d,h=l&&i?.selectionEnd;let u=l?s.length:[...s].indexOf(d);if(l&&r==="Tab"&&o&&!o.hidden&&(e.preventDefault(),o.tabIndex=-1,o.focus(),rt(o,"blur",()=>p(o,"tabindex",null),ge)),!(!l&&Io(e)||u===-1)){if(r==="ArrowRight"&&!l)u+=1;else if(r==="ArrowLeft"&&!h)u-=1;else if(r==="Enter"&&l){const T=p(i,"form");return p(i,"form","#"),requestAnimationFrame(()=>p(i,"form",T)),Mt(t)}else if((r==="Backspace"||r==="Delete")&&!h){if(e.preventDefault(),!a&&s[u])return q(t,s[u]);l&&(u-=1)}else return l||i?.focus();e.preventDefault(),(n=s[Math.max(0,u)]||i)==null||n.focus()}};Oo.define("u-combobox",ut);const Vo="1.3.12",E={capture:!0,passive:!0},K=typeof window<"u"&&typeof document<"u";function Yo(t,e){let n;return(...o)=>{clearTimeout(n),n=setTimeout(()=>t(...o),e)}}function c(t,e,n){return n===void 0?t.getAttribute(e)??null:(n===null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n),null)}let jo=0;const Ko=`${Date.now().toString(36)}${Math.random().toString(36).slice(2,5)}`;function Ot(t){return t.id||(t.id=`${Ko}${++jo}`),t.id}const Wo=(t,e,n)=>{for(const o of n[0].split(","))n[0]=o,e[`${t}EventListener`](...n)},v=(t,...e)=>Wo("add",t,e),W=K?document.createElement("div"):null,ht=new Map,Xo=()=>{for(const[t,e]of ht)e()};W&&(W.style.cssText="position:absolute;padding:1px;top:0;left:0px",v(window,"load,resize,scroll",Xo,E));const F={top:0,right:1,bottom:2,left:3};function P(t,e,n,o){const i=F[n]??Number(n)??F.bottom;if(e===!1||!e.isConnected||!t.isConnected)return ht.delete(t);W?.isConnected||document.body.append(W||""),ht.has(t)||ht.set(t,()=>P(t,e,i,o));const s=e instanceof HTMLElement,{offsetWidth:r,offsetHeight:a}=t,d=s?e.offsetWidth:e.clientWidth,l=s?e.offsetHeight:e.clientHeight,{width:h,height:u,left:T,top:w}=e.getBoundingClientRect(),k=window.visualViewport?.width||window.innerWidth,J=window.visualViewport?.height||window.innerHeight,b=window.pageXOffset||document.documentElement.scrollLeft,I=window.pageYOffset||document.documentElement.scrollTop,m=Math.round(T-(d-h)/2),A=Math.round(w-(l-u)/2),ee=Math.min(Math.max(10,m-(r-d)/2),k-r-10),rs=Math.min(Math.max(10,A-(a-l)/2),J-a-10),as=m-r>0,ls=m+d+r<k,cs=A-a>0,ds=A+l+a<J,uo=i===F.top||i===F.bottom,us=i===F.right&&(o||ls)||!as,po=i===F.bottom&&(o||ds)||!cs,ps=Math.round(uo?ee:us?m+d:m-r),fs=Math.round(uo?po?A+l:A-a:rs);t.style.position="absolute",t.style.left=`${ps+b}px`,t.style.top=`${fs+I}px`,W?.style.setProperty("translate",`0px ${Math.round(po?b+A+l+a+30:0)}px`)}function Ee(t){let e=0;const n=()=>setTimeout(o,200),o=()=>{t([],i),i.takeRecords(),e=0},i=new MutationObserver(()=>{e||(e=requestAnimationFrame(n))});return i}const Pt=new WeakMap,V=(t,e,n)=>{const o=t.getElementsByClassName(e),i=Pt.get(t)||[];i.length||(Pt.set(t,i),Ee((s,r)=>{if(t.isConnected&&i?.length)for(const a of i)a();else r?.disconnect(),Pt.delete(t)}).observe(t,{attributeFilter:["class","hidden"],attributes:!0,childList:!0,subtree:!0})),i.push(()=>n(o))},x=t=>{if(!K)return;const e=()=>requestAnimationFrame(t);document.readyState==="complete"?e():v(window,"load",e)},Dt=t=>t instanceof HTMLElement&&"validity"in t&&!(t instanceof HTMLButtonElement),$e="mattilsynet.matomo.cloud";let Nt=!0;function Go(t,e={}){if(K){if(window._paq||(window._paq=[],window._paq.push(["HeatmapSessionRecording::disable"]),window._paq.push(["enableLinkTracking"]),window._paq.push(["setTrackerUrl",`https://${$e}/matomo.php`]),document.querySelector('script[src*="matomo.js"]')||document.head.append(Object.assign(document.createElement("script"),{async:!0,src:`https://cdn.matomo.cloud/${$e}/matomo.js`}))),t==="init"){const{matomoId:n,enabled:o}=e;Nt=o??window.location.hostname==="localhost",window._paq.push(["setSiteId",n])}if(Nt==="debug")return console.info(`Analytics: "${t}"`,e);if(Nt!==!1)if(t==="pageview"){const{url:n,title:o}=e;window._paq.push(["setCustomUrl",n||location.href]),window._paq.push(["setDocumentTitle",o||document.title]),window._paq.push(["trackPageView"])}else if(t==="event"){const{category:n,action:o,name:i,value:s}=e,r=["trackEvent",n,o,i,s];window._paq.push(r.filter(a=>a!==void 0))}else if(t==="search"){const{query:n,category:o=!1,results:i=!1}=e;window._paq.push(["trackSiteSearch",n,o,i])}else t==="matomo"&&window._paq.push(e)}}const zo=(t,e,n=Number.POSITIVE_INFINITY)=>{const o=(n-1)/2,i=Math.max(Math.min(t-Math.floor(o),e-n+1),1),s=Math.min(Math.max(t+Math.ceil(o),n),e),r=Array.from({length:s+1-i},(a,d)=>d+i);return n>4&&i>1&&r.splice(0,2,1,0),n>3&&s<e&&r.splice(-2,2,0,e),r},Qo=({current:t=1,total:e=10,show:n=7})=>({prev:t>1?t-1:0,next:t<e?t+1:0,pages:zo(t,e,n).map((o,i)=>({current:o===t&&"page",key:`key-${o}-${i}`,page:o}))}),Se="_alert_1run0_1 _ds-alert_im5h3_1",Te="_app_1run0_1",xe="_sticky_1run0_1",Ce="_avatar_1run0_1 _ds-avatar_im5h3_1",ke="_badge_1run0_1",Ie="_breadcrumbs_1run0_1 _ds-breadcrumbs_im5h3_1",Le="_button_1run0_1 _ds-button_im5h3_1",Ae="_card_1run0_1",Me="_group_1run0_1",Oe="_chip_1run0_1 _ds-chip_im5h3_1",Pe="_details_1run0_1 _ds-details_im5h3_1",De="_dialog_1run0_1 _ds-dialog_im5h3_1",Ne="_divider_1run0_1",He="_errorsummary_1run0_1 _ds-error-summary_im5h3_1",Re="__errorsummary_1run0_1",Be="_field_1run0_1 _ds-field_im5h3_1",Ue="__datalist_1run0_1",qe="_affixes_1run0_1 _ds-field-affixes_im5h3_1",Fe="_fieldset_1run0_1 _ds-fieldset_im5h3_1",Ve="_heading_1run0_1 _ds-heading_im5h3_1",Ye="_ingress_1run0_1",je="_muted_1run0_1",Ke="_info_1run0_1",We="_prose_1run0_1",Xe="_helptext_1run0_1 _ds-focus_im5h3_1",Ge="_input_1run0_1 _ds-input_im5h3_1",ze="_grid_1run0_1",Qe="_flex_1run0_1",Je="_link_1run0_1",Ze="_logo_1run0_1",tn="_pagination_1run0_1 _ds-pagination_im5h3_1",en="_popover_1run0_1",nn="_progress_1run0_1",on="__indeterminate_1run0_1",sn="_skeleton_1run0_1 _ds-skeleton_im5h3_1",rn="__skeleton_1run0_1",an="_spinner_1run0_1",ln="_steps_1run0_1",cn="_table_1run0_1 _ds-table_im5h3_1",dn="__scrollShadow_1run0_1",un="_tabs_1run0_1 _ds-tabs_im5h3_1",pn="__scrollMask_1run0_1",fn="_tag_1run0_1 _ds-tag_im5h3_1",hn="_togglegroup_1run0_1",mn="__tooltip_1run0_1",vn="_validation_1run0_1 _ds-validation-message_im5h3_1",_n="_body_1run0_153",bn="__checked_1run0_1",_={alert:Se,app:Te,sticky:xe,avatar:Ce,badge:ke,breadcrumbs:Ie,button:Le,card:Ae,group:Me,chip:Oe,details:Pe,dialog:De,divider:Ne,errorsummary:He,_errorsummary:Re,field:Be,_datalist:Ue,affixes:qe,fieldset:Fe,heading:Ve,ingress:Ye,muted:je,info:Ke,prose:We,helptext:Xe,input:Ge,grid:ze,flex:Qe,link:Je,logo:Ze,pagination:tn,popover:en,progress:nn,_indeterminate:on,skeleton:sn,_skeleton:rn,spinner:an,steps:ln,table:cn,_scrollShadow:dn,tabs:un,_scrollMask:pn,tag:fn,togglegroup:hn,_tooltip:mn,validation:vn,body:_n,_checked:bn},Jo=Object.freeze(Object.defineProperty({__proto__:null,_checked:bn,_datalist:Ue,_errorsummary:Re,_indeterminate:on,_scrollMask:pn,_scrollShadow:dn,_skeleton:rn,_tooltip:mn,affixes:qe,alert:Se,app:Te,avatar:Ce,badge:ke,body:_n,breadcrumbs:Ie,button:Le,card:Ae,chip:Oe,default:_,details:Pe,dialog:De,divider:Ne,errorsummary:He,field:Be,fieldset:Fe,flex:Qe,grid:ze,group:Me,heading:Ve,helptext:Xe,info:Ke,ingress:Ye,input:Ge,link:Je,logo:Ze,muted:je,pagination:tn,popover:en,progress:nn,prose:We,skeleton:sn,spinner:an,steps:ln,sticky:xe,table:cn,tabs:un,tag:fn,togglegroup:hn,validation:vn},Symbol.toStringTag,{value:"Module"}));typeof window<"u"&&window.CSSStyleSheet&&document.adoptedStyleSheets&&(()=>{const t="--mtds-app-expanded",e=new CSSStyleSheet,n=()=>!window.localStorage.getItem(t)?.includes("false");document.adoptedStyleSheets.push(e),window.mtdsToggleAppExpanded=o=>{try{const i=o??!n();e.replaceSync?.(`:root { ${t}: var(${t}--${i})}`),window.localStorage.setItem(t,i)}catch{}},window.mtdsToggleAppExpanded(n())})();const gn=_.app.split(" ")[0],Zo=_.sticky.split(" ")[0],ti='[data-command="toggle-app-expanded"]',yn=`.${gn} > dialog,.${gn} dialog ~ main`,wn=t=>{document.startViewTransition?document.startViewTransition(t):t()},En=t=>wn(()=>window.mtdsToggleAppExpanded?.(t));function ei({target:t,defaultPrevented:e}){if(!(e||!(t instanceof HTMLButtonElement)||!t.matches(ti))){if(getComputedStyle(t).position==="sticky")return En();wn(()=>{const n=document.querySelector(yn);n?.setAttribute("data-closedby","any"),n?.showModal()})}}function ni(){document.querySelector(yn)?.close()}let Ht=0,Y,M=0,g,Rt=0,mt=0,Bt=!1,Ut=0,N=0;function oi([t]){g=t,$n()}function $n(){if(!g?.isConnected)return;const t=window.scrollY,e=t<N;N=t,e!==Y&&(Ht=(g.parentElement?.getBoundingClientRect().top||0)+N,Y=e,Rt=g.offsetHeight,mt=g.getBoundingClientRect().top+N,Bt=g.offsetHeight<=window.innerHeight,Ut=window.innerHeight),!(M===-1&&Bt)&&(M!==-1&&(Bt||Y&&N<=mt)?(g.style.setProperty("--pos","sticky"),g.style.setProperty("--top","0px"),M=-1):M===-1&&!Y?(g.style.setProperty("--pos","relative"),g.style.setProperty("--top",`${Math.max(0,N-Ht)}px`),M=0):M!==1&&!Y&&N+Ut>=mt+Rt?(g.style.setProperty("--pos","sticky"),g.style.setProperty("--top",`${Ut-Rt}px`),M=1):M===1&&Y&&(g.style.setProperty("--pos","relative"),g.style.setProperty("--top",`${mt-Ht}px`),M=0))}x(()=>{V(document.documentElement,Zo,oi),v(document,"click",ei,E),v(window,"resize",Yo(ni,100),E),v(window,"scroll",$n,E)});const ii=_.breadcrumbs.split(" ")[0];function si(t){for(const e of t)e.querySelectorAll("li a").forEach((n,o,{length:i})=>{c(n,"aria-current",o===i-1?"page":null)})}x(()=>V(document.documentElement,ii,si));const ri=_.dialog.split(" ")[0],ai=K?document.getElementsByClassName(ri):[],li=()=>{for(const t of ai)t.isConnected&&t.showModal&&t.close&&(t.matches('[open]:not([data-modal="false"]):not(:modal)')?(c(t,"open",null),t.showModal()):t.matches(":modal:not([open])")&&(c(t,"open",""),t.close()))},ci=({clientX:t,clientY:e,target:n})=>{if(n instanceof HTMLDialogElement&&c(n,"data-closedby")==="any"){const{top:o,right:i,bottom:s,left:r}=n.getBoundingClientRect();o<=e&&e<=s&&r<=t&&t<=i||n.close()}else n instanceof Element&&n.closest('button[data-command="close"]')&&n?.closest("dialog")?.close()};x(()=>{v(document,"click",ci,E),Ee(li).observe(document.documentElement,{attributeFilter:["open"],attributes:!0,childList:!0,subtree:!0})});function di(t){if(t.animationName!==_._errorsummary)return;const e=t.target?.firstElementChild;e instanceof HTMLHeadingElement&&(c(e,"tabindex","-1"),e.focus())}x(()=>v(document,"animationend",di,E));var ui=Object.defineProperty,Sn=Object.getOwnPropertySymbols,pi=Object.prototype.hasOwnProperty,fi=Object.prototype.propertyIsEnumerable,Tn=(t,e,n)=>e in t?ui(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,hi=(t,e)=>{for(var n in e||(e={}))pi.call(e,n)&&Tn(t,n,e[n]);if(Sn)for(var n of Sn(e))fi.call(e,n)&&Tn(t,n,e[n]);return t},X=typeof window<"u"&&typeof window.document<"u"&&typeof window.navigator<"u",vt=X&&/android/i.test(navigator.userAgent),qt=X&&/iPad|iPhone|iPod/.test(navigator.userAgent),xn;X&&/^Mac/i.test(((xn=navigator.userAgentData)==null?void 0:xn.platform)||navigator.platform);var mi=`${vt?"data":"aria"}-labelledby`,vi=":host(:not([hidden])) { display: block }",_i="outline: 1px dotted; outline: 5px auto Highlight; outline: 5px auto -webkit-focus-ring-color",Cn=typeof HTMLElement>"u"?class{}:HTMLElement;function f(t,e,n){return n===void 0?t.getAttribute(e):(n===null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n),null)}var kn=(t,e,n)=>{for(const o of n[0].split(","))n[0]=o,Element.prototype[`${t}EventListener`].apply(e,n)},G=(t,...e)=>kn("add",t,e),_t=(t,...e)=>kn("remove",t,e),bi=(t,e)=>t.attachShadow({mode:"open"}).append(Yt("slot"),Yt("style",e)),bt=new WeakMap,Ft=(t,e)=>{if(e===void 0)return bt.get(t);try{bt.get(t).disconnect(),bt.delete(t)}catch{}if(e){const n=new MutationObserver(o=>t.handleEvent({type:"mutation",detail:o}));n.observe(t,e),bt.set(t,n)}},In=t=>{var e;const n=((e=t.getRootNode)==null?void 0:e.call(t))||t.ownerDocument;return n instanceof Document||n instanceof ShadowRoot?n:document},gi=0,Vt=t=>t?(t.id||(t.id=`:${t.nodeName.toLowerCase()}${(++gi).toString(32)}`),t.id):"",Yt=(t,e,n)=>{const o=document.createElement(t);return e&&(o.textContent=e),o},Ln={define:(t,e)=>!X||window.customElements.get(t)||window.customElements.define(t,e)},H,yi=0,An=t=>{H||(H=Yt("div"),H.style.cssText="position:fixed;overflow:hidden;width:1px;white-space:nowrap",f(H,"aria-live","assertive")),H.isConnected||document.body.append(H),t&&(H.textContent=`${t}${yi++%2?" ":""}`)},wi=(t,e,n="")=>{var o,i;const s={bubbles:!0,composed:!0,data:e,inputType:n},r=HTMLInputElement.prototype;t.dispatchEvent(new InputEvent("beforeinput",s)),(i=(o=Object.getOwnPropertyDescriptor(r,"value"))==null?void 0:o.set)==null||i.call(t,e),t.dispatchEvent(new InputEvent("input",s)),t.dispatchEvent(new Event("change",{bubbles:!0}))},jt=!1,Kt=t=>(t?.type==="mouseup"&&(jt=!1),t?.type==="mousedown"&&(jt=!0,G(document,"mouseup",Kt,{once:!0})),jt),Wt="disabled",z="selected",Ei=class extends Cn{static get observedAttributes(){return[Wt,z]}connectedCallback(){qt||(this.tabIndex=-1),this.hasAttribute("role")||f(this,"role","option"),this.attributeChangedCallback()}attributeChangedCallback(){f(this,"aria-disabled",`${this.disabled}`),f(this,"aria-selected",`${this.selected}`)}get defaultSelected(){return this[z]}set defaultSelected(t){this[z]=t}get disabled(){return f(this,Wt)!==null}set disabled(t){f(this,Wt,t?"":null)}get form(){return this.closest("form")}get index(){var t;return[...((t=this.parentElement)==null?void 0:t.options)||[this]].indexOf(this)}get label(){var t;return(t=f(this,"label"))!=null?t:this.text}set label(t){f(this,"label",t)}get selected(){return f(this,z)!==null}set selected(t){f(this,z,t?"":null)}get text(){var t;return((t=this.textContent)==null?void 0:t.trim())||""}set text(t){this.textContent=t}get value(){var t;return(t=f(this,"value"))!=null?t:this.text}set value(t){f(this,"value",t)}};Ln.define("u-option",Ei);var Mn,On=0,$i=qt||vt,Pn="click,focusout,input,keydown,mousedown,mouseup",Dn="focus,focusin,blur,focusout",gt={singular:"%d hit",plural:"%d hits"},Nn=class extends Cn{constructor(){super(),this._texts=hi({},gt),this._value="",bi(this,`${vi}
9
9
  ::slotted(u-option) { display: block; cursor: pointer }
10
10
  ::slotted(u-option:focus) { ${_i} }
11
11
  ::slotted(u-option[aria-hidden="true"]),
@@ -1,4 +1,4 @@
1
- const o = "1.3.11";
1
+ const o = "1.3.12";
2
2
  export {
3
3
  o as version
4
4
  };