@mattilsynet/design 2.2.4 → 2.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/mtds/app/app-observer.js +1 -1
- package/mtds/app/app-toggle.js +26 -10
- package/mtds/app/app-toggle.js.map +1 -1
- package/mtds/app/app-toggle2.js +10 -26
- package/mtds/app/app-toggle2.js.map +1 -1
- package/mtds/app/app.js +1 -1
- package/mtds/field/field.js +1 -0
- package/mtds/field/field.js.map +1 -1
- package/mtds/index.iife.js +1 -1
- package/mtds/map/map.d.ts +4 -0
- package/mtds/package.json.js +1 -1
- package/mtds/styles.css +1 -1
- package/mtds/toast/toast.js +8 -7
- package/mtds/toast/toast.js.map +1 -1
- package/package.json +1 -1
- package/mtds/_virtual/client.js +0 -6
- package/mtds/_virtual/client.js.map +0 -1
- package/mtds/_virtual/client2.js +0 -5
- package/mtds/_virtual/client2.js.map +0 -1
- package/mtds/_virtual/index.js +0 -5
- package/mtds/_virtual/index.js.map +0 -1
- package/mtds/_virtual/react-dom-client.development.js +0 -5
- package/mtds/_virtual/react-dom-client.development.js.map +0 -1
- package/mtds/_virtual/react-dom-client.production.js +0 -5
- package/mtds/_virtual/react-dom-client.production.js.map +0 -1
- package/mtds/_virtual/scheduler.development.js +0 -5
- package/mtds/_virtual/scheduler.development.js.map +0 -1
- package/mtds/_virtual/scheduler.production.js +0 -5
- package/mtds/_virtual/scheduler.production.js.map +0 -1
- package/mtds/external/react-dom/cjs/react-dom-client.development.js +0 -15323
- package/mtds/external/react-dom/cjs/react-dom-client.development.js.map +0 -1
- package/mtds/external/react-dom/cjs/react-dom-client.production.js +0 -9409
- package/mtds/external/react-dom/cjs/react-dom-client.production.js.map +0 -1
- package/mtds/external/react-dom/client.js +0 -24
- package/mtds/external/react-dom/client.js.map +0 -1
- package/mtds/external/scheduler/cjs/scheduler.development.js +0 -237
- package/mtds/external/scheduler/cjs/scheduler.development.js.map +0 -1
- package/mtds/external/scheduler/cjs/scheduler.production.js +0 -234
- package/mtds/external/scheduler/cjs/scheduler.production.js.map +0 -1
- package/mtds/external/scheduler/index.js +0 -11
- package/mtds/external/scheduler/index.js.map +0 -1
package/mtds/app/app-observer.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import S from "../styles.module.css.js";
|
|
2
2
|
import { onLoaded as _, onMutation as P, on as r, QUICK_EVENT as p, debounce as E } from "../utils.js";
|
|
3
|
-
import "./app-
|
|
3
|
+
import "./app-toggle2.js";
|
|
4
4
|
const g = S.app.split(" ")[0], h = S.sticky.split(" ")[0], I = '[data-command="toggle-app-expanded"]', y = `.${g} > dialog,.${g} dialog ~ main`, C = (t) => {
|
|
5
5
|
document.startViewTransition ? document.startViewTransition(t) : t();
|
|
6
6
|
}, x = (t) => (
|
package/mtds/app/app-toggle.js
CHANGED
|
@@ -1,11 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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-toggle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-toggle.js","sources":["../../designsystem/app/app-toggle.js"],"sourcesContent":["if (
|
|
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,MAAAA,IAAe;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-toggle2.js
CHANGED
|
@@ -1,27 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
)
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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-toggle2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-toggle2.js","sources":["../../designsystem/app/app-toggle.js
|
|
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,cAAa,GACzBC,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,EAAI;AAC3B,MAAAD,EAAM,cAAc,WAAWD,CAAG,SAASA,CAAG,KAAKI,CAAI,IAAI,GAC3D,OAAO,aAAa,QAAQJ,GAAKI,CAAI;AAAA,IACtC,QAAe;AAAA,IAAC;AAAA,EACjB,GAGA,OAAO,sBAAsBF,GAAM;AACpC,GAAC;"}
|
package/mtds/app/app.js
CHANGED
|
@@ -34,7 +34,7 @@ import "../togglegroup/togglegroup.js";
|
|
|
34
34
|
import "../typography/typography.js";
|
|
35
35
|
import "../validation/validation.js";
|
|
36
36
|
import a from "../styles.module.css.js";
|
|
37
|
-
import d from "./app-
|
|
37
|
+
import d from "./app-toggle.js";
|
|
38
38
|
const f = p(function({ as: t, className: r, ...m }, n) {
|
|
39
39
|
return /* @__PURE__ */ o(t || "div", { className: e(a.app, r), ref: n, ...m });
|
|
40
40
|
}), u = p(function({ as: t, className: r, ...m }, n) {
|
package/mtds/field/field.js
CHANGED
package/mtds/field/field.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field.js","sources":["../../designsystem/field/field.tsx"],"sourcesContent":["import type { Placement } from \"@floating-ui/dom\";\nimport type {\n\tReactUcombobox,\n\tUHTMLComboboxElement,\n} from \"@u-elements/u-combobox\";\nimport clsx from \"clsx\";\nimport type { JSX } from \"react\";\nimport { forwardRef, useEffect, useImperativeHandle, useRef } from \"react\";\nimport { HelpText, Input, type InputProps } from \"../react\";\nimport type {\n\tPolymorphicComponentPropWithRef,\n\tPolymorphicRef,\n} from \"../react-types\";\nimport styles from \"../styles.module.css\";\nimport { 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?: (\n\t\te: React.ChangeEvent<\n\t\t\tHTMLInputElement | HTMLSelectElement | HTMLTextAreaElement\n\t\t>,\n\t) => 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\toptions: undefined, // Ensure options is not passed to DOM\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 suppressHydrationWarning>{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\n\t\t\t\t\t\tclassName={styles.input}\n\t\t\t\t\t\tsuppressHydrationWarning\n\t\t\t\t\t\tref={ref}\n\t\t\t\t\t\t{...rest}\n\t\t\t\t\t/>\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 && (\n\t\t\t\t<div suppressHydrationWarning className={styles.validation}>\n\t\t\t\t\t{valid}\n\t\t\t\t</div>\n\t\t\t)}\n\t\t\t{!!count && <p suppressHydrationWarning 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\nexport type FieldAffixProps = React.ComponentPropsWithoutRef<\"div\">;\nconst FieldAffixes = forwardRef<HTMLDivElement, FieldAffixProps>(\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\"?: Placement;\n};\n\nconst FieldDatalist = forwardRef<HTMLDataListElement, FieldDatalistProps>(\n\tfunction FieldDatalist({ \"data-nofilter\": filter, ...rest }, ref) {\n\t\treturn (\n\t\t\t<u-datalist\n\t\t\t\tdata-nofilter={!!filter || undefined} // Ensure data-nofilter is set correctly\n\t\t\t\tref={ref}\n\t\t\t\t{...toCustomElementProps(rest)}\n\t\t\t/>\n\t\t);\n\t},\n);\n\nexport type FieldOptionProps = React.ComponentPropsWithoutRef<\"option\">;\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; // deprecated\n\tonAfterSelect?: (e: CustomEvent<HTMLDataElement>) => void; // Custom event to handle before change\n\tonBeforeChange?: (e: CustomEvent<HTMLDataElement>) => void; // deprecated\n\tonBeforeMatch?: (e: CustomEvent<HTMLOptionElement>) => void; // Custom event to handle before change\n\tonBeforeSelect?: (e: CustomEvent<HTMLDataElement>) => void; // Custom event to handle before change\n\tonSelectedChange?: (selected: FieldComboboxSelected) => void; // Allow onChange to be a function that returns void\n\toptions?: FieldComboboxSelected;\n\tselected?: FieldComboboxSelected; // Allow value to be a string or an array of strings for multiple select\n} & Pick<\n\t\tInputProps,\n\t\t\"disabled\" | \"readOnly\" | \"placeholder\" | \"type\" | \"name\"\n\t> & // Allow input props to be passed down\n\tPick<FieldDatalistProps, \"data-position\" | \"data-nofilter\">; // Allow datalist props to be passed down\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\t\"data-position\": position,\n\t\t\tonAfterChange,\n\t\t\tonAfterSelect,\n\t\t\tonBeforeChange,\n\t\t\tonBeforeMatch,\n\t\t\tonBeforeSelect,\n\t\t\tonSelectedChange,\n\t\t\tchildren,\n\t\t\tdisabled,\n\t\t\tname,\n\t\t\toptions,\n\t\t\tplaceholder,\n\t\t\treadOnly,\n\t\t\tselected,\n\t\t\ttype,\n\t\t\t...props\n\t\t},\n\t\tref,\n\t) {\n\t\tconst innerRef = useRef<UHTMLComboboxElement>(null);\n\t\tconst onSelected = useRef(onSelectedChange);\n\t\tonSelected.current = onSelectedChange; // Sync the latest onSelectedChange function\n\n\t\t// Deprecated props\n\t\tif (onAfterChange) {\n\t\t\tonAfterSelect = onAfterChange;\n\t\t\tconsole.warn(\n\t\t\t\t`Combobox onAfterChange is deprecated, use onAfterSelect instead.`,\n\t\t\t);\n\t\t}\n\t\tif (onBeforeChange) {\n\t\t\tonBeforeSelect = onBeforeChange;\n\t\t\tconsole.warn(\n\t\t\t\t`Combobox onBeforeChange is deprecated, use onBeforeSelect instead.`,\n\t\t\t);\n\t\t}\n\n\t\t// Using useEffect for React 18 and lower compatibility\n\t\tuseImperativeHandle(ref, () => innerRef.current as UHTMLComboboxElement); // Forward innerRef\n\t\tuseEffect(() => {\n\t\t\tconst self = innerRef.current;\n\t\t\tconst handleChange = (event: CustomEvent<HTMLDataElement>) => {\n\t\t\t\tconst handleSelected = onSelected.current;\n\t\t\t\tif (!onSelected) return; // No onSelectedChange function provided, let u-combobox handle it\n\t\t\t\tevent.preventDefault();\n\t\t\t\tconst { isConnected: remove, textContent, value } = event.detail;\n\t\t\t\tconst label = textContent?.trim() || \"\";\n\t\t\t\tconst prev = selected || [];\n\n\t\t\t\tif (remove) handleSelected?.(prev.filter((i) => i.value !== value));\n\t\t\t\telse if (multiple) handleSelected?.([...prev, { value, label }]);\n\t\t\t\telse handleSelected?.([{ value, label }]);\n\t\t\t};\n\n\t\t\tself?.addEventListener(\"comboboxbeforeselect\", handleChange);\n\t\t\treturn () =>\n\t\t\t\tself?.removeEventListener(\"comboboxbeforeselect\", handleChange);\n\t\t}, [multiple, selected]);\n\n\t\treturn (\n\t\t\t<u-combobox\n\t\t\t\tdata-multiple={multiple || undefined}\n\t\t\t\t{...toCustomElementProps({\n\t\t\t\t\toncomboboxbeforeselect: onBeforeSelect,\n\t\t\t\t\toncomboboxbeforematch: onBeforeMatch,\n\t\t\t\t\toncomboboxafterselect: onAfterSelect,\n\t\t\t\t\tref: innerRef,\n\t\t\t\t\t...props,\n\t\t\t\t})}\n\t\t\t>\n\t\t\t\t{selected?.map(({ children, label, value }) => (\n\t\t\t\t\t<data key={value} value={value} suppressHydrationWarning>\n\t\t\t\t\t\t{children ?? label}\n\t\t\t\t\t</data>\n\t\t\t\t))}\n\t\t\t\t{children || (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\tname={name}\n\t\t\t\t\t\t\ttype={type}\n\t\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\t\treadOnly={readOnly}\n\t\t\t\t\t\t\tplaceholder={placeholder}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<del {...toCustomElementProps({ \"aria-label\": \"Fjern tekst\" })} />\n\t\t\t\t\t</>\n\t\t\t\t)}\n\t\t\t\t{!!options && (\n\t\t\t\t\t<FieldDatalist data-nofilter={nofilter} data-position={position}>\n\t\t\t\t\t\t{options.map(toOption).map(({ children, label, value }) => (\n\t\t\t\t\t\t\t<FieldOption key={value} value={value} label={label}>\n\t\t\t\t\t\t\t\t{children ?? label}\n\t\t\t\t\t\t\t</FieldOption>\n\t\t\t\t\t\t))}\n\t\t\t\t\t</FieldDatalist>\n\t\t\t\t)}\n\t\t\t</u-combobox>\n\t\t);\n\t},\n);\n\nexport type FieldLabelProps = React.ComponentPropsWithoutRef<\"label\">;\nexport const Field = Object.assign(FieldComp, {\n\tAffixes: FieldAffixes,\n\tCombobox: FieldCombobox,\n\tDatalist: FieldDatalist,\n\tOption: FieldOption,\n\tLabel: forwardRef<HTMLLabelElement, FieldLabelProps>(\n\t\tfunction FieldLabel(rest, ref) {\n\t\t\treturn <label suppressHydrationWarning ref={ref} {...rest} />;\n\t\t},\n\t),\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","filter","toCustomElementProps","FieldOption","props","FieldCombobox","multiple","nofilter","position","onAfterChange","onAfterSelect","onBeforeChange","onBeforeMatch","onBeforeSelect","onSelectedChange","children","disabled","name","options","placeholder","readOnly","selected","type","innerRef","useRef","onSelected","useImperativeHandle","useEffect","self","handleChange","event","handleSelected","remove","textContent","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;A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V,UAAUL;AAAA,EACV,QAAQG;AAAA,EACR,OAAO9B;AAAA,IACN,SAAoBc,GAAMC,GAAK;AAC9B,+BAAQ,SAAA,EAAM,0BAAwB,IAAC,KAAAA,GAAW,GAAGD,GAAM;AAAA,IAC5D;AAAA,EAAA;AAEF,CAAC;"}
|
|
1
|
+
{"version":3,"file":"field.js","sources":["../../designsystem/field/field.tsx"],"sourcesContent":["\"use client\";\nimport type { Placement } from \"@floating-ui/dom\";\nimport type {\n\tReactUcombobox,\n\tUHTMLComboboxElement,\n} from \"@u-elements/u-combobox\";\nimport clsx from \"clsx\";\nimport type { JSX } from \"react\";\nimport { forwardRef, useEffect, useImperativeHandle, useRef } from \"react\";\nimport { HelpText, Input, type InputProps } from \"../react\";\nimport type {\n\tPolymorphicComponentPropWithRef,\n\tPolymorphicRef,\n} from \"../react-types\";\nimport styles from \"../styles.module.css\";\nimport { 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?: (\n\t\te: React.ChangeEvent<\n\t\t\tHTMLInputElement | HTMLSelectElement | HTMLTextAreaElement\n\t\t>,\n\t) => 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\toptions: undefined, // Ensure options is not passed to DOM\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 suppressHydrationWarning>{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\n\t\t\t\t\t\tclassName={styles.input}\n\t\t\t\t\t\tsuppressHydrationWarning\n\t\t\t\t\t\tref={ref}\n\t\t\t\t\t\t{...rest}\n\t\t\t\t\t/>\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 && (\n\t\t\t\t<div suppressHydrationWarning className={styles.validation}>\n\t\t\t\t\t{valid}\n\t\t\t\t</div>\n\t\t\t)}\n\t\t\t{!!count && <p suppressHydrationWarning 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\nexport type FieldAffixProps = React.ComponentPropsWithoutRef<\"div\">;\nconst FieldAffixes = forwardRef<HTMLDivElement, FieldAffixProps>(\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\"?: Placement;\n};\n\nconst FieldDatalist = forwardRef<HTMLDataListElement, FieldDatalistProps>(\n\tfunction FieldDatalist({ \"data-nofilter\": filter, ...rest }, ref) {\n\t\treturn (\n\t\t\t<u-datalist\n\t\t\t\tdata-nofilter={!!filter || undefined} // Ensure data-nofilter is set correctly\n\t\t\t\tref={ref}\n\t\t\t\t{...toCustomElementProps(rest)}\n\t\t\t/>\n\t\t);\n\t},\n);\n\nexport type FieldOptionProps = React.ComponentPropsWithoutRef<\"option\">;\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; // deprecated\n\tonAfterSelect?: (e: CustomEvent<HTMLDataElement>) => void; // Custom event to handle before change\n\tonBeforeChange?: (e: CustomEvent<HTMLDataElement>) => void; // deprecated\n\tonBeforeMatch?: (e: CustomEvent<HTMLOptionElement>) => void; // Custom event to handle before change\n\tonBeforeSelect?: (e: CustomEvent<HTMLDataElement>) => void; // Custom event to handle before change\n\tonSelectedChange?: (selected: FieldComboboxSelected) => void; // Allow onChange to be a function that returns void\n\toptions?: FieldComboboxSelected;\n\tselected?: FieldComboboxSelected; // Allow value to be a string or an array of strings for multiple select\n} & Pick<\n\t\tInputProps,\n\t\t\"disabled\" | \"readOnly\" | \"placeholder\" | \"type\" | \"name\"\n\t> & // Allow input props to be passed down\n\tPick<FieldDatalistProps, \"data-position\" | \"data-nofilter\">; // Allow datalist props to be passed down\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\t\"data-position\": position,\n\t\t\tonAfterChange,\n\t\t\tonAfterSelect,\n\t\t\tonBeforeChange,\n\t\t\tonBeforeMatch,\n\t\t\tonBeforeSelect,\n\t\t\tonSelectedChange,\n\t\t\tchildren,\n\t\t\tdisabled,\n\t\t\tname,\n\t\t\toptions,\n\t\t\tplaceholder,\n\t\t\treadOnly,\n\t\t\tselected,\n\t\t\ttype,\n\t\t\t...props\n\t\t},\n\t\tref,\n\t) {\n\t\tconst innerRef = useRef<UHTMLComboboxElement>(null);\n\t\tconst onSelected = useRef(onSelectedChange);\n\t\tonSelected.current = onSelectedChange; // Sync the latest onSelectedChange function\n\n\t\t// Deprecated props\n\t\tif (onAfterChange) {\n\t\t\tonAfterSelect = onAfterChange;\n\t\t\tconsole.warn(\n\t\t\t\t`Combobox onAfterChange is deprecated, use onAfterSelect instead.`,\n\t\t\t);\n\t\t}\n\t\tif (onBeforeChange) {\n\t\t\tonBeforeSelect = onBeforeChange;\n\t\t\tconsole.warn(\n\t\t\t\t`Combobox onBeforeChange is deprecated, use onBeforeSelect instead.`,\n\t\t\t);\n\t\t}\n\n\t\t// Using useEffect for React 18 and lower compatibility\n\t\tuseImperativeHandle(ref, () => innerRef.current as UHTMLComboboxElement); // Forward innerRef\n\t\tuseEffect(() => {\n\t\t\tconst self = innerRef.current;\n\t\t\tconst handleChange = (event: CustomEvent<HTMLDataElement>) => {\n\t\t\t\tconst handleSelected = onSelected.current;\n\t\t\t\tif (!onSelected) return; // No onSelectedChange function provided, let u-combobox handle it\n\t\t\t\tevent.preventDefault();\n\t\t\t\tconst { isConnected: remove, textContent, value } = event.detail;\n\t\t\t\tconst label = textContent?.trim() || \"\";\n\t\t\t\tconst prev = selected || [];\n\n\t\t\t\tif (remove) handleSelected?.(prev.filter((i) => i.value !== value));\n\t\t\t\telse if (multiple) handleSelected?.([...prev, { value, label }]);\n\t\t\t\telse handleSelected?.([{ value, label }]);\n\t\t\t};\n\n\t\t\tself?.addEventListener(\"comboboxbeforeselect\", handleChange);\n\t\t\treturn () =>\n\t\t\t\tself?.removeEventListener(\"comboboxbeforeselect\", handleChange);\n\t\t}, [multiple, selected]);\n\n\t\treturn (\n\t\t\t<u-combobox\n\t\t\t\tdata-multiple={multiple || undefined}\n\t\t\t\t{...toCustomElementProps({\n\t\t\t\t\toncomboboxbeforeselect: onBeforeSelect,\n\t\t\t\t\toncomboboxbeforematch: onBeforeMatch,\n\t\t\t\t\toncomboboxafterselect: onAfterSelect,\n\t\t\t\t\tref: innerRef,\n\t\t\t\t\t...props,\n\t\t\t\t})}\n\t\t\t>\n\t\t\t\t{selected?.map(({ children, label, value }) => (\n\t\t\t\t\t<data key={value} value={value} suppressHydrationWarning>\n\t\t\t\t\t\t{children ?? label}\n\t\t\t\t\t</data>\n\t\t\t\t))}\n\t\t\t\t{children || (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\tname={name}\n\t\t\t\t\t\t\ttype={type}\n\t\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\t\treadOnly={readOnly}\n\t\t\t\t\t\t\tplaceholder={placeholder}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<del {...toCustomElementProps({ \"aria-label\": \"Fjern tekst\" })} />\n\t\t\t\t\t</>\n\t\t\t\t)}\n\t\t\t\t{!!options && (\n\t\t\t\t\t<FieldDatalist data-nofilter={nofilter} data-position={position}>\n\t\t\t\t\t\t{options.map(toOption).map(({ children, label, value }) => (\n\t\t\t\t\t\t\t<FieldOption key={value} value={value} label={label}>\n\t\t\t\t\t\t\t\t{children ?? label}\n\t\t\t\t\t\t\t</FieldOption>\n\t\t\t\t\t\t))}\n\t\t\t\t\t</FieldDatalist>\n\t\t\t\t)}\n\t\t\t</u-combobox>\n\t\t);\n\t},\n);\n\nexport type FieldLabelProps = React.ComponentPropsWithoutRef<\"label\">;\nexport const Field = Object.assign(FieldComp, {\n\tAffixes: FieldAffixes,\n\tCombobox: FieldCombobox,\n\tDatalist: FieldDatalist,\n\tOption: FieldOption,\n\tLabel: forwardRef<HTMLLabelElement, FieldLabelProps>(\n\t\tfunction FieldLabel(rest, ref) {\n\t\t\treturn <label suppressHydrationWarning ref={ref} {...rest} />;\n\t\t},\n\t),\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","filter","toCustomElementProps","FieldOption","props","FieldCombobox","multiple","nofilter","position","onAfterChange","onAfterSelect","onBeforeChange","onBeforeMatch","onBeforeSelect","onSelectedChange","children","disabled","name","options","placeholder","readOnly","selected","type","innerRef","useRef","onSelected","useImperativeHandle","useEffect","self","handleChange","event","handleSelected","remove","textContent","prev","i","Fragment","Input","Field"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4CA,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,EAAA;AAID,SAAIT,MAAO,YAAY,CAACY,EAAK,YAC5B,OAAO,OAAOA,GAAM;AAAA,IACnB,SAAS;AAAA;AAAA,IACT,iCAEI,UAAAA,EAAK,SACJ,IAAIjB,CAAQ,EACb,IAAI,CAAC,EAAE,OAAAY,GAAO,OAAAa,EAAA,MACd,gBAAAC,EAAC,UAAA,EAAmB,OAAAD,GAClB,UAAAb,EAAAA,GADWa,CAEb,CACA,EAAA,CACH;AAAA,EAAA,CAED,GAGKpB,IACN,gBAAAsB,EAAC,OAAA,EAAK,GAAGL,GACP,UAAA;AAAA,IAAA,CAAC,CAACV,KAAS,gBAAAc,EAAC,SAAA,EAAM,0BAAwB,IAAE,UAAAd,GAAM;AAAA,IAClD,CAAC,CAACF,uBAAakB,GAAA,EAAS,cAAYjB,GAAgB,UAAAD,GAAS;AAAA,IAC7D,CAAC,CAACF,uBA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BAAAC,EAACO,GAAA,EAAwB,OAAAR,GAAc,OAAAb,GACrC,UAAAiC,KAAYjC,EAAA,GADIa,CAElB,CACA,EAAA,CACF;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAIJ;AACD,GAGa2C,KAAQ,OAAO,OAAOlE,GAAW;AAAA,EAC7C,SAAS2B;AAAA,EACT,UAAUM;AAAA,EACV,UAAUL;AAAA,EACV,QAAQG;AAAA,EACR,OAAO9B;AAAA,IACN,SAAoBc,GAAMC,GAAK;AAC9B,+BAAQ,SAAA,EAAM,0BAAwB,IAAC,KAAAA,GAAW,GAAGD,GAAM;AAAA,IAC5D;AAAA,EAAA;AAEF,CAAC;"}
|
package/mtds/index.iife.js
CHANGED
|
@@ -5,7 +5,7 @@ var mtds=function(M){"use strict";var ns=Object.defineProperty,ln=Object.getOwnP
|
|
|
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; cursor: pointer }
|
|
8
|
-
::slotted(data:focus) { ${ls} }`,mn="beforeinput,blur,focus,click,input,keydown,mousedown",gn={once:!0,passive:!0},vs=rs&&!dn,ws=dn||as,bn="".repeat(5),Bt="false",Ft={added:"Added",empty:"No selected",found:"Navigate left to find %d selected",invalid:"Invalid value",of:"of",remove:"Press to remove",removed:"Removed"},we=class extends cs{constructor(){super(),this._item="",this._speak="",this._texts=ss({},Ft),this._value="",this.shadowRoot||this.attachShadow({mode:"open"}).append(Ht("slot"),Ht("style",bs))}static get observedAttributes(){return Object.keys(Ft).map(t=>`data-sr-${t}`)}connectedCallback(){this._root=fs(this),Dt(this,mn,this,!0),me(this,{attributeFilter:["value","id"],attributes:!0,characterData:!0,childList:!0,subtree:!0}),setTimeout(Ut,0,this),setTimeout(zt,0,this)}attributeChangedCallback(t,e,n){const o=t.split("data-sr-")[1];Ft[o]&&(this._texts[o]=n||Ft[o])}disconnectedCallback(){me(this,!1),ds(this,mn,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;ye(this)||(t.type==="beforeinput"&&(this._value=e?.value||""),t.type==="blur"&&ys(this),t.type==="click"&&Es(this,t),t.type==="focus"&&_s(this,t),t.type==="input"&&Ss(this,t),t.type==="keydown"&&Ts(this,t),t.type==="mousedown"&&ve(t),t.type==="mutation"&&Ut(this,t))}get multiple(){var t;return((t=_(this,"data-multiple"))!=null?t:Bt)!==Bt}set multiple(t){_(this,"data-multiple",t?"":null)}get creatable(){var t;return((t=_(this,"data-creatable"))!=null?t:Bt)!==Bt}set creatable(t){_(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)}},ot=t=>{var e;return((e=t?.textContent)==null?void 0:e.trim())||""},_e=t=>t instanceof HTMLDataElement,ye=({control:t})=>t?.disabled||t?.readOnly||!1,Ut=(t,e)=>{var n;const{_focus:o,_texts:i,items:s,control:r,list:a,multiple:c}=t;if(!r||!a)return;const l=ms(r),d=l.endsWith(bn)?_(r,"data-label"):l;_(r,"data-label",d);let u=`${d}${c?`, ${s.length?i.found.replace("%d",`${s.length}`):i.empty}`:""}`;const h=[];for(const{addedNodes:b,removedNodes:x}of e?.detail||[]){for(const y of b)_e(y)&&h.unshift(y);for(const y of x)_e(y)&&h.push(y)}const p=c?h.length===1:h[0]===o;if(o&&p){const b=_(r,"aria-expanded"),x=_(r,"inputmode"),y=_e(o)?r:o,S=!h[0].isConnected;t._speak=`${i[S?"removed":"added"]} ${ot(h[0])}, `,(ws||o===r)&&ge(t._speak),r!==y&&(_(r,"aria-expanded",null),_(r,"inputmode","none"),u=" ",r.focus()),setTimeout(()=>{var N;_(r,"aria-expanded",b),_(r,"inputmode",S?"none":x),(N=y?.focus)==null||N.call(y),_(r,"inputmode",x),t._speak="",vs?Dt(t,"blur",()=>Ut(t),gn):setTimeout(Ut,100,t)},100)}let g=0;const m=t.querySelector("select"),w=ye(t)?"":`${i.remove}, `;for(const b of s){const x=m?.options[g],y=ot(b),S=b.value||y,N=`${t._speak}${y}, ${w}${++g} ${i.of} ${s.length}`;_(b,"role","button"),_(b,"value",S),_(b,"tabindex","-1"),_(b,"aria-label",N),x?Object.assign(x,{textContent:y,value:S}):m?.appendChild(new Option(y,S,!0,!0))}m&&_(m,"multiple",c?"":null);for(const b of[...m?.options||[]].slice(g))b.remove();!c&&g>1&&console.warn("u-combobox: Multiple <data> found in single mode."),_(a,"aria-multiselectable",`${c}`),_(r,"list",pn(a)),_(r,"aria-label",`${t._speak}${u}${bn}`),a.hasAttribute("popover")&&(_(r,"popovertarget",pn(a)),_(a,"popover","manual"));const v=ot(s[0]);v!==t._item&&zt(t),t._item=v,vn(t),wn(t),(n=me(t))==null||n.takeRecords()},vn=t=>{var e;t.clear&&_(t.clear,"role","button"),t.clear&&(t.clear.hidden=!((e=t.control)!=null&&e.value)||ye(t))},wn=t=>{var e;const{_speak:n,options:o=[],values:i}=t;for(const s of o){const r=(e=_(s,"value"))!=null?e:ot(s);_(s,"aria-label",n?`${n}${ot(s)}`:null),_(s,"selected",i.includes(r)?"":null)}},zt=t=>{const{multiple:e,control:n,items:o}=t,i=ot(o[0]);!e&&n&&i!==n.value&&hn(n,i,i?"insertText":"deleteContent")},xe=(t,e=!0)=>{var n;const{_texts:o,options:i=[],creatable:s,control:r,items:a,multiple:c}=t,l=((n=r?.value)==null?void 0:n.trim())||"",d=l.toLowerCase()||null;let u=[...i].find(p=>(_(p,"label")||ot(p)).trim().toLowerCase()===d);const h={bubbles:!0,cancelable:!0,detail:u};if(t.dispatchEvent(new CustomEvent("comboboxbeforematch",h))||(u=[...i].find(p=>p.selected)),e)return wn(t),u?ht(t,u,!1):s&&l?ht(t,{value:l},!1):(!c&&!l&&a[0]?ht(t,a[0]):zt(t),ge(o.invalid));for(const p of i)p.selected=p===u},ht=(t,e,n=!0)=>{const{control:o,items:i,multiple:s}=t,r=Ht("data",e.label||e.value,{value:e.value}),a=[...i].find(d=>d.value===e.value),c={bubbles:!0,cancelable:!0,detail:a||r};if(a&&!n)return zt(t);if(t.dispatchEvent(new CustomEvent("comboboxbeforeselect",c))){if(!s)for(const d of[...i])d.remove();a?a.remove():o?.insertAdjacentElement("beforebegin",r),t.dispatchEvent(new CustomEvent("comboboxafterselect",c))}},_s=(t,{target:e})=>{e instanceof HTMLElement&&(t._focus=e),ge()},ys=t=>ve()||setTimeout(xs,0,t),xs=t=>{var e;!t._focus||t.contains((e=t._root)==null?void 0:e.activeElement)||(t.multiple||xe(t),t._focus=void 0)},Es=(t,e)=>{const{clientX:n,clientY:o,target:i}=e,{clear:s,control:r,items:a}=t;if(s?.contains(i))return r&&hn(r,"","deleteContentBackward"),r?.focus();for(const c of a){const{top:l,right:d,bottom:u,left:h}=c.getBoundingClientRect();if(c.contains(i))return ht(t,c);if(o>=l&&o<=u&&n>=h&&n<=d)return c.focus()}i===t&&r?.focus()},Ss=(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 c of o)if(c.value&&c.value===r)return ht(t,c,s)}else s||xe(t,!1);vn(t)},Ts=(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:c}=e,l=i&&i===c,d=l&&i?.selectionEnd;let u=l?s.length:[...s].indexOf(c);if(l&&r==="Tab"&&o&&!o.hidden&&(e.preventDefault(),o.tabIndex=-1,o.focus(),Dt(o,"blur",()=>_(o,"tabindex",null),gn)),!(!l&&us(e)||u===-1)){if(r==="ArrowRight"&&!l)u+=1;else if(r==="ArrowLeft"&&!d)u-=1;else if(r==="Enter"&&l){const h=_(i,"form");return _(i,"form","#"),requestAnimationFrame(()=>_(i,"form",h)),xe(t)}else if((r==="Backspace"||r==="Delete")&&!d){if(e.preventDefault(),!a&&s[u])return ht(t,s[u]);l&&(u-=1)}else return l||i?.focus();e.preventDefault(),(n=s[Math.max(0,u)]||i)==null||n.focus()}};hs.define("u-combobox",we);var Ee=typeof window<"u"&&typeof window.document<"u"&&typeof window.navigator<"u",Cs=Ee&&/android/i.test(navigator.userAgent),_n;Ee&&/^Mac/i.test(((_n=navigator.userAgentData)==null?void 0:_n.platform)||navigator.platform);var $s=`${Cs?"data":"aria"}-labelledby`,Se=":host(:not([hidden])) { display: block }",qt=typeof HTMLElement>"u"?class{}:HTMLElement;function A(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 yn=(t,e,n)=>{for(const o of n[0].split(","))n[0]=o,Element.prototype[`${t}EventListener`].apply(e,n)},ks=(t,...e)=>yn("add",t,e),As=(t,...e)=>yn("remove",t,e),Vt=(t,e)=>t.shadowRoot||t.attachShadow({mode:"open"}).append(Tn("slot"),Tn("style",e)),Wt=new WeakMap,xn=(t,e)=>{if(e===void 0)return Wt.get(t);try{Wt.get(t).disconnect(),Wt.delete(t)}catch{}if(e){const n=new MutationObserver(o=>t.handleEvent({type:"mutation",detail:o}));n.observe(t,e),Wt.set(t,n)}},Ls=t=>{const e="key"in t&&(t.key===" "||t.key==="Enter");return e&&t.preventDefault(),e&&t.target instanceof HTMLElement&&t.target.click(),e},En=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},Is=0,Sn=t=>t?(t.id||(t.id=`:${t.nodeName.toLowerCase()}${(++Is).toString(32)}`),t.id):"",Tn=(t,e,n)=>{const o=document.createElement(t);return e&&(o.textContent=e),o},jt={define:(t,e)=>!Ee||window.customElements.get(t)||window.customElements.define(t,e)},Ms=Se,Os=Se,Rs=Se,Ps=':host(:not([hidden])) { display: inline-block; cursor: pointer }:host([aria-disabled="true"]) { cursor: default }',Gt="aria-controls",mt="aria-selected",Cn=class extends qt{constructor(){super(),Vt(this,Ms)}get tabList(){return Yt("u-tablist",this)[0]||null}get selectedIndex(){return Kt(this.tabs)}set selectedIndex(t){$e(this.tabs[t])}get tabs(){return Yt("u-tab",this)}get panels(){return Yt("u-tabpanel",this)}},$n=class extends qt{constructor(){super(),Vt(this,Os)}connectedCallback(){A(this,"role","tablist"),ks(this,"click,keydown",this),xn(this,{childList:!0}),this.tabs.length&&this.handleEvent()}disconnectedCallback(){As(this,"click,keydown",this),xn(this,!1)}handleEvent(t){if(!t||t.type==="mutation"){const s=this.tabs[Math.max(this.selectedIndex,0)];return s?.setAttribute(mt,"true")}const{key:e}=t,n=[...this.tabs],o=n.findIndex(s=>s.contains(t.target));let i=o;if(!(t.defaultPrevented||o===-1)&&(t.type==="click"&&$e(n[o]),t.type==="keydown"&&!Ls(t))){if(e==="ArrowDown"||e==="ArrowRight")i=(o+1)%n.length;else if(e==="ArrowUp"||e==="ArrowLeft")i=(o||n.length)-1;else if(e==="End")i=n.length-1;else if(e==="Home")i=0;else if(e==="Tab")i=Kt(n);else return;setTimeout(()=>{n[o].tabIndex=-1,n[i].tabIndex=0}),e!=="Tab"&&(t.preventDefault(),n[i].focus())}}get tabsElement(){return this.closest("u-tabs")}get tabs(){return this.querySelectorAll("u-tab")}get selectedIndex(){return Kt(this.tabs)}set selectedIndex(t){$e(this.tabs[t])}},Te=!1,kn=class extends qt{static get observedAttributes(){return["id",mt,Gt]}constructor(){super(),Vt(this,Ps)}connectedCallback(){A(this,"role","tab"),this.tabIndex=this.selected?0:-1}attributeChangedCallback(){if(!Te&&this.selected&&this.tabList){Te=!0;const t=[...this.tabList.querySelectorAll("u-tab")],e=Yt("u-tabpanel",this.tabsElement||this),n=Ce(this,e[t.indexOf(this)]);n&&A(n,$s,Sn(this)),t.forEach((o,i)=>{const s=Ce(o,e[i]);o.tabIndex=o===this?0:-1,A(o,mt,`${o===this}`),A(o,Gt,s?.id||null),s&&(s.hidden=s!==n)}),Te=!1}}get tabsElement(){return this.closest("u-tabs")}get tabList(){const t=this.parentElement;return t?.nodeName==="U-TABLIST"?t:null}get selected(){return A(this,mt)==="true"}set selected(t){A(this,mt,`${!!t}`)}get index(){const t=this.tabList;return t?[...t.querySelectorAll("u-tab")].indexOf(this):0}get panel(){return Ce(this)}},An=class extends qt{static get observedAttributes(){return["hidden"]}constructor(){super(),Vt(this,Rs)}connectedCallback(){A(this,"role","tabpanel"),this.hidden=Kt(this.tabs)===-1,this.attributeChangedCallback()}attributeChangedCallback(){const t=this.hidden;A(this,"aria-hidden",`${t}`),A(this,"tabindex",t||Ds(this.firstChild)?null:"0")}get tabsElement(){return this.closest("u-tabs")}get tabs(){const t=`u-tab[${Gt}="${this.id}"]`;return En(this).querySelectorAll(t)}},Yt=(t,e)=>e.querySelectorAll(`${t}:not(:scope u-tabpanel ${t})`),Ce=(t,e)=>{const n=A(t,Gt)||Sn(e),o=En(t).getElementById(n);return o?.nodeName==="U-TABPANEL"?o:null},Kt=t=>[...t].findIndex(e=>A(e,mt)==="true"),$e=t=>t&&A(t,"aria-disabled")!=="true"&&A(t,"aria-selected","true"),Ds=t=>t instanceof Element&&!t.matches(':disabled,[tabindex^="-"]')&&t.matches('[contenteditable],[controls],[href],[tabindex],input:not([type="hidden"]),select,textarea,button,summary,iframe');jt.define("u-tabs",Cn),jt.define("u-tablist",$n),jt.define("u-tab",kn),jt.define("u-tabpanel",An);const Ns="2.2.4",Ln="_alert_1nshl_1 _ds-alert_nwz76_3",In="_app_1nshl_1",Mn="_sticky_1nshl_1",On="_avatar_1nshl_1 _ds-avatar_nwz76_1",Rn="_badge_1nshl_1",Pn="_breadcrumbs_1nshl_1 _ds-breadcrumbs_nwz76_5",Dn="_button_1nshl_1 _ds-button_nwz76_1",Nn="_card_1nshl_1",Hn="_group_1nshl_1",Bn="_chip_1nshl_1 _ds-chip_nwz76_5",Fn="_details_1nshl_1 _ds-details_nwz76_3",Un="_dialog_1nshl_1 _ds-dialog_nwz76_5",zn="__drawer_1nshl_1",qn="_divider_1nshl_1",Vn="_errorsummary_1nshl_1 _ds-error-summary_nwz76_5",Wn="__errorsummary_1nshl_1",jn="_field_1nshl_1 _ds-field_nwz76_1",Gn="__datalist_1nshl_1",Yn="_affixes_1nshl_1 _ds-field-affixes_nwz76_3",Kn="_fieldset_1nshl_1 _ds-fieldset_nwz76_3",Xn="_helptext_1nshl_1 _ds-focus_nwz76_1",Qn="_input_1nshl_1 _ds-input_nwz76_1",Jn="_grid_1nshl_1",Zn="_flex_1nshl_1",to="_link_1nshl_1",eo="_logo_1nshl_1",no="_pagination_1nshl_1 _ds-pagination_nwz76_5",oo="_popover_1nshl_1",io="_progress_1nshl_1",so="__indeterminate_1nshl_1",ro="_skeleton_1nshl_1 _ds-skeleton_nwz76_5",ao="__skeleton_1nshl_1",lo="_spinner_1nshl_1",co="_steps_1nshl_1",uo="_table_1nshl_1 _ds-table_nwz76_5",fo="__scrollShadow_1nshl_1",po="_tabs_1nshl_1 _ds-tabs_nwz76_5",ho="__scrollMask_1nshl_1",mo="_tag_1nshl_1 _ds-tag_nwz76_5",go="_toast_1nshl_1",bo="__toastClose_1nshl_1",vo="__toastOpen_1nshl_1",wo="__toastTimeout_1nshl_1",_o="_togglegroup_1nshl_1",yo="__tooltip_1nshl_1",xo="_heading_1nshl_1 _ds-heading_nwz76_1",Eo="_ingress_1nshl_1",So="_muted_1nshl_1",To="_info_1nshl_1",Co="_prose_1nshl_1",$o="_validation_1nshl_1 _ds-validation-message_nwz76_1",ko="_body_1nshl_172",Ao="__checked_1nshl_1",T={alert:Ln,app:In,sticky:Mn,avatar:On,badge:Rn,breadcrumbs:Pn,button:Dn,card:Nn,group:Hn,chip:Bn,details:Fn,dialog:Un,_drawer:zn,divider:qn,errorsummary:Vn,_errorsummary:Wn,field:jn,_datalist:Gn,affixes:Yn,fieldset:Kn,helptext:Xn,input:Qn,grid:Jn,flex:Zn,link:to,logo:eo,pagination:no,popover:oo,progress:io,_indeterminate:so,skeleton:ro,_skeleton:ao,spinner:lo,steps:co,table:uo,_scrollShadow:fo,tabs:po,_scrollMask:ho,tag:mo,toast:go,_toastClose:bo,_toastOpen:vo,_toastTimeout:wo,togglegroup:_o,_tooltip:yo,heading:xo,ingress:Eo,muted:So,info:To,prose:Co,validation:$o,body:ko,_checked:Ao},Hs=Object.freeze(Object.defineProperty({__proto__:null,_checked:Ao,_datalist:Gn,_drawer:zn,_errorsummary:Wn,_indeterminate:so,_scrollMask:ho,_scrollShadow:fo,_skeleton:ao,_toastClose:bo,_toastOpen:vo,_toastTimeout:wo,_tooltip:yo,affixes:Yn,alert:Ln,app:In,avatar:On,badge:Rn,body:ko,breadcrumbs:Pn,button:Dn,card:Nn,chip:Bn,default:T,details:Fn,dialog:Un,divider:qn,errorsummary:Vn,field:jn,fieldset:Kn,flex:Zn,grid:Jn,group:Hn,heading:xo,helptext:Xn,info:To,ingress:Eo,input:Qn,link:to,logo:eo,muted:So,pagination:no,popover:oo,progress:io,prose:Co,skeleton:ro,spinner:lo,steps:co,sticky:Mn,table:uo,tabs:po,tag:mo,toast:go,togglegroup:_o,validation:$o},Symbol.toStringTag,{value:"Module"})),gt=Math.min,O=Math.max,Xt=Math.round,Qt=Math.floor,V=t=>({x:t,y:t}),Bs={left:"right",right:"left",bottom:"top",top:"bottom"},Fs={start:"end",end:"start"};function Lo(t,e,n){return O(t,gt(e,n))}function Jt(t,e){return typeof t=="function"?t(e):t}function it(t){return t.split("-")[0]}function Zt(t){return t.split("-")[1]}function Io(t){return t==="x"?"y":"x"}function Mo(t){return t==="y"?"height":"width"}const Us=new Set(["top","bottom"]);function Q(t){return Us.has(it(t))?"y":"x"}function Oo(t){return Io(Q(t))}function zs(t,e,n){n===void 0&&(n=!1);const o=Zt(t),i=Oo(t),s=Mo(i);let r=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(r=te(r)),[r,te(r)]}function qs(t){const e=te(t);return[ke(t),e,ke(e)]}function ke(t){return t.replace(/start|end/g,e=>Fs[e])}const Ro=["left","right"],Po=["right","left"],Vs=["top","bottom"],Ws=["bottom","top"];function js(t,e,n){switch(t){case"top":case"bottom":return n?e?Po:Ro:e?Ro:Po;case"left":case"right":return e?Vs:Ws;default:return[]}}function Gs(t,e,n,o){const i=Zt(t);let s=js(it(t),n==="start",o);return i&&(s=s.map(r=>r+"-"+i),e&&(s=s.concat(s.map(ke)))),s}function te(t){return t.replace(/left|right|bottom|top/g,e=>Bs[e])}function Ys(t){return{top:0,right:0,bottom:0,left:0,...t}}function Ks(t){return typeof t!="number"?Ys(t):{top:t,right:t,bottom:t,left:t}}function ee(t){const{x:e,y:n,width:o,height:i}=t;return{width:o,height:i,top:n,left:e,right:e+o,bottom:n+i,x:e,y:n}}function Do(t,e,n){let{reference:o,floating:i}=t;const s=Q(e),r=Oo(e),a=Mo(r),c=it(e),l=s==="y",d=o.x+o.width/2-i.width/2,u=o.y+o.height/2-i.height/2,h=o[a]/2-i[a]/2;let p;switch(c){case"top":p={x:d,y:o.y-i.height};break;case"bottom":p={x:d,y:o.y+o.height};break;case"right":p={x:o.x+o.width,y:u};break;case"left":p={x:o.x-i.width,y:u};break;default:p={x:o.x,y:o.y}}switch(Zt(e)){case"start":p[r]-=h*(n&&l?-1:1);break;case"end":p[r]+=h*(n&&l?-1:1);break}return p}const Xs=async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:s=[],platform:r}=n,a=s.filter(Boolean),c=await(r.isRTL==null?void 0:r.isRTL(e));let l=await r.getElementRects({reference:t,floating:e,strategy:i}),{x:d,y:u}=Do(l,o,c),h=o,p={},g=0;for(let m=0;m<a.length;m++){const{name:w,fn:v}=a[m],{x:b,y:x,data:y,reset:S}=await v({x:d,y:u,initialPlacement:o,placement:h,strategy:i,middlewareData:p,rects:l,platform:r,elements:{reference:t,floating:e}});d=b??d,u=x??u,p={...p,[w]:{...p[w],...y}},S&&g<=50&&(g++,typeof S=="object"&&(S.placement&&(h=S.placement),S.rects&&(l=S.rects===!0?await r.getElementRects({reference:t,floating:e,strategy:i}):S.rects),{x:d,y:u}=Do(l,h,c)),m=-1)}return{x:d,y:u,placement:h,strategy:i,middlewareData:p}};async function Ae(t,e){var n;e===void 0&&(e={});const{x:o,y:i,platform:s,rects:r,elements:a,strategy:c}=t,{boundary:l="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:h=!1,padding:p=0}=Jt(e,t),g=Ks(p),w=a[h?u==="floating"?"reference":"floating":u],v=ee(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(w)))==null||n?w:w.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:l,rootBoundary:d,strategy:c})),b=u==="floating"?{x:o,y:i,width:r.floating.width,height:r.floating.height}:r.reference,x=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),y=await(s.isElement==null?void 0:s.isElement(x))?await(s.getScale==null?void 0:s.getScale(x))||{x:1,y:1}:{x:1,y:1},S=ee(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:x,strategy:c}):b);return{top:(v.top-S.top+g.top)/y.y,bottom:(S.bottom-v.bottom+g.bottom)/y.y,left:(v.left-S.left+g.left)/y.x,right:(S.right-v.right+g.right)/y.x}}const Qs=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:i,middlewareData:s,rects:r,initialPlacement:a,platform:c,elements:l}=e,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:m=!0,...w}=Jt(t,e);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const v=it(i),b=Q(a),x=it(a)===a,y=await(c.isRTL==null?void 0:c.isRTL(l.floating)),S=h||(x||!m?[te(a)]:qs(a)),N=g!=="none";!h&&N&&S.push(...Gs(a,m,g,y));const G=[a,...S],dt=await Ae(e,w),ut=[];let X=((o=s.flip)==null?void 0:o.overflows)||[];if(d&&ut.push(dt[v]),u){const ft=zs(i,r,y);ut.push(dt[ft[0]],dt[ft[1]])}if(X=[...X,{placement:i,overflows:ut}],!ut.every(ft=>ft<=0)){var Mt,Ot;const ft=(((Mt=s.flip)==null?void 0:Mt.index)||0)+1,an=G[ft];if(an&&(!(u==="alignment"?b!==Q(an):!1)||X.every(q=>Q(q.placement)===b?q.overflows[0]>0:!0)))return{data:{index:ft,overflows:X},reset:{placement:an}};let Pt=(Ot=X.filter(pt=>pt.overflows[0]<=0).sort((pt,q)=>pt.overflows[1]-q.overflows[1])[0])==null?void 0:Ot.placement;if(!Pt)switch(p){case"bestFit":{var Rt;const pt=(Rt=X.filter(q=>{if(N){const et=Q(q.placement);return et===b||et==="y"}return!0}).map(q=>[q.placement,q.overflows.filter(et=>et>0).reduce((et,_l)=>et+_l,0)]).sort((q,et)=>q[1]-et[1])[0])==null?void 0:Rt[0];pt&&(Pt=pt);break}case"initialPlacement":Pt=a;break}if(i!==Pt)return{reset:{placement:Pt}}}return{}}}},Js=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:i}=e,{mainAxis:s=!0,crossAxis:r=!1,limiter:a={fn:w=>{let{x:v,y:b}=w;return{x:v,y:b}}},...c}=Jt(t,e),l={x:n,y:o},d=await Ae(e,c),u=Q(it(i)),h=Io(u);let p=l[h],g=l[u];if(s){const w=h==="y"?"top":"left",v=h==="y"?"bottom":"right",b=p+d[w],x=p-d[v];p=Lo(b,p,x)}if(r){const w=u==="y"?"top":"left",v=u==="y"?"bottom":"right",b=g+d[w],x=g-d[v];g=Lo(b,g,x)}const m=a.fn({...e,[h]:p,[u]:g});return{...m,data:{x:m.x-n,y:m.y-o,enabled:{[h]:s,[u]:r}}}}}},Zs=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,o;const{placement:i,rects:s,platform:r,elements:a}=e,{apply:c=()=>{},...l}=Jt(t,e),d=await Ae(e,l),u=it(i),h=Zt(i),p=Q(i)==="y",{width:g,height:m}=s.floating;let w,v;u==="top"||u==="bottom"?(w=u,v=h===(await(r.isRTL==null?void 0:r.isRTL(a.floating))?"start":"end")?"left":"right"):(v=u,w=h==="end"?"top":"bottom");const b=m-d.top-d.bottom,x=g-d.left-d.right,y=gt(m-d[w],b),S=gt(g-d[v],x),N=!e.middlewareData.shift;let G=y,dt=S;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(dt=x),(o=e.middlewareData.shift)!=null&&o.enabled.y&&(G=b),N&&!h){const X=O(d.left,0),Mt=O(d.right,0),Ot=O(d.top,0),Rt=O(d.bottom,0);p?dt=g-2*(X!==0||Mt!==0?X+Mt:O(d.left,d.right)):G=m-2*(Ot!==0||Rt!==0?Ot+Rt:O(d.top,d.bottom))}await c({...e,availableWidth:dt,availableHeight:G});const ut=await r.getDimensions(a.floating);return g!==ut.width||m!==ut.height?{reset:{rects:!0}}:{}}}};function ne(){return typeof window<"u"}function bt(t){return No(t)?(t.nodeName||"").toLowerCase():"#document"}function R(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function W(t){var e;return(e=(No(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function No(t){return ne()?t instanceof Node||t instanceof R(t).Node:!1}function H(t){return ne()?t instanceof Element||t instanceof R(t).Element:!1}function j(t){return ne()?t instanceof HTMLElement||t instanceof R(t).HTMLElement:!1}function Ho(t){return!ne()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof R(t).ShadowRoot}const tr=new Set(["inline","contents"]);function Et(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=B(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!tr.has(i)}const er=new Set(["table","td","th"]);function nr(t){return er.has(bt(t))}const or=[":popover-open",":modal"];function oe(t){return or.some(e=>{try{return t.matches(e)}catch{return!1}})}const ir=["transform","translate","scale","rotate","perspective"],sr=["transform","translate","scale","rotate","perspective","filter"],rr=["paint","layout","strict","content"];function Le(t){const e=Ie(),n=H(t)?B(t):t;return ir.some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||sr.some(o=>(n.willChange||"").includes(o))||rr.some(o=>(n.contain||"").includes(o))}function ar(t){let e=J(t);for(;j(e)&&!vt(e);){if(Le(e))return e;if(oe(e))return null;e=J(e)}return null}function Ie(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const lr=new Set(["html","body","#document"]);function vt(t){return lr.has(bt(t))}function B(t){return R(t).getComputedStyle(t)}function ie(t){return H(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function J(t){if(bt(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Ho(t)&&t.host||W(t);return Ho(e)?e.host:e}function Bo(t){const e=J(t);return vt(e)?t.ownerDocument?t.ownerDocument.body:t.body:j(e)&&Et(e)?e:Bo(e)}function St(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=Bo(t),s=i===((o=t.ownerDocument)==null?void 0:o.body),r=R(i);if(s){const a=Me(r);return e.concat(r,r.visualViewport||[],Et(i)?i:[],a&&n?St(a):[])}return e.concat(i,St(i,[],n))}function Me(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Fo(t){const e=B(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=j(t),s=i?t.offsetWidth:n,r=i?t.offsetHeight:o,a=Xt(n)!==s||Xt(o)!==r;return a&&(n=s,o=r),{width:n,height:o,$:a}}function Oe(t){return H(t)?t:t.contextElement}function wt(t){const e=Oe(t);if(!j(e))return V(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:s}=Fo(e);let r=(s?Xt(n.width):n.width)/o,a=(s?Xt(n.height):n.height)/i;return(!r||!Number.isFinite(r))&&(r=1),(!a||!Number.isFinite(a))&&(a=1),{x:r,y:a}}const cr=V(0);function Uo(t){const e=R(t);return!Ie()||!e.visualViewport?cr:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function dr(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==R(t)?!1:e}function st(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),s=Oe(t);let r=V(1);e&&(o?H(o)&&(r=wt(o)):r=wt(t));const a=dr(s,n,o)?Uo(s):V(0);let c=(i.left+a.x)/r.x,l=(i.top+a.y)/r.y,d=i.width/r.x,u=i.height/r.y;if(s){const h=R(s),p=o&&H(o)?R(o):o;let g=h,m=Me(g);for(;m&&o&&p!==g;){const w=wt(m),v=m.getBoundingClientRect(),b=B(m),x=v.left+(m.clientLeft+parseFloat(b.paddingLeft))*w.x,y=v.top+(m.clientTop+parseFloat(b.paddingTop))*w.y;c*=w.x,l*=w.y,d*=w.x,u*=w.y,c+=x,l+=y,g=R(m),m=Me(g)}}return ee({width:d,height:u,x:c,y:l})}function se(t,e){const n=ie(t).scrollLeft;return e?e.left+n:st(W(t)).left+n}function zo(t,e){const n=t.getBoundingClientRect(),o=n.left+e.scrollLeft-se(t,n),i=n.top+e.scrollTop;return{x:o,y:i}}function ur(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const s=i==="fixed",r=W(o),a=e?oe(e.floating):!1;if(o===r||a&&s)return n;let c={scrollLeft:0,scrollTop:0},l=V(1);const d=V(0),u=j(o);if((u||!u&&!s)&&((bt(o)!=="body"||Et(r))&&(c=ie(o)),j(o))){const p=st(o);l=wt(o),d.x=p.x+o.clientLeft,d.y=p.y+o.clientTop}const h=r&&!u&&!s?zo(r,c):V(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+d.x+h.x,y:n.y*l.y-c.scrollTop*l.y+d.y+h.y}}function fr(t){return Array.from(t.getClientRects())}function pr(t){const e=W(t),n=ie(t),o=t.ownerDocument.body,i=O(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),s=O(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let r=-n.scrollLeft+se(t);const a=-n.scrollTop;return B(o).direction==="rtl"&&(r+=O(e.clientWidth,o.clientWidth)-i),{width:i,height:s,x:r,y:a}}const qo=25;function hr(t,e){const n=R(t),o=W(t),i=n.visualViewport;let s=o.clientWidth,r=o.clientHeight,a=0,c=0;if(i){s=i.width,r=i.height;const d=Ie();(!d||d&&e==="fixed")&&(a=i.offsetLeft,c=i.offsetTop)}const l=se(o);if(l<=0){const d=o.ownerDocument,u=d.body,h=getComputedStyle(u),p=d.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,g=Math.abs(o.clientWidth-u.clientWidth-p);g<=qo&&(s-=g)}else l<=qo&&(s+=l);return{width:s,height:r,x:a,y:c}}const mr=new Set(["absolute","fixed"]);function gr(t,e){const n=st(t,!0,e==="fixed"),o=n.top+t.clientTop,i=n.left+t.clientLeft,s=j(t)?wt(t):V(1),r=t.clientWidth*s.x,a=t.clientHeight*s.y,c=i*s.x,l=o*s.y;return{width:r,height:a,x:c,y:l}}function Vo(t,e,n){let o;if(e==="viewport")o=hr(t,n);else if(e==="document")o=pr(W(t));else if(H(e))o=gr(e,n);else{const i=Uo(t);o={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return ee(o)}function Wo(t,e){const n=J(t);return n===e||!H(n)||vt(n)?!1:B(n).position==="fixed"||Wo(n,e)}function br(t,e){const n=e.get(t);if(n)return n;let o=St(t,[],!1).filter(a=>H(a)&&bt(a)!=="body"),i=null;const s=B(t).position==="fixed";let r=s?J(t):t;for(;H(r)&&!vt(r);){const a=B(r),c=Le(r);!c&&a.position==="fixed"&&(i=null),(s?!c&&!i:!c&&a.position==="static"&&!!i&&mr.has(i.position)||Et(r)&&!c&&Wo(t,r))?o=o.filter(d=>d!==r):i=a,r=J(r)}return e.set(t,o),o}function vr(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const r=[...n==="clippingAncestors"?oe(e)?[]:br(e,this._c):[].concat(n),o],a=r[0],c=r.reduce((l,d)=>{const u=Vo(e,d,i);return l.top=O(u.top,l.top),l.right=gt(u.right,l.right),l.bottom=gt(u.bottom,l.bottom),l.left=O(u.left,l.left),l},Vo(e,a,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function wr(t){const{width:e,height:n}=Fo(t);return{width:e,height:n}}function _r(t,e,n){const o=j(e),i=W(e),s=n==="fixed",r=st(t,!0,s,e);let a={scrollLeft:0,scrollTop:0};const c=V(0);function l(){c.x=se(i)}if(o||!o&&!s)if((bt(e)!=="body"||Et(i))&&(a=ie(e)),o){const p=st(e,!0,s,e);c.x=p.x+e.clientLeft,c.y=p.y+e.clientTop}else i&&l();s&&!o&&i&&l();const d=i&&!o&&!s?zo(i,a):V(0),u=r.left+a.scrollLeft-c.x-d.x,h=r.top+a.scrollTop-c.y-d.y;return{x:u,y:h,width:r.width,height:r.height}}function Re(t){return B(t).position==="static"}function jo(t,e){if(!j(t)||B(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return W(t)===n&&(n=n.ownerDocument.body),n}function Go(t,e){const n=R(t);if(oe(t))return n;if(!j(t)){let i=J(t);for(;i&&!vt(i);){if(H(i)&&!Re(i))return i;i=J(i)}return n}let o=jo(t,e);for(;o&&nr(o)&&Re(o);)o=jo(o,e);return o&&vt(o)&&Re(o)&&!Le(o)?n:o||ar(t)||n}const yr=async function(t){const e=this.getOffsetParent||Go,n=this.getDimensions,o=await n(t.floating);return{reference:_r(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function xr(t){return B(t).direction==="rtl"}const Er={convertOffsetParentRelativeRectToViewportRelativeRect:ur,getDocumentElement:W,getClippingRect:vr,getOffsetParent:Go,getElementRects:yr,getClientRects:fr,getDimensions:wr,getScale:wt,isElement:H,isRTL:xr};function Yo(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function Sr(t,e){let n=null,o;const i=W(t);function s(){var a;clearTimeout(o),(a=n)==null||a.disconnect(),n=null}function r(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),s();const l=t.getBoundingClientRect(),{left:d,top:u,width:h,height:p}=l;if(a||e(),!h||!p)return;const g=Qt(u),m=Qt(i.clientWidth-(d+h)),w=Qt(i.clientHeight-(u+p)),v=Qt(d),x={rootMargin:-g+"px "+-m+"px "+-w+"px "+-v+"px",threshold:O(0,gt(1,c))||1};let y=!0;function S(N){const G=N[0].intersectionRatio;if(G!==c){if(!y)return r();G?r(!1,G):o=setTimeout(()=>{r(!1,1e-7)},1e3)}G===1&&!Yo(l,t.getBoundingClientRect())&&r(),y=!1}try{n=new IntersectionObserver(S,{...x,root:i.ownerDocument})}catch{n=new IntersectionObserver(S,x)}n.observe(t)}return r(!0),s}function Tr(t,e,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=o,l=Oe(t),d=i||s?[...l?St(l):[],...St(e)]:[];d.forEach(v=>{i&&v.addEventListener("scroll",n,{passive:!0}),s&&v.addEventListener("resize",n)});const u=l&&a?Sr(l,n):null;let h=-1,p=null;r&&(p=new ResizeObserver(v=>{let[b]=v;b&&b.target===l&&p&&(p.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var x;(x=p)==null||x.observe(e)})),n()}),l&&!c&&p.observe(l),p.observe(e));let g,m=c?st(t):null;c&&w();function w(){const v=st(t);m&&!Yo(m,v)&&n(),m=v,g=requestAnimationFrame(w)}return n(),()=>{var v;d.forEach(b=>{i&&b.removeEventListener("scroll",n),s&&b.removeEventListener("resize",n)}),u?.(),(v=p)==null||v.disconnect(),p=null,c&&cancelAnimationFrame(g)}}const Pe=Js,De=Qs,Ko=Zs,Cr=(t,e,n)=>{const o=new Map,i={platform:Er,...n},s={...i.platform,_c:o};return Xs(t,e,{...i,platform:s})};function Xo(t){var e,n,o="";if(typeof t=="string"||typeof t=="number")o+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e<i;e++)t[e]&&(n=Xo(t[e]))&&(o&&(o+=" "),o+=n)}else for(n in t)t[n]&&(o&&(o+=" "),o+=n);return o}function $r(){for(var t,e,n=0,o="",i=arguments.length;n<i;n++)(t=arguments[n])&&(e=Xo(t))&&(o&&(o+=" "),o+=e);return o}const P={capture:!0,passive:!0},rt=typeof window<"u"&&typeof document<"u";function kr(t,e){let n;return(...o)=>{clearTimeout(n),n=setTimeout(()=>t(...o),e)}}function f(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 Ar=0;const Lr=`${Date.now().toString(36)}${Math.random().toString(36).slice(2,5)}`;function re(t){return t.id||(t.id=`${Lr}${++Ar}`),t.id}const Qo=(t,e,[...n])=>{for(const o of n[0].split(","))n[0]=o,e[`${t}EventListener`](...n)},C=(t,...e)=>{Tt&&(t===window||t===document)&&Tt.push(()=>Jo(t,...e)),Qo("add",t,e)},Jo=(t,...e)=>Qo("remove",t,e);let Tt=null;const D=t=>{if(!rt||!window.requestAnimationFrame)return;window._mtdsUnbindEvents||(window._mtdsUnbindEvents=new Map);const e=()=>requestAnimationFrame(()=>{const n=String(t).replace(/(\n|\s)/g,"");window._mtdsUnbindEvents?.get(n)?.map(o=>o()),Tt=[],t(),window._mtdsUnbindEvents?.set(n,Tt?.slice(0)),Tt=null});document.readyState==="complete"?e():C(window,"load",e)},Ne=new WeakMap;function at(t,e,n){Ne.get(t)?.(),Ne.delete(t),e&&Ne.set(t,Tr(e,t,()=>{if(!t.isConnected||!e.isConnected||t.hidden)return at(t,!1);Cr(e,t,n).then(({x:o,y:i})=>{t.style.left=`${o}px`,t.style.top=`${i}px`})}))}function Zo(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 He=new WeakMap,_t=(t,e,n)=>{if(!rt||!window.requestAnimationFrame)return;const o=t.getElementsByClassName(e),i=He.get(t)||[];i.length||(He.set(t,i),Zo((s,r)=>{if(t.isConnected&&i?.length)for(const a of i)a();else r?.disconnect(),He.delete(t)}).observe(t,{attributeFilter:["class","hidden"],attributes:!0,childList:!0,subtree:!0})),i.push(()=>n(o))},Be=t=>t instanceof HTMLElement&&"validity"in t&&!(t instanceof HTMLButtonElement),$=(t,e,n)=>{const o=document.createElement(t);if(n&&(o.textContent=n),e)for(const[i,s]of Object.entries(e))f(o,i,s);return o},Ir=typeof HTMLElement>"u"?class{}:HTMLElement,Mr=`.${T.breadcrumbs.split(" ")[0]}`,Or=`.${T.card.split(" ")[0]}`,ti=`.${T.chip.split(" ")[0]}`,Rr=`.${T.helptext.split(" ")[0]}`,Pr=`.${T.pagination.split(" ")[0]}`,Dr='summary,u-summary,a,button,[role="tab"],[role="button"]',Nr="click,toggle,submit,change",Fe="mattilsynet.matomo.cloud",F="mtds-analytics-banner",Hr="https://www.mattilsynet.no/om-mattilsynet/personvernerklaering/informasjonskapsler";function ei(t,e={}){if(rt){if(window._paq||(window._paq=[],window._paq.push(["HeatmapSessionRecording::disable"]),window._paq.push(["enableLinkTracking"]),window._paq.push(["setTrackerUrl",`https://${Fe}/matomo.php`])),window._mtm||(window._mtm=window._mtm||[],window._mtm.push({"mtm.startTime":Date.now(),event:"mtm.Start"})),t==="init"){window._mtdsTracking={enabled:window.location.hostname!=="localhost",...window._mtdsTracking,...e};const{consent:n,enabled:o,matomoId:i,matomoTagManagerId:s}=window._mtdsTracking;if(i&&window._paq.push(["setSiteId",i]),o){n!=="custom"&&Br();const r=s?`https://cdn.matomo.cloud/${Fe}/container_${s}.js`:`https://cdn.matomo.cloud/${Fe}/matomo.js`;document.querySelector(`script[src="${r}"]`)||document.head.append($("script",{async:"",src:r}))}}if(window._mtdsTracking?.enabled!==!1){if(window._mtdsTracking?.enabled==="debug")return console.info(`analytics("${t}", `,e,")");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];let a=location.href;window._paq.push([function(){a=this.getCurrentUrl()}]),window._paq.push(["setCustomUrl",a.split("#")[0]]),window._paq.push(r.filter(c=>c!==void 0)),window._paq.push(["setCustomUrl",a])}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)}}}function Br(){if(document.getElementById(F)||window.localStorage.getItem(F))return;document.body.insertAdjacentHTML("afterbegin",`<dialog id="${F}" data-analytics="ignore"><style>
|
|
8
|
+
::slotted(data:focus) { ${ls} }`,mn="beforeinput,blur,focus,click,input,keydown,mousedown",gn={once:!0,passive:!0},vs=rs&&!dn,ws=dn||as,bn="".repeat(5),Bt="false",Ft={added:"Added",empty:"No selected",found:"Navigate left to find %d selected",invalid:"Invalid value",of:"of",remove:"Press to remove",removed:"Removed"},we=class extends cs{constructor(){super(),this._item="",this._speak="",this._texts=ss({},Ft),this._value="",this.shadowRoot||this.attachShadow({mode:"open"}).append(Ht("slot"),Ht("style",bs))}static get observedAttributes(){return Object.keys(Ft).map(t=>`data-sr-${t}`)}connectedCallback(){this._root=fs(this),Dt(this,mn,this,!0),me(this,{attributeFilter:["value","id"],attributes:!0,characterData:!0,childList:!0,subtree:!0}),setTimeout(Ut,0,this),setTimeout(zt,0,this)}attributeChangedCallback(t,e,n){const o=t.split("data-sr-")[1];Ft[o]&&(this._texts[o]=n||Ft[o])}disconnectedCallback(){me(this,!1),ds(this,mn,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;ye(this)||(t.type==="beforeinput"&&(this._value=e?.value||""),t.type==="blur"&&ys(this),t.type==="click"&&Es(this,t),t.type==="focus"&&_s(this,t),t.type==="input"&&Ss(this,t),t.type==="keydown"&&Ts(this,t),t.type==="mousedown"&&ve(t),t.type==="mutation"&&Ut(this,t))}get multiple(){var t;return((t=_(this,"data-multiple"))!=null?t:Bt)!==Bt}set multiple(t){_(this,"data-multiple",t?"":null)}get creatable(){var t;return((t=_(this,"data-creatable"))!=null?t:Bt)!==Bt}set creatable(t){_(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)}},ot=t=>{var e;return((e=t?.textContent)==null?void 0:e.trim())||""},_e=t=>t instanceof HTMLDataElement,ye=({control:t})=>t?.disabled||t?.readOnly||!1,Ut=(t,e)=>{var n;const{_focus:o,_texts:i,items:s,control:r,list:a,multiple:c}=t;if(!r||!a)return;const l=ms(r),d=l.endsWith(bn)?_(r,"data-label"):l;_(r,"data-label",d);let u=`${d}${c?`, ${s.length?i.found.replace("%d",`${s.length}`):i.empty}`:""}`;const h=[];for(const{addedNodes:b,removedNodes:x}of e?.detail||[]){for(const y of b)_e(y)&&h.unshift(y);for(const y of x)_e(y)&&h.push(y)}const p=c?h.length===1:h[0]===o;if(o&&p){const b=_(r,"aria-expanded"),x=_(r,"inputmode"),y=_e(o)?r:o,S=!h[0].isConnected;t._speak=`${i[S?"removed":"added"]} ${ot(h[0])}, `,(ws||o===r)&&ge(t._speak),r!==y&&(_(r,"aria-expanded",null),_(r,"inputmode","none"),u=" ",r.focus()),setTimeout(()=>{var N;_(r,"aria-expanded",b),_(r,"inputmode",S?"none":x),(N=y?.focus)==null||N.call(y),_(r,"inputmode",x),t._speak="",vs?Dt(t,"blur",()=>Ut(t),gn):setTimeout(Ut,100,t)},100)}let g=0;const m=t.querySelector("select"),w=ye(t)?"":`${i.remove}, `;for(const b of s){const x=m?.options[g],y=ot(b),S=b.value||y,N=`${t._speak}${y}, ${w}${++g} ${i.of} ${s.length}`;_(b,"role","button"),_(b,"value",S),_(b,"tabindex","-1"),_(b,"aria-label",N),x?Object.assign(x,{textContent:y,value:S}):m?.appendChild(new Option(y,S,!0,!0))}m&&_(m,"multiple",c?"":null);for(const b of[...m?.options||[]].slice(g))b.remove();!c&&g>1&&console.warn("u-combobox: Multiple <data> found in single mode."),_(a,"aria-multiselectable",`${c}`),_(r,"list",pn(a)),_(r,"aria-label",`${t._speak}${u}${bn}`),a.hasAttribute("popover")&&(_(r,"popovertarget",pn(a)),_(a,"popover","manual"));const v=ot(s[0]);v!==t._item&&zt(t),t._item=v,vn(t),wn(t),(n=me(t))==null||n.takeRecords()},vn=t=>{var e;t.clear&&_(t.clear,"role","button"),t.clear&&(t.clear.hidden=!((e=t.control)!=null&&e.value)||ye(t))},wn=t=>{var e;const{_speak:n,options:o=[],values:i}=t;for(const s of o){const r=(e=_(s,"value"))!=null?e:ot(s);_(s,"aria-label",n?`${n}${ot(s)}`:null),_(s,"selected",i.includes(r)?"":null)}},zt=t=>{const{multiple:e,control:n,items:o}=t,i=ot(o[0]);!e&&n&&i!==n.value&&hn(n,i,i?"insertText":"deleteContent")},xe=(t,e=!0)=>{var n;const{_texts:o,options:i=[],creatable:s,control:r,items:a,multiple:c}=t,l=((n=r?.value)==null?void 0:n.trim())||"",d=l.toLowerCase()||null;let u=[...i].find(p=>(_(p,"label")||ot(p)).trim().toLowerCase()===d);const h={bubbles:!0,cancelable:!0,detail:u};if(t.dispatchEvent(new CustomEvent("comboboxbeforematch",h))||(u=[...i].find(p=>p.selected)),e)return wn(t),u?ht(t,u,!1):s&&l?ht(t,{value:l},!1):(!c&&!l&&a[0]?ht(t,a[0]):zt(t),ge(o.invalid));for(const p of i)p.selected=p===u},ht=(t,e,n=!0)=>{const{control:o,items:i,multiple:s}=t,r=Ht("data",e.label||e.value,{value:e.value}),a=[...i].find(d=>d.value===e.value),c={bubbles:!0,cancelable:!0,detail:a||r};if(a&&!n)return zt(t);if(t.dispatchEvent(new CustomEvent("comboboxbeforeselect",c))){if(!s)for(const d of[...i])d.remove();a?a.remove():o?.insertAdjacentElement("beforebegin",r),t.dispatchEvent(new CustomEvent("comboboxafterselect",c))}},_s=(t,{target:e})=>{e instanceof HTMLElement&&(t._focus=e),ge()},ys=t=>ve()||setTimeout(xs,0,t),xs=t=>{var e;!t._focus||t.contains((e=t._root)==null?void 0:e.activeElement)||(t.multiple||xe(t),t._focus=void 0)},Es=(t,e)=>{const{clientX:n,clientY:o,target:i}=e,{clear:s,control:r,items:a}=t;if(s?.contains(i))return r&&hn(r,"","deleteContentBackward"),r?.focus();for(const c of a){const{top:l,right:d,bottom:u,left:h}=c.getBoundingClientRect();if(c.contains(i))return ht(t,c);if(o>=l&&o<=u&&n>=h&&n<=d)return c.focus()}i===t&&r?.focus()},Ss=(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 c of o)if(c.value&&c.value===r)return ht(t,c,s)}else s||xe(t,!1);vn(t)},Ts=(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:c}=e,l=i&&i===c,d=l&&i?.selectionEnd;let u=l?s.length:[...s].indexOf(c);if(l&&r==="Tab"&&o&&!o.hidden&&(e.preventDefault(),o.tabIndex=-1,o.focus(),Dt(o,"blur",()=>_(o,"tabindex",null),gn)),!(!l&&us(e)||u===-1)){if(r==="ArrowRight"&&!l)u+=1;else if(r==="ArrowLeft"&&!d)u-=1;else if(r==="Enter"&&l){const h=_(i,"form");return _(i,"form","#"),requestAnimationFrame(()=>_(i,"form",h)),xe(t)}else if((r==="Backspace"||r==="Delete")&&!d){if(e.preventDefault(),!a&&s[u])return ht(t,s[u]);l&&(u-=1)}else return l||i?.focus();e.preventDefault(),(n=s[Math.max(0,u)]||i)==null||n.focus()}};hs.define("u-combobox",we);var Ee=typeof window<"u"&&typeof window.document<"u"&&typeof window.navigator<"u",Cs=Ee&&/android/i.test(navigator.userAgent),_n;Ee&&/^Mac/i.test(((_n=navigator.userAgentData)==null?void 0:_n.platform)||navigator.platform);var $s=`${Cs?"data":"aria"}-labelledby`,Se=":host(:not([hidden])) { display: block }",qt=typeof HTMLElement>"u"?class{}:HTMLElement;function A(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 yn=(t,e,n)=>{for(const o of n[0].split(","))n[0]=o,Element.prototype[`${t}EventListener`].apply(e,n)},ks=(t,...e)=>yn("add",t,e),As=(t,...e)=>yn("remove",t,e),Vt=(t,e)=>t.shadowRoot||t.attachShadow({mode:"open"}).append(Tn("slot"),Tn("style",e)),Wt=new WeakMap,xn=(t,e)=>{if(e===void 0)return Wt.get(t);try{Wt.get(t).disconnect(),Wt.delete(t)}catch{}if(e){const n=new MutationObserver(o=>t.handleEvent({type:"mutation",detail:o}));n.observe(t,e),Wt.set(t,n)}},Ls=t=>{const e="key"in t&&(t.key===" "||t.key==="Enter");return e&&t.preventDefault(),e&&t.target instanceof HTMLElement&&t.target.click(),e},En=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},Is=0,Sn=t=>t?(t.id||(t.id=`:${t.nodeName.toLowerCase()}${(++Is).toString(32)}`),t.id):"",Tn=(t,e,n)=>{const o=document.createElement(t);return e&&(o.textContent=e),o},jt={define:(t,e)=>!Ee||window.customElements.get(t)||window.customElements.define(t,e)},Ms=Se,Os=Se,Rs=Se,Ps=':host(:not([hidden])) { display: inline-block; cursor: pointer }:host([aria-disabled="true"]) { cursor: default }',Gt="aria-controls",mt="aria-selected",Cn=class extends qt{constructor(){super(),Vt(this,Ms)}get tabList(){return Yt("u-tablist",this)[0]||null}get selectedIndex(){return Kt(this.tabs)}set selectedIndex(t){$e(this.tabs[t])}get tabs(){return Yt("u-tab",this)}get panels(){return Yt("u-tabpanel",this)}},$n=class extends qt{constructor(){super(),Vt(this,Os)}connectedCallback(){A(this,"role","tablist"),ks(this,"click,keydown",this),xn(this,{childList:!0}),this.tabs.length&&this.handleEvent()}disconnectedCallback(){As(this,"click,keydown",this),xn(this,!1)}handleEvent(t){if(!t||t.type==="mutation"){const s=this.tabs[Math.max(this.selectedIndex,0)];return s?.setAttribute(mt,"true")}const{key:e}=t,n=[...this.tabs],o=n.findIndex(s=>s.contains(t.target));let i=o;if(!(t.defaultPrevented||o===-1)&&(t.type==="click"&&$e(n[o]),t.type==="keydown"&&!Ls(t))){if(e==="ArrowDown"||e==="ArrowRight")i=(o+1)%n.length;else if(e==="ArrowUp"||e==="ArrowLeft")i=(o||n.length)-1;else if(e==="End")i=n.length-1;else if(e==="Home")i=0;else if(e==="Tab")i=Kt(n);else return;setTimeout(()=>{n[o].tabIndex=-1,n[i].tabIndex=0}),e!=="Tab"&&(t.preventDefault(),n[i].focus())}}get tabsElement(){return this.closest("u-tabs")}get tabs(){return this.querySelectorAll("u-tab")}get selectedIndex(){return Kt(this.tabs)}set selectedIndex(t){$e(this.tabs[t])}},Te=!1,kn=class extends qt{static get observedAttributes(){return["id",mt,Gt]}constructor(){super(),Vt(this,Ps)}connectedCallback(){A(this,"role","tab"),this.tabIndex=this.selected?0:-1}attributeChangedCallback(){if(!Te&&this.selected&&this.tabList){Te=!0;const t=[...this.tabList.querySelectorAll("u-tab")],e=Yt("u-tabpanel",this.tabsElement||this),n=Ce(this,e[t.indexOf(this)]);n&&A(n,$s,Sn(this)),t.forEach((o,i)=>{const s=Ce(o,e[i]);o.tabIndex=o===this?0:-1,A(o,mt,`${o===this}`),A(o,Gt,s?.id||null),s&&(s.hidden=s!==n)}),Te=!1}}get tabsElement(){return this.closest("u-tabs")}get tabList(){const t=this.parentElement;return t?.nodeName==="U-TABLIST"?t:null}get selected(){return A(this,mt)==="true"}set selected(t){A(this,mt,`${!!t}`)}get index(){const t=this.tabList;return t?[...t.querySelectorAll("u-tab")].indexOf(this):0}get panel(){return Ce(this)}},An=class extends qt{static get observedAttributes(){return["hidden"]}constructor(){super(),Vt(this,Rs)}connectedCallback(){A(this,"role","tabpanel"),this.hidden=Kt(this.tabs)===-1,this.attributeChangedCallback()}attributeChangedCallback(){const t=this.hidden;A(this,"aria-hidden",`${t}`),A(this,"tabindex",t||Ds(this.firstChild)?null:"0")}get tabsElement(){return this.closest("u-tabs")}get tabs(){const t=`u-tab[${Gt}="${this.id}"]`;return En(this).querySelectorAll(t)}},Yt=(t,e)=>e.querySelectorAll(`${t}:not(:scope u-tabpanel ${t})`),Ce=(t,e)=>{const n=A(t,Gt)||Sn(e),o=En(t).getElementById(n);return o?.nodeName==="U-TABPANEL"?o:null},Kt=t=>[...t].findIndex(e=>A(e,mt)==="true"),$e=t=>t&&A(t,"aria-disabled")!=="true"&&A(t,"aria-selected","true"),Ds=t=>t instanceof Element&&!t.matches(':disabled,[tabindex^="-"]')&&t.matches('[contenteditable],[controls],[href],[tabindex],input:not([type="hidden"]),select,textarea,button,summary,iframe');jt.define("u-tabs",Cn),jt.define("u-tablist",$n),jt.define("u-tab",kn),jt.define("u-tabpanel",An);const Ns="2.2.5",Ln="_alert_1nshl_1 _ds-alert_nwz76_3",In="_app_1nshl_1",Mn="_sticky_1nshl_1",On="_avatar_1nshl_1 _ds-avatar_nwz76_1",Rn="_badge_1nshl_1",Pn="_breadcrumbs_1nshl_1 _ds-breadcrumbs_nwz76_5",Dn="_button_1nshl_1 _ds-button_nwz76_1",Nn="_card_1nshl_1",Hn="_group_1nshl_1",Bn="_chip_1nshl_1 _ds-chip_nwz76_5",Fn="_details_1nshl_1 _ds-details_nwz76_3",Un="_dialog_1nshl_1 _ds-dialog_nwz76_5",zn="__drawer_1nshl_1",qn="_divider_1nshl_1",Vn="_errorsummary_1nshl_1 _ds-error-summary_nwz76_5",Wn="__errorsummary_1nshl_1",jn="_field_1nshl_1 _ds-field_nwz76_1",Gn="__datalist_1nshl_1",Yn="_affixes_1nshl_1 _ds-field-affixes_nwz76_3",Kn="_fieldset_1nshl_1 _ds-fieldset_nwz76_3",Xn="_helptext_1nshl_1 _ds-focus_nwz76_1",Qn="_input_1nshl_1 _ds-input_nwz76_1",Jn="_grid_1nshl_1",Zn="_flex_1nshl_1",to="_link_1nshl_1",eo="_logo_1nshl_1",no="_pagination_1nshl_1 _ds-pagination_nwz76_5",oo="_popover_1nshl_1",io="_progress_1nshl_1",so="__indeterminate_1nshl_1",ro="_skeleton_1nshl_1 _ds-skeleton_nwz76_5",ao="__skeleton_1nshl_1",lo="_spinner_1nshl_1",co="_steps_1nshl_1",uo="_table_1nshl_1 _ds-table_nwz76_5",fo="__scrollShadow_1nshl_1",po="_tabs_1nshl_1 _ds-tabs_nwz76_5",ho="__scrollMask_1nshl_1",mo="_tag_1nshl_1 _ds-tag_nwz76_5",go="_toast_1nshl_1",bo="__toastClose_1nshl_1",vo="__toastOpen_1nshl_1",wo="__toastTimeout_1nshl_1",_o="_togglegroup_1nshl_1",yo="__tooltip_1nshl_1",xo="_heading_1nshl_1 _ds-heading_nwz76_1",Eo="_ingress_1nshl_1",So="_muted_1nshl_1",To="_info_1nshl_1",Co="_prose_1nshl_1",$o="_validation_1nshl_1 _ds-validation-message_nwz76_1",ko="_body_1nshl_172",Ao="__checked_1nshl_1",T={alert:Ln,app:In,sticky:Mn,avatar:On,badge:Rn,breadcrumbs:Pn,button:Dn,card:Nn,group:Hn,chip:Bn,details:Fn,dialog:Un,_drawer:zn,divider:qn,errorsummary:Vn,_errorsummary:Wn,field:jn,_datalist:Gn,affixes:Yn,fieldset:Kn,helptext:Xn,input:Qn,grid:Jn,flex:Zn,link:to,logo:eo,pagination:no,popover:oo,progress:io,_indeterminate:so,skeleton:ro,_skeleton:ao,spinner:lo,steps:co,table:uo,_scrollShadow:fo,tabs:po,_scrollMask:ho,tag:mo,toast:go,_toastClose:bo,_toastOpen:vo,_toastTimeout:wo,togglegroup:_o,_tooltip:yo,heading:xo,ingress:Eo,muted:So,info:To,prose:Co,validation:$o,body:ko,_checked:Ao},Hs=Object.freeze(Object.defineProperty({__proto__:null,_checked:Ao,_datalist:Gn,_drawer:zn,_errorsummary:Wn,_indeterminate:so,_scrollMask:ho,_scrollShadow:fo,_skeleton:ao,_toastClose:bo,_toastOpen:vo,_toastTimeout:wo,_tooltip:yo,affixes:Yn,alert:Ln,app:In,avatar:On,badge:Rn,body:ko,breadcrumbs:Pn,button:Dn,card:Nn,chip:Bn,default:T,details:Fn,dialog:Un,divider:qn,errorsummary:Vn,field:jn,fieldset:Kn,flex:Zn,grid:Jn,group:Hn,heading:xo,helptext:Xn,info:To,ingress:Eo,input:Qn,link:to,logo:eo,muted:So,pagination:no,popover:oo,progress:io,prose:Co,skeleton:ro,spinner:lo,steps:co,sticky:Mn,table:uo,tabs:po,tag:mo,toast:go,togglegroup:_o,validation:$o},Symbol.toStringTag,{value:"Module"})),gt=Math.min,O=Math.max,Xt=Math.round,Qt=Math.floor,V=t=>({x:t,y:t}),Bs={left:"right",right:"left",bottom:"top",top:"bottom"},Fs={start:"end",end:"start"};function Lo(t,e,n){return O(t,gt(e,n))}function Jt(t,e){return typeof t=="function"?t(e):t}function it(t){return t.split("-")[0]}function Zt(t){return t.split("-")[1]}function Io(t){return t==="x"?"y":"x"}function Mo(t){return t==="y"?"height":"width"}const Us=new Set(["top","bottom"]);function Q(t){return Us.has(it(t))?"y":"x"}function Oo(t){return Io(Q(t))}function zs(t,e,n){n===void 0&&(n=!1);const o=Zt(t),i=Oo(t),s=Mo(i);let r=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(r=te(r)),[r,te(r)]}function qs(t){const e=te(t);return[ke(t),e,ke(e)]}function ke(t){return t.replace(/start|end/g,e=>Fs[e])}const Ro=["left","right"],Po=["right","left"],Vs=["top","bottom"],Ws=["bottom","top"];function js(t,e,n){switch(t){case"top":case"bottom":return n?e?Po:Ro:e?Ro:Po;case"left":case"right":return e?Vs:Ws;default:return[]}}function Gs(t,e,n,o){const i=Zt(t);let s=js(it(t),n==="start",o);return i&&(s=s.map(r=>r+"-"+i),e&&(s=s.concat(s.map(ke)))),s}function te(t){return t.replace(/left|right|bottom|top/g,e=>Bs[e])}function Ys(t){return{top:0,right:0,bottom:0,left:0,...t}}function Ks(t){return typeof t!="number"?Ys(t):{top:t,right:t,bottom:t,left:t}}function ee(t){const{x:e,y:n,width:o,height:i}=t;return{width:o,height:i,top:n,left:e,right:e+o,bottom:n+i,x:e,y:n}}function Do(t,e,n){let{reference:o,floating:i}=t;const s=Q(e),r=Oo(e),a=Mo(r),c=it(e),l=s==="y",d=o.x+o.width/2-i.width/2,u=o.y+o.height/2-i.height/2,h=o[a]/2-i[a]/2;let p;switch(c){case"top":p={x:d,y:o.y-i.height};break;case"bottom":p={x:d,y:o.y+o.height};break;case"right":p={x:o.x+o.width,y:u};break;case"left":p={x:o.x-i.width,y:u};break;default:p={x:o.x,y:o.y}}switch(Zt(e)){case"start":p[r]-=h*(n&&l?-1:1);break;case"end":p[r]+=h*(n&&l?-1:1);break}return p}const Xs=async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:s=[],platform:r}=n,a=s.filter(Boolean),c=await(r.isRTL==null?void 0:r.isRTL(e));let l=await r.getElementRects({reference:t,floating:e,strategy:i}),{x:d,y:u}=Do(l,o,c),h=o,p={},g=0;for(let m=0;m<a.length;m++){const{name:w,fn:v}=a[m],{x:b,y:x,data:y,reset:S}=await v({x:d,y:u,initialPlacement:o,placement:h,strategy:i,middlewareData:p,rects:l,platform:r,elements:{reference:t,floating:e}});d=b??d,u=x??u,p={...p,[w]:{...p[w],...y}},S&&g<=50&&(g++,typeof S=="object"&&(S.placement&&(h=S.placement),S.rects&&(l=S.rects===!0?await r.getElementRects({reference:t,floating:e,strategy:i}):S.rects),{x:d,y:u}=Do(l,h,c)),m=-1)}return{x:d,y:u,placement:h,strategy:i,middlewareData:p}};async function Ae(t,e){var n;e===void 0&&(e={});const{x:o,y:i,platform:s,rects:r,elements:a,strategy:c}=t,{boundary:l="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:h=!1,padding:p=0}=Jt(e,t),g=Ks(p),w=a[h?u==="floating"?"reference":"floating":u],v=ee(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(w)))==null||n?w:w.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:l,rootBoundary:d,strategy:c})),b=u==="floating"?{x:o,y:i,width:r.floating.width,height:r.floating.height}:r.reference,x=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),y=await(s.isElement==null?void 0:s.isElement(x))?await(s.getScale==null?void 0:s.getScale(x))||{x:1,y:1}:{x:1,y:1},S=ee(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:x,strategy:c}):b);return{top:(v.top-S.top+g.top)/y.y,bottom:(S.bottom-v.bottom+g.bottom)/y.y,left:(v.left-S.left+g.left)/y.x,right:(S.right-v.right+g.right)/y.x}}const Qs=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:i,middlewareData:s,rects:r,initialPlacement:a,platform:c,elements:l}=e,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:m=!0,...w}=Jt(t,e);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const v=it(i),b=Q(a),x=it(a)===a,y=await(c.isRTL==null?void 0:c.isRTL(l.floating)),S=h||(x||!m?[te(a)]:qs(a)),N=g!=="none";!h&&N&&S.push(...Gs(a,m,g,y));const G=[a,...S],dt=await Ae(e,w),ut=[];let X=((o=s.flip)==null?void 0:o.overflows)||[];if(d&&ut.push(dt[v]),u){const ft=zs(i,r,y);ut.push(dt[ft[0]],dt[ft[1]])}if(X=[...X,{placement:i,overflows:ut}],!ut.every(ft=>ft<=0)){var Mt,Ot;const ft=(((Mt=s.flip)==null?void 0:Mt.index)||0)+1,an=G[ft];if(an&&(!(u==="alignment"?b!==Q(an):!1)||X.every(q=>Q(q.placement)===b?q.overflows[0]>0:!0)))return{data:{index:ft,overflows:X},reset:{placement:an}};let Pt=(Ot=X.filter(pt=>pt.overflows[0]<=0).sort((pt,q)=>pt.overflows[1]-q.overflows[1])[0])==null?void 0:Ot.placement;if(!Pt)switch(p){case"bestFit":{var Rt;const pt=(Rt=X.filter(q=>{if(N){const et=Q(q.placement);return et===b||et==="y"}return!0}).map(q=>[q.placement,q.overflows.filter(et=>et>0).reduce((et,_l)=>et+_l,0)]).sort((q,et)=>q[1]-et[1])[0])==null?void 0:Rt[0];pt&&(Pt=pt);break}case"initialPlacement":Pt=a;break}if(i!==Pt)return{reset:{placement:Pt}}}return{}}}},Js=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:i}=e,{mainAxis:s=!0,crossAxis:r=!1,limiter:a={fn:w=>{let{x:v,y:b}=w;return{x:v,y:b}}},...c}=Jt(t,e),l={x:n,y:o},d=await Ae(e,c),u=Q(it(i)),h=Io(u);let p=l[h],g=l[u];if(s){const w=h==="y"?"top":"left",v=h==="y"?"bottom":"right",b=p+d[w],x=p-d[v];p=Lo(b,p,x)}if(r){const w=u==="y"?"top":"left",v=u==="y"?"bottom":"right",b=g+d[w],x=g-d[v];g=Lo(b,g,x)}const m=a.fn({...e,[h]:p,[u]:g});return{...m,data:{x:m.x-n,y:m.y-o,enabled:{[h]:s,[u]:r}}}}}},Zs=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,o;const{placement:i,rects:s,platform:r,elements:a}=e,{apply:c=()=>{},...l}=Jt(t,e),d=await Ae(e,l),u=it(i),h=Zt(i),p=Q(i)==="y",{width:g,height:m}=s.floating;let w,v;u==="top"||u==="bottom"?(w=u,v=h===(await(r.isRTL==null?void 0:r.isRTL(a.floating))?"start":"end")?"left":"right"):(v=u,w=h==="end"?"top":"bottom");const b=m-d.top-d.bottom,x=g-d.left-d.right,y=gt(m-d[w],b),S=gt(g-d[v],x),N=!e.middlewareData.shift;let G=y,dt=S;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(dt=x),(o=e.middlewareData.shift)!=null&&o.enabled.y&&(G=b),N&&!h){const X=O(d.left,0),Mt=O(d.right,0),Ot=O(d.top,0),Rt=O(d.bottom,0);p?dt=g-2*(X!==0||Mt!==0?X+Mt:O(d.left,d.right)):G=m-2*(Ot!==0||Rt!==0?Ot+Rt:O(d.top,d.bottom))}await c({...e,availableWidth:dt,availableHeight:G});const ut=await r.getDimensions(a.floating);return g!==ut.width||m!==ut.height?{reset:{rects:!0}}:{}}}};function ne(){return typeof window<"u"}function bt(t){return No(t)?(t.nodeName||"").toLowerCase():"#document"}function R(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function W(t){var e;return(e=(No(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function No(t){return ne()?t instanceof Node||t instanceof R(t).Node:!1}function H(t){return ne()?t instanceof Element||t instanceof R(t).Element:!1}function j(t){return ne()?t instanceof HTMLElement||t instanceof R(t).HTMLElement:!1}function Ho(t){return!ne()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof R(t).ShadowRoot}const tr=new Set(["inline","contents"]);function Et(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=B(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!tr.has(i)}const er=new Set(["table","td","th"]);function nr(t){return er.has(bt(t))}const or=[":popover-open",":modal"];function oe(t){return or.some(e=>{try{return t.matches(e)}catch{return!1}})}const ir=["transform","translate","scale","rotate","perspective"],sr=["transform","translate","scale","rotate","perspective","filter"],rr=["paint","layout","strict","content"];function Le(t){const e=Ie(),n=H(t)?B(t):t;return ir.some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||sr.some(o=>(n.willChange||"").includes(o))||rr.some(o=>(n.contain||"").includes(o))}function ar(t){let e=J(t);for(;j(e)&&!vt(e);){if(Le(e))return e;if(oe(e))return null;e=J(e)}return null}function Ie(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const lr=new Set(["html","body","#document"]);function vt(t){return lr.has(bt(t))}function B(t){return R(t).getComputedStyle(t)}function ie(t){return H(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function J(t){if(bt(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Ho(t)&&t.host||W(t);return Ho(e)?e.host:e}function Bo(t){const e=J(t);return vt(e)?t.ownerDocument?t.ownerDocument.body:t.body:j(e)&&Et(e)?e:Bo(e)}function St(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=Bo(t),s=i===((o=t.ownerDocument)==null?void 0:o.body),r=R(i);if(s){const a=Me(r);return e.concat(r,r.visualViewport||[],Et(i)?i:[],a&&n?St(a):[])}return e.concat(i,St(i,[],n))}function Me(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Fo(t){const e=B(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=j(t),s=i?t.offsetWidth:n,r=i?t.offsetHeight:o,a=Xt(n)!==s||Xt(o)!==r;return a&&(n=s,o=r),{width:n,height:o,$:a}}function Oe(t){return H(t)?t:t.contextElement}function wt(t){const e=Oe(t);if(!j(e))return V(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:s}=Fo(e);let r=(s?Xt(n.width):n.width)/o,a=(s?Xt(n.height):n.height)/i;return(!r||!Number.isFinite(r))&&(r=1),(!a||!Number.isFinite(a))&&(a=1),{x:r,y:a}}const cr=V(0);function Uo(t){const e=R(t);return!Ie()||!e.visualViewport?cr:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function dr(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==R(t)?!1:e}function st(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),s=Oe(t);let r=V(1);e&&(o?H(o)&&(r=wt(o)):r=wt(t));const a=dr(s,n,o)?Uo(s):V(0);let c=(i.left+a.x)/r.x,l=(i.top+a.y)/r.y,d=i.width/r.x,u=i.height/r.y;if(s){const h=R(s),p=o&&H(o)?R(o):o;let g=h,m=Me(g);for(;m&&o&&p!==g;){const w=wt(m),v=m.getBoundingClientRect(),b=B(m),x=v.left+(m.clientLeft+parseFloat(b.paddingLeft))*w.x,y=v.top+(m.clientTop+parseFloat(b.paddingTop))*w.y;c*=w.x,l*=w.y,d*=w.x,u*=w.y,c+=x,l+=y,g=R(m),m=Me(g)}}return ee({width:d,height:u,x:c,y:l})}function se(t,e){const n=ie(t).scrollLeft;return e?e.left+n:st(W(t)).left+n}function zo(t,e){const n=t.getBoundingClientRect(),o=n.left+e.scrollLeft-se(t,n),i=n.top+e.scrollTop;return{x:o,y:i}}function ur(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const s=i==="fixed",r=W(o),a=e?oe(e.floating):!1;if(o===r||a&&s)return n;let c={scrollLeft:0,scrollTop:0},l=V(1);const d=V(0),u=j(o);if((u||!u&&!s)&&((bt(o)!=="body"||Et(r))&&(c=ie(o)),j(o))){const p=st(o);l=wt(o),d.x=p.x+o.clientLeft,d.y=p.y+o.clientTop}const h=r&&!u&&!s?zo(r,c):V(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+d.x+h.x,y:n.y*l.y-c.scrollTop*l.y+d.y+h.y}}function fr(t){return Array.from(t.getClientRects())}function pr(t){const e=W(t),n=ie(t),o=t.ownerDocument.body,i=O(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),s=O(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let r=-n.scrollLeft+se(t);const a=-n.scrollTop;return B(o).direction==="rtl"&&(r+=O(e.clientWidth,o.clientWidth)-i),{width:i,height:s,x:r,y:a}}const qo=25;function hr(t,e){const n=R(t),o=W(t),i=n.visualViewport;let s=o.clientWidth,r=o.clientHeight,a=0,c=0;if(i){s=i.width,r=i.height;const d=Ie();(!d||d&&e==="fixed")&&(a=i.offsetLeft,c=i.offsetTop)}const l=se(o);if(l<=0){const d=o.ownerDocument,u=d.body,h=getComputedStyle(u),p=d.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,g=Math.abs(o.clientWidth-u.clientWidth-p);g<=qo&&(s-=g)}else l<=qo&&(s+=l);return{width:s,height:r,x:a,y:c}}const mr=new Set(["absolute","fixed"]);function gr(t,e){const n=st(t,!0,e==="fixed"),o=n.top+t.clientTop,i=n.left+t.clientLeft,s=j(t)?wt(t):V(1),r=t.clientWidth*s.x,a=t.clientHeight*s.y,c=i*s.x,l=o*s.y;return{width:r,height:a,x:c,y:l}}function Vo(t,e,n){let o;if(e==="viewport")o=hr(t,n);else if(e==="document")o=pr(W(t));else if(H(e))o=gr(e,n);else{const i=Uo(t);o={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return ee(o)}function Wo(t,e){const n=J(t);return n===e||!H(n)||vt(n)?!1:B(n).position==="fixed"||Wo(n,e)}function br(t,e){const n=e.get(t);if(n)return n;let o=St(t,[],!1).filter(a=>H(a)&&bt(a)!=="body"),i=null;const s=B(t).position==="fixed";let r=s?J(t):t;for(;H(r)&&!vt(r);){const a=B(r),c=Le(r);!c&&a.position==="fixed"&&(i=null),(s?!c&&!i:!c&&a.position==="static"&&!!i&&mr.has(i.position)||Et(r)&&!c&&Wo(t,r))?o=o.filter(d=>d!==r):i=a,r=J(r)}return e.set(t,o),o}function vr(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const r=[...n==="clippingAncestors"?oe(e)?[]:br(e,this._c):[].concat(n),o],a=r[0],c=r.reduce((l,d)=>{const u=Vo(e,d,i);return l.top=O(u.top,l.top),l.right=gt(u.right,l.right),l.bottom=gt(u.bottom,l.bottom),l.left=O(u.left,l.left),l},Vo(e,a,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function wr(t){const{width:e,height:n}=Fo(t);return{width:e,height:n}}function _r(t,e,n){const o=j(e),i=W(e),s=n==="fixed",r=st(t,!0,s,e);let a={scrollLeft:0,scrollTop:0};const c=V(0);function l(){c.x=se(i)}if(o||!o&&!s)if((bt(e)!=="body"||Et(i))&&(a=ie(e)),o){const p=st(e,!0,s,e);c.x=p.x+e.clientLeft,c.y=p.y+e.clientTop}else i&&l();s&&!o&&i&&l();const d=i&&!o&&!s?zo(i,a):V(0),u=r.left+a.scrollLeft-c.x-d.x,h=r.top+a.scrollTop-c.y-d.y;return{x:u,y:h,width:r.width,height:r.height}}function Re(t){return B(t).position==="static"}function jo(t,e){if(!j(t)||B(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return W(t)===n&&(n=n.ownerDocument.body),n}function Go(t,e){const n=R(t);if(oe(t))return n;if(!j(t)){let i=J(t);for(;i&&!vt(i);){if(H(i)&&!Re(i))return i;i=J(i)}return n}let o=jo(t,e);for(;o&&nr(o)&&Re(o);)o=jo(o,e);return o&&vt(o)&&Re(o)&&!Le(o)?n:o||ar(t)||n}const yr=async function(t){const e=this.getOffsetParent||Go,n=this.getDimensions,o=await n(t.floating);return{reference:_r(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function xr(t){return B(t).direction==="rtl"}const Er={convertOffsetParentRelativeRectToViewportRelativeRect:ur,getDocumentElement:W,getClippingRect:vr,getOffsetParent:Go,getElementRects:yr,getClientRects:fr,getDimensions:wr,getScale:wt,isElement:H,isRTL:xr};function Yo(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function Sr(t,e){let n=null,o;const i=W(t);function s(){var a;clearTimeout(o),(a=n)==null||a.disconnect(),n=null}function r(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),s();const l=t.getBoundingClientRect(),{left:d,top:u,width:h,height:p}=l;if(a||e(),!h||!p)return;const g=Qt(u),m=Qt(i.clientWidth-(d+h)),w=Qt(i.clientHeight-(u+p)),v=Qt(d),x={rootMargin:-g+"px "+-m+"px "+-w+"px "+-v+"px",threshold:O(0,gt(1,c))||1};let y=!0;function S(N){const G=N[0].intersectionRatio;if(G!==c){if(!y)return r();G?r(!1,G):o=setTimeout(()=>{r(!1,1e-7)},1e3)}G===1&&!Yo(l,t.getBoundingClientRect())&&r(),y=!1}try{n=new IntersectionObserver(S,{...x,root:i.ownerDocument})}catch{n=new IntersectionObserver(S,x)}n.observe(t)}return r(!0),s}function Tr(t,e,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=o,l=Oe(t),d=i||s?[...l?St(l):[],...St(e)]:[];d.forEach(v=>{i&&v.addEventListener("scroll",n,{passive:!0}),s&&v.addEventListener("resize",n)});const u=l&&a?Sr(l,n):null;let h=-1,p=null;r&&(p=new ResizeObserver(v=>{let[b]=v;b&&b.target===l&&p&&(p.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var x;(x=p)==null||x.observe(e)})),n()}),l&&!c&&p.observe(l),p.observe(e));let g,m=c?st(t):null;c&&w();function w(){const v=st(t);m&&!Yo(m,v)&&n(),m=v,g=requestAnimationFrame(w)}return n(),()=>{var v;d.forEach(b=>{i&&b.removeEventListener("scroll",n),s&&b.removeEventListener("resize",n)}),u?.(),(v=p)==null||v.disconnect(),p=null,c&&cancelAnimationFrame(g)}}const Pe=Js,De=Qs,Ko=Zs,Cr=(t,e,n)=>{const o=new Map,i={platform:Er,...n},s={...i.platform,_c:o};return Xs(t,e,{...i,platform:s})};function Xo(t){var e,n,o="";if(typeof t=="string"||typeof t=="number")o+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e<i;e++)t[e]&&(n=Xo(t[e]))&&(o&&(o+=" "),o+=n)}else for(n in t)t[n]&&(o&&(o+=" "),o+=n);return o}function $r(){for(var t,e,n=0,o="",i=arguments.length;n<i;n++)(t=arguments[n])&&(e=Xo(t))&&(o&&(o+=" "),o+=e);return o}const P={capture:!0,passive:!0},rt=typeof window<"u"&&typeof document<"u";function kr(t,e){let n;return(...o)=>{clearTimeout(n),n=setTimeout(()=>t(...o),e)}}function f(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 Ar=0;const Lr=`${Date.now().toString(36)}${Math.random().toString(36).slice(2,5)}`;function re(t){return t.id||(t.id=`${Lr}${++Ar}`),t.id}const Qo=(t,e,[...n])=>{for(const o of n[0].split(","))n[0]=o,e[`${t}EventListener`](...n)},C=(t,...e)=>{Tt&&(t===window||t===document)&&Tt.push(()=>Jo(t,...e)),Qo("add",t,e)},Jo=(t,...e)=>Qo("remove",t,e);let Tt=null;const D=t=>{if(!rt||!window.requestAnimationFrame)return;window._mtdsUnbindEvents||(window._mtdsUnbindEvents=new Map);const e=()=>requestAnimationFrame(()=>{const n=String(t).replace(/(\n|\s)/g,"");window._mtdsUnbindEvents?.get(n)?.map(o=>o()),Tt=[],t(),window._mtdsUnbindEvents?.set(n,Tt?.slice(0)),Tt=null});document.readyState==="complete"?e():C(window,"load",e)},Ne=new WeakMap;function at(t,e,n){Ne.get(t)?.(),Ne.delete(t),e&&Ne.set(t,Tr(e,t,()=>{if(!t.isConnected||!e.isConnected||t.hidden)return at(t,!1);Cr(e,t,n).then(({x:o,y:i})=>{t.style.left=`${o}px`,t.style.top=`${i}px`})}))}function Zo(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 He=new WeakMap,_t=(t,e,n)=>{if(!rt||!window.requestAnimationFrame)return;const o=t.getElementsByClassName(e),i=He.get(t)||[];i.length||(He.set(t,i),Zo((s,r)=>{if(t.isConnected&&i?.length)for(const a of i)a();else r?.disconnect(),He.delete(t)}).observe(t,{attributeFilter:["class","hidden"],attributes:!0,childList:!0,subtree:!0})),i.push(()=>n(o))},Be=t=>t instanceof HTMLElement&&"validity"in t&&!(t instanceof HTMLButtonElement),$=(t,e,n)=>{const o=document.createElement(t);if(n&&(o.textContent=n),e)for(const[i,s]of Object.entries(e))f(o,i,s);return o},Ir=typeof HTMLElement>"u"?class{}:HTMLElement,Mr=`.${T.breadcrumbs.split(" ")[0]}`,Or=`.${T.card.split(" ")[0]}`,ti=`.${T.chip.split(" ")[0]}`,Rr=`.${T.helptext.split(" ")[0]}`,Pr=`.${T.pagination.split(" ")[0]}`,Dr='summary,u-summary,a,button,[role="tab"],[role="button"]',Nr="click,toggle,submit,change",Fe="mattilsynet.matomo.cloud",F="mtds-analytics-banner",Hr="https://www.mattilsynet.no/om-mattilsynet/personvernerklaering/informasjonskapsler";function ei(t,e={}){if(rt){if(window._paq||(window._paq=[],window._paq.push(["HeatmapSessionRecording::disable"]),window._paq.push(["enableLinkTracking"]),window._paq.push(["setTrackerUrl",`https://${Fe}/matomo.php`])),window._mtm||(window._mtm=window._mtm||[],window._mtm.push({"mtm.startTime":Date.now(),event:"mtm.Start"})),t==="init"){window._mtdsTracking={enabled:window.location.hostname!=="localhost",...window._mtdsTracking,...e};const{consent:n,enabled:o,matomoId:i,matomoTagManagerId:s}=window._mtdsTracking;if(i&&window._paq.push(["setSiteId",i]),o){n!=="custom"&&Br();const r=s?`https://cdn.matomo.cloud/${Fe}/container_${s}.js`:`https://cdn.matomo.cloud/${Fe}/matomo.js`;document.querySelector(`script[src="${r}"]`)||document.head.append($("script",{async:"",src:r}))}}if(window._mtdsTracking?.enabled!==!1){if(window._mtdsTracking?.enabled==="debug")return console.info(`analytics("${t}", `,e,")");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];let a=location.href;window._paq.push([function(){a=this.getCurrentUrl()}]),window._paq.push(["setCustomUrl",a.split("#")[0]]),window._paq.push(r.filter(c=>c!==void 0)),window._paq.push(["setCustomUrl",a])}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)}}}function Br(){if(document.getElementById(F)||window.localStorage.getItem(F))return;document.body.insertAdjacentHTML("afterbegin",`<dialog id="${F}" data-analytics="ignore"><style>
|
|
9
9
|
#${F}[open] { box-sizing: border-box; display: flex; align-items: center; background: #116e6b; border-radius: .5em; border: 0; box-shadow: 0 .25em .5em rgba(0,0,0,.3); color: #fff; font-size: .875em; inset: auto auto 1em 1em; max-width: calc(100vw - 2em); outline: 0; padding: .5em; position: fixed; z-index: 99999 }
|
|
10
10
|
#${F} button { all: unset; box-sizing: border-box; cursor: pointer; display: flex; width: 1.5em; height: 1.5em; font: 300 1.5em/1.35 sans-serif; border-radius: .25em; place-content: center; transition: .2s; transition-property: background, scale }
|
|
11
11
|
#${F} button:focus-visible { outline: 2px solid }
|
package/mtds/package.json.js
CHANGED