@mattilsynet/design 3.1.9 → 3.1.10

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.
@@ -24,7 +24,7 @@ class m extends C {
24
24
  "style",
25
25
  null,
26
26
  `@layer leaflet{${f}}
27
- @layer mt.v3-1-9design{${b}`
27
+ @layer mt.v3-1-10design{${b}`
28
28
  ),
29
29
  r("figure")
30
30
  );
@@ -1 +1 @@
1
- {"version":3,"file":"atlas-element.js","sources":["../../designsystem/atlas/atlas-element.ts"],"sourcesContent":["import L from \"leaflet\";\nimport LeafletCSS from \"leaflet/dist/leaflet.css?raw\";\nimport type {} from \"leaflet.markercluster\"; // Extend L namespace\nimport \"./cluster.js\";\nimport {\n\tattr,\n\tdefineElement,\n\tisBrowser,\n\tMTDSElement,\n\toff,\n\ton,\n\ttag,\n} from \"../utils\";\nimport css from \"./atlas.css?raw\";\nexport { L };\nexport { MTDSAtlasMarkerElement } from \"./atlas-marker\";\nexport { MTDSAtlasMatgeoElement } from \"./atlas-matgeo\";\nexport { MTDSAtlasWMSElement } from \"./atlas-wms\";\n\n// TODO: Add minimum zoom level for adding markers (minimum 17 som standard?)\n// TODO: Add search helper (https://ws.geonorge.no/adresser/v1/openapi.json + https://ws.geonorge.no/adresser/v1/#/default/get_sok)\n// TODO: matgeo-autoload popover info\n\ntype Link = { href: string; rel: string; type: string; title: string };\ntype BBox = [number, number, number, number];\nexport type MTDSAtlasCollections = Record<string, MTDSAtlasCollection>;\nexport type MTDSAtlasCollection = {\n\tcrs: string[];\n\tdescription: string;\n\textent: { spatial: { bbox: BBox[] } };\n\tgeometry: string;\n\tid: string;\n\titemType: string;\n\tlinks: Link[];\n\ttitle: string;\n};\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t\"mtds-atlas\": MTDSAtlasElement;\n\t}\n\n\tinterface Window {\n\t\t_matgeoCollections?: Promise<MTDSAtlasCollections>;\n\t}\n}\n\nlet SKIP_CLICK: number | NodeJS.Timeout = 0;\nconst KARTVERKET_MAX_ZOOM = 18; // Kartverket does not support more than zoom level 18\nconst KARTVERKET_TILES_URL =\n\t\"https://cache.kartverket.no/v1/wmts/1.0.0/topo/default/webmercator/{z}/{y}/{x}.png\";\nexport const MATGEO_URL =\n\t\"https://matgeoservice-256616427209.europe-north1.run.app/ogc/features/collections\";\nconst BOUNDS_NORWAY: L.LatLngBoundsLiteral = [\n\t[57.5, 4.73],\n\t[71.5, 31.44],\n];\n\nif (isBrowser() && !window._matgeoCollections)\n\twindow._matgeoCollections = fetch(MATGEO_URL)\n\t\t.then((res) => res.json())\n\t\t.then((d) => d.collections.map((c: MTDSAtlasCollection) => [c.id, c]))\n\t\t.then(Object.fromEntries);\n\nexport class MTDSAtlasElement extends MTDSElement {\n\tcluster?: L.MarkerClusterGroup;\n\tmap?: L.Map;\n\n\tstatic get observedAttributes() {\n\t\treturn [\"data-view\", \"data-scrollzoom\"]; // Using ES2015 syntax for backwards compatibility\n\t}\n\tconstructor() {\n\t\tsuper();\n\t\tthis.attachShadow({ mode: \"open\" }).append(\n\t\t\ttag(\n\t\t\t\t\"style\",\n\t\t\t\tnull,\n\t\t\t\t`@layer leaflet{${LeafletCSS}}\\n@layer mt.design{${css}`,\n\t\t\t),\n\t\t\ttag(\"figure\"),\n\t\t);\n\t}\n\tconnectedCallback() {\n\t\tconst container = this.shadowRoot?.lastElementChild as HTMLElement;\n\t\tconst cluster = attr(this, \"data-cluster\") ?? \"false\";\n\t\tconst tiles = new L.TileLayer(KARTVERKET_TILES_URL, {\n\t\t\tattribution: \"&copy; Kartverket\",\n\t\t\tclassName: \"leaflet-kartverket-tiles\",\n\t\t\tmaxZoom: KARTVERKET_MAX_ZOOM,\n\t\t});\n\n\t\tthis.map = new L.Map(container, {\n\t\t\tattributionControl: false,\n\t\t\tfadeAnimation: false, // Prevent popup fades\n\t\t\tlayers: [tiles],\n\t\t\tzoomControl: false,\n\t\t\tzoomSnap: 0.2,\n\t\t});\n\n\t\ton(this, \"pointerup click\", this.#skipClick); // Prevent clicks from bubbling up unless sent from Leaflet\n\t\tthis.map.addControl(new L.Control.Attribution({ prefix: \"\" }));\n\t\tthis.map.addControl(new L.Control.Zoom({ position: \"bottomright\" }));\n\t\tthis.map.on(\"popupopen popupclose\", this.#handlePopup, this);\n\t\tthis.cluster = new L.MarkerClusterGroup({\n\t\t\tzoomToBoundsOnClick: true,\n\t\t\tshowCoverageOnHover: false,\n\t\t\tdisableClusteringAtZoom:\n\t\t\t\tcluster === \"false\" ? 1 : Number(cluster) || KARTVERKET_MAX_ZOOM + 1,\n\t\t\ticonCreateFunction: (cluster: L.MarkerCluster) =>\n\t\t\t\tnew L.DivIcon({\n\t\t\t\t\thtml: `${cluster.getChildCount()}`,\n\t\t\t\t\tclassName: \"leaflet-cluster-icon\",\n\t\t\t\t\ticonSize: [30, 30],\n\t\t\t\t}),\n\t\t}).addTo(this.map);\n\n\t\t// Initial setup attributes\n\t\tfor (const name of MTDSAtlasElement.observedAttributes)\n\t\t\tthis.attributeChangedCallback(name, null, attr(this, name));\n\t}\n\tattributeChangedCallback(name: string, _prev?: null, next?: string | null) {\n\t\tif (name === \"data-view\") this.setView(next || \"\");\n\t\tif (name === \"data-scrollzoom\")\n\t\t\tthis.map?.scrollWheelZoom[next === \"false\" ? \"disable\" : \"enable\"]();\n\t}\n\tsetView(view: string | number[], opts?: L.FitBoundsOptions) {\n\t\tconst p = `${view}`.split(\",\").map(parseFloat).filter(Number.isFinite);\n\t\tconst b = this.cluster?.getBounds();\n\n\t\tif (p.length === 3) return this.map?.setView([p[0], p[1]], p[2], opts);\n\t\tif (view !== \"fit\") return this.map?.fitBounds(BOUNDS_NORWAY, opts);\n\t\tif (b?.isValid()) return this.map?.fitBounds(b.pad(0.1), opts);\n\t\tthis.cluster?.once(\"layeradd\", () => {\n\t\t\tsetTimeout(() => this.setView(\"fit\"), 50); // Add all markers before fitting\n\t\t});\n\t}\n\tlatLngFromPoint(x: number, y: number) {\n\t\t// @ts-expect-error -- Missing from Leaflet@2.0.0-alpha.1 types\n\t\treturn this.map?.pointerEventToLatLng({ clientX: x, clientY: y });\n\t}\n\tdisconnectedCallback() {\n\t\toff(this, \"pointerup click\", this.#skipClick);\n\t\tthis.map?.remove();\n\t\tthis.map = this.cluster = undefined;\n\t}\n\tasync getCollections() {\n\t\treturn (\n\t\t\twindow._matgeoCollections || Promise.resolve({} as MTDSAtlasCollections)\n\t\t);\n\t}\n\t#handlePopup({ type, popup }: { type: string; popup: L.Popup }) {\n\t\tconst open = type === \"popupopen\";\n\t\tconst cont = popup.getElement()?.querySelector(\".leaflet-popup-content\");\n\t\tconst slot = cont?.querySelector<HTMLSlotElement>(\":scope > slot\");\n\t\tconst id = cont?.textContent?.match(/^#(\\S+)/)?.[1] || \"\";\n\t\tconst el = document.getElementById(slot?.name || id); // If content of popup is #id, replace with <slot>\n\n\t\tif (!el) return open && id && popup.close(); // Close popup if target element not found\n\t\tL.Util.setOptions(popup, { maxWidth: this.offsetWidth - 40 });\n\t\tattr(el, \"data-popover\", open ? attr(el, \"popover\") : null); // Store previous popover mode\n\t\tattr(el, \"popover\", open ? null : attr(el, \"data-popover\")); // But temporarily remove it so popover renders\n\t\tattr(el, \"slot\", open ? el.id : null); // Render popover in slot\n\t\tif (open) popup.setContent(tag(\"slot\", { name: el.id }));\n\t}\n\t#skipClick(event: Partial<MouseEvent>) {\n\t\tif (event.type === \"click\") SKIP_CLICK && event.stopPropagation?.();\n\t\telse if (document.body.classList.contains(\"leaflet-dragging\"))\n\t\t\tSKIP_CLICK = setTimeout(() => {\n\t\t\t\tSKIP_CLICK = 0;\n\t\t\t}, 50); // Was dragging, so skip succeeding click\n\t}\n}\n\ndefineElement(\"mtds-atlas\", MTDSAtlasElement);\n\nif (isBrowser())\n\tL.Marker.prototype.options.icon = new L.DivIcon({\n\t\thtml: '<div class=\"leaflet-marker-generated-slot\"><div class=\"leaflet-marker-generated-icon\"></div></div>',\n\t\ticonSize: [0, 0],\n\t});\n"],"names":["SKIP_CLICK","KARTVERKET_MAX_ZOOM","KARTVERKET_TILES_URL","MATGEO_URL","BOUNDS_NORWAY","isBrowser","res","d","c","MTDSAtlasElement","MTDSElement","tag","LeafletCSS","css","container","cluster","attr","tiles","L","on","#skipClick","#handlePopup","name","_prev","next","view","opts","p","b","x","y","off","type","popup","open","cont","slot","id","el","event","defineElement"],"mappings":";;;;;;;;AA+CA,IAAIA,IAAsC;AAC1C,MAAMC,IAAsB,IACtBC,IACL,sFACYC,IACZ,qFACKC,IAAuC;AAAA,EAC5C,CAAC,MAAM,IAAI;AAAA,EACX,CAAC,MAAM,KAAK;AACb;AAEIC,EAAA,KAAe,CAAC,OAAO,uBAC1B,OAAO,qBAAqB,MAAMF,CAAU,EAC1C,KAAK,CAACG,MAAQA,EAAI,MAAM,EACxB,KAAK,CAACC,MAAMA,EAAE,YAAY,IAAI,CAACC,MAA2B,CAACA,EAAE,IAAIA,CAAC,CAAC,CAAC,EACpE,KAAK,OAAO,WAAW;AAEnB,MAAMC,UAAyBC,EAAY;AAAA,EACjD;AAAA,EACA;AAAA,EAEA,WAAW,qBAAqB;AAC/B,WAAO,CAAC,aAAa,iBAAiB;AAAA,EACvC;AAAA,EACA,cAAc;AACb,UAAA,GACA,KAAK,aAAa,EAAE,MAAM,OAAA,CAAQ,EAAE;AAAA,MACnCC;AAAA,QACC;AAAA,QACA;AAAA,QACA,kBAAkBC,CAAU;AAAA,yBAA0BC,CAAA;AAAA,MAAA;AAAA,MAEvDF,EAAI,QAAQ;AAAA,IAAA;AAAA,EAEd;AAAA,EACA,oBAAoB;AACnB,UAAMG,IAAY,KAAK,YAAY,kBAC7BC,IAAUC,EAAK,MAAM,cAAc,KAAK,SACxCC,IAAQ,IAAIC,EAAE,UAAUhB,GAAsB;AAAA,MACnD,aAAa;AAAA,MACb,WAAW;AAAA,MACX,SAASD;AAAA,IAAA,CACT;AAED,SAAK,MAAM,IAAIiB,EAAE,IAAIJ,GAAW;AAAA,MAC/B,oBAAoB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I,EAAG,KAAK,IAAI,GAChCJ,KAAMD,EAAM,WAAWtB,EAAI,QAAQ,EAAE,MAAM2B,EAAG,GAAA,CAAI,CAAC;AAAA,EACxD;AAAA,EACAlB,GAAWmB,GAA4B;AACtC,IAAIA,EAAM,SAAS,UAASvC,KAAcuC,EAAM,kBAAA,IACvC,SAAS,KAAK,UAAU,SAAS,kBAAkB,MAC3DvC,IAAa,WAAW,MAAM;AAC7B,MAAAA,IAAa;AAAA,IACd,GAAG,EAAE;AAAA,EACP;AACD;AAEAwC,EAAc,cAAc/B,CAAgB;AAExCJ,EAAA,MACHa,EAAE,OAAO,UAAU,QAAQ,OAAO,IAAIA,EAAE,QAAQ;AAAA,EAC/C,MAAM;AAAA,EACN,UAAU,CAAC,GAAG,CAAC;AAAA,CACf;"}
1
+ {"version":3,"file":"atlas-element.js","sources":["../../designsystem/atlas/atlas-element.ts"],"sourcesContent":["import L from \"leaflet\";\nimport LeafletCSS from \"leaflet/dist/leaflet.css?raw\";\nimport type {} from \"leaflet.markercluster\"; // Extend L namespace\nimport \"./cluster.js\";\nimport {\n\tattr,\n\tdefineElement,\n\tisBrowser,\n\tMTDSElement,\n\toff,\n\ton,\n\ttag,\n} from \"../utils\";\nimport css from \"./atlas.css?raw\";\nexport { L };\nexport { MTDSAtlasMarkerElement } from \"./atlas-marker\";\nexport { MTDSAtlasMatgeoElement } from \"./atlas-matgeo\";\nexport { MTDSAtlasWMSElement } from \"./atlas-wms\";\n\n// TODO: Add minimum zoom level for adding markers (minimum 17 som standard?)\n// TODO: Add search helper (https://ws.geonorge.no/adresser/v1/openapi.json + https://ws.geonorge.no/adresser/v1/#/default/get_sok)\n// TODO: matgeo-autoload popover info\n\ntype Link = { href: string; rel: string; type: string; title: string };\ntype BBox = [number, number, number, number];\nexport type MTDSAtlasCollections = Record<string, MTDSAtlasCollection>;\nexport type MTDSAtlasCollection = {\n\tcrs: string[];\n\tdescription: string;\n\textent: { spatial: { bbox: BBox[] } };\n\tgeometry: string;\n\tid: string;\n\titemType: string;\n\tlinks: Link[];\n\ttitle: string;\n};\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t\"mtds-atlas\": MTDSAtlasElement;\n\t}\n\n\tinterface Window {\n\t\t_matgeoCollections?: Promise<MTDSAtlasCollections>;\n\t}\n}\n\nlet SKIP_CLICK: number | NodeJS.Timeout = 0;\nconst KARTVERKET_MAX_ZOOM = 18; // Kartverket does not support more than zoom level 18\nconst KARTVERKET_TILES_URL =\n\t\"https://cache.kartverket.no/v1/wmts/1.0.0/topo/default/webmercator/{z}/{y}/{x}.png\";\nexport const MATGEO_URL =\n\t\"https://matgeoservice-256616427209.europe-north1.run.app/ogc/features/collections\";\nconst BOUNDS_NORWAY: L.LatLngBoundsLiteral = [\n\t[57.5, 4.73],\n\t[71.5, 31.44],\n];\n\nif (isBrowser() && !window._matgeoCollections)\n\twindow._matgeoCollections = fetch(MATGEO_URL)\n\t\t.then((res) => res.json())\n\t\t.then((d) => d.collections.map((c: MTDSAtlasCollection) => [c.id, c]))\n\t\t.then(Object.fromEntries);\n\nexport class MTDSAtlasElement extends MTDSElement {\n\tcluster?: L.MarkerClusterGroup;\n\tmap?: L.Map;\n\n\tstatic get observedAttributes() {\n\t\treturn [\"data-view\", \"data-scrollzoom\"]; // Using ES2015 syntax for backwards compatibility\n\t}\n\tconstructor() {\n\t\tsuper();\n\t\tthis.attachShadow({ mode: \"open\" }).append(\n\t\t\ttag(\n\t\t\t\t\"style\",\n\t\t\t\tnull,\n\t\t\t\t`@layer leaflet{${LeafletCSS}}\\n@layer mt.design{${css}`,\n\t\t\t),\n\t\t\ttag(\"figure\"),\n\t\t);\n\t}\n\tconnectedCallback() {\n\t\tconst container = this.shadowRoot?.lastElementChild as HTMLElement;\n\t\tconst cluster = attr(this, \"data-cluster\") ?? \"false\";\n\t\tconst tiles = new L.TileLayer(KARTVERKET_TILES_URL, {\n\t\t\tattribution: \"&copy; Kartverket\",\n\t\t\tclassName: \"leaflet-kartverket-tiles\",\n\t\t\tmaxZoom: KARTVERKET_MAX_ZOOM,\n\t\t});\n\n\t\tthis.map = new L.Map(container, {\n\t\t\tattributionControl: false,\n\t\t\tfadeAnimation: false, // Prevent popup fades\n\t\t\tlayers: [tiles],\n\t\t\tzoomControl: false,\n\t\t\tzoomSnap: 0.2,\n\t\t});\n\n\t\ton(this, \"pointerup click\", this.#skipClick); // Prevent clicks from bubbling up unless sent from Leaflet\n\t\tthis.map.addControl(new L.Control.Attribution({ prefix: \"\" }));\n\t\tthis.map.addControl(new L.Control.Zoom({ position: \"bottomright\" }));\n\t\tthis.map.on(\"popupopen popupclose\", this.#handlePopup, this);\n\t\tthis.cluster = new L.MarkerClusterGroup({\n\t\t\tzoomToBoundsOnClick: true,\n\t\t\tshowCoverageOnHover: false,\n\t\t\tdisableClusteringAtZoom:\n\t\t\t\tcluster === \"false\" ? 1 : Number(cluster) || KARTVERKET_MAX_ZOOM + 1,\n\t\t\ticonCreateFunction: (cluster: L.MarkerCluster) =>\n\t\t\t\tnew L.DivIcon({\n\t\t\t\t\thtml: `${cluster.getChildCount()}`,\n\t\t\t\t\tclassName: \"leaflet-cluster-icon\",\n\t\t\t\t\ticonSize: [30, 30],\n\t\t\t\t}),\n\t\t}).addTo(this.map);\n\n\t\t// Initial setup attributes\n\t\tfor (const name of MTDSAtlasElement.observedAttributes)\n\t\t\tthis.attributeChangedCallback(name, null, attr(this, name));\n\t}\n\tattributeChangedCallback(name: string, _prev?: null, next?: string | null) {\n\t\tif (name === \"data-view\") this.setView(next || \"\");\n\t\tif (name === \"data-scrollzoom\")\n\t\t\tthis.map?.scrollWheelZoom[next === \"false\" ? \"disable\" : \"enable\"]();\n\t}\n\tsetView(view: string | number[], opts?: L.FitBoundsOptions) {\n\t\tconst p = `${view}`.split(\",\").map(parseFloat).filter(Number.isFinite);\n\t\tconst b = this.cluster?.getBounds();\n\n\t\tif (p.length === 3) return this.map?.setView([p[0], p[1]], p[2], opts);\n\t\tif (view !== \"fit\") return this.map?.fitBounds(BOUNDS_NORWAY, opts);\n\t\tif (b?.isValid()) return this.map?.fitBounds(b.pad(0.1), opts);\n\t\tthis.cluster?.once(\"layeradd\", () => {\n\t\t\tsetTimeout(() => this.setView(\"fit\"), 50); // Add all markers before fitting\n\t\t});\n\t}\n\tlatLngFromPoint(x: number, y: number) {\n\t\t// @ts-expect-error -- Missing from Leaflet@2.0.0-alpha.1 types\n\t\treturn this.map?.pointerEventToLatLng({ clientX: x, clientY: y });\n\t}\n\tdisconnectedCallback() {\n\t\toff(this, \"pointerup click\", this.#skipClick);\n\t\tthis.map?.remove();\n\t\tthis.map = this.cluster = undefined;\n\t}\n\tasync getCollections() {\n\t\treturn (\n\t\t\twindow._matgeoCollections || Promise.resolve({} as MTDSAtlasCollections)\n\t\t);\n\t}\n\t#handlePopup({ type, popup }: { type: string; popup: L.Popup }) {\n\t\tconst open = type === \"popupopen\";\n\t\tconst cont = popup.getElement()?.querySelector(\".leaflet-popup-content\");\n\t\tconst slot = cont?.querySelector<HTMLSlotElement>(\":scope > slot\");\n\t\tconst id = cont?.textContent?.match(/^#(\\S+)/)?.[1] || \"\";\n\t\tconst el = document.getElementById(slot?.name || id); // If content of popup is #id, replace with <slot>\n\n\t\tif (!el) return open && id && popup.close(); // Close popup if target element not found\n\t\tL.Util.setOptions(popup, { maxWidth: this.offsetWidth - 40 });\n\t\tattr(el, \"data-popover\", open ? attr(el, \"popover\") : null); // Store previous popover mode\n\t\tattr(el, \"popover\", open ? null : attr(el, \"data-popover\")); // But temporarily remove it so popover renders\n\t\tattr(el, \"slot\", open ? el.id : null); // Render popover in slot\n\t\tif (open) popup.setContent(tag(\"slot\", { name: el.id }));\n\t}\n\t#skipClick(event: Partial<MouseEvent>) {\n\t\tif (event.type === \"click\") SKIP_CLICK && event.stopPropagation?.();\n\t\telse if (document.body.classList.contains(\"leaflet-dragging\"))\n\t\t\tSKIP_CLICK = setTimeout(() => {\n\t\t\t\tSKIP_CLICK = 0;\n\t\t\t}, 50); // Was dragging, so skip succeeding click\n\t}\n}\n\ndefineElement(\"mtds-atlas\", MTDSAtlasElement);\n\nif (isBrowser())\n\tL.Marker.prototype.options.icon = new L.DivIcon({\n\t\thtml: '<div class=\"leaflet-marker-generated-slot\"><div class=\"leaflet-marker-generated-icon\"></div></div>',\n\t\ticonSize: [0, 0],\n\t});\n"],"names":["SKIP_CLICK","KARTVERKET_MAX_ZOOM","KARTVERKET_TILES_URL","MATGEO_URL","BOUNDS_NORWAY","isBrowser","res","d","c","MTDSAtlasElement","MTDSElement","tag","LeafletCSS","css","container","cluster","attr","tiles","L","on","#skipClick","#handlePopup","name","_prev","next","view","opts","p","b","x","y","off","type","popup","open","cont","slot","id","el","event","defineElement"],"mappings":";;;;;;;;AA+CA,IAAIA,IAAsC;AAC1C,MAAMC,IAAsB,IACtBC,IACL,sFACYC,IACZ,qFACKC,IAAuC;AAAA,EAC5C,CAAC,MAAM,IAAI;AAAA,EACX,CAAC,MAAM,KAAK;AACb;AAEIC,EAAA,KAAe,CAAC,OAAO,uBAC1B,OAAO,qBAAqB,MAAMF,CAAU,EAC1C,KAAK,CAACG,MAAQA,EAAI,MAAM,EACxB,KAAK,CAACC,MAAMA,EAAE,YAAY,IAAI,CAACC,MAA2B,CAACA,EAAE,IAAIA,CAAC,CAAC,CAAC,EACpE,KAAK,OAAO,WAAW;AAEnB,MAAMC,UAAyBC,EAAY;AAAA,EACjD;AAAA,EACA;AAAA,EAEA,WAAW,qBAAqB;AAC/B,WAAO,CAAC,aAAa,iBAAiB;AAAA,EACvC;AAAA,EACA,cAAc;AACb,UAAA,GACA,KAAK,aAAa,EAAE,MAAM,OAAA,CAAQ,EAAE;AAAA,MACnCC;AAAA,QACC;AAAA,QACA;AAAA,QACA,kBAAkBC,CAAU;AAAA,0BAA0BC,CAAA;AAAA,MAAA;AAAA,MAEvDF,EAAI,QAAQ;AAAA,IAAA;AAAA,EAEd;AAAA,EACA,oBAAoB;AACnB,UAAMG,IAAY,KAAK,YAAY,kBAC7B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,UAAU,KAAK,cAAc,IAAI,GAC5DjB,EAAKsB,GAAI,gBAAgBJ,IAAOlB,EAAKsB,GAAI,SAAS,IAAI,IAAI,GAC1DtB,EAAKsB,GAAI,WAAWJ,IAAO,OAAOlB,EAAKsB,GAAI,cAAc,CAAC,GAC1DtB,EAAKsB,GAAI,QAAQJ,IAAOI,EAAG,KAAK,IAAI,GAChCJ,KAAMD,EAAM,WAAWtB,EAAI,QAAQ,EAAE,MAAM2B,EAAG,GAAA,CAAI,CAAC;AAAA,EACxD;AAAA,EACAlB,GAAWmB,GAA4B;AACtC,IAAIA,EAAM,SAAS,UAASvC,KAAcuC,EAAM,kBAAA,IACvC,SAAS,KAAK,UAAU,SAAS,kBAAkB,MAC3DvC,IAAa,WAAW,MAAM;AAC7B,MAAAA,IAAa;AAAA,IACd,GAAG,EAAE;AAAA,EACP;AACD;AAEAwC,EAAc,cAAc/B,CAAgB;AAExCJ,EAAA,MACHa,EAAE,OAAO,UAAU,QAAQ,OAAO,IAAIA,EAAE,QAAQ;AAAA,EAC/C,MAAM;AAAA,EACN,UAAU,CAAC,GAAG,CAAC;AAAA,CACf;"}
@@ -196,7 +196,7 @@ Please use <details> and <summary>, but import '@u-elements/u-details/polyfill'
196
196
  ::slotted([role="option"]:focus) { ${Kl} }
197
197
  ::slotted([role="option"][aria-hidden="true"]),
198
198
  ::slotted([role="option"][disabled]),
199
- ::slotted([role="option"][hidden]) { display: none !important }`,nc=tc(Wn),Vi,Ui=0,oc=Cn||Me,Di="click,focusout,input,keydown,mousedown,mouseup",zi="focus,focusin,blur,focusout",Ne={singular:"%d hit",plural:"%d hits"},Fi=class extends Ni{constructor(){super(),this._texts=Xl({},Ne),this._value="",this._of="/",Yl(this,Wn)}static get observedAttributes(){return["id",...Object.keys(Ne).map(t=>`data-sr-${t}`)]}connectedCallback(){this.hidden=!0,this._root=qi(this),L(this,"role","listbox"),L(this,"tabindex","-1"),Ft(this._root,"focusin",this),Ft(this._root,"focus",this,!0),Mn(this,{attributeFilter:["disabled","hidden","label","value"],attributes:!0,characterData:!0,childList:!0,subtree:!0}),setTimeout(()=>this.attributeChangedCallback())}disconnectedCallback(){Oe(this._root||this,"focus",this,!0),Oe(this._root||this,"focusin",this),Mn(this,!1),Pn(this),this._root=void 0}attributeChangedCallback(t,e,n){const o=t?.split("data-sr-")[1],i=`input[list="${this.id}"]`;if(Ne[o])this._texts[o]=n||Ne[o];else if(this._root){this._input&&Vn(this,this._input);for(const r of this._root.querySelectorAll(i))Vn(this,r)}}handleEvent(t){const{target:e,type:n}=t;t.defaultPrevented||(n==="click"&&ac(this,t),(n==="focus"||n==="focusin")&&ic(this,t),(n==="blur"||n==="focusout")&&rc(this,t),n==="keydown"&&sc(this,t),n==="mousedown"&&this.contains(e)&&Rn(t),(n==="mutation"||n==="input")&&(clearTimeout(Ui),Ui=setTimeout(Hi,0,this,t)))}get options(){var t;if(!this._options){const e=(t=this.querySelector('[role="option"],option'))==null?void 0:t.nodeName;e&&(this._options=this.getElementsByTagName(e))}return this._options||this.getElementsByTagName("option")}},Bi=t=>t?.disabled||t?.readOnly||!1,Gt=(t,e)=>{var n,o,i;if(t.hidden!==e)return;t.hidden=Bi(t?._input)||!e,(n=Mn(t))==null||n.takeRecords();const r=t.isConnected&&t.popover&&((o=t._input)==null?void 0:o.isConnected)&&((i=t._input)==null?void 0:i.popoverTargetElement)===t;t._input&&Vn(t,t._input,e),r&&L(t,"popover","manual"),r&&t.togglePopover(e),e&&Hi(t)},Pn=t=>{t._input&&(Oe(t._input||t,zi,t),Oe(t._root||t,Di,t),Gt(t,!1),t._input=void 0)},Vn=(t,e,n=!1)=>{t.popover&&L(e,"popovertarget",On(t)),Ft(e,zi,t,!0),L(e,"aria-autocomplete","list"),L(e,"aria-controls",On(t)),L(e,"aria-expanded",`${!oc||n}`),L(e,"autocomplete","off"),L(e,"role",Bi(e)?null:"combobox")},ic=(t,e)=>{var n;const o=e.target instanceof HTMLInputElement;o&&e.isTrusted&&e.stopImmediatePropagation(),t._input!==e.target&&o&&e.target.list===t&&(t._input&&Pn(t),t._input=e.target,t._input.dispatchEvent(new FocusEvent("focus")),t._input.dispatchEvent(new FocusEvent("focusin",{bubbles:!0})),L(t,jl,On((n=t._input.labels)==null?void 0:n[0])),Ft(t._root||t,Di,t),Gt(t,L(t._input,"inputmode")!=="none"),Pi())},rc=(t,e)=>{!Me&&!Rn()&&t._input&&setTimeout(Gi,0,t),e.target===t._input&&e.isTrusted&&e.stopImmediatePropagation()},Gi=t=>{var e;const n=((e=t._root)==null?void 0:e.activeElement)||null,o=t._input;o&&o!==n&&!t.contains(n)&&(o.dispatchEvent(new FocusEvent("blur",{relatedTarget:n})),o.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:n})),Pn(t))},ac=(t,{target:e})=>{var n;if(!t._input||t._input===e)return Gt(t,!0);for(const o of t.options)if(o.contains(e))return L(t,"aria-multiselectable")!=="true"&&((n=t._input)==null||n.focus(),Gt(t,!1)),$l(t._input,o.value);Me&&Gi(t)},sc=(t,e)=>{var n;const{key:o,target:i,altKey:r,ctrlKey:a,shiftKey:s,metaKey:c}=e,l=o==="Escape"||o==="Esc";if(r||a||c||s||o==="Tab")return;l&&!t.hidden&&e?.preventDefault(),Gt(t,!l);const d=[...t.options].filter(f=>L(f,"aria-hidden")!=="true"&&f.offsetHeight),u=d.indexOf(i);let m=-1;if(o==="ArrowDown"&&(m=(u+1)%d.length),o==="ArrowUp"&&(m=(~u?u:d.length)-1),~u&&((o==="Home"||o==="PageUp")&&(m=0),(o==="End"||o==="PageDown")&&(m=d.length-1),o==="Enter"))return d[u].click(),e.preventDefault();if(d[m])for(const f of d)f.tabIndex=-1;d[m]&&e.preventDefault(),(n=d[m]||t._input)==null||n.focus(),!d[m]&&o==="ArrowUp"&&setTimeout(()=>{var f;return(f=t._input)==null?void 0:f.setSelectionRange(999,999)})},Hi=(t,e)=>{const{_texts:n,_root:o,_input:i,options:r}=t,a=i?.value.toLowerCase().trim()||"",s=!t.hasAttribute("data-nofilter"),c=[],l=[];for(const m of r)(m.disabled||m.hidden||s&&!m.label.toLowerCase().includes(a)?c:l).push(m);for(const m of c)L(m,"aria-hidden","true");for(const m of l)L(m,"aria-hidden","false");const d=l.length;clearTimeout(Vi),e?.type==="input"&&a!==t._value&&(Vi=setTimeout(()=>{const m=`${!d&&t.innerText.trim()||`${n[d===1?"singular":"plural"]}`.replace("%d",`${d}`)}`;!t.hidden&&o?.activeElement===i&&Pi(m),t._value=a},1e3));let u=0;if(Cn)for(const m of l)L(m,"title",`${++u} ${t._of} ${d}`)};zt&&Object.defineProperty(HTMLInputElement.prototype,"list",{configurable:!0,enumerable:!0,get(){return qi(this).getElementById(L(this,"list")||"")}}),Wi.define("u-datalist",Fi),ct()&&!Dl()&&zl();const lc="3.1.9",Ji="_alert_1d3iq_1 _ds-alert_s9m4f_3",Xi="_app_1d3iq_1",ji="_sticky_1d3iq_1",Zi="_avatar_1d3iq_1 _ds-avatar_s9m4f_1",Ki="_badge_1d3iq_1",Yi="_breadcrumbs_1d3iq_1 _ds-breadcrumbs_s9m4f_5",Qi="_button_1d3iq_1 _ds-button_s9m4f_1",_i="_card_1d3iq_1",$i="_group_1d3iq_1",tr="_chip_1d3iq_1 _ds-chip_s9m4f_5",er="_details_1d3iq_1 _ds-details_s9m4f_3",nr="_dialog_1d3iq_1 _ds-dialog_s9m4f_5",or="__drawer_1d3iq_1",ir="_divider_1d3iq_1",rr="_errorsummary_1d3iq_1 _ds-error-summary_s9m4f_5",ar="_field_1d3iq_1 _ds-field_s9m4f_1",sr="_suggestion_1d3iq_1 _ds-suggestion_s9m4f_5",lr="_affixes_1d3iq_1 _ds-field-affixes_s9m4f_3",cr="_fieldset_1d3iq_1 _ds-fieldset_s9m4f_3",dr="_fileupload_1d3iq_1",ur="_helptext_1d3iq_1 _ds-focus_s9m4f_1",mr="_input_1d3iq_1 _ds-input_s9m4f_1",pr="_law_1d3iq_1",fr="_grid_1d3iq_1",hr="_flex_1d3iq_1",gr="_link_1d3iq_1",vr="_logo_1d3iq_1",br="__logo_1d3iq_1",wr="_pagination_1d3iq_1 _ds-pagination_s9m4f_5",yr="_popover_1d3iq_1 _ds-popover_s9m4f_3",xr="_progress_1d3iq_1",Er="__indeterminate_1d3iq_1",Sr="_skeleton_1d3iq_1 _ds-skeleton_s9m4f_5",kr="__skeleton_1d3iq_1",Tr="_spinner_1d3iq_1",Ar="_steps_1d3iq_1",Lr="_table_1d3iq_1 _ds-table_s9m4f_5",Cr="__scrollShadow_1d3iq_1",Mr="_tabs_1d3iq_1 _ds-tabs_s9m4f_5",Or="__scrollMask_1d3iq_1",Ir="_tag_1d3iq_1 _ds-tag_s9m4f_5",Nr="_toast_1d3iq_1",Rr="__toastClose_1d3iq_1",qr="__toastOpen_1d3iq_1",Wr="__toastTimeout_1d3iq_1",Pr="_togglegroup_1d3iq_1 _ds-toggle-group_s9m4f_5",Vr="__tooltip_1d3iq_1 _ds-tooltip_s9m4f_5",Ur="_heading_1d3iq_1 _ds-heading_s9m4f_1",Dr="_ingress_1d3iq_1",zr="_muted_1d3iq_1",Fr="_info_1d3iq_1",Br="_prose_1d3iq_1",Gr="_validation_1d3iq_1 _ds-validation-message_s9m4f_1",Hr="_body_1d3iq_161",Jr="__checked_1d3iq_1",C={alert:Ji,app:Xi,sticky:ji,avatar:Zi,badge:Ki,breadcrumbs:Yi,button:Qi,card:_i,group:$i,chip:tr,details:er,dialog:nr,_drawer:or,divider:ir,errorsummary:rr,field:ar,suggestion:sr,affixes:lr,fieldset:cr,fileupload:dr,helptext:ur,input:mr,law:pr,grid:fr,flex:hr,link:gr,logo:vr,_logo:br,pagination:wr,popover:yr,progress:xr,_indeterminate:Er,skeleton:Sr,_skeleton:kr,spinner:Tr,steps:Ar,table:Lr,_scrollShadow:Cr,tabs:Mr,_scrollMask:Or,tag:Ir,toast:Nr,_toastClose:Rr,_toastOpen:qr,_toastTimeout:Wr,togglegroup:Pr,_tooltip:Vr,heading:Ur,ingress:Dr,muted:zr,info:Fr,prose:Br,validation:Gr,body:Hr,_checked:Jr},cc=Object.freeze(Object.defineProperty({__proto__:null,_checked:Jr,_drawer:or,_indeterminate:Er,_logo:br,_scrollMask:Or,_scrollShadow:Cr,_skeleton:kr,_toastClose:Rr,_toastOpen:qr,_toastTimeout:Wr,_tooltip:Vr,affixes:lr,alert:Ji,app:Xi,avatar:Zi,badge:Ki,body:Hr,breadcrumbs:Yi,button:Qi,card:_i,chip:tr,default:C,details:er,dialog:nr,divider:ir,errorsummary:rr,field:ar,fieldset:cr,fileupload:dr,flex:hr,grid:fr,group:$i,heading:Ur,helptext:ur,info:Fr,ingress:Dr,input:mr,law:pr,link:gr,logo:vr,muted:zr,pagination:wr,popover:yr,progress:xr,prose:Br,skeleton:Sr,spinner:Tr,steps:Ar,sticky:ji,suggestion:sr,table:Lr,tabs:Mr,tag:Ir,toast:Nr,togglegroup:Pr,validation:Gr},Symbol.toStringTag,{value:"Module"}));function Xr(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=Xr(t[e]))&&(o&&(o+=" "),o+=n)}else for(n in t)t[n]&&(o&&(o+=" "),o+=n);return o}function dc(){for(var t,e,n=0,o="",i=arguments.length;n<i;n++)(t=arguments[n])&&(e=Xr(t))&&(o&&(o+=" "),o+=e);return o}const Ht={capture:!0,passive:!0},Q=()=>typeof window<"u"&&typeof document<"u",bt=t=>Q()?document.getElementsByClassName(C[t].split(" ")[0]):[];function wt(t,e){let n;return function(...o){clearTimeout(n),n=setTimeout(()=>t.apply(this,o),e)}}const v=(t,e,n)=>n===void 0?t.getAttribute(e)??null:(n===null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n),null),N=(t,...e)=>{const[n,...o]=e;for(const i of n.split(" "))t.addEventListener(i,...o);return()=>jr(t,...e)},jr=(t,...e)=>{const[n,...o]=e;for(const i of n.split(" "))t.removeEventListener(i,...o)},it=(t,e)=>{if(!Q())return;window._mtdsHotReloadCleanup||(window._mtdsHotReloadCleanup=new Map);const n=()=>{window._mtdsHotReloadCleanup?.get(t)?.map(o=>o()),window._mtdsHotReloadCleanup?.set(t,e())};document.readyState!=="complete"?N(window,"load",n):document.fonts?.ready?.then(n)||setTimeout(n,0)},Re=(t,e,n)=>{let o=0;const i=()=>{if(!t.isConnected)return r();e(a),a.takeRecords(),o=0},r=()=>a?.disconnect?.(),a=new MutationObserver(()=>{o||(o=requestAnimationFrame(i))});return a.observe(t,n),i(),r},O=(t,e,n)=>{const o=document.createElement(t);if(n&&(o.textContent=n),e)for(const[i,r]of Object.entries(e))v(o,i,r);return o},uc=typeof HTMLElement>"u"?class{}:HTMLElement,mc=(t,e)=>!Q()||window.customElements.get(t)||window.customElements.define(t,e),pc=`[data-command="toggle-app-expanded"],.${C.app.split(" ")[0]} > [command="show-modal"]`,fc=`.${C.breadcrumbs.split(" ")[0]}`,hc=`.${C.card.split(" ")[0]}`,Zr=`.${C.chip.split(" ")[0]}`,gc=`.${C.helptext.split(" ")[0]}`,vc=`.${C.pagination.split(" ")[0]}`,bc='summary,u-summary,a,button,[role="tab"],[role="button"]',Un="mattilsynet.matomo.cloud",wc=["setCustomUrl","setDocumentTitle","setReferrerUrl"],J="mtds-analytics-banner",yc="https://www.mattilsynet.no/om-mattilsynet/personvernerklaering/informasjonskapsler";function Kr(t,e={}){if(Q()){if(window._paq||(window._paq=[],window._paq.push(["HeatmapSessionRecording::disable"]),window._paq.push(["enableLinkTracking"]),window._paq.push(["setTrackerUrl",`https://${Un}/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:r}=window._mtdsTracking;if(i&&window._paq.push(["setSiteId",i]),o){n!=="custom"&&xc();const a=r?`https://cdn.matomo.cloud/${Un}/container_${r}.js`:`https://cdn.matomo.cloud/${Un}/matomo.js`;document.querySelector(`script[src="${a}"]`)||document.head.append(O("script",{async:"",src:a}))}}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:r}=e,a=["trackEvent",n,o,i,r];let s=location.href;window._paq.push([function(){s=this.getCurrentUrl()}]),window._paq.push(["setCustomUrl",s.split("#")[0]]),window._paq.push(a.filter(c=>c!==void 0)),window._paq.push(["setCustomUrl",s])}else if(t==="search"){const{query:n,category:o=!1,results:i=!1}=e;window._paq.push(["trackSiteSearch",n,o,i])}else if(t==="matomo"){const n=e;wc.includes(n?.[0])&&typeof n[1]!="string"&&(n[1]=`${n[1]??""}`),window._paq.push(n)}}}}function xc(){if(document.getElementById(J)||window.localStorage.getItem(J))return;document.body.insertAdjacentHTML("afterbegin",`<dialog id="${J}" data-analytics="ignore"><style>
199
+ ::slotted([role="option"][hidden]) { display: none !important }`,nc=tc(Wn),Vi,Ui=0,oc=Cn||Me,Di="click,focusout,input,keydown,mousedown,mouseup",zi="focus,focusin,blur,focusout",Ne={singular:"%d hit",plural:"%d hits"},Fi=class extends Ni{constructor(){super(),this._texts=Xl({},Ne),this._value="",this._of="/",Yl(this,Wn)}static get observedAttributes(){return["id",...Object.keys(Ne).map(t=>`data-sr-${t}`)]}connectedCallback(){this.hidden=!0,this._root=qi(this),L(this,"role","listbox"),L(this,"tabindex","-1"),Ft(this._root,"focusin",this),Ft(this._root,"focus",this,!0),Mn(this,{attributeFilter:["disabled","hidden","label","value"],attributes:!0,characterData:!0,childList:!0,subtree:!0}),setTimeout(()=>this.attributeChangedCallback())}disconnectedCallback(){Oe(this._root||this,"focus",this,!0),Oe(this._root||this,"focusin",this),Mn(this,!1),Pn(this),this._root=void 0}attributeChangedCallback(t,e,n){const o=t?.split("data-sr-")[1],i=`input[list="${this.id}"]`;if(Ne[o])this._texts[o]=n||Ne[o];else if(this._root){this._input&&Vn(this,this._input);for(const r of this._root.querySelectorAll(i))Vn(this,r)}}handleEvent(t){const{target:e,type:n}=t;t.defaultPrevented||(n==="click"&&ac(this,t),(n==="focus"||n==="focusin")&&ic(this,t),(n==="blur"||n==="focusout")&&rc(this,t),n==="keydown"&&sc(this,t),n==="mousedown"&&this.contains(e)&&Rn(t),(n==="mutation"||n==="input")&&(clearTimeout(Ui),Ui=setTimeout(Hi,0,this,t)))}get options(){var t;if(!this._options){const e=(t=this.querySelector('[role="option"],option'))==null?void 0:t.nodeName;e&&(this._options=this.getElementsByTagName(e))}return this._options||this.getElementsByTagName("option")}},Bi=t=>t?.disabled||t?.readOnly||!1,Gt=(t,e)=>{var n,o,i;if(t.hidden!==e)return;t.hidden=Bi(t?._input)||!e,(n=Mn(t))==null||n.takeRecords();const r=t.isConnected&&t.popover&&((o=t._input)==null?void 0:o.isConnected)&&((i=t._input)==null?void 0:i.popoverTargetElement)===t;t._input&&Vn(t,t._input,e),r&&L(t,"popover","manual"),r&&t.togglePopover(e),e&&Hi(t)},Pn=t=>{t._input&&(Oe(t._input||t,zi,t),Oe(t._root||t,Di,t),Gt(t,!1),t._input=void 0)},Vn=(t,e,n=!1)=>{t.popover&&L(e,"popovertarget",On(t)),Ft(e,zi,t,!0),L(e,"aria-autocomplete","list"),L(e,"aria-controls",On(t)),L(e,"aria-expanded",`${!oc||n}`),L(e,"autocomplete","off"),L(e,"role",Bi(e)?null:"combobox")},ic=(t,e)=>{var n;const o=e.target instanceof HTMLInputElement;o&&e.isTrusted&&e.stopImmediatePropagation(),t._input!==e.target&&o&&e.target.list===t&&(t._input&&Pn(t),t._input=e.target,t._input.dispatchEvent(new FocusEvent("focus")),t._input.dispatchEvent(new FocusEvent("focusin",{bubbles:!0})),L(t,jl,On((n=t._input.labels)==null?void 0:n[0])),Ft(t._root||t,Di,t),Gt(t,L(t._input,"inputmode")!=="none"),Pi())},rc=(t,e)=>{!Me&&!Rn()&&t._input&&setTimeout(Gi,0,t),e.target===t._input&&e.isTrusted&&e.stopImmediatePropagation()},Gi=t=>{var e;const n=((e=t._root)==null?void 0:e.activeElement)||null,o=t._input;o&&o!==n&&!t.contains(n)&&(o.dispatchEvent(new FocusEvent("blur",{relatedTarget:n})),o.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:n})),Pn(t))},ac=(t,{target:e})=>{var n;if(!t._input||t._input===e)return Gt(t,!0);for(const o of t.options)if(o.contains(e))return L(t,"aria-multiselectable")!=="true"&&((n=t._input)==null||n.focus(),Gt(t,!1)),$l(t._input,o.value);Me&&Gi(t)},sc=(t,e)=>{var n;const{key:o,target:i,altKey:r,ctrlKey:a,shiftKey:s,metaKey:c}=e,l=o==="Escape"||o==="Esc";if(r||a||c||s||o==="Tab")return;l&&!t.hidden&&e?.preventDefault(),Gt(t,!l);const d=[...t.options].filter(f=>L(f,"aria-hidden")!=="true"&&f.offsetHeight),u=d.indexOf(i);let m=-1;if(o==="ArrowDown"&&(m=(u+1)%d.length),o==="ArrowUp"&&(m=(~u?u:d.length)-1),~u&&((o==="Home"||o==="PageUp")&&(m=0),(o==="End"||o==="PageDown")&&(m=d.length-1),o==="Enter"))return d[u].click(),e.preventDefault();if(d[m])for(const f of d)f.tabIndex=-1;d[m]&&e.preventDefault(),(n=d[m]||t._input)==null||n.focus(),!d[m]&&o==="ArrowUp"&&setTimeout(()=>{var f;return(f=t._input)==null?void 0:f.setSelectionRange(999,999)})},Hi=(t,e)=>{const{_texts:n,_root:o,_input:i,options:r}=t,a=i?.value.toLowerCase().trim()||"",s=!t.hasAttribute("data-nofilter"),c=[],l=[];for(const m of r)(m.disabled||m.hidden||s&&!m.label.toLowerCase().includes(a)?c:l).push(m);for(const m of c)L(m,"aria-hidden","true");for(const m of l)L(m,"aria-hidden","false");const d=l.length;clearTimeout(Vi),e?.type==="input"&&a!==t._value&&(Vi=setTimeout(()=>{const m=`${!d&&t.innerText.trim()||`${n[d===1?"singular":"plural"]}`.replace("%d",`${d}`)}`;!t.hidden&&o?.activeElement===i&&Pi(m),t._value=a},1e3));let u=0;if(Cn)for(const m of l)L(m,"title",`${++u} ${t._of} ${d}`)};zt&&Object.defineProperty(HTMLInputElement.prototype,"list",{configurable:!0,enumerable:!0,get(){return qi(this).getElementById(L(this,"list")||"")}}),Wi.define("u-datalist",Fi),ct()&&!Dl()&&zl();const lc="3.1.10",Ji="_alert_1d3iq_1 _ds-alert_s9m4f_3",Xi="_app_1d3iq_1",ji="_sticky_1d3iq_1",Zi="_avatar_1d3iq_1 _ds-avatar_s9m4f_1",Ki="_badge_1d3iq_1",Yi="_breadcrumbs_1d3iq_1 _ds-breadcrumbs_s9m4f_5",Qi="_button_1d3iq_1 _ds-button_s9m4f_1",_i="_card_1d3iq_1",$i="_group_1d3iq_1",tr="_chip_1d3iq_1 _ds-chip_s9m4f_5",er="_details_1d3iq_1 _ds-details_s9m4f_3",nr="_dialog_1d3iq_1 _ds-dialog_s9m4f_5",or="__drawer_1d3iq_1",ir="_divider_1d3iq_1",rr="_errorsummary_1d3iq_1 _ds-error-summary_s9m4f_5",ar="_field_1d3iq_1 _ds-field_s9m4f_1",sr="_suggestion_1d3iq_1 _ds-suggestion_s9m4f_5",lr="_affixes_1d3iq_1 _ds-field-affixes_s9m4f_3",cr="_fieldset_1d3iq_1 _ds-fieldset_s9m4f_3",dr="_fileupload_1d3iq_1",ur="_helptext_1d3iq_1 _ds-focus_s9m4f_1",mr="_input_1d3iq_1 _ds-input_s9m4f_1",pr="_law_1d3iq_1",fr="_grid_1d3iq_1",hr="_flex_1d3iq_1",gr="_link_1d3iq_1",vr="_logo_1d3iq_1",br="__logo_1d3iq_1",wr="_pagination_1d3iq_1 _ds-pagination_s9m4f_5",yr="_popover_1d3iq_1 _ds-popover_s9m4f_3",xr="_progress_1d3iq_1",Er="__indeterminate_1d3iq_1",Sr="_skeleton_1d3iq_1 _ds-skeleton_s9m4f_5",kr="__skeleton_1d3iq_1",Tr="_spinner_1d3iq_1",Ar="_steps_1d3iq_1",Lr="_table_1d3iq_1 _ds-table_s9m4f_5",Cr="__scrollShadow_1d3iq_1",Mr="_tabs_1d3iq_1 _ds-tabs_s9m4f_5",Or="__scrollMask_1d3iq_1",Ir="_tag_1d3iq_1 _ds-tag_s9m4f_5",Nr="_toast_1d3iq_1",Rr="__toastClose_1d3iq_1",qr="__toastOpen_1d3iq_1",Wr="__toastTimeout_1d3iq_1",Pr="_togglegroup_1d3iq_1 _ds-toggle-group_s9m4f_5",Vr="__tooltip_1d3iq_1 _ds-tooltip_s9m4f_5",Ur="_heading_1d3iq_1 _ds-heading_s9m4f_1",Dr="_ingress_1d3iq_1",zr="_muted_1d3iq_1",Fr="_info_1d3iq_1",Br="_prose_1d3iq_1",Gr="_validation_1d3iq_1 _ds-validation-message_s9m4f_1",Hr="_body_1d3iq_161",Jr="__checked_1d3iq_1",C={alert:Ji,app:Xi,sticky:ji,avatar:Zi,badge:Ki,breadcrumbs:Yi,button:Qi,card:_i,group:$i,chip:tr,details:er,dialog:nr,_drawer:or,divider:ir,errorsummary:rr,field:ar,suggestion:sr,affixes:lr,fieldset:cr,fileupload:dr,helptext:ur,input:mr,law:pr,grid:fr,flex:hr,link:gr,logo:vr,_logo:br,pagination:wr,popover:yr,progress:xr,_indeterminate:Er,skeleton:Sr,_skeleton:kr,spinner:Tr,steps:Ar,table:Lr,_scrollShadow:Cr,tabs:Mr,_scrollMask:Or,tag:Ir,toast:Nr,_toastClose:Rr,_toastOpen:qr,_toastTimeout:Wr,togglegroup:Pr,_tooltip:Vr,heading:Ur,ingress:Dr,muted:zr,info:Fr,prose:Br,validation:Gr,body:Hr,_checked:Jr},cc=Object.freeze(Object.defineProperty({__proto__:null,_checked:Jr,_drawer:or,_indeterminate:Er,_logo:br,_scrollMask:Or,_scrollShadow:Cr,_skeleton:kr,_toastClose:Rr,_toastOpen:qr,_toastTimeout:Wr,_tooltip:Vr,affixes:lr,alert:Ji,app:Xi,avatar:Zi,badge:Ki,body:Hr,breadcrumbs:Yi,button:Qi,card:_i,chip:tr,default:C,details:er,dialog:nr,divider:ir,errorsummary:rr,field:ar,fieldset:cr,fileupload:dr,flex:hr,grid:fr,group:$i,heading:Ur,helptext:ur,info:Fr,ingress:Dr,input:mr,law:pr,link:gr,logo:vr,muted:zr,pagination:wr,popover:yr,progress:xr,prose:Br,skeleton:Sr,spinner:Tr,steps:Ar,sticky:ji,suggestion:sr,table:Lr,tabs:Mr,tag:Ir,toast:Nr,togglegroup:Pr,validation:Gr},Symbol.toStringTag,{value:"Module"}));function Xr(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=Xr(t[e]))&&(o&&(o+=" "),o+=n)}else for(n in t)t[n]&&(o&&(o+=" "),o+=n);return o}function dc(){for(var t,e,n=0,o="",i=arguments.length;n<i;n++)(t=arguments[n])&&(e=Xr(t))&&(o&&(o+=" "),o+=e);return o}const Ht={capture:!0,passive:!0},Q=()=>typeof window<"u"&&typeof document<"u",bt=t=>Q()?document.getElementsByClassName(C[t].split(" ")[0]):[];function wt(t,e){let n;return function(...o){clearTimeout(n),n=setTimeout(()=>t.apply(this,o),e)}}const v=(t,e,n)=>n===void 0?t.getAttribute(e)??null:(n===null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n),null),N=(t,...e)=>{const[n,...o]=e;for(const i of n.split(" "))t.addEventListener(i,...o);return()=>jr(t,...e)},jr=(t,...e)=>{const[n,...o]=e;for(const i of n.split(" "))t.removeEventListener(i,...o)},it=(t,e)=>{if(!Q())return;window._mtdsHotReloadCleanup||(window._mtdsHotReloadCleanup=new Map);const n=()=>{window._mtdsHotReloadCleanup?.get(t)?.map(o=>o()),window._mtdsHotReloadCleanup?.set(t,e())};document.readyState!=="complete"?N(window,"load",n):document.fonts?.ready?.then(n)||setTimeout(n,0)},Re=(t,e,n)=>{let o=0;const i=()=>{if(!t.isConnected)return r();e(a),a.takeRecords(),o=0},r=()=>a?.disconnect?.(),a=new MutationObserver(()=>{o||(o=requestAnimationFrame(i))});return a.observe(t,n),i(),r},O=(t,e,n)=>{const o=document.createElement(t);if(n&&(o.textContent=n),e)for(const[i,r]of Object.entries(e))v(o,i,r);return o},uc=typeof HTMLElement>"u"?class{}:HTMLElement,mc=(t,e)=>!Q()||window.customElements.get(t)||window.customElements.define(t,e),pc=`[data-command="toggle-app-expanded"],.${C.app.split(" ")[0]} > [command="show-modal"]`,fc=`.${C.breadcrumbs.split(" ")[0]}`,hc=`.${C.card.split(" ")[0]}`,Zr=`.${C.chip.split(" ")[0]}`,gc=`.${C.helptext.split(" ")[0]}`,vc=`.${C.pagination.split(" ")[0]}`,bc='summary,u-summary,a,button,[role="tab"],[role="button"]',Un="mattilsynet.matomo.cloud",wc=["setCustomUrl","setDocumentTitle","setReferrerUrl"],J="mtds-analytics-banner",yc="https://www.mattilsynet.no/om-mattilsynet/personvernerklaering/informasjonskapsler";function Kr(t,e={}){if(Q()){if(window._paq||(window._paq=[],window._paq.push(["HeatmapSessionRecording::disable"]),window._paq.push(["enableLinkTracking"]),window._paq.push(["setTrackerUrl",`https://${Un}/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:r}=window._mtdsTracking;if(i&&window._paq.push(["setSiteId",i]),o){n!=="custom"&&xc();const a=r?`https://cdn.matomo.cloud/${Un}/container_${r}.js`:`https://cdn.matomo.cloud/${Un}/matomo.js`;document.querySelector(`script[src="${a}"]`)||document.head.append(O("script",{async:"",src:a}))}}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:r}=e,a=["trackEvent",n,o,i,r];let s=location.href;window._paq.push([function(){s=this.getCurrentUrl()}]),window._paq.push(["setCustomUrl",s.split("#")[0]]),window._paq.push(a.filter(c=>c!==void 0)),window._paq.push(["setCustomUrl",s])}else if(t==="search"){const{query:n,category:o=!1,results:i=!1}=e;window._paq.push(["trackSiteSearch",n,o,i])}else if(t==="matomo"){const n=e;wc.includes(n?.[0])&&typeof n[1]!="string"&&(n[1]=`${n[1]??""}`),window._paq.push(n)}}}}function xc(){if(document.getElementById(J)||window.localStorage.getItem(J))return;document.body.insertAdjacentHTML("afterbegin",`<dialog id="${J}" data-analytics="ignore"><style>
200
200
  #${J}[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 }
201
201
  #${J} 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 }
202
202
  #${J} button:focus-visible { outline: 2px solid }
@@ -1,4 +1,4 @@
1
- const o = "3.1.9";
1
+ const o = "3.1.10";
2
2
  export {
3
3
  o as version
4
4
  };