@oslokommune/punkt-react 12.39.1 → 12.39.2
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/dist/punkt-react.es.js
CHANGED
|
@@ -38725,7 +38725,7 @@ const sH = [
|
|
|
38725
38725
|
{
|
|
38726
38726
|
id: "tickets",
|
|
38727
38727
|
fn: "tickets.svg",
|
|
38728
|
-
cat: "
|
|
38728
|
+
cat: "sign"
|
|
38729
38729
|
},
|
|
38730
38730
|
{
|
|
38731
38731
|
id: "trail",
|
package/dist/punkt-react.umd.js
CHANGED
|
@@ -1530,5 +1530,5 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1530
1530
|
* @public
|
|
1531
1531
|
*/var i=function(l){var c=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,h=0,m={},D={manual:l.Prism&&l.Prism.manual,disableWorkerMessageHandler:l.Prism&&l.Prism.disableWorkerMessageHandler,util:{encode:function J(G){return G instanceof C?new C(G.type,J(G.content),G.alias):Array.isArray(G)?G.map(J):G.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(J){return Object.prototype.toString.call(J).slice(8,-1)},objId:function(J){return J.__id||Object.defineProperty(J,"__id",{value:++h}),J.__id},clone:function J(G,re){re=re||{};var V,ae;switch(D.util.type(G)){case"Object":if(ae=D.util.objId(G),re[ae])return re[ae];V={},re[ae]=V;for(var ce in G)G.hasOwnProperty(ce)&&(V[ce]=J(G[ce],re));return V;case"Array":return ae=D.util.objId(G),re[ae]?re[ae]:(V=[],re[ae]=V,G.forEach(function(Te,ke){V[ke]=J(Te,re)}),V);default:return G}},getLanguage:function(J){for(;J;){var G=c.exec(J.className);if(G)return G[1].toLowerCase();J=J.parentElement}return"none"},setLanguage:function(J,G){J.className=J.className.replace(RegExp(c,"gi"),""),J.classList.add("language-"+G)},currentScript:function(){if(typeof document>"u")return null;if("currentScript"in document)return document.currentScript;try{throw new Error}catch(V){var J=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(V.stack)||[])[1];if(J){var G=document.getElementsByTagName("script");for(var re in G)if(G[re].src==J)return G[re]}return null}},isActive:function(J,G,re){for(var V="no-"+G;J;){var ae=J.classList;if(ae.contains(G))return!0;if(ae.contains(V))return!1;J=J.parentElement}return!!re}},languages:{plain:m,plaintext:m,text:m,txt:m,extend:function(J,G){var re=D.util.clone(D.languages[J]);for(var V in G)re[V]=G[V];return re},insertBefore:function(J,G,re,V){V=V||D.languages;var ae=V[J],ce={};for(var Te in ae)if(ae.hasOwnProperty(Te)){if(Te==G)for(var ke in re)re.hasOwnProperty(ke)&&(ce[ke]=re[ke]);re.hasOwnProperty(Te)||(ce[Te]=ae[Te])}var Ge=V[J];return V[J]=ce,D.languages.DFS(D.languages,function(We,Ke){Ke===Ge&&We!=J&&(this[We]=ce)}),ce},DFS:function J(G,re,V,ae){ae=ae||{};var ce=D.util.objId;for(var Te in G)if(G.hasOwnProperty(Te)){re.call(G,Te,G[Te],V||Te);var ke=G[Te],Ge=D.util.type(ke);Ge==="Object"&&!ae[ce(ke)]?(ae[ce(ke)]=!0,J(ke,re,null,ae)):Ge==="Array"&&!ae[ce(ke)]&&(ae[ce(ke)]=!0,J(ke,re,Te,ae))}}},plugins:{},highlightAll:function(J,G){D.highlightAllUnder(document,J,G)},highlightAllUnder:function(J,G,re){var V={callback:re,container:J,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};D.hooks.run("before-highlightall",V),V.elements=Array.prototype.slice.apply(V.container.querySelectorAll(V.selector)),D.hooks.run("before-all-elements-highlight",V);for(var ae=0,ce;ce=V.elements[ae++];)D.highlightElement(ce,G===!0,V.callback)},highlightElement:function(J,G,re){var V=D.util.getLanguage(J),ae=D.languages[V];D.util.setLanguage(J,V);var ce=J.parentElement;ce&&ce.nodeName.toLowerCase()==="pre"&&D.util.setLanguage(ce,V);var Te=J.textContent,ke={element:J,language:V,grammar:ae,code:Te};function Ge(Ke){ke.highlightedCode=Ke,D.hooks.run("before-insert",ke),ke.element.innerHTML=ke.highlightedCode,D.hooks.run("after-highlight",ke),D.hooks.run("complete",ke),re&&re.call(ke.element)}if(D.hooks.run("before-sanity-check",ke),ce=ke.element.parentElement,ce&&ce.nodeName.toLowerCase()==="pre"&&!ce.hasAttribute("tabindex")&&ce.setAttribute("tabindex","0"),!ke.code){D.hooks.run("complete",ke),re&&re.call(ke.element);return}if(D.hooks.run("before-highlight",ke),!ke.grammar){Ge(D.util.encode(ke.code));return}if(G&&l.Worker){var We=new Worker(D.filename);We.onmessage=function(Ke){Ge(Ke.data)},We.postMessage(JSON.stringify({language:ke.language,code:ke.code,immediateClose:!0}))}else Ge(D.highlight(ke.code,ke.grammar,ke.language))},highlight:function(J,G,re){var V={code:J,grammar:G,language:re};if(D.hooks.run("before-tokenize",V),!V.grammar)throw new Error('The language "'+V.language+'" has no grammar.');return V.tokens=D.tokenize(V.code,V.grammar),D.hooks.run("after-tokenize",V),C.stringify(D.util.encode(V.tokens),V.language)},tokenize:function(J,G){var re=G.rest;if(re){for(var V in re)G[V]=re[V];delete G.rest}var ae=new N;return O(ae,ae.head,J),$(J,ae,G,ae.head,0),I(ae)},hooks:{all:{},add:function(J,G){var re=D.hooks.all;re[J]=re[J]||[],re[J].push(G)},run:function(J,G){var re=D.hooks.all[J];if(!(!re||!re.length))for(var V=0,ae;ae=re[V++];)ae(G)}},Token:C};l.Prism=D;function C(J,G,re,V){this.type=J,this.content=G,this.alias=re,this.length=(V||"").length|0}C.stringify=function J(G,re){if(typeof G=="string")return G;if(Array.isArray(G)){var V="";return G.forEach(function(Ge){V+=J(Ge,re)}),V}var ae={type:G.type,content:J(G.content,re),tag:"span",classes:["token",G.type],attributes:{},language:re},ce=G.alias;ce&&(Array.isArray(ce)?Array.prototype.push.apply(ae.classes,ce):ae.classes.push(ce)),D.hooks.run("wrap",ae);var Te="";for(var ke in ae.attributes)Te+=" "+ke+'="'+(ae.attributes[ke]||"").replace(/"/g,""")+'"';return"<"+ae.tag+' class="'+ae.classes.join(" ")+'"'+Te+">"+ae.content+"</"+ae.tag+">"};function T(J,G,re,V){J.lastIndex=G;var ae=J.exec(re);if(ae&&V&&ae[1]){var ce=ae[1].length;ae.index+=ce,ae[0]=ae[0].slice(ce)}return ae}function $(J,G,re,V,ae,ce){for(var Te in re)if(!(!re.hasOwnProperty(Te)||!re[Te])){var ke=re[Te];ke=Array.isArray(ke)?ke:[ke];for(var Ge=0;Ge<ke.length;++Ge){if(ce&&ce.cause==Te+","+Ge)return;var We=ke[Ge],Ke=We.inside,nt=!!We.lookbehind,He=!!We.greedy,dt=We.alias;if(He&&!We.pattern.global){var Me=We.pattern.toString().match(/[imsuy]*$/)[0];We.pattern=RegExp(We.pattern.source,Me+"g")}for(var Le=We.pattern||We,fe=V.next,Re=ae;fe!==G.tail&&!(ce&&Re>=ce.reach);Re+=fe.value.length,fe=fe.next){var _e=fe.value;if(G.length>J.length)return;if(!(_e instanceof C)){var Q=1,he;if(He){if(he=T(Le,Re,J,nt),!he||he.index>=J.length)break;var ht=he.index,ot=he.index+he[0].length,rt=Re;for(rt+=fe.value.length;ht>=rt;)fe=fe.next,rt+=fe.value.length;if(rt-=fe.value.length,Re=rt,fe.value instanceof C)continue;for(var Dt=fe;Dt!==G.tail&&(rt<ot||typeof Dt.value=="string");Dt=Dt.next)Q++,rt+=Dt.value.length;Q--,_e=J.slice(Re,rt),he.index-=Re}else if(he=T(Le,0,_e,nt),!he)continue;var ht=he.index,bt=he[0],vt=_e.slice(0,ht),Rt=_e.slice(ht+bt.length),cn=Re+_e.length;ce&&cn>ce.reach&&(ce.reach=cn);var en=fe.prev;vt&&(en=O(G,en,vt),Re+=vt.length),B(G,en,Q);var Qn=new C(Te,Ke?D.tokenize(bt,Ke):bt,dt,bt);if(fe=O(G,en,Qn),Rt&&O(G,fe,Rt),Q>1){var Lt={cause:Te+","+Ge,reach:cn};$(J,G,re,fe.prev,Re,Lt),ce&&Lt.reach>ce.reach&&(ce.reach=Lt.reach)}}}}}}function N(){var J={value:null,prev:null,next:null},G={value:null,prev:J,next:null};J.next=G,this.head=J,this.tail=G,this.length=0}function O(J,G,re){var V=G.next,ae={value:re,prev:G,next:V};return G.next=ae,V.prev=ae,J.length++,ae}function B(J,G,re){for(var V=G.next,ae=0;ae<re&&V!==J.tail;ae++)V=V.next;G.next=V,V.prev=G,J.length-=ae}function I(J){for(var G=[],re=J.head.next;re!==J.tail;)G.push(re.value),re=re.next;return G}if(!l.document)return l.addEventListener&&(D.disableWorkerMessageHandler||l.addEventListener("message",function(J){var G=JSON.parse(J.data),re=G.language,V=G.code,ae=G.immediateClose;l.postMessage(D.highlight(V,D.languages[re],re)),ae&&l.close()},!1)),D;var K=D.util.currentScript();K&&(D.filename=K.src,K.hasAttribute("data-manual")&&(D.manual=!0));function Y(){D.manual||D.highlightAll()}if(!D.manual){var Ce=document.readyState;Ce==="loading"||Ce==="interactive"&&K&&K.defer?document.addEventListener("DOMContentLoaded",Y):window.requestAnimationFrame?window.requestAnimationFrame(Y):window.setTimeout(Y,16)}return D}(r);n.exports&&(n.exports=i),typeof bd<"u"&&(bd.Prism=i)})(PE);var oj=PE.exports,sj=w2;w2.displayName="markup",w2.aliases=["html","mathml","svg","xml","ssml","atom","rss"];function w2(n){n.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},n.languages.markup.tag.inside["attr-value"].inside.entity=n.languages.markup.entity,n.languages.markup.doctype.inside["internal-subset"].inside=n.languages.markup,n.hooks.add("wrap",function(r){r.type==="entity"&&(r.attributes.title=r.content.value.replace(/&/,"&"))}),Object.defineProperty(n.languages.markup.tag,"addInlined",{value:function(i,l){var c={};c["language-"+l]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:n.languages[l]},c.cdata=/^<!\[CDATA\[|\]\]>$/i;var h={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:c}};h["language-"+l]={pattern:/[\s\S]+/,inside:n.languages[l]};var m={};m[i]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return i}),"i"),lookbehind:!0,greedy:!0,inside:h},n.languages.insertBefore("markup","cdata",m)}}),Object.defineProperty(n.languages.markup.tag,"addAttribute",{value:function(r,i){n.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+r+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[i,"language-"+i],inside:n.languages[i]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),n.languages.html=n.languages.markup,n.languages.mathml=n.languages.markup,n.languages.svg=n.languages.markup,n.languages.xml=n.languages.extend("markup",{}),n.languages.ssml=n.languages.xml,n.languages.atom=n.languages.xml,n.languages.rss=n.languages.xml}var lj=D2;D2.displayName="css",D2.aliases=[];function D2(n){(function(r){var i=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;r.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:/@[\w-](?:[^;{\s]|\s+(?![\s{]))*(?:;|(?=\s*\{))/,inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+i.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+i.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+i.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:i,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},r.languages.css.atrule.inside.rest=r.languages.css;var l=r.languages.markup;l&&(l.tag.addInlined("style","css"),l.tag.addAttribute("style","css"))})(n)}var uj=S2;S2.displayName="clike",S2.aliases=[];function S2(n){n.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/}}var cj=C2;C2.displayName="javascript",C2.aliases=["js"];function C2(n){n.languages.javascript=n.languages.extend("clike",{"class-name":[n.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),n.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,n.languages.insertBefore("javascript","keyword",{regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)\/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/,lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:n.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:n.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:n.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:n.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:n.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),n.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:n.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),n.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),n.languages.markup&&(n.languages.markup.tag.addInlined("script","javascript"),n.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),n.languages.js=n.languages.javascript}var Kg=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof bd=="object"?bd:{},dj=Ej();Kg.Prism={manual:!0,disableWorkerMessageHandler:!0};var fj=_4,pj=H4,NE=oj,hj=sj,mj=lj,gj=uj,vj=cj;dj();var _2={}.hasOwnProperty;function OE(){}OE.prototype=NE;var ma=new OE,yj=ma;ma.highlight=kj,ma.register=Qg,ma.alias=bj,ma.registered=wj,ma.listLanguages=Dj,Qg(hj),Qg(mj),Qg(gj),Qg(vj),ma.util.encode=_j,ma.Token.stringify=Sj;function Qg(n){if(typeof n!="function"||!n.displayName)throw new Error("Expected `function` for `grammar`, got `"+n+"`");ma.languages[n.displayName]===void 0&&n(ma)}function bj(n,r){var i=ma.languages,l=n,c,h,m,D;r&&(l={},l[n]=r);for(c in l)for(h=l[c],h=typeof h=="string"?[h]:h,m=h.length,D=-1;++D<m;)i[h[D]]=i[c]}function kj(n,r){var i=NE.highlight,l;if(typeof n!="string")throw new Error("Expected `string` for `value`, got `"+n+"`");if(ma.util.type(r)==="Object")l=r,r=null;else{if(typeof r!="string")throw new Error("Expected `string` for `name`, got `"+r+"`");if(_2.call(ma.languages,r))l=ma.languages[r];else throw new Error("Unknown language: `"+r+"` is not registered")}return i.call(this,n,l,r)}function wj(n){if(typeof n!="string")throw new Error("Expected `string` for `language`, got `"+n+"`");return _2.call(ma.languages,n)}function Dj(){var n=ma.languages,r=[],i;for(i in n)_2.call(n,i)&&typeof n[i]=="object"&&r.push(i);return r}function Sj(n,r,i){var l;return typeof n=="string"?{type:"text",value:n}:ma.util.type(n)==="Array"?Cj(n,r):(l={type:n.type,content:ma.Token.stringify(n.content,r,i),tag:"span",classes:["token",n.type],attributes:{},language:r,parent:i},n.alias&&(l.classes=l.classes.concat(n.alias)),ma.hooks.run("wrap",l),fj(l.tag+"."+l.classes.join("."),xj(l.attributes),l.content))}function Cj(n,r){for(var i=[],l=n.length,c=-1,h;++c<l;)h=n[c],h!==""&&h!==null&&h!==void 0&&i.push(h);for(c=-1,l=i.length;++c<l;)h=i[c],i[c]=ma.Token.stringify(h,r,i);return i}function _j(n){return n}function xj(n){var r;for(r in n)n[r]=pj(n[r]);return n}function Ej(){var n="Prism"in Kg,r=n?Kg.Prism:void 0;return i;function i(){n?Kg.Prism=r:delete Kg.Prism,n=void 0,r=void 0}}const x2=By(yj);var Xg=sI(x2,{});Xg.registerLanguage=function(n,r){return x2.register(r)},Xg.alias=function(n,r){return x2.alias(n,r)};const RE={'code[class*="language-"]':{color:"black",background:"none",textShadow:"0 1px white",fontFamily:"Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace",fontSize:"1em",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",wordWrap:"normal",lineHeight:"1.5",MozTabSize:"4",OTabSize:"4",tabSize:"4",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none"},'pre[class*="language-"]':{color:"black",background:"#f5f2f0",textShadow:"0 1px white",fontFamily:"Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace",fontSize:"1em",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",wordWrap:"normal",lineHeight:"1.5",MozTabSize:"4",OTabSize:"4",tabSize:"4",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none",padding:"1em",margin:".5em 0",overflow:"auto"},'pre[class*="language-"]::-moz-selection':{textShadow:"none",background:"#b3d4fc"},'pre[class*="language-"] ::-moz-selection':{textShadow:"none",background:"#b3d4fc"},'code[class*="language-"]::-moz-selection':{textShadow:"none",background:"#b3d4fc"},'code[class*="language-"] ::-moz-selection':{textShadow:"none",background:"#b3d4fc"},'pre[class*="language-"]::selection':{textShadow:"none",background:"#b3d4fc"},'pre[class*="language-"] ::selection':{textShadow:"none",background:"#b3d4fc"},'code[class*="language-"]::selection':{textShadow:"none",background:"#b3d4fc"},'code[class*="language-"] ::selection':{textShadow:"none",background:"#b3d4fc"},':not(pre) > code[class*="language-"]':{background:"#f5f2f0",padding:".1em",borderRadius:".3em",whiteSpace:"normal"},comment:{color:"slategray"},prolog:{color:"slategray"},doctype:{color:"slategray"},cdata:{color:"slategray"},punctuation:{color:"#999"},namespace:{Opacity:".7"},property:{color:"#905"},tag:{color:"#905"},boolean:{color:"#905"},number:{color:"#905"},constant:{color:"#905"},symbol:{color:"#905"},deleted:{color:"#905"},selector:{color:"#690"},"attr-name":{color:"#690"},string:{color:"#690"},char:{color:"#690"},builtin:{color:"#690"},inserted:{color:"#690"},operator:{color:"#9a6e3a",background:"hsla(0, 0%, 100%, .5)"},entity:{color:"#9a6e3a",background:"hsla(0, 0%, 100%, .5)",cursor:"help"},url:{color:"#9a6e3a",background:"hsla(0, 0%, 100%, .5)"},".language-css .token.string":{color:"#9a6e3a",background:"hsla(0, 0%, 100%, .5)"},".style .token.string":{color:"#9a6e3a",background:"hsla(0, 0%, 100%, .5)"},atrule:{color:"#07a"},"attr-value":{color:"#07a"},keyword:{color:"#07a"},function:{color:"#DD4A68"},"class-name":{color:"#DD4A68"},regex:{color:"#e90"},important:{color:"#e90",fontWeight:"bold"},variable:{color:"#e90"},bold:{fontWeight:"bold"},italic:{fontStyle:"italic"}};var Tj=E2;E2.displayName="jsx",E2.aliases=[];function E2(n){(function(r){var i=r.util.clone(r.languages.javascript),l=/(?:\s|\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))\*\/)/.source,c=/(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])*\})/.source,h=/(?:\{<S>*\.{3}(?:[^{}]|<BRACES>)*\})/.source;function m(T,$){return T=T.replace(/<S>/g,function(){return l}).replace(/<BRACES>/g,function(){return c}).replace(/<SPREAD>/g,function(){return h}),RegExp(T,$)}h=m(h).source,r.languages.jsx=r.languages.extend("markup",i),r.languages.jsx.tag.pattern=m(/<\/?(?:[\w.:-]+(?:<S>+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\/?)?>/.source),r.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,r.languages.jsx.tag.inside["attr-value"].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,r.languages.jsx.tag.inside.tag.inside["class-name"]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,r.languages.jsx.tag.inside.comment=i.comment,r.languages.insertBefore("inside","attr-name",{spread:{pattern:m(/<SPREAD>/.source),inside:r.languages.jsx}},r.languages.jsx.tag),r.languages.insertBefore("inside","special-attr",{script:{pattern:m(/=<BRACES>/.source),alias:"language-javascript",inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:"punctuation"},rest:r.languages.jsx}}},r.languages.jsx.tag);var D=function(T){return T?typeof T=="string"?T:typeof T.content=="string"?T.content:T.content.map(D).join(""):""},C=function(T){for(var $=[],N=0;N<T.length;N++){var O=T[N],B=!1;if(typeof O!="string"&&(O.type==="tag"&&O.content[0]&&O.content[0].type==="tag"?O.content[0].content[0].content==="</"?$.length>0&&$[$.length-1].tagName===D(O.content[0].content[1])&&$.pop():O.content[O.content.length-1].content==="/>"||$.push({tagName:D(O.content[0].content[1]),openedBraces:0}):$.length>0&&O.type==="punctuation"&&O.content==="{"?$[$.length-1].openedBraces++:$.length>0&&$[$.length-1].openedBraces>0&&O.type==="punctuation"&&O.content==="}"?$[$.length-1].openedBraces--:B=!0),(B||typeof O=="string")&&$.length>0&&$[$.length-1].openedBraces===0){var I=D(O);N<T.length-1&&(typeof T[N+1]=="string"||T[N+1].type==="plain-text")&&(I+=D(T[N+1]),T.splice(N+1,1)),N>0&&(typeof T[N-1]=="string"||T[N-1].type==="plain-text")&&(I=D(T[N-1])+I,T.splice(N-1,1),N--),T[N]=new r.Token("plain-text",I,null,I)}O.content&&typeof O.content!="string"&&C(O.content)}};r.hooks.add("after-tokenize",function(T){T.language!=="jsx"&&T.language!=="tsx"||C(T.tokens)})})(n)}const Aj=By(Tj),Fj=Or({tagName:"pkt-tag",elementClass:xs,react:$e,displayName:"PktTag",events:{onClose:"close"}}),Wh=$e.forwardRef(({children:n,...r},i)=>L.jsx(Fj,{ref:i,...r,children:L.jsx("div",{className:"pkt-contents",children:n})}));Wh.displayName="PktTag";const LE=$e.forwardRef(({arrowNav:n=!0,tabs:r,onTabSelected:i},l)=>{const c=$e.useRef([]);$e.useEffect(()=>{c.current=c.current.slice(0,r.length)},[r]);const h=(D,C)=>{C.action&&C.action(D),i&&i(D)},m=(D,C)=>{var T,$;n&&(C.code==="ArrowLeft"&&D!==0&&((T=c.current[D-1])==null||T.focus()),C.code==="ArrowRight"&&D<r.length-1&&(($=c.current[D+1])==null||$.focus()),(C.code==="ArrowDown"||C.code==="Space")&&h(D,r[D]))};return L.jsx("div",{className:"pkt-tabs",ref:l,children:L.jsx("div",{className:"pkt-tabs__list",role:n?"tablist":"navigation",children:r.map((D,C)=>L.jsx($e.Fragment,{children:D.href?L.jsxs("a",{"aria-selected":!!D.active,role:n?"tab":void 0,href:D.href,"aria-controls":D.controls,className:`pkt-tabs__link ${D.active?"active":""}`,onKeyUp:T=>m(C,T),onClick:()=>h(C,D),tabIndex:D.active||!n?void 0:-1,ref:T=>{c.current[C]=T},children:[D.icon&&L.jsx(br,{name:D.icon,className:"pkt-icon--small"}),D.text,D.tag&&L.jsx(Wh,{skin:D.tag.skin,size:"small",children:D.tag.text})]}):L.jsxs("button",{"aria-selected":!!D.active,role:n?"tab":void 0,type:"button","aria-controls":D.controls,className:`pkt-tabs__button pkt-link-button ${D.active?"active":""}`,onKeyUp:T=>m(C,T),onClick:()=>h(C,D),tabIndex:D.active||!n?void 0:-1,ref:T=>{c.current[C]=T},children:[D.icon&&L.jsx(br,{name:D.icon,className:"pkt-icon--small"}),D.text,D.tag&&L.jsx(Wh,{skin:D.tag.skin,size:"small",children:D.tag.text})]},"b-"+C)},C))})})}),$j=Or({tagName:"pkt-textinput",elementClass:Ts,react:$e,displayName:"PktTextinput",events:{onChange:"change",onInput:"input",onBlur:"blur",onFocus:"focus",onValueChange:"valueChange",onToggleHelpText:"toggleHelpText"}}),Jg=$e.forwardRef(({helptext:n,...r},i)=>L.jsx($j,{...r,ref:i,children:n&&L.jsx("div",{slot:"helptext",className:"pkt-contents",children:n})}));Jg.displayName="PktTextinput";const $b=({className:n,compact:r=!1,skin:i="basic",responsiveView:l=!0,children:c})=>L.jsx("table",{"data-testid":"pkt-table",className:hl(n,"pkt-table",{"pkt-table--responsive":l,"pkt-table--compact":r,"pkt-table--basic":i==="basic","pkt-table--zebra-blue":i==="zebra-blue"}),role:"table",children:c}),Pb=({className:n,children:r})=>L.jsx("thead",{className:hl(n,"pkt-table__header",{}),role:"rowgroup",children:r}),Nb=({children:n,className:r})=>L.jsx("tbody",{className:hl(r,"pkt-table__body",{}),role:"rowgroup",children:n}),tp=({className:n,children:r})=>L.jsx("tr",{className:hl(n,"pkt-table__row",{}),role:"row",children:r}),ml=({className:n,children:r})=>L.jsx("th",{className:hl(n,"pkt-table__header-cell",{}),role:"columnheader",children:r}),Xo=({children:n,className:r,dataLabel:i})=>L.jsx("td",{className:hl(r,"pkt-table__data-cell",{}),"data-label":i,role:"cell","data-testid":"pkt-table__data-cell",children:n}),Pj=({specs:n})=>{const r=l=>Array.isArray(l)?l.join(`
|
|
1532
1532
|
`):l,i=l=>typeof l=="boolean"?l?"true":"false":l;return L.jsxs(L.Fragment,{children:[L.jsx("h2",{children:"Egenskaper"}),L.jsxs($b,{compact:!0,children:[L.jsx(Pb,{children:L.jsxs(tp,{children:[L.jsx(ml,{children:"Prop"}),L.jsx(ml,{children:"Navn"}),L.jsx(ml,{children:"Beskrivelse"}),L.jsx(ml,{children:"Type"}),L.jsx(ml,{children:"Standardverdi"})]})}),L.jsx(Nb,{children:Object.entries(n.props||{}).map(([l,c])=>L.jsxs(tp,{children:[L.jsx(Xo,{dataLabel:"Prop",children:L.jsx("pre",{children:l})}),L.jsx(Xo,{dataLabel:"Navn",children:!Array.isArray(c)&&c.name||l}),Array.isArray(c)?L.jsxs(L.Fragment,{children:[L.jsx(Xo,{dataLabel:"Beskrivelse"}),L.jsx(Xo,{dataLabel:"Type",children:L.jsx("pre",{children:c.join(`
|
|
1533
|
-
`)})})]}):L.jsxs(L.Fragment,{children:[L.jsx(Xo,{dataLabel:"Beskrivelse",children:L.jsx("span",{dangerouslySetInnerHTML:{__html:c.description||""}})}),L.jsx(Xo,{dataLabel:"Type",children:L.jsx("pre",{children:c.type&&r(c.type)})}),L.jsx(Xo,{dataLabel:"Standardverdi",children:L.jsx("pre",{children:i(c.default)})})]})]},l))})]}),n.events&&L.jsxs(L.Fragment,{children:[L.jsx("h2",{children:"Hendelser / handlinger"}),L.jsxs($b,{compact:!0,children:[L.jsx(Pb,{children:L.jsxs(tp,{children:[L.jsx(ml,{children:"Event"}),L.jsx(ml,{children:"Beskrivelse"}),L.jsx(ml,{children:"Type"})]})}),L.jsx(Nb,{children:Object.entries(n.events||{}).map(([l,c])=>L.jsxs(tp,{children:[L.jsx(Xo,{dataLabel:"Event",children:L.jsx("pre",{children:l})}),L.jsx(Xo,{dataLabel:"Beskrivelse",children:L.jsx("span",{dangerouslySetInnerHTML:{__html:c.description||""}})}),L.jsx(Xo,{dataLabel:"Type",children:c.type})]},l))})]})]}),n.slots&&L.jsxs(L.Fragment,{children:[L.jsx("h2",{children:"Innhold"}),L.jsxs($b,{compact:!0,children:[L.jsx(Pb,{children:L.jsxs(tp,{children:[L.jsx(ml,{children:"Slot"}),L.jsx(ml,{children:"Beskrivelse"})]})}),L.jsx(Nb,{children:Object.entries(n.slots||{}).map(([l,c])=>L.jsxs(tp,{children:[L.jsx(Xo,{dataLabel:"Slot",children:L.jsx("pre",{children:l})}),L.jsx(Xo,{dataLabel:"Beskrivelse",children:L.jsx("span",{dangerouslySetInnerHTML:{__html:c.description||""}})})]},l))})]})]})]})},Nj=Or({tagName:"pkt-select",elementClass:Ph,react:$e,displayName:"PktSelect",events:{onChange:"change",onInput:"input",onBlur:"blur",onFocus:"focus",onValueChange:"valueChange",onToggleHelpText:"toggleHelpText"}}),Ob=$e.forwardRef(({children:n,helptext:r,...i},l)=>L.jsxs(Nj,{ref:l,...i,children:[r&&L.jsx("div",{slot:"helptext",className:"pkt-contents",children:r}),n]}));Ob.displayName="PktSelect";const Oj=[{id:"24h",fn:"24h.svg",cat:"services"},{id:"active-person",fn:"active-person.svg",cat:"people-and-health"},{id:"adjust",fn:"adjust.svg",cat:"ui"},{id:"advice",fn:"advice.svg",cat:"ui"},{id:"alert-circle",fn:"alert-circle.svg",cat:"ui"},{id:"alert-error",fn:"alert-error.svg",cat:"ui"},{id:"alert-information",fn:"alert-information.svg",cat:"ui"},{id:"alert-success",fn:"alert-success.svg",cat:"ui"},{id:"alert-warning",fn:"alert-warning.svg",cat:"ui"},{id:"apple",fn:"apple.svg",cat:"ui"},{id:"archive",fn:"archive.svg",cat:"ui"},{id:"arrow-circle",fn:"arrow-circle.svg",cat:"ui"},{id:"arrow-return",fn:"arrow-return.svg",cat:"arrows"},{id:"arrow",fn:"arrow.svg",cat:"arrows"},{id:"attachment",fn:"attachment.svg",cat:"ui"},{id:"backpack",fn:"backpack.svg",cat:"services"},{id:"balloons",fn:"balloons.svg",cat:"ui"},{id:"books",fn:"books.svg",cat:"services"},{id:"brain-heart",fn:"brain-heart.svg",cat:"people-and-health"},{id:"brain-signal",fn:"brain-signal.svg",cat:"people-and-health"},{id:"briefcase",fn:"briefcase.svg",cat:"sign"},{id:"bullseye",fn:"bullseye.svg",cat:"ui"},{id:"bus",fn:"bus.svg",cat:"services"},{id:"cafe",fn:"cafe.svg",cat:"sign"},{id:"calendar",fn:"calendar.svg",cat:"ui"},{id:"camera",fn:"camera.svg",cat:"ui"},{id:"car",fn:"car.svg",cat:"sign"},{id:"care-room",fn:"care-room.svg",cat:"sign"},{id:"character-exclamation-mark",fn:"character-exclamation-mark.svg",cat:"ui"},{id:"character-information",fn:"character-information.svg",cat:"ui"},{id:"check-big",fn:"check-big.svg",cat:"ui"},{id:"check-circle",fn:"check-circle.svg",cat:"ui"},{id:"check-medium",fn:"check-medium.svg",cat:"ui"},{id:"check",fn:"check.svg",cat:"ui"},{id:"chevron-down",fn:"chevron-down.svg",cat:"arrows"},{id:"chevron-left",fn:"chevron-left.svg",cat:"arrows"},{id:"chevron-right",fn:"chevron-right.svg",cat:"arrows"},{id:"chevron-thin-down",fn:"chevron-thin-down.svg",cat:"arrows"},{id:"chevron-thin-left",fn:"chevron-thin-left.svg",cat:"arrows"},{id:"chevron-thin-right",fn:"chevron-thin-right.svg",cat:"arrows"},{id:"chevron-thin-up",fn:"chevron-thin-up.svg",cat:"arrows"},{id:"chevron-up-and-down",fn:"chevron-up-and-down.svg",cat:"ui"},{id:"chevron-up",fn:"chevron-up.svg",cat:"arrows"},{id:"clock-history",fn:"clock-history.svg",cat:"ui"},{id:"clock",fn:"clock.svg",cat:"ui"},{id:"close",fn:"close.svg",cat:"ui"},{id:"cloud",fn:"cloud.svg",cat:"ui"},{id:"code",fn:"code.svg",cat:"ui"},{id:"coffee",fn:"coffee.svg",cat:"sign"},{id:"cogwheel",fn:"cogwheel.svg",cat:"ui"},{id:"coin-stacks",fn:"coin-stacks.svg",cat:"services"},{id:"computer",fn:"computer.svg",cat:"ui"},{id:"cookie",fn:"cookie.svg",cat:"ui"},{id:"copy",fn:"copy.svg",cat:"ui"},{id:"crane",fn:"crane.svg",cat:"services"},{id:"cross-circle-big",fn:"cross-circle-big.svg",cat:"ui"},{id:"cross-circle-fill-large",fn:"cross-circle-fill-large.svg",cat:"none"},{id:"cross-circle-fill",fn:"cross-circle-fill.svg",cat:"ui"},{id:"cross-circle",fn:"cross-circle.svg",cat:"ui"},{id:"cross",fn:"cross.svg",cat:"ui"},{id:"data",fn:"data.svg",cat:"ui"},{id:"defibrillators",fn:"defibrillators.svg",cat:"sign"},{id:"district",fn:"district.svg",cat:"ui"},{id:"document-code",fn:"document-code.svg",cat:"ui"},{id:"document-pdf",fn:"document-pdf.svg",cat:"ui"},{id:"document-plain",fn:"document-plain.svg",cat:"ui"},{id:"document-table",fn:"document-table.svg",cat:"ui"},{id:"document-text",fn:"document-text.svg",cat:"ui"},{id:"download",fn:"download.svg",cat:"ui"},{id:"drag",fn:"drag.svg",cat:"ui"},{id:"drinking-area-refreshments",fn:"drinking-area-refreshments.svg",cat:"sign"},{id:"ecg-heart",fn:"ecg-heart.svg",cat:"people-and-health"},{id:"edit",fn:"edit.svg",cat:"ui"},{id:"email",fn:"email.svg",cat:"ui"},{id:"exclamation-mark-circle",fn:"exclamation-mark-circle.svg",cat:"ui"},{id:"exclamation-mark-square",fn:"exclamation-mark-square.svg",cat:"ui"},{id:"exit",fn:"exit.svg",cat:"ui"},{id:"expand",fn:"expand.svg",cat:"ui"},{id:"eye",fn:"eye.svg",cat:"ui"},{id:"face-almost-happy",fn:"face-almost-happy.svg",cat:"feedback"},{id:"face-almost-sad",fn:"face-almost-sad.svg",cat:"feedback"},{id:"face-happy",fn:"face-happy.svg",cat:"feedback"},{id:"face-neutral",fn:"face-neutral.svg",cat:"feedback"},{id:"face-sad",fn:"face-sad.svg",cat:"feedback"},{id:"facebook",fn:"facebook.svg",cat:"social"},{id:"factory-fill",fn:"factory-fill.svg",cat:"ui"},{id:"feedback",fn:"feedback.svg",cat:"ui"},{id:"figma",fn:"figma.svg",cat:"social"},{id:"filter",fn:"filter.svg",cat:"ui"},{id:"fire-safety",fn:"fire-safety.svg",cat:"people-and-health"},{id:"folder",fn:"folder.svg",cat:"ui"},{id:"game-console",fn:"game-console.svg",cat:"ui"},{id:"github",fn:"github.svg",cat:"social"},{id:"graph",fn:"graph.svg",cat:"ui"},{id:"grid",fn:"grid.svg",cat:"ui"},{id:"hands-globe",fn:"hands-globe.svg",cat:"people-and-health"},{id:"headset",fn:"headset.svg",cat:"ui"},{id:"heart-hand",fn:"heart-hand.svg",cat:"people-and-health"},{id:"heart-plus",fn:"heart-plus.svg",cat:"services"},{id:"heart",fn:"heart.svg",cat:"ui"},{id:"holding-hands",fn:"holding-hands.svg",cat:"people-and-health"},{id:"home",fn:"home.svg",cat:"ui"},{id:"horizontal-menu",fn:"horizontal-menu.svg",cat:"ui"},{id:"house-heart",fn:"house-heart.svg",cat:"services"},{id:"information",fn:"information.svg",cat:"ui"},{id:"instagram",fn:"instagram.svg",cat:"social"},{id:"invoice",fn:"invoice.svg",cat:"ui"},{id:"key",fn:"key.svg",cat:"ui"},{id:"language",fn:"language.svg",cat:"ui"},{id:"law-paragraph",fn:"law-paragraph.svg",cat:"ui"},{id:"lecture-workplace",fn:"lecture-workplace.svg",cat:"sign"},{id:"link",fn:"link.svg",cat:"ui"},{id:"linkedin",fn:"linkedin.svg",cat:"social"},{id:"list",fn:"list.svg",cat:"ui"},{id:"location-pin-filled",fn:"location-pin-filled.svg",cat:"ui"},{id:"location-pin",fn:"location-pin.svg",cat:"ui"},{id:"lock-locked",fn:"lock-locked.svg",cat:"ui"},{id:"lock-unlocked",fn:"lock-unlocked.svg",cat:"ui"},{id:"magnifying-glass-big",fn:"magnifying-glass-big.svg",cat:"ui"},{id:"magnifying-glass-small",fn:"magnifying-glass-small.svg",cat:"ui"},{id:"map",fn:"map.svg",cat:"ui"},{id:"medicine-cabinet",fn:"medicine-cabinet.svg",cat:"ui"},{id:"menu",fn:"menu.svg",cat:"ui"},{id:"message",fn:"message.svg",cat:"ui"},{id:"minimize",fn:"minimize.svg",cat:"ui"},{id:"minus-circle-fill",fn:"minus-circle-fill.svg",cat:"plusminus"},{id:"minus-circle",fn:"minus-circle.svg",cat:"plusminus"},{id:"minus-sign",fn:"minus-sign.svg",cat:"plusminus"},{id:"mobile-phone",fn:"mobile-phone.svg",cat:"ui"},{id:"music-notes",fn:"music-notes.svg",cat:"ui"},{id:"new-window-small",fn:"new-window-small.svg",cat:"ui"},{id:"new-window",fn:"new-window.svg",cat:"ui"},{id:"nodejs",fn:"nodejs.svg",cat:"social"},{id:"obstacle",fn:"obstacle.svg",cat:"ui"},{id:"organization",fn:"organization.svg",cat:"ui"},{id:"paint-bucket",fn:"paint-bucket.svg",cat:"ui"},{id:"palette",fn:"palette.svg",cat:"ui"},{id:"paragraph",fn:"paragraph.svg",cat:"ui"},{id:"park",fn:"park.svg",cat:"services"},{id:"partner-workout",fn:"partner-workout.svg",cat:"people-and-health"},{id:"paste",fn:"paste.svg",cat:"ui"},{id:"picture",fn:"picture.svg",cat:"ui"},{id:"placeholder-icon",fn:"placeholder-icon.svg",cat:"ui"},{id:"plus-circle-fill",fn:"plus-circle-fill.svg",cat:"plusminus"},{id:"plus-circle",fn:"plus-circle.svg",cat:"plusminus"},{id:"plus-sign",fn:"plus-sign.svg",cat:"plusminus"},{id:"pride-heart",fn:"pride-heart.svg",cat:"people-and-health"},{id:"print",fn:"print.svg",cat:"ui"},{id:"privacy",fn:"privacy.svg",cat:"ui"},{id:"punkt-circle-blue",fn:"punkt-circle-blue.svg",cat:"social"},{id:"qr-code",fn:"qr-code.svg",cat:"ui"},{id:"question",fn:"question.svg",cat:"ui"},{id:"react",fn:"react.svg",cat:"social"},{id:"receipt",fn:"receipt.svg",cat:"ui"},{id:"recycling",fn:"recycling.svg",cat:"services"},{id:"restaurant",fn:"restaurant.svg",cat:"sign"},{id:"ruler",fn:"ruler.svg",cat:"ui"},{id:"sass",fn:"sass.svg",cat:"social"},{id:"save",fn:"save.svg",cat:"ui"},{id:"scooter",fn:"scooter.svg",cat:"ui"},{id:"share-outline",fn:"share-outline.svg",cat:"ui"},{id:"share",fn:"share.svg",cat:"ui"},{id:"shield-fire",fn:"shield-fire.svg",cat:"services"},{id:"shield-law-paragraph",fn:"shield-law-paragraph.svg",cat:"ui"},{id:"slack",fn:"slack.svg",cat:"social"},{id:"smiley-neutral",fn:"smiley-neutral.svg",cat:"feedback"},{id:"smiley-sad",fn:"smiley-sad.svg",cat:"feedback"},{id:"smiley-smile",fn:"smiley-smile.svg",cat:"feedback"},{id:"sort",fn:"sort.svg",cat:"ui"},{id:"sound-off",fn:"sound-off.svg",cat:"ui"},{id:"sound-on",fn:"sound-on.svg",cat:"ui"},{id:"sparkles",fn:"sparkles.svg",cat:"ui"},{id:"svg-logo",fn:"svg.svg",cat:"social"},{id:"swingset",fn:"swingset.svg",cat:"services"},{id:"table",fn:"table.svg",cat:"ui"},{id:"tap",fn:"tap.svg",cat:"ui"},{id:"target",fn:"target.svg",cat:"ui"},{id:"thumbs-down",fn:"thumbs-down.svg",cat:"feedback"},{id:"thumbs-up",fn:"thumbs-up.svg",cat:"feedback"},{id:"tickets",fn:"tickets.svg",cat:"none"},{id:"trail",fn:"trail.svg",cat:"sign"},{id:"trash-can",fn:"trash-can.svg",cat:"ui"},{id:"trash",fn:"trash.svg",cat:"sign"},{id:"twitter",fn:"twitter.svg",cat:"social"},{id:"two-people-dancing",fn:"two-people-dancing.svg",cat:"people-and-health"},{id:"two-people-talking",fn:"two-people-talking.svg",cat:"people-and-health"},{id:"user",fn:"user.svg",cat:"ui"},{id:"vertical-menu",fn:"vertical-menu.svg",cat:"ui"},{id:"vue",fn:"vue.svg",cat:"social"},{id:"wardrobe-boys",fn:"wardrobe-boys.svg",cat:"sign"},{id:"wardrobe-girls",fn:"wardrobe-girls.svg",cat:"sign"},{id:"wardrobe",fn:"wardrobe.svg",cat:"sign"},{id:"water-faucet",fn:"water-faucet.svg",cat:"services"},{id:"wheelchair",fn:"wheelchair.svg",cat:"none"},{id:"wifi",fn:"wifi.svg",cat:"sign"},{id:"wine-bottle",fn:"wine-bottle.svg",cat:"people-and-health"},{id:"workplace",fn:"workplace.svg",cat:"social"},{id:"wrench",fn:"wrench.svg",cat:"ui"}],T2=({propKey:n,spec:r,props:i,handleChange:l})=>{const c={BOOLEAN:"boolean",ICON:"icon",ARRAY:"array",OBJECT:"object",DATE:"ISOdatestring",NUMBER:"number"},h=(T,$)=>{l(n,{...i[n],[T]:$})},m=(T,$,N)=>{const O=[...i[n]];O[T]={...O[T],[$]:N},l(n,O)},D=()=>{const T=[...i[n],{}];l(n,T)},C=T=>{const $=i[n].filter((N,O)=>O!==T);l(n,$)};if(r.type===c.BOOLEAN)return L.jsx(r_,{label:r.name||n,forId:n,helptext:r.description||null,hasFieldset:!0,requiredTag:r.required,children:L.jsx(y0,{id:n,label:n,type:"checkbox",checked:i[n]||!1,onChange:T=>l(n,T.target.checked,r.displayAsFalse),labelPosition:"right",isSwitch:!0})});if(r.type===c.ICON)return L.jsxs(Ob,{label:r.name||n,helptext:r.description||null,id:n,value:i[n]||"",onChange:T=>l(n,T.target.value),requiredTag:r.required,children:[L.jsx("option",{value:""}),Oj.map(T=>L.jsx("option",{value:T.id,children:T.id},T.id))]});if(r.type===c.DATE)return L.jsx(b0,{id:n,label:r.name||n,helptext:r.description||null,value:i[n]||"",multiple:r.variant==="multiple",maxlength:999,onChange:T=>l(n,T.target.value),requiredTag:r.required});if(Array.isArray(r)||Array.isArray(r.type)||Array.isArray(r.values)){const T=Array.isArray(r)?r:r.values||r.type;return L.jsxs(Ob,{label:r.name||n,helptext:r.description||null,id:n,value:i[n],onChange:$=>l(n,$.target.value),requiredTag:r.required,children:[L.jsx("option",{value:""}),T.map($=>L.jsx("option",{value:$,children:$},$))]})}return r.type===c.NUMBER?L.jsx(Jg,{id:n,label:r.name||n,helptext:r.description||null,type:"number",value:i[n]||"",onChange:T=>l(n,parseFloat(T.currentTarget.value)),requiredTag:r.required}):r.type===c.OBJECT?(i[n]||(i[n]={}),L.jsxs("div",{children:[L.jsx("div",{className:"pkt-inputwrapper__label",children:L.jsx("h2",{children:r.name||n})}),r.description&&L.jsx("p",{children:r.description}),L.jsxs("fieldset",{children:[L.jsx("legend",{children:r.name||n}),Object.entries(r.properties).map(([T,$])=>L.jsx(T2,{propKey:T,props:i[n],spec:$,handleChange:(N,O)=>h(N,O)},T))]})]})):r.type===c.ARRAY&&r.items.type===c.OBJECT?(i[n]||(i[n]=[]),L.jsxs("div",{children:[L.jsx("div",{className:"pkt-inputwrapper__label",children:L.jsx("h2",{children:r.name||n})}),r.description&&L.jsx("p",{children:r.description}),i[n].map((T,$)=>L.jsx("div",{children:L.jsxs("fieldset",{children:[L.jsxs("legend",{children:["Item ",$+1]}),Object.entries(r.items.properties).map(([N,O])=>L.jsx(T2,{propKey:N,props:T,spec:O,handleChange:(B,I)=>m($,B,I)},N)),L.jsx(Fd,{onClick:()=>C($),children:"Fjern denne"})]})},$)),L.jsx(Fd,{onClick:D,children:"Legg til ny"})]})):L.jsx(Jg,{id:n,label:r.name||n,helptext:r.description||null,type:"text",value:i[n]||"",onChange:T=>l(n,r.type==="number"?parseFloat(T.currentTarget.value):T.currentTarget.value),requiredTag:r.required})};Xg.registerLanguage("jsx",Aj);const BE=({specs:n,children:r,fullWidth:i})=>{var He,dt;const l=n.props&&typeof n.props=="object"&&!Array.isArray(n.props)?Object.entries(n.props).reduce((Me,[Le,fe])=>(typeof fe=="object"&&!Array.isArray(fe)&&fe.previewDefault!==void 0&&fe.previewDefault!==null?(fe.previewDefault==="false"&&(fe.previewDefault=!1),fe.previewDefault==="true"&&(fe.previewDefault=!0),Me[Le]=fe.previewDefault):typeof fe=="object"&&!Array.isArray(fe)&&fe.default!==void 0&&fe.default!==null&&(fe.default==="false"&&(fe.default=!1),fe.default==="true"&&(fe.default=!0),Me[Le]=fe.default),Me),{}):{},[c,h]=$e.useState(0),[m,D]=$e.useState(l),[C,T]=$e.useState("light"),[$,N]=$e.useState(""),[O,B]=$e.useState(""),[I,K]=$e.useState(""),[Y,Ce]=$e.useState("Rediger innhold"),[J,G]=$e.useState([{text:"Rediger",icon:"adjust",active:!0},{text:"Kode (React)",icon:"react",active:!1},{text:`Kode (${n.isElement?"Element":"HTML"})`,icon:"code",active:!1},{text:"Egenskaper",icon:"list",active:!1}]),re=Me=>{Me===1&&ce(),Me===2&&ae(),K(""),G(Le=>Le.map((fe,Re)=>({...fe,active:Re===Me})))},V=$e.useRef(null),ae=async()=>{if(n.isElement&&$e.isValidElement(Ke)){const Me=$e.isValidElement(Ke)?Ke.type.displayName||Ke.type.name:n.name,Le=Object.entries(m).map(([Re,_e])=>{if(_e&&!ke(_e)&&!Ge(_e))return typeof _e=="object"?`${Re}='${JSON.stringify(_e)}'`:`${Re}="${_e}"`}).join(" "),fe=await xb(`<${n.name||Me} ${Le}>${Y}</${n.name||Me}>`,{parser:"html",plugins:[zx]});N(`<!-- Denne koden bør testes grundig før bruk. Spør en Punkt-utvikler om du er usikker. -->
|
|
1533
|
+
`)})})]}):L.jsxs(L.Fragment,{children:[L.jsx(Xo,{dataLabel:"Beskrivelse",children:L.jsx("span",{dangerouslySetInnerHTML:{__html:c.description||""}})}),L.jsx(Xo,{dataLabel:"Type",children:L.jsx("pre",{children:c.type&&r(c.type)})}),L.jsx(Xo,{dataLabel:"Standardverdi",children:L.jsx("pre",{children:i(c.default)})})]})]},l))})]}),n.events&&L.jsxs(L.Fragment,{children:[L.jsx("h2",{children:"Hendelser / handlinger"}),L.jsxs($b,{compact:!0,children:[L.jsx(Pb,{children:L.jsxs(tp,{children:[L.jsx(ml,{children:"Event"}),L.jsx(ml,{children:"Beskrivelse"}),L.jsx(ml,{children:"Type"})]})}),L.jsx(Nb,{children:Object.entries(n.events||{}).map(([l,c])=>L.jsxs(tp,{children:[L.jsx(Xo,{dataLabel:"Event",children:L.jsx("pre",{children:l})}),L.jsx(Xo,{dataLabel:"Beskrivelse",children:L.jsx("span",{dangerouslySetInnerHTML:{__html:c.description||""}})}),L.jsx(Xo,{dataLabel:"Type",children:c.type})]},l))})]})]}),n.slots&&L.jsxs(L.Fragment,{children:[L.jsx("h2",{children:"Innhold"}),L.jsxs($b,{compact:!0,children:[L.jsx(Pb,{children:L.jsxs(tp,{children:[L.jsx(ml,{children:"Slot"}),L.jsx(ml,{children:"Beskrivelse"})]})}),L.jsx(Nb,{children:Object.entries(n.slots||{}).map(([l,c])=>L.jsxs(tp,{children:[L.jsx(Xo,{dataLabel:"Slot",children:L.jsx("pre",{children:l})}),L.jsx(Xo,{dataLabel:"Beskrivelse",children:L.jsx("span",{dangerouslySetInnerHTML:{__html:c.description||""}})})]},l))})]})]})]})},Nj=Or({tagName:"pkt-select",elementClass:Ph,react:$e,displayName:"PktSelect",events:{onChange:"change",onInput:"input",onBlur:"blur",onFocus:"focus",onValueChange:"valueChange",onToggleHelpText:"toggleHelpText"}}),Ob=$e.forwardRef(({children:n,helptext:r,...i},l)=>L.jsxs(Nj,{ref:l,...i,children:[r&&L.jsx("div",{slot:"helptext",className:"pkt-contents",children:r}),n]}));Ob.displayName="PktSelect";const Oj=[{id:"24h",fn:"24h.svg",cat:"services"},{id:"active-person",fn:"active-person.svg",cat:"people-and-health"},{id:"adjust",fn:"adjust.svg",cat:"ui"},{id:"advice",fn:"advice.svg",cat:"ui"},{id:"alert-circle",fn:"alert-circle.svg",cat:"ui"},{id:"alert-error",fn:"alert-error.svg",cat:"ui"},{id:"alert-information",fn:"alert-information.svg",cat:"ui"},{id:"alert-success",fn:"alert-success.svg",cat:"ui"},{id:"alert-warning",fn:"alert-warning.svg",cat:"ui"},{id:"apple",fn:"apple.svg",cat:"ui"},{id:"archive",fn:"archive.svg",cat:"ui"},{id:"arrow-circle",fn:"arrow-circle.svg",cat:"ui"},{id:"arrow-return",fn:"arrow-return.svg",cat:"arrows"},{id:"arrow",fn:"arrow.svg",cat:"arrows"},{id:"attachment",fn:"attachment.svg",cat:"ui"},{id:"backpack",fn:"backpack.svg",cat:"services"},{id:"balloons",fn:"balloons.svg",cat:"ui"},{id:"books",fn:"books.svg",cat:"services"},{id:"brain-heart",fn:"brain-heart.svg",cat:"people-and-health"},{id:"brain-signal",fn:"brain-signal.svg",cat:"people-and-health"},{id:"briefcase",fn:"briefcase.svg",cat:"sign"},{id:"bullseye",fn:"bullseye.svg",cat:"ui"},{id:"bus",fn:"bus.svg",cat:"services"},{id:"cafe",fn:"cafe.svg",cat:"sign"},{id:"calendar",fn:"calendar.svg",cat:"ui"},{id:"camera",fn:"camera.svg",cat:"ui"},{id:"car",fn:"car.svg",cat:"sign"},{id:"care-room",fn:"care-room.svg",cat:"sign"},{id:"character-exclamation-mark",fn:"character-exclamation-mark.svg",cat:"ui"},{id:"character-information",fn:"character-information.svg",cat:"ui"},{id:"check-big",fn:"check-big.svg",cat:"ui"},{id:"check-circle",fn:"check-circle.svg",cat:"ui"},{id:"check-medium",fn:"check-medium.svg",cat:"ui"},{id:"check",fn:"check.svg",cat:"ui"},{id:"chevron-down",fn:"chevron-down.svg",cat:"arrows"},{id:"chevron-left",fn:"chevron-left.svg",cat:"arrows"},{id:"chevron-right",fn:"chevron-right.svg",cat:"arrows"},{id:"chevron-thin-down",fn:"chevron-thin-down.svg",cat:"arrows"},{id:"chevron-thin-left",fn:"chevron-thin-left.svg",cat:"arrows"},{id:"chevron-thin-right",fn:"chevron-thin-right.svg",cat:"arrows"},{id:"chevron-thin-up",fn:"chevron-thin-up.svg",cat:"arrows"},{id:"chevron-up-and-down",fn:"chevron-up-and-down.svg",cat:"ui"},{id:"chevron-up",fn:"chevron-up.svg",cat:"arrows"},{id:"clock-history",fn:"clock-history.svg",cat:"ui"},{id:"clock",fn:"clock.svg",cat:"ui"},{id:"close",fn:"close.svg",cat:"ui"},{id:"cloud",fn:"cloud.svg",cat:"ui"},{id:"code",fn:"code.svg",cat:"ui"},{id:"coffee",fn:"coffee.svg",cat:"sign"},{id:"cogwheel",fn:"cogwheel.svg",cat:"ui"},{id:"coin-stacks",fn:"coin-stacks.svg",cat:"services"},{id:"computer",fn:"computer.svg",cat:"ui"},{id:"cookie",fn:"cookie.svg",cat:"ui"},{id:"copy",fn:"copy.svg",cat:"ui"},{id:"crane",fn:"crane.svg",cat:"services"},{id:"cross-circle-big",fn:"cross-circle-big.svg",cat:"ui"},{id:"cross-circle-fill-large",fn:"cross-circle-fill-large.svg",cat:"none"},{id:"cross-circle-fill",fn:"cross-circle-fill.svg",cat:"ui"},{id:"cross-circle",fn:"cross-circle.svg",cat:"ui"},{id:"cross",fn:"cross.svg",cat:"ui"},{id:"data",fn:"data.svg",cat:"ui"},{id:"defibrillators",fn:"defibrillators.svg",cat:"sign"},{id:"district",fn:"district.svg",cat:"ui"},{id:"document-code",fn:"document-code.svg",cat:"ui"},{id:"document-pdf",fn:"document-pdf.svg",cat:"ui"},{id:"document-plain",fn:"document-plain.svg",cat:"ui"},{id:"document-table",fn:"document-table.svg",cat:"ui"},{id:"document-text",fn:"document-text.svg",cat:"ui"},{id:"download",fn:"download.svg",cat:"ui"},{id:"drag",fn:"drag.svg",cat:"ui"},{id:"drinking-area-refreshments",fn:"drinking-area-refreshments.svg",cat:"sign"},{id:"ecg-heart",fn:"ecg-heart.svg",cat:"people-and-health"},{id:"edit",fn:"edit.svg",cat:"ui"},{id:"email",fn:"email.svg",cat:"ui"},{id:"exclamation-mark-circle",fn:"exclamation-mark-circle.svg",cat:"ui"},{id:"exclamation-mark-square",fn:"exclamation-mark-square.svg",cat:"ui"},{id:"exit",fn:"exit.svg",cat:"ui"},{id:"expand",fn:"expand.svg",cat:"ui"},{id:"eye",fn:"eye.svg",cat:"ui"},{id:"face-almost-happy",fn:"face-almost-happy.svg",cat:"feedback"},{id:"face-almost-sad",fn:"face-almost-sad.svg",cat:"feedback"},{id:"face-happy",fn:"face-happy.svg",cat:"feedback"},{id:"face-neutral",fn:"face-neutral.svg",cat:"feedback"},{id:"face-sad",fn:"face-sad.svg",cat:"feedback"},{id:"facebook",fn:"facebook.svg",cat:"social"},{id:"factory-fill",fn:"factory-fill.svg",cat:"ui"},{id:"feedback",fn:"feedback.svg",cat:"ui"},{id:"figma",fn:"figma.svg",cat:"social"},{id:"filter",fn:"filter.svg",cat:"ui"},{id:"fire-safety",fn:"fire-safety.svg",cat:"people-and-health"},{id:"folder",fn:"folder.svg",cat:"ui"},{id:"game-console",fn:"game-console.svg",cat:"ui"},{id:"github",fn:"github.svg",cat:"social"},{id:"graph",fn:"graph.svg",cat:"ui"},{id:"grid",fn:"grid.svg",cat:"ui"},{id:"hands-globe",fn:"hands-globe.svg",cat:"people-and-health"},{id:"headset",fn:"headset.svg",cat:"ui"},{id:"heart-hand",fn:"heart-hand.svg",cat:"people-and-health"},{id:"heart-plus",fn:"heart-plus.svg",cat:"services"},{id:"heart",fn:"heart.svg",cat:"ui"},{id:"holding-hands",fn:"holding-hands.svg",cat:"people-and-health"},{id:"home",fn:"home.svg",cat:"ui"},{id:"horizontal-menu",fn:"horizontal-menu.svg",cat:"ui"},{id:"house-heart",fn:"house-heart.svg",cat:"services"},{id:"information",fn:"information.svg",cat:"ui"},{id:"instagram",fn:"instagram.svg",cat:"social"},{id:"invoice",fn:"invoice.svg",cat:"ui"},{id:"key",fn:"key.svg",cat:"ui"},{id:"language",fn:"language.svg",cat:"ui"},{id:"law-paragraph",fn:"law-paragraph.svg",cat:"ui"},{id:"lecture-workplace",fn:"lecture-workplace.svg",cat:"sign"},{id:"link",fn:"link.svg",cat:"ui"},{id:"linkedin",fn:"linkedin.svg",cat:"social"},{id:"list",fn:"list.svg",cat:"ui"},{id:"location-pin-filled",fn:"location-pin-filled.svg",cat:"ui"},{id:"location-pin",fn:"location-pin.svg",cat:"ui"},{id:"lock-locked",fn:"lock-locked.svg",cat:"ui"},{id:"lock-unlocked",fn:"lock-unlocked.svg",cat:"ui"},{id:"magnifying-glass-big",fn:"magnifying-glass-big.svg",cat:"ui"},{id:"magnifying-glass-small",fn:"magnifying-glass-small.svg",cat:"ui"},{id:"map",fn:"map.svg",cat:"ui"},{id:"medicine-cabinet",fn:"medicine-cabinet.svg",cat:"ui"},{id:"menu",fn:"menu.svg",cat:"ui"},{id:"message",fn:"message.svg",cat:"ui"},{id:"minimize",fn:"minimize.svg",cat:"ui"},{id:"minus-circle-fill",fn:"minus-circle-fill.svg",cat:"plusminus"},{id:"minus-circle",fn:"minus-circle.svg",cat:"plusminus"},{id:"minus-sign",fn:"minus-sign.svg",cat:"plusminus"},{id:"mobile-phone",fn:"mobile-phone.svg",cat:"ui"},{id:"music-notes",fn:"music-notes.svg",cat:"ui"},{id:"new-window-small",fn:"new-window-small.svg",cat:"ui"},{id:"new-window",fn:"new-window.svg",cat:"ui"},{id:"nodejs",fn:"nodejs.svg",cat:"social"},{id:"obstacle",fn:"obstacle.svg",cat:"ui"},{id:"organization",fn:"organization.svg",cat:"ui"},{id:"paint-bucket",fn:"paint-bucket.svg",cat:"ui"},{id:"palette",fn:"palette.svg",cat:"ui"},{id:"paragraph",fn:"paragraph.svg",cat:"ui"},{id:"park",fn:"park.svg",cat:"services"},{id:"partner-workout",fn:"partner-workout.svg",cat:"people-and-health"},{id:"paste",fn:"paste.svg",cat:"ui"},{id:"picture",fn:"picture.svg",cat:"ui"},{id:"placeholder-icon",fn:"placeholder-icon.svg",cat:"ui"},{id:"plus-circle-fill",fn:"plus-circle-fill.svg",cat:"plusminus"},{id:"plus-circle",fn:"plus-circle.svg",cat:"plusminus"},{id:"plus-sign",fn:"plus-sign.svg",cat:"plusminus"},{id:"pride-heart",fn:"pride-heart.svg",cat:"people-and-health"},{id:"print",fn:"print.svg",cat:"ui"},{id:"privacy",fn:"privacy.svg",cat:"ui"},{id:"punkt-circle-blue",fn:"punkt-circle-blue.svg",cat:"social"},{id:"qr-code",fn:"qr-code.svg",cat:"ui"},{id:"question",fn:"question.svg",cat:"ui"},{id:"react",fn:"react.svg",cat:"social"},{id:"receipt",fn:"receipt.svg",cat:"ui"},{id:"recycling",fn:"recycling.svg",cat:"services"},{id:"restaurant",fn:"restaurant.svg",cat:"sign"},{id:"ruler",fn:"ruler.svg",cat:"ui"},{id:"sass",fn:"sass.svg",cat:"social"},{id:"save",fn:"save.svg",cat:"ui"},{id:"scooter",fn:"scooter.svg",cat:"ui"},{id:"share-outline",fn:"share-outline.svg",cat:"ui"},{id:"share",fn:"share.svg",cat:"ui"},{id:"shield-fire",fn:"shield-fire.svg",cat:"services"},{id:"shield-law-paragraph",fn:"shield-law-paragraph.svg",cat:"ui"},{id:"slack",fn:"slack.svg",cat:"social"},{id:"smiley-neutral",fn:"smiley-neutral.svg",cat:"feedback"},{id:"smiley-sad",fn:"smiley-sad.svg",cat:"feedback"},{id:"smiley-smile",fn:"smiley-smile.svg",cat:"feedback"},{id:"sort",fn:"sort.svg",cat:"ui"},{id:"sound-off",fn:"sound-off.svg",cat:"ui"},{id:"sound-on",fn:"sound-on.svg",cat:"ui"},{id:"sparkles",fn:"sparkles.svg",cat:"ui"},{id:"svg-logo",fn:"svg.svg",cat:"social"},{id:"swingset",fn:"swingset.svg",cat:"services"},{id:"table",fn:"table.svg",cat:"ui"},{id:"tap",fn:"tap.svg",cat:"ui"},{id:"target",fn:"target.svg",cat:"ui"},{id:"thumbs-down",fn:"thumbs-down.svg",cat:"feedback"},{id:"thumbs-up",fn:"thumbs-up.svg",cat:"feedback"},{id:"tickets",fn:"tickets.svg",cat:"sign"},{id:"trail",fn:"trail.svg",cat:"sign"},{id:"trash-can",fn:"trash-can.svg",cat:"ui"},{id:"trash",fn:"trash.svg",cat:"sign"},{id:"twitter",fn:"twitter.svg",cat:"social"},{id:"two-people-dancing",fn:"two-people-dancing.svg",cat:"people-and-health"},{id:"two-people-talking",fn:"two-people-talking.svg",cat:"people-and-health"},{id:"user",fn:"user.svg",cat:"ui"},{id:"vertical-menu",fn:"vertical-menu.svg",cat:"ui"},{id:"vue",fn:"vue.svg",cat:"social"},{id:"wardrobe-boys",fn:"wardrobe-boys.svg",cat:"sign"},{id:"wardrobe-girls",fn:"wardrobe-girls.svg",cat:"sign"},{id:"wardrobe",fn:"wardrobe.svg",cat:"sign"},{id:"water-faucet",fn:"water-faucet.svg",cat:"services"},{id:"wheelchair",fn:"wheelchair.svg",cat:"none"},{id:"wifi",fn:"wifi.svg",cat:"sign"},{id:"wine-bottle",fn:"wine-bottle.svg",cat:"people-and-health"},{id:"workplace",fn:"workplace.svg",cat:"social"},{id:"wrench",fn:"wrench.svg",cat:"ui"}],T2=({propKey:n,spec:r,props:i,handleChange:l})=>{const c={BOOLEAN:"boolean",ICON:"icon",ARRAY:"array",OBJECT:"object",DATE:"ISOdatestring",NUMBER:"number"},h=(T,$)=>{l(n,{...i[n],[T]:$})},m=(T,$,N)=>{const O=[...i[n]];O[T]={...O[T],[$]:N},l(n,O)},D=()=>{const T=[...i[n],{}];l(n,T)},C=T=>{const $=i[n].filter((N,O)=>O!==T);l(n,$)};if(r.type===c.BOOLEAN)return L.jsx(r_,{label:r.name||n,forId:n,helptext:r.description||null,hasFieldset:!0,requiredTag:r.required,children:L.jsx(y0,{id:n,label:n,type:"checkbox",checked:i[n]||!1,onChange:T=>l(n,T.target.checked,r.displayAsFalse),labelPosition:"right",isSwitch:!0})});if(r.type===c.ICON)return L.jsxs(Ob,{label:r.name||n,helptext:r.description||null,id:n,value:i[n]||"",onChange:T=>l(n,T.target.value),requiredTag:r.required,children:[L.jsx("option",{value:""}),Oj.map(T=>L.jsx("option",{value:T.id,children:T.id},T.id))]});if(r.type===c.DATE)return L.jsx(b0,{id:n,label:r.name||n,helptext:r.description||null,value:i[n]||"",multiple:r.variant==="multiple",maxlength:999,onChange:T=>l(n,T.target.value),requiredTag:r.required});if(Array.isArray(r)||Array.isArray(r.type)||Array.isArray(r.values)){const T=Array.isArray(r)?r:r.values||r.type;return L.jsxs(Ob,{label:r.name||n,helptext:r.description||null,id:n,value:i[n],onChange:$=>l(n,$.target.value),requiredTag:r.required,children:[L.jsx("option",{value:""}),T.map($=>L.jsx("option",{value:$,children:$},$))]})}return r.type===c.NUMBER?L.jsx(Jg,{id:n,label:r.name||n,helptext:r.description||null,type:"number",value:i[n]||"",onChange:T=>l(n,parseFloat(T.currentTarget.value)),requiredTag:r.required}):r.type===c.OBJECT?(i[n]||(i[n]={}),L.jsxs("div",{children:[L.jsx("div",{className:"pkt-inputwrapper__label",children:L.jsx("h2",{children:r.name||n})}),r.description&&L.jsx("p",{children:r.description}),L.jsxs("fieldset",{children:[L.jsx("legend",{children:r.name||n}),Object.entries(r.properties).map(([T,$])=>L.jsx(T2,{propKey:T,props:i[n],spec:$,handleChange:(N,O)=>h(N,O)},T))]})]})):r.type===c.ARRAY&&r.items.type===c.OBJECT?(i[n]||(i[n]=[]),L.jsxs("div",{children:[L.jsx("div",{className:"pkt-inputwrapper__label",children:L.jsx("h2",{children:r.name||n})}),r.description&&L.jsx("p",{children:r.description}),i[n].map((T,$)=>L.jsx("div",{children:L.jsxs("fieldset",{children:[L.jsxs("legend",{children:["Item ",$+1]}),Object.entries(r.items.properties).map(([N,O])=>L.jsx(T2,{propKey:N,props:T,spec:O,handleChange:(B,I)=>m($,B,I)},N)),L.jsx(Fd,{onClick:()=>C($),children:"Fjern denne"})]})},$)),L.jsx(Fd,{onClick:D,children:"Legg til ny"})]})):L.jsx(Jg,{id:n,label:r.name||n,helptext:r.description||null,type:"text",value:i[n]||"",onChange:T=>l(n,r.type==="number"?parseFloat(T.currentTarget.value):T.currentTarget.value),requiredTag:r.required})};Xg.registerLanguage("jsx",Aj);const BE=({specs:n,children:r,fullWidth:i})=>{var He,dt;const l=n.props&&typeof n.props=="object"&&!Array.isArray(n.props)?Object.entries(n.props).reduce((Me,[Le,fe])=>(typeof fe=="object"&&!Array.isArray(fe)&&fe.previewDefault!==void 0&&fe.previewDefault!==null?(fe.previewDefault==="false"&&(fe.previewDefault=!1),fe.previewDefault==="true"&&(fe.previewDefault=!0),Me[Le]=fe.previewDefault):typeof fe=="object"&&!Array.isArray(fe)&&fe.default!==void 0&&fe.default!==null&&(fe.default==="false"&&(fe.default=!1),fe.default==="true"&&(fe.default=!0),Me[Le]=fe.default),Me),{}):{},[c,h]=$e.useState(0),[m,D]=$e.useState(l),[C,T]=$e.useState("light"),[$,N]=$e.useState(""),[O,B]=$e.useState(""),[I,K]=$e.useState(""),[Y,Ce]=$e.useState("Rediger innhold"),[J,G]=$e.useState([{text:"Rediger",icon:"adjust",active:!0},{text:"Kode (React)",icon:"react",active:!1},{text:`Kode (${n.isElement?"Element":"HTML"})`,icon:"code",active:!1},{text:"Egenskaper",icon:"list",active:!1}]),re=Me=>{Me===1&&ce(),Me===2&&ae(),K(""),G(Le=>Le.map((fe,Re)=>({...fe,active:Re===Me})))},V=$e.useRef(null),ae=async()=>{if(n.isElement&&$e.isValidElement(Ke)){const Me=$e.isValidElement(Ke)?Ke.type.displayName||Ke.type.name:n.name,Le=Object.entries(m).map(([Re,_e])=>{if(_e&&!ke(_e)&&!Ge(_e))return typeof _e=="object"?`${Re}='${JSON.stringify(_e)}'`:`${Re}="${_e}"`}).join(" "),fe=await xb(`<${n.name||Me} ${Le}>${Y}</${n.name||Me}>`,{parser:"html",plugins:[zx]});N(`<!-- Denne koden bør testes grundig før bruk. Spør en Punkt-utvikler om du er usikker. -->
|
|
1534
1534
|
`+fe)}else{const Me=await xb(V.current.innerHTML,{parser:"html",plugins:[zx]});N(Me.replace(/<\!--.*?-->/g,""))}},ce=async()=>{const Me=await wR(Ke);return B(Me),Promise.resolve()},Te=(Me,Le)=>{navigator.clipboard.writeText(Le).then(()=>{K(Me),console.log("Copied to clipboard",Me)})},ke=Me=>Array.isArray(Me)&&Me.length===0,Ge=Me=>Me&&typeof Me=="object"&&!Object.keys(Me).length,We=(Me,Le)=>L.jsxs("div",{className:"pkt-preview__copy",children:[I===Me&&L.jsx("span",{className:"pkt-preview__copied",children:"Kode kopiert til utklippstavle"}),L.jsx(Fd,{skin:"tertiary",variant:"icon-only",size:"small",iconName:"copy",onClick:()=>Te(Me,Le),children:"Kopier kode"})]}),Ke=$e.isValidElement(r)&&$e.cloneElement(r,{...m},r.props.children?r.props.children:(He=n.slots)!=null&&He.default?Y:null),nt=(Me,Le,fe=!1)=>{if(h(c+1),!fe&&(!Le||Le=="false")){const{[Me]:Re,..._e}=m;D(_e)}else D(Re=>({...Re,[Me]:Le}))};return L.jsxs("div",{className:"pkt-preview",children:[L.jsxs("div",{className:"pkt-preview__component-container","data-mode":C,children:[n["dark-mode"]&&L.jsx("div",{className:"pkt-preview__mode",children:L.jsx(y0,{id:"mode",label:"Dark mode",type:"checkbox",checked:C==="dark",onChange:Me=>T(Me.target.checked?"dark":"light"),labelPosition:"right",isSwitch:!0})}),L.jsx("div",{className:`pkt-preview__component ${i&&"pkt-preview__component--fullwidth"}`,ref:V,children:L.jsx("div",{children:Ke})},c)]}),L.jsx(LE,{tabs:J,onTabSelected:re}),L.jsxs("div",{className:`pkt-grid pkt-preview__opts ${J[0].active?"":"pkt-hide"}`,children:[((dt=n.slots)==null?void 0:dt.default)&&!r.props.children&&L.jsxs("div",{className:"pkt-cell pkt-cell--span12 pkt-cell--span6-phablet-up",children:[L.jsx(Wh,{size:"small",skin:"blue-light",textStyle:"thin-text",children:"children"}),L.jsx(Jg,{id:"slot",label:"Slot",helptext:n.slots.default.description||"Innholdet i slot",type:"text",value:Y,onChange:Me=>Ce(Me.currentTarget.value)})]}),n.props&&typeof n.props=="object"&&!Array.isArray(n.props)?Object.entries(n.props).map(([Me,Le])=>L.jsxs("div",{className:"pkt-cell pkt-cell--span12 pkt-cell--span6-phablet-up",children:[L.jsx(Wh,{size:"small",skin:"blue-light",textStyle:"thin-text",children:Me}),L.jsx(T2,{propKey:Me,props:m,spec:Le,handleChange:nt})]},Me)):L.jsx("p",{children:"OBS! Specs mangler props!"})]}),L.jsxs("div",{className:`pkt-preview__code ${J[1].active?"":"pkt-hide"}`,children:[L.jsx(Xg,{language:"jsx",style:RE,children:O}),We("jsx",O)]}),L.jsxs("div",{className:`pkt-preview__code ${J[2].active?"":"pkt-hide"}`,children:[L.jsx(Xg,{language:"html",style:RE,children:$}),We("html",$)]}),L.jsx("div",{className:`pkt-preview__specs ${J[3].active?"":"pkt-hide"}`,children:L.jsx(Pj,{specs:n})})]})};BE.displayName="PktPreview";const Rj=Or({tagName:"pkt-progressbar",elementClass:ia,react:$e,displayName:"PktProgressbar",events:{}}),ME=$e.forwardRef(({children:n,...r},i)=>L.jsx(Rj,{ref:i,...r,children:L.jsx("div",{className:"pkt-contents",children:n})}));ME.displayName="PktProgressbar";const Lj=Or({tagName:"pkt-radiobutton",elementClass:fu,react:$e,displayName:"PktRadioButton",events:{onChange:"change",onInput:"input",onBlur:"blur",onFocus:"focus",onValueChange:"valueChange"}}),Bj=$e.forwardRef(({appearance:n="local",disabled:r=!1,fullwidth:i=!1,id:l,label:c,name:h,placeholder:m="Søk…",suggestions:D,value:C="",action:T,method:$,onChange:N,onSearch:O,onSuggestionClick:B,...I},K)=>{const Y=(V,ae)=>{V?V():B&&B(ae)},Ce=V=>{C=V.target.value},J=`pkt-searchinput pkt-searchinput--${n} ${i?"pkt-searchinput--fullwidth":""}`,G=c?"label":"div";let re;return T?re=V=>L.jsx("form",{role:"search",className:J,action:T,method:$,children:V}):re=V=>L.jsx("div",{role:"search",className:J,children:V}),re(L.jsxs(L.Fragment,{children:[L.jsxs(G,{htmlFor:c?l:void 0,className:c?"pkt-inputwrapper__label":"",children:[c&&L.jsx(L.Fragment,{children:c}),L.jsxs("div",{className:n==="local"?"pkt-input__container":"pkt-searchinput__field",children:[L.jsx("input",{className:`pkt-input ${i?"pkt-input--fullwidth":""}`,type:"search",name:h||l,id:l,placeholder:m,defaultValue:C,disabled:r,autoComplete:"off","aria-autocomplete":"list",ref:K,"aria-controls":`${l}-suggestions`,onChange:N||Ce,onKeyUp:O&&(V=>{V.key==="Enter"&&(V.preventDefault(),O(C))}),...I}),L.jsx(Fd,{className:`pkt-searchinput__button ${n==="local"?"pkt-input-icon":""}`,variant:"icon-only",iconName:"magnifying-glass-big",skin:n==="local"?"tertiary":"primary",color:n==="global"?"yellow":void 0,type:"submit",disabled:r,onClick:O&&(V=>{V.preventDefault(),O(C)}),children:c||m})]})]}),D&&L.jsx("ul",{id:`${l}-suggestions`,className:"pkt-searchinput__suggestions","aria-live":"assertive",children:D.map((V,ae)=>L.jsx("li",{children:$e.createElement(V.href?"a":V.onClick?"button":"div",{href:V.href,className:`pkt-searchinput__suggestion ${V.onClick?"pkt-link-button":""} ${V.href||V.onClick?"pkt-searchinput__suggestion--has-hover":""}`,type:V.onClick?"button":void 0,onClick:()=>Y(V.onClick,ae),onKeyUp:ce=>ce.key==="Enter"&&Y(V.onClick,ae)},L.jsxs(L.Fragment,{children:[V.title&&L.jsx("h3",{className:"pkt-searchinput__suggestion-title",children:V.title}),V.text&&L.jsx("p",{className:"pkt-searchinput__suggestion-text",children:V.text})]}))},`search-suggestion-${ae}`))})]}))}),Mj=$e.forwardRef(({activeStep:n,className:r,children:i,hideNonActiveSteps:l=!1,hideNonActiveStepsContent:c=!0,orientation:h="vertical",...m},D)=>{const C=hl(r,"pkt-stepper",h==="horizontal"?"pkt-stepper--horizontal":"pkt-stepper--vertical"),T=$e.Children.map(i,($,N)=>$e.isValidElement($)?$e.cloneElement($,{className:hl($.props.className,{"pkt-step--hideStep":l&&N!==n,"pkt-step--hideContent":c&&N!==n})}):$);return L.jsx("ol",{"data-testid":"pkt-stepper",className:C,ref:D,...m,children:T})}),Ij=L.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",children:L.jsx("circle",{cx:"12",cy:"12",r:"7",style:{fill:"var(--pkt-color-grays-grey-200, #CCC)"}})}),jj=L.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",children:[L.jsx("circle",{opacity:".15",cx:"12",cy:"12",r:"12",fill:"#2A2859"}),L.jsx("circle",{cx:"12",cy:"12",r:"6",fill:"#2A2859"})]}),zj=L.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",children:[L.jsx("path",{fill:"#2A2859",d:"M3 3h18v18H3z"}),L.jsx("path",{d:"m10.34 16-1.11-1.14L7 12.58l1.11-1.15 2.23 2.28L15.88 8 17 9.15l-5.55 5.71L10.34 16Z",fill:"#F1FDFF"})]}),Uj=({children:n,className:r,status:i="incomplete",title:l})=>L.jsxs("li",{className:hl("pkt-step",r,`pkt-step--${i}`),"data-testid":"pkt-step",children:[L.jsx("span",{className:"pkt-step__line pkt-step__line--1","aria-hidden":!0}),L.jsx("span",{className:"pkt-step__line pkt-step__line--2","aria-hidden":!0}),L.jsx("span",{className:hl("pkt-step__indicator"),children:i==="current"?jj:i==="completed"?zj:Ij}),L.jsx("span",{className:"pkt-step__line pkt-step__line--3","aria-hidden":!0}),L.jsxs("div",{className:"pkt-step__wrapper",children:[L.jsx("div",{className:"pkt-step__title",children:l}),L.jsx("div",{className:"pkt-step__content",children:n})]})]}),Hj=Or({tagName:"pkt-textarea",elementClass:Hf,react:$e,displayName:"PktTextarea",events:{onChange:"change",onInput:"change",onBlur:"blur",onFocus:"focus",onValueChange:"valueChange",onToggleHelpText:"toggleHelpText"}}),IE=$e.forwardRef(({helptext:n,...r},i)=>L.jsx(Hj,{...r,ref:i,children:n&&L.jsx("div",{slot:"helptext",className:"pkt-contents",children:n})}));IE.displayName="PktTextarea";var Yh=window.CustomEvent;(!Yh||typeof Yh=="object")&&(Yh=function(n,r){r=r||{};var i=document.createEvent("CustomEvent");return i.initCustomEvent(n,!!r.bubbles,!!r.cancelable,r.detail||null),i},Yh.prototype=window.Event.prototype);function jE(n,r){var i="on"+r.type.toLowerCase();return typeof n[i]=="function"&&n[i](r),n.dispatchEvent(r)}function Vj(n){for(;n&&n!==document.body;){var r=window.getComputedStyle(n),i=function(l,c){return!(r[l]===void 0||r[l]===c)};if(r.opacity<1||i("zIndex","auto")||i("transform","none")||i("mixBlendMode","normal")||i("filter","none")||i("perspective","none")||r.isolation==="isolate"||r.position==="fixed"||r.webkitOverflowScrolling==="touch")return!0;n=n.parentElement}return!1}function Zg(n){for(;n;){if(n.localName==="dialog")return n;n.parentElement?n=n.parentElement:n.parentNode?n=n.parentNode.host:n=null}return null}function zE(n){for(;n&&n.shadowRoot&&n.shadowRoot.activeElement;)n=n.shadowRoot.activeElement;n&&n.blur&&n!==document.body&&n.blur()}function qj(n,r){for(var i=0;i<n.length;++i)if(n[i]===r)return!0;return!1}function A2(n){return!n||!n.hasAttribute("method")?!1:n.getAttribute("method").toLowerCase()==="dialog"}function UE(n){var r=["button","input","keygen","select","textarea"],i=r.map(function(m){return m+":not([disabled])"});i.push('[tabindex]:not([disabled]):not([tabindex=""])');var l=n.querySelector(i.join(", "));if(!l&&"attachShadow"in Element.prototype)for(var c=n.querySelectorAll("*"),h=0;h<c.length&&!(c[h].tagName&&c[h].shadowRoot&&(l=UE(c[h].shadowRoot),l));h++);return l}function HE(n){return n.isConnected||document.body.contains(n)}function VE(n){if(n.submitter)return n.submitter;var r=n.target;if(!(r instanceof HTMLFormElement))return null;var i=In.formSubmitter;if(!i){var l=n.target,c="getRootNode"in l&&l.getRootNode()||document;i=c.activeElement}return!i||i.form!==r?null:i}function Wj(n){if(!n.defaultPrevented){var r=n.target,i=In.imagemapUseValue,l=VE(n);i===null&&l&&(i=l.value);var c=Zg(r);if(c){var h=l&&l.getAttribute("formmethod")||r.getAttribute("method");h==="dialog"&&(n.preventDefault(),i!=null?c.close(i):c.close())}}}function qE(n){if(this.dialog_=n,this.replacedStyleTop_=!1,this.openAsModal_=!1,n.hasAttribute("role")||n.setAttribute("role","dialog"),n.show=this.show.bind(this),n.showModal=this.showModal.bind(this),n.close=this.close.bind(this),n.addEventListener("submit",Wj,!1),"returnValue"in n||(n.returnValue=""),"MutationObserver"in window){var r=new MutationObserver(this.maybeHideModal.bind(this));r.observe(n,{attributes:!0,attributeFilter:["open"]})}else{var i=!1,l=(function(){i?this.downgradeModal():this.maybeHideModal(),i=!1}).bind(this),c,h=function(m){if(m.target===n){var D="DOMNodeRemoved";i|=m.type.substr(0,D.length)===D,window.clearTimeout(c),c=window.setTimeout(l,0)}};["DOMAttrModified","DOMNodeRemoved","DOMNodeRemovedFromDocument"].forEach(function(m){n.addEventListener(m,h)})}Object.defineProperty(n,"open",{set:this.setOpen.bind(this),get:n.hasAttribute.bind(n,"open")}),this.backdrop_=document.createElement("div"),this.backdrop_.className="backdrop",this.backdrop_.addEventListener("mouseup",this.backdropMouseEvent_.bind(this)),this.backdrop_.addEventListener("mousedown",this.backdropMouseEvent_.bind(this)),this.backdrop_.addEventListener("click",this.backdropMouseEvent_.bind(this))}qE.prototype={get dialog(){return this.dialog_},maybeHideModal:function(){this.dialog_.hasAttribute("open")&&HE(this.dialog_)||this.downgradeModal()},downgradeModal:function(){this.openAsModal_&&(this.openAsModal_=!1,this.dialog_.style.zIndex="",this.replacedStyleTop_&&(this.dialog_.style.top="",this.replacedStyleTop_=!1),this.backdrop_.parentNode&&this.backdrop_.parentNode.removeChild(this.backdrop_),In.dm.removeDialog(this))},setOpen:function(n){n?this.dialog_.hasAttribute("open")||this.dialog_.setAttribute("open",""):(this.dialog_.removeAttribute("open"),this.maybeHideModal())},backdropMouseEvent_:function(n){if(this.dialog_.hasAttribute("tabindex"))this.dialog_.focus();else{var r=document.createElement("div");this.dialog_.insertBefore(r,this.dialog_.firstChild),r.tabIndex=-1,r.focus(),this.dialog_.removeChild(r)}var i=document.createEvent("MouseEvents");i.initMouseEvent(n.type,n.bubbles,n.cancelable,window,n.detail,n.screenX,n.screenY,n.clientX,n.clientY,n.ctrlKey,n.altKey,n.shiftKey,n.metaKey,n.button,n.relatedTarget),this.dialog_.dispatchEvent(i),n.stopPropagation()},focus_:function(){var n=this.dialog_.querySelector("[autofocus]:not([disabled])");!n&&this.dialog_.tabIndex>=0&&(n=this.dialog_),n||(n=UE(this.dialog_)),zE(document.activeElement),n&&n.focus()},updateZIndex:function(n,r){if(n<r)throw new Error("dialogZ should never be < backdropZ");this.dialog_.style.zIndex=n,this.backdrop_.style.zIndex=r},show:function(){this.dialog_.open||(this.setOpen(!0),this.focus_())},showModal:function(){if(this.dialog_.hasAttribute("open"))throw new Error("Failed to execute 'showModal' on dialog: The element is already open, and therefore cannot be opened modally.");if(!HE(this.dialog_))throw new Error("Failed to execute 'showModal' on dialog: The element is not in a Document.");if(!In.dm.pushDialog(this))throw new Error("Failed to execute 'showModal' on dialog: There are too many open modal dialogs.");Vj(this.dialog_.parentElement)&&console.warn("A dialog is being shown inside a stacking context. This may cause it to be unusable. For more information, see this link: https://github.com/GoogleChrome/dialog-polyfill/#stacking-context"),this.setOpen(!0),this.openAsModal_=!0,In.needsCentering(this.dialog_)?(In.reposition(this.dialog_),this.replacedStyleTop_=!0):this.replacedStyleTop_=!1,this.dialog_.parentNode.insertBefore(this.backdrop_,this.dialog_.nextSibling),this.focus_()},close:function(n){if(!this.dialog_.hasAttribute("open"))throw new Error("Failed to execute 'close' on dialog: The element does not have an 'open' attribute, and therefore cannot be closed.");this.setOpen(!1),n!==void 0&&(this.dialog_.returnValue=n);var r=new Yh("close",{bubbles:!1,cancelable:!1});jE(this.dialog_,r)}};var In={};if(In.reposition=function(n){var r=document.body.scrollTop||document.documentElement.scrollTop,i=r+(window.innerHeight-n.offsetHeight)/2;n.style.top=Math.max(r,i)+"px"},In.isInlinePositionSetByStylesheet=function(n){for(var r=0;r<document.styleSheets.length;++r){var i=document.styleSheets[r],l=null;try{l=i.cssRules}catch{}if(l)for(var c=0;c<l.length;++c){var h=l[c],m=null;try{m=document.querySelectorAll(h.selectorText)}catch{}if(!(!m||!qj(m,n))){var D=h.style.getPropertyValue("top"),C=h.style.getPropertyValue("bottom");if(D&&D!=="auto"||C&&C!=="auto")return!0}}}return!1},In.needsCentering=function(n){var r=window.getComputedStyle(n);return r.position!=="absolute"||n.style.top!=="auto"&&n.style.top!==""||n.style.bottom!=="auto"&&n.style.bottom!==""?!1:!In.isInlinePositionSetByStylesheet(n)},In.forceRegisterDialog=function(n){if((window.HTMLDialogElement||n.showModal)&&console.warn("This browser already supports <dialog>, the polyfill may not work correctly",n),n.localName!=="dialog")throw new Error("Failed to register dialog: The element is not a dialog.");new qE(n)},In.registerDialog=function(n){n.showModal||In.forceRegisterDialog(n)},In.DialogManager=function(){this.pendingDialogStack=[];var n=this.checkDOM_.bind(this);this.overlay=document.createElement("div"),this.overlay.className="_dialog_overlay",this.overlay.addEventListener("click",(function(r){this.forwardTab_=void 0,r.stopPropagation(),n([])}).bind(this)),this.handleKey_=this.handleKey_.bind(this),this.handleFocus_=this.handleFocus_.bind(this),this.zIndexLow_=1e5,this.zIndexHigh_=100150,this.forwardTab_=void 0,"MutationObserver"in window&&(this.mo_=new MutationObserver(function(r){var i=[];r.forEach(function(l){for(var c=0,h;h=l.removedNodes[c];++c){if(h instanceof Element)h.localName==="dialog"&&i.push(h);else continue;i=i.concat(h.querySelectorAll("dialog"))}}),i.length&&n(i)}))},In.DialogManager.prototype.blockDocument=function(){document.documentElement.addEventListener("focus",this.handleFocus_,!0),document.addEventListener("keydown",this.handleKey_),this.mo_&&this.mo_.observe(document,{childList:!0,subtree:!0})},In.DialogManager.prototype.unblockDocument=function(){document.documentElement.removeEventListener("focus",this.handleFocus_,!0),document.removeEventListener("keydown",this.handleKey_),this.mo_&&this.mo_.disconnect()},In.DialogManager.prototype.updateStacking=function(){for(var n=this.zIndexHigh_,r=0,i;i=this.pendingDialogStack[r];++r)i.updateZIndex(--n,--n),r===0&&(this.overlay.style.zIndex=--n);var l=this.pendingDialogStack[0];if(l){var c=l.dialog.parentNode||document.body;c.appendChild(this.overlay)}else this.overlay.parentNode&&this.overlay.parentNode.removeChild(this.overlay)},In.DialogManager.prototype.containedByTopDialog_=function(n){for(;n=Zg(n);){for(var r=0,i;i=this.pendingDialogStack[r];++r)if(i.dialog===n)return r===0;n=n.parentElement}return!1},In.DialogManager.prototype.handleFocus_=function(n){var r=n.composedPath?n.composedPath()[0]:n.target;if(!this.containedByTopDialog_(r)&&document.activeElement!==document.documentElement&&(n.preventDefault(),n.stopPropagation(),zE(r),this.forwardTab_!==void 0)){var i=this.pendingDialogStack[0],l=i.dialog,c=l.compareDocumentPosition(r);return c&Node.DOCUMENT_POSITION_PRECEDING&&(this.forwardTab_?i.focus_():r!==document.documentElement&&document.documentElement.focus()),!1}},In.DialogManager.prototype.handleKey_=function(n){if(this.forwardTab_=void 0,n.keyCode===27){n.preventDefault(),n.stopPropagation();var r=new Yh("cancel",{bubbles:!1,cancelable:!0}),i=this.pendingDialogStack[0];i&&jE(i.dialog,r)&&i.dialog.close()}else n.keyCode===9&&(this.forwardTab_=!n.shiftKey)},In.DialogManager.prototype.checkDOM_=function(n){var r=this.pendingDialogStack.slice();r.forEach(function(i){n.indexOf(i.dialog)!==-1?i.downgradeModal():i.maybeHideModal()})},In.DialogManager.prototype.pushDialog=function(n){var r=(this.zIndexHigh_-this.zIndexLow_)/2-1;return this.pendingDialogStack.length>=r?!1:(this.pendingDialogStack.unshift(n)===1&&this.blockDocument(),this.updateStacking(),!0)},In.DialogManager.prototype.removeDialog=function(n){var r=this.pendingDialogStack.indexOf(n);r!==-1&&(this.pendingDialogStack.splice(r,1),this.pendingDialogStack.length===0&&this.unblockDocument(),this.updateStacking())},In.dm=new In.DialogManager,In.formSubmitter=null,In.imagemapUseValue=null,window.HTMLDialogElement===void 0){var WE=document.createElement("form");if(WE.setAttribute("method","dialog"),WE.method!=="dialog"){var Gh=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"method");if(Gh){var Yj=Gh.get;Gh.get=function(){return A2(this)?"dialog":Yj.call(this)};var Gj=Gh.set;Gh.set=function(n){return typeof n=="string"&&n.toLowerCase()==="dialog"?this.setAttribute("method",n):Gj.call(this,n)},Object.defineProperty(HTMLFormElement.prototype,"method",Gh)}}document.addEventListener("click",function(n){if(In.formSubmitter=null,In.imagemapUseValue=null,!n.defaultPrevented){var r=n.target;if("composedPath"in n){var i=n.composedPath();r=i.shift()||r}if(!(!r||!A2(r.form))){var l=r.type==="submit"&&["button","input"].indexOf(r.localName)>-1;if(!l){if(!(r.localName==="input"&&r.type==="image"))return;In.imagemapUseValue=n.offsetX+","+n.offsetY}var c=Zg(r);c&&(In.formSubmitter=r)}}},!1),document.addEventListener("submit",function(n){var r=n.target,i=Zg(r);if(!i){var l=VE(n),c=l&&l.getAttribute("formmethod")||r.getAttribute("method");c==="dialog"&&n.preventDefault()}});var Kj=HTMLFormElement.prototype.submit,Qj=function(){if(!A2(this))return Kj.call(this);var n=Zg(this);n&&n.close()};HTMLFormElement.prototype.submit=Qj}const Xj=Object.freeze(Object.defineProperty({__proto__:null,default:In},Symbol.toStringTag,{value:"Module"}));Ot.PktAccordion=G1,Ot.PktAccordionItem=K1,Ot.PktAlert=Q1,Ot.PktBackLink=X1,Ot.PktBreadcrumbs=mO,Ot.PktButton=Fd,Ot.PktCard=J1,Ot.PktCheckbox=y0,Ot.PktCombobox=Z1,Ot.PktConsent=ab,Ot.PktDatepicker=b0,Ot.PktFooter=kO,Ot.PktFooterSimple=wO,Ot.PktHeader=SO,Ot.PktHelptext=t_,Ot.PktIcon=br,Ot.PktInput=n_,Ot.PktInputWrapper=r_,Ot.PktLink=a_,Ot.PktLinkCard=i_,Ot.PktLoader=o_,Ot.PktMessagebox=s_,Ot.PktModal=l_,Ot.PktPreview=BE,Ot.PktProgressbar=ME,Ot.PktRadioButton=Lj,Ot.PktSearchInput=Bj,Ot.PktSelect=Ob,Ot.PktStep=Uj,Ot.PktStepper=Mj,Ot.PktTable=$b,Ot.PktTableBody=Nb,Ot.PktTableDataCell=Xo,Ot.PktTableHeader=Pb,Ot.PktTableHeaderCell=ml,Ot.PktTableRow=tp,Ot.PktTabs=LE,Ot.PktTag=Wh,Ot.PktTextarea=IE,Ot.PktTextinput=Jg,Object.defineProperty(Ot,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oslokommune/punkt-react",
|
|
3
|
-
"version": "12.39.
|
|
3
|
+
"version": "12.39.2",
|
|
4
4
|
"description": "React komponentbibliotek til Punkt, et designsystem laget av Oslo Origo",
|
|
5
5
|
"homepage": "https://punkt.oslo.kommune.no",
|
|
6
6
|
"author": "Team Designsystem, Oslo Origo",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@lit-labs/ssr-dom-shim": "^1.2.1",
|
|
40
40
|
"@lit/react": "^1.0.7",
|
|
41
|
-
"@oslokommune/punkt-elements": "^12.39.
|
|
41
|
+
"@oslokommune/punkt-elements": "^12.39.2",
|
|
42
42
|
"angular-html-parser": "^6.0.2",
|
|
43
43
|
"html-format": "^1.1.7",
|
|
44
44
|
"prettier": "^3.3.3",
|
|
@@ -48,8 +48,8 @@
|
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@babel/plugin-proposal-private-property-in-object": "^7.18.6",
|
|
51
|
-
"@oslokommune/punkt-assets": "^12.39.
|
|
52
|
-
"@oslokommune/punkt-css": "^12.39.
|
|
51
|
+
"@oslokommune/punkt-assets": "^12.39.2",
|
|
52
|
+
"@oslokommune/punkt-css": "^12.39.2",
|
|
53
53
|
"@testing-library/jest-dom": "^6.5.0",
|
|
54
54
|
"@testing-library/react": "^16.0.1",
|
|
55
55
|
"@testing-library/user-event": "^14.5.2",
|
|
@@ -112,5 +112,5 @@
|
|
|
112
112
|
"url": "https://github.com/oslokommune/punkt/issues"
|
|
113
113
|
},
|
|
114
114
|
"license": "MIT",
|
|
115
|
-
"gitHead": "
|
|
115
|
+
"gitHead": "34331d986e18bbdab2c1f5b1f5a95aecae7acaf4"
|
|
116
116
|
}
|