@oslokommune/punkt-react 11.3.0 → 11.4.1

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 @@ Check the render method of \``+t+"`."}return""}}function kr(t){{if(t!==void 0){v
24
24
 
25
25
  Check your code at `+p+":"+m+"."}return""}}var Lt={};function vr(t){{var p=It();if(!p){var m=typeof t=="string"?t:t.displayName||t.name;m&&(p=`
26
26
 
27
- Check the top-level render call using <`+m+">.")}return p}}function Ft(t,p){{if(!t._store||t._store.validated||t.key!=null)return;t._store.validated=!0;var m=vr(p);if(Lt[m])return;Lt[m]=!0;var b="";t&&t._owner&&t._owner!==ze.current&&(b=" It was passed a child from "+L(t._owner.type)+"."),ie(t),E('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',m,b),ie(null)}}function Ut(t,p){{if(typeof t!="object")return;if(Ke(t))for(var m=0;m<t.length;m++){var b=t[m];Ge(b)&&Ft(b,p)}else if(Ge(t))t._store&&(t._store.validated=!0);else if(t){var T=I(t);if(typeof T=="function"&&T!==t.entries)for(var D=T.call(t),P;!(P=D.next()).done;)Ge(P.value)&&Ft(P.value,p)}}}function _r(t){{var p=t.type;if(p==null||typeof p=="string")return;var m;if(typeof p=="function")m=p.propTypes;else if(typeof p=="object"&&(p.$$typeof===f||p.$$typeof===k))m=p.propTypes;else return;if(m){var b=L(p);ar(m,t.props,"prop",b,t)}else if(p.PropTypes!==void 0&&!qe){qe=!0;var T=L(p);E("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",T||"Unknown")}typeof p.getDefaultProps=="function"&&!p.getDefaultProps.isReactClassApproved&&E("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function br(t){{for(var p=Object.keys(t.props),m=0;m<p.length;m++){var b=p[m];if(b!=="children"&&b!=="key"){ie(t),E("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",b),ie(null);break}}t.ref!==null&&(ie(t),E("Invalid attribute `ref` supplied to `React.Fragment`."),ie(null))}}function At(t,p,m,b,T,D){{var P=G(t);if(!P){var x="";(t===void 0||typeof t=="object"&&t!==null&&Object.keys(t).length===0)&&(x+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var Y=kr(T);Y?x+=Y:x+=It();var U;t===null?U="null":Ke(t)?U="array":t!==void 0&&t.$$typeof===n?(U="<"+(L(t.type)||"Unknown")+" />",x=" Did you accidentally export a JSX literal instead of a component?"):U=typeof t,E("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",U,x)}var A=hr(t,p,m,T,D);if(A==null)return A;if(P){var H=p.children;if(H!==void 0)if(b)if(Ke(H)){for(var oe=0;oe<H.length;oe++)Ut(H[oe],t);Object.freeze&&Object.freeze(H)}else E("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Ut(H,t)}return t===l?br(A):_r(A),A}}function gr(t,p,m){return At(t,p,m,!0)}function Nr(t,p,m){return At(t,p,m,!1)}var yr=Nr,wr=gr;ce.Fragment=l,ce.jsx=yr,ce.jsxs=wr}()),ce}process.env.NODE_ENV==="production"?Re.exports=Mt():Re.exports=Yt();var Te=Re.exports;const X=Te.Fragment,i=Te.jsx,h=Te.jsxs,Oe={},Kt='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"></svg>',Jt="https://punkt-cdn.oslo.kommune.no/11.3/icons/",zt=(e,n)=>(!Oe[e]&&typeof window.fetch=="function"&&(Oe[e]=window.fetch(n+e+".svg").then(a=>a.ok?a.text():(console.error("Missing icon: "+n+e+".svg"),Kt)).then(a=>a)),Promise.resolve(Oe[e])),qt={fetchIcon:async(e,n)=>zt(e,n||Jt)},Ze=N.createContext(qt),C=({name:e,path:n,className:a="",...l})=>{const[r,o]=N.useState(null),s=N.useContext(Ze);return N.useEffect(()=>{e?s.fetchIcon(e,n).then(o):o(null)},[e,n]),r?i("span",{className:`pkt-icon ${a}`,dangerouslySetInnerHTML:{__html:r},...l}):null},Qe=N.forwardRef(({children:e,className:n,skin:a="info",closeAlert:l=!1,onClose:r,title:o,date:s,ariaLive:c="polite",compact:f=!1,...u},d)=>{const k=[n,"pkt-alert",a&&`pkt-alert--${a}`,f&&"pkt-alert--compact"].filter(Boolean).join(" "),[_,R]=N.useState(!0),S=()=>{R(!1),r&&r()};return _?h("div",{...u,className:k,"aria-live":c,ref:d,children:[i(C,{className:"pkt-alert__icon",name:a==="info"?"alert-information":`alert-${a}`}),l&&i("div",{className:"pkt-alert__close",children:i("button",{type:"button",className:"pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only",tabIndex:0,"aria-label":"close",onClick:S,children:i(C,{name:"close",className:"pkt-btn__icon","aria-hidden":"true"})})}),o&&i("div",{className:"pkt-alert__title",children:o}),i("div",{className:"pkt-alert__text",children:e}),s&&h("div",{className:"pkt-alert__date",children:["Sist oppdatert: ",s]})]}):null}),Gt=N.forwardRef(({href:e,text:n,onClick:a,className:l,...r},o)=>{const s=[l,"pkt-back-link"].filter(Boolean).join(" ");return i("nav",{ref:o,className:s,"aria-label":"Gå tilbake et steg",children:h("a",{href:e||"/",className:"pkt-link pkt-link--icon-left",onClick:()=>{a&&a()},...r,children:[i(C,{className:"pkt-back-link__icon pkt-icon pkt-link__icon",name:"chevron-thin-left","aria-hidden":"true"}),i("span",{className:"pkt-back-link__text",children:n||"Forsiden"})]})})});/**
27
+ Check the top-level render call using <`+m+">.")}return p}}function Ft(t,p){{if(!t._store||t._store.validated||t.key!=null)return;t._store.validated=!0;var m=vr(p);if(Lt[m])return;Lt[m]=!0;var b="";t&&t._owner&&t._owner!==ze.current&&(b=" It was passed a child from "+L(t._owner.type)+"."),ie(t),E('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',m,b),ie(null)}}function Ut(t,p){{if(typeof t!="object")return;if(Ke(t))for(var m=0;m<t.length;m++){var b=t[m];Ge(b)&&Ft(b,p)}else if(Ge(t))t._store&&(t._store.validated=!0);else if(t){var T=I(t);if(typeof T=="function"&&T!==t.entries)for(var D=T.call(t),P;!(P=D.next()).done;)Ge(P.value)&&Ft(P.value,p)}}}function _r(t){{var p=t.type;if(p==null||typeof p=="string")return;var m;if(typeof p=="function")m=p.propTypes;else if(typeof p=="object"&&(p.$$typeof===f||p.$$typeof===k))m=p.propTypes;else return;if(m){var b=L(p);ar(m,t.props,"prop",b,t)}else if(p.PropTypes!==void 0&&!qe){qe=!0;var T=L(p);E("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",T||"Unknown")}typeof p.getDefaultProps=="function"&&!p.getDefaultProps.isReactClassApproved&&E("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function br(t){{for(var p=Object.keys(t.props),m=0;m<p.length;m++){var b=p[m];if(b!=="children"&&b!=="key"){ie(t),E("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",b),ie(null);break}}t.ref!==null&&(ie(t),E("Invalid attribute `ref` supplied to `React.Fragment`."),ie(null))}}function At(t,p,m,b,T,D){{var P=G(t);if(!P){var x="";(t===void 0||typeof t=="object"&&t!==null&&Object.keys(t).length===0)&&(x+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var Y=kr(T);Y?x+=Y:x+=It();var U;t===null?U="null":Ke(t)?U="array":t!==void 0&&t.$$typeof===n?(U="<"+(L(t.type)||"Unknown")+" />",x=" Did you accidentally export a JSX literal instead of a component?"):U=typeof t,E("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",U,x)}var A=hr(t,p,m,T,D);if(A==null)return A;if(P){var H=p.children;if(H!==void 0)if(b)if(Ke(H)){for(var oe=0;oe<H.length;oe++)Ut(H[oe],t);Object.freeze&&Object.freeze(H)}else E("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Ut(H,t)}return t===l?br(A):_r(A),A}}function gr(t,p,m){return At(t,p,m,!0)}function Nr(t,p,m){return At(t,p,m,!1)}var yr=Nr,wr=gr;ce.Fragment=l,ce.jsx=yr,ce.jsxs=wr}()),ce}process.env.NODE_ENV==="production"?Re.exports=Mt():Re.exports=Yt();var Te=Re.exports;const X=Te.Fragment,i=Te.jsx,h=Te.jsxs,Oe={},Kt='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"></svg>',Jt="https://punkt-cdn.oslo.kommune.no/11.4/icons/",zt=(e,n)=>(!Oe[e]&&typeof window.fetch=="function"&&(Oe[e]=window.fetch(n+e+".svg").then(a=>a.ok?a.text():(console.error("Missing icon: "+n+e+".svg"),Kt)).then(a=>a)),Promise.resolve(Oe[e])),qt={fetchIcon:async(e,n)=>zt(e,n||Jt)},Ze=N.createContext(qt),C=({name:e,path:n,className:a="",...l})=>{const[r,o]=N.useState(null),s=N.useContext(Ze);return N.useEffect(()=>{e?s.fetchIcon(e,n).then(o):o(null)},[e,n]),r?i("span",{className:`pkt-icon ${a}`,dangerouslySetInnerHTML:{__html:r},...l}):null},Qe=N.forwardRef(({children:e,className:n,skin:a="info",closeAlert:l=!1,onClose:r,title:o,date:s,ariaLive:c="polite",compact:f=!1,...u},d)=>{const k=[n,"pkt-alert",a&&`pkt-alert--${a}`,f&&"pkt-alert--compact"].filter(Boolean).join(" "),[_,R]=N.useState(!0),S=()=>{R(!1),r&&r()};return _?h("div",{...u,className:k,"aria-live":c,ref:d,children:[i(C,{className:"pkt-alert__icon",name:a==="info"?"alert-information":`alert-${a}`}),l&&i("div",{className:"pkt-alert__close",children:i("button",{type:"button",className:"pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only",tabIndex:0,"aria-label":"close",onClick:S,children:i(C,{name:"close",className:"pkt-btn__icon","aria-hidden":"true"})})}),o&&i("div",{className:"pkt-alert__title",children:o}),i("div",{className:"pkt-alert__text",children:e}),s&&h("div",{className:"pkt-alert__date",children:["Sist oppdatert: ",s]})]}):null}),Gt=N.forwardRef(({href:e,text:n,onClick:a,className:l,...r},o)=>{const s=[l,"pkt-back-link"].filter(Boolean).join(" ");return i("nav",{ref:o,className:s,"aria-label":"Gå tilbake et steg",children:h("a",{href:e||"/",className:"pkt-link pkt-link--icon-left",onClick:()=>{a&&a()},...r,children:[i(C,{className:"pkt-back-link__icon pkt-icon pkt-link__icon",name:"chevron-thin-left","aria-hidden":"true"}),i("span",{className:"pkt-back-link__text",children:n||"Forsiden"})]})})});/**
28
28
  * @remix-run/router v1.14.0
29
29
  *
30
30
  * Copyright (c) Remix Software Inc.
@@ -51,8 +51,8 @@ Check the top-level render call using <`+m+">.")}return p}}function Ft(t,p){{if(
51
51
  * LICENSE.md file in the root directory of this source tree.
52
52
  *
53
53
  * @license MIT
54
- */function ae(){return ae=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var a=arguments[n];for(var l in a)Object.prototype.hasOwnProperty.call(a,l)&&(e[l]=a[l])}return e},ae.apply(this,arguments)}function Ve(e,n){if(e==null)return{};var a={},l=Object.keys(e),r,o;for(o=0;o<l.length;o++)r=l[o],!(n.indexOf(r)>=0)&&(a[r]=e[r]);return a}const ve="get",_e="application/x-www-form-urlencoded";function be(e){return e!=null&&typeof e.tagName=="string"}function mn(e){return be(e)&&e.tagName.toLowerCase()==="button"}function hn(e){return be(e)&&e.tagName.toLowerCase()==="form"}function kn(e){return be(e)&&e.tagName.toLowerCase()==="input"}function vn(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function _n(e,n){return e.button===0&&(!n||n==="_self")&&!vn(e)}let ge=null;function bn(){if(ge===null)try{new FormData(document.createElement("form"),0),ge=!1}catch{ge=!0}return ge}const gn=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function We(e){return e!=null&&!gn.has(e)?(process.env.NODE_ENV!=="production"&&ne(!1,'"'+e+'" is not a valid `encType` for `<Form>`/`<fetcher.Form>` '+('and will default to "'+_e+'"')),null):e}function Nn(e,n){let a,l,r,o,s;if(hn(e)){let c=e.getAttribute("action");l=c?ue(c,n):null,a=e.getAttribute("method")||ve,r=We(e.getAttribute("enctype"))||_e,o=new FormData(e)}else if(mn(e)||kn(e)&&(e.type==="submit"||e.type==="image")){let c=e.form;if(c==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let f=e.getAttribute("formaction")||c.getAttribute("action");if(l=f?ue(f,n):null,a=e.getAttribute("formmethod")||c.getAttribute("method")||ve,r=We(e.getAttribute("formenctype"))||We(c.getAttribute("enctype"))||_e,o=new FormData(c,e),!bn()){let{name:u,type:d,value:k}=e;if(d==="image"){let _=u?u+".":"";o.append(_+"x","0"),o.append(_+"y","0")}else u&&o.append(u,k)}}else{if(be(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');a=ve,l=null,r=_e,s=e}return o&&r==="text/plain"&&(s=o,o=void 0),{action:l,method:a.toLowerCase(),encType:r,formData:o,body:s}}const yn=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],wn=["aria-current","caseSensitive","className","end","style","to","unstable_viewTransition","children"],En=["fetcherKey","navigate","reloadDocument","replace","state","method","action","onSubmit","relative","preventScrollReset","unstable_viewTransition"],dt=y.createContext({isTransitioning:!1});process.env.NODE_ENV!=="production"&&(dt.displayName="ViewTransition");const Cn=y.createContext(new Map);process.env.NODE_ENV!=="production"&&(Cn.displayName="Fetchers"),process.env.NODE_ENV;const xn=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Pn=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ne=y.forwardRef(function(n,a){let{onClick:l,relative:r,reloadDocument:o,replace:s,state:c,target:f,to:u,preventScrollReset:d,unstable_viewTransition:k}=n,_=Ve(n,yn),{basename:R}=y.useContext(Z),S,$=!1;if(typeof u=="string"&&Pn.test(u)&&(S=u,xn))try{let v=new URL(window.location.href),j=u.startsWith("//")?new URL(v.protocol+u):new URL(u),V=ue(j.pathname,R);j.origin===v.origin&&V!=null?u=V+j.search+j.hash:$=!0}catch{process.env.NODE_ENV!=="production"&&ne(!1,'<Link to="'+u+'"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.')}let I=on(u,{relative:r}),w=On(u,{replace:s,state:c,target:f,preventScrollReset:d,relative:r,unstable_viewTransition:k});function E(v){l&&l(v),v.defaultPrevented||w(v)}return y.createElement("a",ae({},_,{href:S||I,onClick:$||o?l:E,ref:a,target:f}))});process.env.NODE_ENV!=="production"&&(Ne.displayName="Link");const Sn=y.forwardRef(function(n,a){let{"aria-current":l="page",caseSensitive:r=!1,className:o="",end:s=!1,style:c,to:f,unstable_viewTransition:u,children:d}=n,k=Ve(n,wn),_=pe(f,{relative:k.relative}),R=fe(),S=y.useContext(ot),{navigator:$}=y.useContext(Z),I=S!=null&&Fn(_)&&u===!0,w=$.encodeLocation?$.encodeLocation(_).pathname:_.pathname,E=R.pathname,v=S&&S.navigation&&S.navigation.location?S.navigation.location.pathname:null;r||(E=E.toLowerCase(),v=v?v.toLowerCase():null,w=w.toLowerCase());const j=w!=="/"&&w.endsWith("/")?w.length-1:w.length;let V=E===w||!s&&E.startsWith(w)&&E.charAt(j)==="/",W=v!=null&&(v===w||!s&&v.startsWith(w)&&v.charAt(w.length)==="/"),B={isActive:V,isPending:W,isTransitioning:I},J=V?l:void 0,M;typeof o=="function"?M=o(B):M=[o,V?"active":null,W?"pending":null,I?"transitioning":null].filter(Boolean).join(" ");let G=typeof c=="function"?c(B):c;return y.createElement(Ne,ae({},k,{"aria-current":J,className:M,ref:a,style:G,to:f,unstable_viewTransition:u}),typeof d=="function"?d(B):d)});process.env.NODE_ENV!=="production"&&(Sn.displayName="NavLink");const Rn=y.forwardRef((e,n)=>{let{fetcherKey:a,navigate:l,reloadDocument:r,replace:o,state:s,method:c=ve,action:f,onSubmit:u,relative:d,preventScrollReset:k,unstable_viewTransition:_}=e,R=Ve(e,En),S=In(),$=Ln(f,{relative:d}),I=c.toLowerCase()==="get"?"get":"post",w=E=>{if(u&&u(E),E.defaultPrevented)return;E.preventDefault();let v=E.nativeEvent.submitter,j=(v==null?void 0:v.getAttribute("formmethod"))||c;S(v||E.currentTarget,{fetcherKey:a,method:j,navigate:l,replace:o,state:s,relative:d,preventScrollReset:k,unstable_viewTransition:_})};return y.createElement("form",ae({ref:n,method:I,action:$,onSubmit:r?u:w},R))});process.env.NODE_ENV!=="production"&&(Rn.displayName="Form"),process.env.NODE_ENV;var ye;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(ye||(ye={}));var mt;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(mt||(mt={}));function Tn(e){return e+" must be used within a data router. See https://reactrouter.com/routers/picking-a-router."}function ht(e){let n=y.useContext(ke);return n||(process.env.NODE_ENV!=="production"?F(!1,Tn(e)):F(!1)),n}function On(e,n){let{target:a,replace:l,state:r,preventScrollReset:o,relative:s,unstable_viewTransition:c}=n===void 0?{}:n,f=sn(),u=fe(),d=pe(e,{relative:s});return y.useCallback(k=>{if(_n(k,a)){k.preventDefault();let _=l!==void 0?l:je(u)===je(d);f(e,{replace:_,state:r,preventScrollReset:o,relative:s,unstable_viewTransition:c})}},[u,f,d,l,r,a,e,o,s,c])}function $n(){if(typeof document>"u")throw new Error("You are calling submit during the server render. Try calling submit within a `useEffect` or callback instead.")}let jn=0,Dn=()=>"__"+String(++jn)+"__";function In(){let{router:e}=ht(ye.UseSubmit),{basename:n}=y.useContext(Z),a=pn();return y.useCallback(function(l,r){r===void 0&&(r={}),$n();let{action:o,method:s,encType:c,formData:f,body:u}=Nn(l,n);if(r.navigate===!1){let d=r.fetcherKey||Dn();e.fetch(d,a,r.action||o,{preventScrollReset:r.preventScrollReset,formData:f,body:u,formMethod:r.method||s,formEncType:r.encType||c,unstable_flushSync:r.unstable_flushSync})}else e.navigate(r.action||o,{preventScrollReset:r.preventScrollReset,formData:f,body:u,formMethod:r.method||s,formEncType:r.encType||c,replace:r.replace,state:r.state,fromRouteId:a,unstable_flushSync:r.unstable_flushSync,unstable_viewTransition:r.unstable_viewTransition})},[e,n,a])}function Ln(e,n){let{relative:a}=n===void 0?{}:n,{basename:l}=y.useContext(Z),r=y.useContext(re);r||(process.env.NODE_ENV!=="production"?F(!1,"useFormAction must be used inside a RouteContext"):F(!1));let[o]=r.matches.slice(-1),s=ae({},pe(e||".",{relative:a})),c=fe();if(e==null){s.search=c.search;let f=new URLSearchParams(s.search);f.has("index")&&f.get("index")===""&&(f.delete("index"),s.search=f.toString()?"?"+f.toString():"")}return(!e||e===".")&&o.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),l!=="/"&&(s.pathname=s.pathname==="/"?l:Ie([l,s.pathname])),je(s)}function Fn(e,n){n===void 0&&(n={});let a=y.useContext(dt);a==null&&(process.env.NODE_ENV!=="production"?F(!1,"`unstable_useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?"):F(!1));let{basename:l}=ht(ye.useViewTransitionState),r=pe(e,{relative:n.relative});if(!a.isTransitioning)return!1;let o=ue(a.currentLocation.pathname,l)||a.currentLocation.pathname,s=ue(a.nextLocation.pathname,l)||a.nextLocation.pathname;return rt(r.pathname,s)!=null||rt(r.pathname,o)!=null}const Un=N.forwardRef(({breadcrumbs:e,navigationType:n,className:a,...l},r)=>{const o=e.slice(0,4),s=o[o.length-2],c=[a,"pkt-breadcrumbs"].filter(Boolean).join(" ");return h("nav",{ref:r,"aria-label":"brødsmulemeny",className:c,children:[i("ol",{className:"pkt-breadcrumbs__list pkt-breadcrumbs--desktop",children:o.map((f,u)=>i("li",{className:"pkt-breadcrumbs__item",children:u===o.length-1?i("span",{className:"pkt-breadcrumbs__label","aria-current":"true",children:i("span",{className:"pkt-breadcrumbs__text",children:f.text})}):n==="router"?h(Ne,{to:f.href,className:"pkt-link pkt-link--icon-right pkt-breadcrumbs__label pkt-breadcrumbs__link",...l,children:[i(C,{className:"pkt-icon pkt-breadcrumbs__icon pkt-link__icon",name:"chevron-thin-right"}),i("span",{className:"pkt-breadcrumbs__text",children:f.text})]}):h("a",{href:f.href,className:"pkt-link pkt-link--icon-right pkt-breadcrumbs__label pkt-breadcrumbs__link",...l,children:[i(C,{className:"pkt-icon pkt-breadcrumbs__icon pkt-link__icon",name:"chevron-thin-right"}),i("span",{className:"pkt-breadcrumbs__text",children:f.text})]})},`breadcrumb-${u}`))}),n==="router"?h(Ne,{to:s.href,className:"pkt-link pkt-link--icon-left pkt-breadcrumbs--mobile",...l,children:[i(C,{className:"pkt-back-link__icon pkt-icon pkt-link__icon",name:"chevron-thin-left"}),i("span",{className:"pkt-breadcrumbs__text",children:s.text})]}):h("a",{href:s.href,className:"pkt-link pkt-link--icon-left pkt-breadcrumbs--mobile",...l,children:[i(C,{className:"pkt-back-link__icon pkt-icon pkt-link__icon",name:"chevron-thin-left"}),i("span",{className:"pkt-breadcrumbs__text",children:s.text})]})]})}),le=N.forwardRef(({children:e,className:n,iconName:a="user",secondIconName:l="user",size:r="medium",skin:o="primary",type:s="button",variant:c="label-only",color:f,...u},d)=>{const k=[n,"pkt-btn",r&&`pkt-btn--${r}`,o&&`pkt-btn--${o}`,c&&`pkt-btn--${c}`,f&&`pkt-btn--${f}`].filter(Boolean).join(" ");return h("button",{...u,className:k,type:s,ref:d,children:[c!=="label-only"&&i(C,{className:"pkt-btn__icon",name:a}),i("span",{className:"pkt-btn__text",children:e}),c==="icons-right-and-left"&&i(C,{className:"pkt-btn__icon",name:l})]})});le.displayName="PktButton";const kt=N.forwardRef(({id:e,hasTile:n=!1,disabled:a=!1,label:l,checkHelptext:r,hasError:o=!1,className:s,...c},f)=>{const u=[s,"pkt-input-check"].filter(Boolean).join(" ");return i("div",{className:u,children:h("div",{className:`pkt-input-check__input ${n?"pkt-input-check__input--tile":""} ${a&&n?"pkt-input-check__input--tile-disabled":""}`,children:[i("input",{ref:f,className:`pkt-input-check__input-checkbox ${o?"pkt-input-check__input-checkbox--error":""}`,type:"checkbox",id:e,disabled:a,...c}),h("label",{className:"pkt-input-check__input-label",htmlFor:e,children:[l,r&&i("div",{className:"pkt-input-check__input-helptext",children:r})]})]})})});kt.displayName="PktCheckbox";const An=({columnOne:e,columnTwo:n,socialLinks:a,className:l,personvernOgInfoLink:r="https://www.oslo.kommune.no/personvern-og-informasjonskapsler/",tilgjengelighetLink:o="https://www.oslo.kommune.no/tilgjengelighet/"})=>{var c,f;const s=[l,"pkt-footer"].filter(Boolean).join(" ");return i("footer",{className:s,"data-mode":"dark",children:h("div",{className:"pkt-footer__container",children:[h("div",{className:"pkt-grid pkt-grid--rowgap-size-32 pkt-grid--gap-size-16",children:[h("div",{className:"pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up",children:[i("h2",{className:"pkt-footer__title",children:e.title}),h("ul",{className:"pkt-footer__list",children:[e.text&&i("li",{className:"pkt-footer__text",children:e.text}),(c=e.links)==null?void 0:c.map((u,d)=>i("li",{className:"pkt-footer__list-item",children:h("a",{className:`pkt-footer__link ${u.external?"pkt-link--external":""}`,href:u.href,target:u.openInNewTab?"_blank":"_self",rel:u.openInNewTab?"noopener noreferrer":void 0,children:[i(C,{className:"pkt-footer__link-icon",name:"chevron-right"}),u.text]})},`links-${d}`))]})]}),h("div",{className:"pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up",children:[i("h2",{className:"pkt-footer__title",children:n.title}),h("ul",{className:"pkt-footer__list",children:[n.text&&i("li",{className:"pkt-footer__text",children:n.text}),(f=n.links)==null?void 0:f.map((u,d)=>i("li",{className:"pkt-footer__list-item",children:h("a",{className:`pkt-footer__link ${u.external?"pkt-link--external":""}`,href:u.href,target:u.openInNewTab?"_blank":"_self",rel:u.openInNewTab?"noopener noreferrer":void 0,children:[i(C,{className:"pkt-footer__link-icon",name:"chevron-right"}),u.text]})},`links-${d}`))]})]}),h("div",{className:"pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up",children:[i("h2",{className:"pkt-footer__title",children:"Om nettstedet"}),h("ul",{className:"pkt-footer__list",children:[i("li",{className:"pkt-footer__list-item",children:h("a",{className:"pkt-footer__link",href:r,children:[i(C,{className:"pkt-footer__link-icon",name:"chevron-right"}),"Personvern og informasjonskapsler"]})}),i("li",{className:"pkt-footer__list-item",children:h("a",{className:"pkt-footer__link",href:o,children:[i(C,{className:"pkt-footer__link-icon",name:"chevron-right"}),"Tilgjengelighet"]})})]})]})]}),a&&h("div",{className:"pkt-footer__social","aria-label":"standard lenker",children:[i("div",{className:"pkt-footer__social-languages",children:a.filter(u=>u.language).map((u,d)=>i("div",{className:"pkt-footer__social-language",children:i("a",{href:u.href,"aria-label":`til ${u.language} versjon av nettsiden`,target:u.openInNewTab?"_blank":"_self",rel:u.openInNewTab?"noopener noreferrer":void 0,children:u.language})},`sociallinks-language-${d}`))}),i("div",{className:"pkt-footer__social-icons",children:a.filter(u=>u.iconName).map((u,d)=>i(N.Fragment,{children:i("a",{href:u.href,"aria-label":`til ${u.iconName}`,className:"pkt-footer__social-icon-link",target:u.openInNewTab?"_blank":"_self",rel:u.openInNewTab?"noopener noreferrer":void 0,children:i(C,{className:"pkt-footer__social-icon",name:u.iconName})})},`sociallinks-${d}`))})]})]})})},Vn=({links:e=[],personvernOgInfoLink:n="https://www.oslo.kommune.no/personvern-og-informasjonskapsler/",tilgjengelighetLink:a="https://www.oslo.kommune.no/tilgjengelighet/",className:l})=>{const r=[l,"pkt-footer-simple"].filter(Boolean).join(" ");return i("footer",{className:r,"data-mode":"dark",children:i("div",{className:"pkt-footer-simple__container",children:h("ul",{className:"pkt-footer-simple__list",children:[e.map((o,s)=>i("li",{className:"pkt-footer-simple__list-item",children:h("a",{className:`pkt-footer-simple__link ${o.external?" pkt-link--external":""}`,href:o.href,target:o.openInNewTab?"_blank":"_self",rel:o.openInNewTab?"noopener noreferrer":void 0,children:[i(C,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),o.text]})},s)),i("li",{className:"pkt-footer-simple__list-item",children:h("a",{className:"pkt-footer-simple__link",href:n,children:[i(C,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),"Personvern og informasjonskapsler"]})}),i("li",{className:"pkt-footer-simple__list-item",children:h("a",{className:"pkt-footer-simple__link",href:a,children:[i(C,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),"Tilgjengelighet"]})})]})})})};var vt={exports:{}};/*!
54
+ */function ae(){return ae=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var a=arguments[n];for(var l in a)Object.prototype.hasOwnProperty.call(a,l)&&(e[l]=a[l])}return e},ae.apply(this,arguments)}function Ve(e,n){if(e==null)return{};var a={},l=Object.keys(e),r,o;for(o=0;o<l.length;o++)r=l[o],!(n.indexOf(r)>=0)&&(a[r]=e[r]);return a}const ve="get",_e="application/x-www-form-urlencoded";function be(e){return e!=null&&typeof e.tagName=="string"}function mn(e){return be(e)&&e.tagName.toLowerCase()==="button"}function hn(e){return be(e)&&e.tagName.toLowerCase()==="form"}function kn(e){return be(e)&&e.tagName.toLowerCase()==="input"}function vn(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function _n(e,n){return e.button===0&&(!n||n==="_self")&&!vn(e)}let ge=null;function bn(){if(ge===null)try{new FormData(document.createElement("form"),0),ge=!1}catch{ge=!0}return ge}const gn=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function We(e){return e!=null&&!gn.has(e)?(process.env.NODE_ENV!=="production"&&ne(!1,'"'+e+'" is not a valid `encType` for `<Form>`/`<fetcher.Form>` '+('and will default to "'+_e+'"')),null):e}function Nn(e,n){let a,l,r,o,s;if(hn(e)){let c=e.getAttribute("action");l=c?ue(c,n):null,a=e.getAttribute("method")||ve,r=We(e.getAttribute("enctype"))||_e,o=new FormData(e)}else if(mn(e)||kn(e)&&(e.type==="submit"||e.type==="image")){let c=e.form;if(c==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let f=e.getAttribute("formaction")||c.getAttribute("action");if(l=f?ue(f,n):null,a=e.getAttribute("formmethod")||c.getAttribute("method")||ve,r=We(e.getAttribute("formenctype"))||We(c.getAttribute("enctype"))||_e,o=new FormData(c,e),!bn()){let{name:u,type:d,value:k}=e;if(d==="image"){let _=u?u+".":"";o.append(_+"x","0"),o.append(_+"y","0")}else u&&o.append(u,k)}}else{if(be(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');a=ve,l=null,r=_e,s=e}return o&&r==="text/plain"&&(s=o,o=void 0),{action:l,method:a.toLowerCase(),encType:r,formData:o,body:s}}const yn=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],wn=["aria-current","caseSensitive","className","end","style","to","unstable_viewTransition","children"],En=["fetcherKey","navigate","reloadDocument","replace","state","method","action","onSubmit","relative","preventScrollReset","unstable_viewTransition"],dt=y.createContext({isTransitioning:!1});process.env.NODE_ENV!=="production"&&(dt.displayName="ViewTransition");const Cn=y.createContext(new Map);process.env.NODE_ENV!=="production"&&(Cn.displayName="Fetchers"),process.env.NODE_ENV;const xn=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Pn=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ne=y.forwardRef(function(n,a){let{onClick:l,relative:r,reloadDocument:o,replace:s,state:c,target:f,to:u,preventScrollReset:d,unstable_viewTransition:k}=n,_=Ve(n,yn),{basename:R}=y.useContext(Z),S,$=!1;if(typeof u=="string"&&Pn.test(u)&&(S=u,xn))try{let v=new URL(window.location.href),j=u.startsWith("//")?new URL(v.protocol+u):new URL(u),V=ue(j.pathname,R);j.origin===v.origin&&V!=null?u=V+j.search+j.hash:$=!0}catch{process.env.NODE_ENV!=="production"&&ne(!1,'<Link to="'+u+'"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.')}let I=on(u,{relative:r}),w=On(u,{replace:s,state:c,target:f,preventScrollReset:d,relative:r,unstable_viewTransition:k});function E(v){l&&l(v),v.defaultPrevented||w(v)}return y.createElement("a",ae({},_,{href:S||I,onClick:$||o?l:E,ref:a,target:f}))});process.env.NODE_ENV!=="production"&&(Ne.displayName="Link");const Sn=y.forwardRef(function(n,a){let{"aria-current":l="page",caseSensitive:r=!1,className:o="",end:s=!1,style:c,to:f,unstable_viewTransition:u,children:d}=n,k=Ve(n,wn),_=pe(f,{relative:k.relative}),R=fe(),S=y.useContext(ot),{navigator:$}=y.useContext(Z),I=S!=null&&Fn(_)&&u===!0,w=$.encodeLocation?$.encodeLocation(_).pathname:_.pathname,E=R.pathname,v=S&&S.navigation&&S.navigation.location?S.navigation.location.pathname:null;r||(E=E.toLowerCase(),v=v?v.toLowerCase():null,w=w.toLowerCase());const j=w!=="/"&&w.endsWith("/")?w.length-1:w.length;let V=E===w||!s&&E.startsWith(w)&&E.charAt(j)==="/",W=v!=null&&(v===w||!s&&v.startsWith(w)&&v.charAt(w.length)==="/"),B={isActive:V,isPending:W,isTransitioning:I},J=V?l:void 0,M;typeof o=="function"?M=o(B):M=[o,V?"active":null,W?"pending":null,I?"transitioning":null].filter(Boolean).join(" ");let G=typeof c=="function"?c(B):c;return y.createElement(Ne,ae({},k,{"aria-current":J,className:M,ref:a,style:G,to:f,unstable_viewTransition:u}),typeof d=="function"?d(B):d)});process.env.NODE_ENV!=="production"&&(Sn.displayName="NavLink");const Rn=y.forwardRef((e,n)=>{let{fetcherKey:a,navigate:l,reloadDocument:r,replace:o,state:s,method:c=ve,action:f,onSubmit:u,relative:d,preventScrollReset:k,unstable_viewTransition:_}=e,R=Ve(e,En),S=In(),$=Ln(f,{relative:d}),I=c.toLowerCase()==="get"?"get":"post",w=E=>{if(u&&u(E),E.defaultPrevented)return;E.preventDefault();let v=E.nativeEvent.submitter,j=(v==null?void 0:v.getAttribute("formmethod"))||c;S(v||E.currentTarget,{fetcherKey:a,method:j,navigate:l,replace:o,state:s,relative:d,preventScrollReset:k,unstable_viewTransition:_})};return y.createElement("form",ae({ref:n,method:I,action:$,onSubmit:r?u:w},R))});process.env.NODE_ENV!=="production"&&(Rn.displayName="Form"),process.env.NODE_ENV;var ye;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(ye||(ye={}));var mt;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(mt||(mt={}));function Tn(e){return e+" must be used within a data router. See https://reactrouter.com/routers/picking-a-router."}function ht(e){let n=y.useContext(ke);return n||(process.env.NODE_ENV!=="production"?F(!1,Tn(e)):F(!1)),n}function On(e,n){let{target:a,replace:l,state:r,preventScrollReset:o,relative:s,unstable_viewTransition:c}=n===void 0?{}:n,f=sn(),u=fe(),d=pe(e,{relative:s});return y.useCallback(k=>{if(_n(k,a)){k.preventDefault();let _=l!==void 0?l:je(u)===je(d);f(e,{replace:_,state:r,preventScrollReset:o,relative:s,unstable_viewTransition:c})}},[u,f,d,l,r,a,e,o,s,c])}function $n(){if(typeof document>"u")throw new Error("You are calling submit during the server render. Try calling submit within a `useEffect` or callback instead.")}let jn=0,Dn=()=>"__"+String(++jn)+"__";function In(){let{router:e}=ht(ye.UseSubmit),{basename:n}=y.useContext(Z),a=pn();return y.useCallback(function(l,r){r===void 0&&(r={}),$n();let{action:o,method:s,encType:c,formData:f,body:u}=Nn(l,n);if(r.navigate===!1){let d=r.fetcherKey||Dn();e.fetch(d,a,r.action||o,{preventScrollReset:r.preventScrollReset,formData:f,body:u,formMethod:r.method||s,formEncType:r.encType||c,unstable_flushSync:r.unstable_flushSync})}else e.navigate(r.action||o,{preventScrollReset:r.preventScrollReset,formData:f,body:u,formMethod:r.method||s,formEncType:r.encType||c,replace:r.replace,state:r.state,fromRouteId:a,unstable_flushSync:r.unstable_flushSync,unstable_viewTransition:r.unstable_viewTransition})},[e,n,a])}function Ln(e,n){let{relative:a}=n===void 0?{}:n,{basename:l}=y.useContext(Z),r=y.useContext(re);r||(process.env.NODE_ENV!=="production"?F(!1,"useFormAction must be used inside a RouteContext"):F(!1));let[o]=r.matches.slice(-1),s=ae({},pe(e||".",{relative:a})),c=fe();if(e==null){s.search=c.search;let f=new URLSearchParams(s.search);f.has("index")&&f.get("index")===""&&(f.delete("index"),s.search=f.toString()?"?"+f.toString():"")}return(!e||e===".")&&o.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),l!=="/"&&(s.pathname=s.pathname==="/"?l:Ie([l,s.pathname])),je(s)}function Fn(e,n){n===void 0&&(n={});let a=y.useContext(dt);a==null&&(process.env.NODE_ENV!=="production"?F(!1,"`unstable_useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?"):F(!1));let{basename:l}=ht(ye.useViewTransitionState),r=pe(e,{relative:n.relative});if(!a.isTransitioning)return!1;let o=ue(a.currentLocation.pathname,l)||a.currentLocation.pathname,s=ue(a.nextLocation.pathname,l)||a.nextLocation.pathname;return rt(r.pathname,s)!=null||rt(r.pathname,o)!=null}const Un=N.forwardRef(({breadcrumbs:e,navigationType:n,className:a,...l},r)=>{const o=e.slice(0,4),s=o[o.length-2],c=[a,"pkt-breadcrumbs"].filter(Boolean).join(" ");return h("nav",{ref:r,"aria-label":"brødsmulemeny",className:c,children:[i("ol",{className:"pkt-breadcrumbs__list pkt-breadcrumbs--desktop",children:o.map((f,u)=>i("li",{className:"pkt-breadcrumbs__item",children:u===o.length-1?i("span",{className:"pkt-breadcrumbs__label","aria-current":"true",children:i("span",{className:"pkt-breadcrumbs__text",children:f.text})}):n==="router"?h(Ne,{to:f.href,className:"pkt-link pkt-link--icon-right pkt-breadcrumbs__label pkt-breadcrumbs__link",...l,children:[i(C,{className:"pkt-icon pkt-breadcrumbs__icon pkt-link__icon",name:"chevron-thin-right"}),i("span",{className:"pkt-breadcrumbs__text",children:f.text})]}):h("a",{href:f.href,className:"pkt-link pkt-link--icon-right pkt-breadcrumbs__label pkt-breadcrumbs__link",...l,children:[i(C,{className:"pkt-icon pkt-breadcrumbs__icon pkt-link__icon",name:"chevron-thin-right"}),i("span",{className:"pkt-breadcrumbs__text",children:f.text})]})},`breadcrumb-${u}`))}),n==="router"?h(Ne,{to:s.href,className:"pkt-link pkt-link--icon-left pkt-breadcrumbs--mobile",...l,children:[i(C,{className:"pkt-back-link__icon pkt-icon pkt-link__icon",name:"chevron-thin-left"}),i("span",{className:"pkt-breadcrumbs__text",children:s.text})]}):h("a",{href:s.href,className:"pkt-link pkt-link--icon-left pkt-breadcrumbs--mobile",...l,children:[i(C,{className:"pkt-back-link__icon pkt-icon pkt-link__icon",name:"chevron-thin-left"}),i("span",{className:"pkt-breadcrumbs__text",children:s.text})]})]})}),le=N.forwardRef(({children:e,className:n,iconName:a="user",secondIconName:l="user",size:r="medium",skin:o="primary",type:s="button",variant:c="label-only",color:f,...u},d)=>{const k=[n,"pkt-btn",r&&`pkt-btn--${r}`,o&&`pkt-btn--${o}`,c&&`pkt-btn--${c}`,f&&`pkt-btn--${f}`].filter(Boolean).join(" ");return h("button",{...u,className:k,type:s,ref:d,children:[c!=="label-only"&&i(C,{className:"pkt-btn__icon",name:a}),i("span",{className:"pkt-btn__text",children:e}),c==="icons-right-and-left"&&i(C,{className:"pkt-btn__icon",name:l})]})});le.displayName="PktButton";const kt=N.forwardRef(({id:e,hasTile:n=!1,disabled:a=!1,label:l,labelPosition:r="right",hideLabel:o=!1,checkHelptext:s,hasError:c=!1,isSwitch:f=!1,className:u,...d},k)=>{const _=[u,"pkt-input-check"].filter(Boolean).join(" ");return i("div",{className:_,children:h("div",{className:`pkt-input-check__input ${n?"pkt-input-check__input--tile":""} ${a&&n?"pkt-input-check__input--tile-disabled":""}`,children:[l&&r==="left"&&h("label",{className:`pkt-input-check__input-label ${o?"pkt-sr-only":""}`,htmlFor:e,children:[l,s&&i("div",{className:"pkt-input-check__input-helptext",children:s})]}),i("input",{ref:k,className:`pkt-input-check__input-checkbox ${c?"pkt-input-check__input-checkbox--error":""}`,type:"checkbox",role:f?"switch":"checkbox",id:e,disabled:a,...d}),l&&r==="right"&&h("label",{className:`pkt-input-check__input-label ${o?"pkt-sr-only":""}`,htmlFor:e,children:[l,s&&i("div",{className:"pkt-input-check__input-helptext",children:s})]})]})})});kt.displayName="PktCheckbox";const An=({columnOne:e,columnTwo:n,socialLinks:a,className:l,personvernOgInfoLink:r="https://www.oslo.kommune.no/personvern-og-informasjonskapsler/",tilgjengelighetLink:o="https://www.oslo.kommune.no/tilgjengelighet/"})=>{var c,f;const s=[l,"pkt-footer"].filter(Boolean).join(" ");return i("footer",{className:s,"data-mode":"dark",children:h("div",{className:"pkt-footer__container",children:[h("div",{className:"pkt-grid pkt-grid--rowgap-size-32 pkt-grid--gap-size-16",children:[h("div",{className:"pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up",children:[i("h2",{className:"pkt-footer__title",children:e.title}),h("ul",{className:"pkt-footer__list",children:[e.text&&i("li",{className:"pkt-footer__text",children:e.text}),(c=e.links)==null?void 0:c.map((u,d)=>i("li",{className:"pkt-footer__list-item",children:h("a",{className:`pkt-footer__link ${u.external?"pkt-link--external":""}`,href:u.href,target:u.openInNewTab?"_blank":"_self",rel:u.openInNewTab?"noopener noreferrer":void 0,children:[i(C,{className:"pkt-footer__link-icon",name:"chevron-right"}),u.text]})},`links-${d}`))]})]}),h("div",{className:"pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up",children:[i("h2",{className:"pkt-footer__title",children:n.title}),h("ul",{className:"pkt-footer__list",children:[n.text&&i("li",{className:"pkt-footer__text",children:n.text}),(f=n.links)==null?void 0:f.map((u,d)=>i("li",{className:"pkt-footer__list-item",children:h("a",{className:`pkt-footer__link ${u.external?"pkt-link--external":""}`,href:u.href,target:u.openInNewTab?"_blank":"_self",rel:u.openInNewTab?"noopener noreferrer":void 0,children:[i(C,{className:"pkt-footer__link-icon",name:"chevron-right"}),u.text]})},`links-${d}`))]})]}),h("div",{className:"pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up",children:[i("h2",{className:"pkt-footer__title",children:"Om nettstedet"}),h("ul",{className:"pkt-footer__list",children:[i("li",{className:"pkt-footer__list-item",children:h("a",{className:"pkt-footer__link",href:r,children:[i(C,{className:"pkt-footer__link-icon",name:"chevron-right"}),"Personvern og informasjonskapsler"]})}),i("li",{className:"pkt-footer__list-item",children:h("a",{className:"pkt-footer__link",href:o,children:[i(C,{className:"pkt-footer__link-icon",name:"chevron-right"}),"Tilgjengelighet"]})})]})]})]}),a&&h("div",{className:"pkt-footer__social","aria-label":"standard lenker",children:[i("div",{className:"pkt-footer__social-languages",children:a.filter(u=>u.language).map((u,d)=>i("div",{className:"pkt-footer__social-language",children:i("a",{href:u.href,"aria-label":`til ${u.language} versjon av nettsiden`,target:u.openInNewTab?"_blank":"_self",rel:u.openInNewTab?"noopener noreferrer":void 0,children:u.language})},`sociallinks-language-${d}`))}),i("div",{className:"pkt-footer__social-icons",children:a.filter(u=>u.iconName).map((u,d)=>i(N.Fragment,{children:i("a",{href:u.href,"aria-label":`til ${u.iconName}`,className:"pkt-footer__social-icon-link",target:u.openInNewTab?"_blank":"_self",rel:u.openInNewTab?"noopener noreferrer":void 0,children:i(C,{className:"pkt-footer__social-icon",name:u.iconName})})},`sociallinks-${d}`))})]})]})})},Vn=({links:e=[],personvernOgInfoLink:n="https://www.oslo.kommune.no/personvern-og-informasjonskapsler/",tilgjengelighetLink:a="https://www.oslo.kommune.no/tilgjengelighet/",className:l})=>{const r=[l,"pkt-footer-simple"].filter(Boolean).join(" ");return i("footer",{className:r,"data-mode":"dark",children:i("div",{className:"pkt-footer-simple__container",children:h("ul",{className:"pkt-footer-simple__list",children:[e.map((o,s)=>i("li",{className:"pkt-footer-simple__list-item",children:h("a",{className:`pkt-footer-simple__link ${o.external?" pkt-link--external":""}`,href:o.href,target:o.openInNewTab?"_blank":"_self",rel:o.openInNewTab?"noopener noreferrer":void 0,children:[i(C,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),o.text]})},s)),i("li",{className:"pkt-footer-simple__list-item",children:h("a",{className:"pkt-footer-simple__link",href:n,children:[i(C,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),"Personvern og informasjonskapsler"]})}),i("li",{className:"pkt-footer-simple__list-item",children:h("a",{className:"pkt-footer-simple__link",href:a,children:[i(C,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),"Tilgjengelighet"]})})]})})})};var vt={exports:{}};/*!
55
55
  Copyright (c) 2018 Jed Watson.
56
56
  Licensed under the MIT License (MIT), see
57
57
  http://jedwatson.github.io/classnames
58
- */(function(e){(function(){var n={}.hasOwnProperty;function a(){for(var l=[],r=0;r<arguments.length;r++){var o=arguments[r];if(o){var s=typeof o;if(s==="string"||s==="number")l.push(o);else if(Array.isArray(o)){if(o.length){var c=a.apply(null,o);c&&l.push(c)}}else if(s==="object"){if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]")){l.push(o.toString());continue}for(var f in o)n.call(o,f)&&o[f]&&l.push(f)}}}return l.join(" ")}e.exports?(a.default=a,e.exports=a):window.classNames=a})()})(vt);var Wn=vt.exports;const _t=Bt(Wn),Bn=N.forwardRef(({logoLink:e="https://www.oslo.kommune.no/",serviceName:n,fixed:a=!0,scrollToHide:l=!0,user:r,userMenu:o,representing:s,userOptions:c,userMenuFooter:f,canChangeRepresentation:u=!0,showMenuButton:d=!1,showLogOutButton:k=!1,openMenu:_,logOut:R,changeRepresentation:S,...$},I)=>{const w=N.useMemo(()=>typeof(r==null?void 0:r.lastLoggedIn)=="string"?r.lastLoggedIn:r!=null&&r.lastLoggedIn?new Date(r.lastLoggedIn).toLocaleString("nb-NO",{year:"numeric",month:"long",day:"numeric"}):"",[r]),[E,v]=N.useState(!1),[j,V]=N.useState(0),[W,B]=N.useState(!1),J=N.useRef(null);N.useEffect(()=>(document.addEventListener("mouseup",G),window.addEventListener("scroll",z),()=>{document.removeEventListener("mouseup",G),window.removeEventListener("scroll",z)}));const M=()=>{B(!W)},G=g=>{J.current&&!J.current.contains(g.target)&&B(!1)},z=()=>{if(l){const g=window.pageYOffset||document.documentElement.scrollTop;if(g<0||Math.abs(g-j)<60)return;v(g>j),V(g)}};return h("header",{...$,id:"pkt-header","data-testid":"pkt-header","aria-label":"Topp",className:_t("pkt-header",{"pkt-header--fixed":a,"pkt-header--scroll-to-hide":l,"pkt-header--hidden":E}),ref:I,children:[h("div",{className:"pkt-header__logo",children:[typeof e=="string"?i("a",{"aria-label":"Tilbake til forside",className:"pkt-header__logo-link",href:e,children:i(C,{name:"oslologo",className:"pkt-header__logo-svg","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/11.3/logos/"})}):i("button",{"aria-label":"Tilbake til forside",className:"pkt-link-button pkt-link pkt-header__logo-link",onClick:e,children:i(C,{name:"oslologo",className:"pkt-header__logo-svg","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/11.3/logos/"})}),i("span",{className:"pkt-header__logo-service",children:n})]}),i("nav",{className:"pkt-header__actions",children:h("ul",{className:"pkt-header__actions-row",children:[d&&i("li",{children:i(le,{className:"pkt-header__menu-btn",skin:"secondary",variant:"icon-right",iconName:"menu",onClick:_,children:"Meny"})}),(r||s)&&h("li",{"data-testid":"usermenu",className:`pkt-header--has-dropdown ${W&&!E?"pkt-header--open-dropdown":""}`,ref:J,children:[h("button",{className:"pkt-header__user-btn pkt-btn pkt-btn--secondary pkt-btn--icons-right-and-left",type:"button",role:"button","aria-controls":"pktUserDropdown","aria-expanded":W,onClick:M,children:[i(C,{name:"user",className:"pkt-btn__icon"}),i("span",{className:"pkt-header__user-fullname",children:(s==null?void 0:s.name)||(r==null?void 0:r.name)}),i("span",{className:"pkt-header__user-shortname",children:(s==null?void 0:s.shortname)||(r==null?void 0:r.shortname)}),i(C,{name:"chevron-thin-down",className:"pkt-btn--closed"}),i(C,{name:"chevron-thin-up",className:"pkt-btn--open"})]}),h("ul",{id:"pktUserDropdown",className:"pkt-header__dropdown pkt-user-menu",children:[r&&h("li",{children:[i("div",{className:"pkt-user-menu__label",children:"Pålogget som"}),i("div",{className:"pkt-user-menu__name",children:r.name}),r.lastLoggedIn&&h("div",{className:"pkt-user-menu__last-logged-in",children:["Sist pålogget: ",i("time",{children:w})]})]}),o&&i("li",{children:i("ul",{className:"pkt-list",children:o.map((g,L)=>i("li",{children:typeof g.target=="string"?h("a",{href:g.target,className:"pkt-link",children:[g.iconName&&i(C,{name:g.iconName,className:"pkt-link__icon"}),g.title]}):h("button",{className:"pkt-link-button pkt-link",onClick:g.target,children:[g.iconName&&i(C,{name:g.iconName,className:"pkt-link__icon"}),g.title]})},`userMenu-${L}`))})}),(s||u)&&h("li",{children:[s&&h(X,{children:[i("div",{className:"pkt-user-menu__label",children:"Representerer"}),i("div",{className:"pkt-user-menu__name",children:s.name}),s.orgNumber&&h("div",{className:"pkt-user-menu__org-number",children:["Org.nr. ",s.orgNumber]})]}),i("ul",{className:"pkt-list mt-size-16",children:u&&i("li",{children:h("button",{className:"pkt-link-button pkt-link",onClick:S,children:[i(C,{name:"cogwheel",className:"pkt-link__icon"}),"Endre organisasjon"]})})})]}),i("li",{children:i("ul",{className:"pkt-list",children:(c||!k)&&h(X,{children:[c==null?void 0:c.map((g,L)=>i("li",{children:typeof g.target=="string"?h("a",{href:g.target,className:"pkt-link",children:[g.iconName&&i(C,{name:g.iconName,className:"pkt-link__icon"}),g.title]}):h("button",{className:"pkt-link-button pkt-link",onClick:g.target,children:[g.iconName&&i(C,{name:g.iconName,className:"pkt-link__icon"}),g.title]})},`userOptions-${L}`)),!k&&i("li",{children:h("button",{className:"pkt-link-button pkt-link",onClick:R,children:[i(C,{name:"exit",className:"pkt-link__icon"}),"Logg ut"]})})]})})}),f&&i("li",{className:"footer",children:i("ul",{className:"pkt-list-horizontal bordered",children:f.map((g,L)=>i("li",{children:typeof g.target=="string"?i("a",{href:g.target,className:"pkt-link",children:g.title}):i("button",{className:"pkt-link-button pkt-link",onClick:g.target,children:g.title})},`userMenuFooter-${L}`))})})]})]}),k&&i("li",{children:i(le,{className:"pkt-header__user-btn pkt-header__user-btn-logout",iconName:"exit",role:"button",onClick:R,skin:"secondary",variant:"icon-right",children:"Logg ut"})})]})})]})}),bt=N.forwardRef(({label:e,id:n,children:a,...l},r)=>h("div",{className:"pkt-form-group",children:[i("label",{htmlFor:n,className:"pkt-form-label",children:e}),i("input",{className:"pkt-form-input",id:n,...l,ref:r}),a]}));bt.displayName="PktInput";const de=N.forwardRef(({forId:e,label:n,helptext:a,helptextDropdown:l,helptextDropdownButton:r,optionalTag:o=!1,optionalText:s="Valgfritt",requiredTag:c=!1,requiredText:f="Må fylles ut",hasError:u,errorMessage:d,disabled:k,inline:_,ariaDescribedby:R,useWrapper:S=!0,children:$,className:I,hasFieldset:w=!1},E)=>{const[v,j]=N.useState(!1),V=()=>{j(!v)},W=()=>o?"pkt-tag pkt-tag--small pkt-tag--thin-text pkt-tag--blue-light":c?"pkt-tag pkt-tag--small pkt-tag--thin-text pkt-tag--beige":"",B=o?s:c?f:"",J=k?"pkt-inputwrapper--disabled":"",M=_?"pkt-inputwrapper--inline":"",G=u?"pkt-inputwrapper--error":"",z=!!l&&l!=="",g=r||'Les mer <span class="pkt-sr-only">om inputfeltet</span>',L=w?"fieldset":z?"div":"label",K=w?"legend":z?"h2":"span",q=R||(a?`${e}-helptext`:void 0);return h("div",{className:["pkt-inputwrapper",I,J,M,G].join(" "),ref:E,children:[S?i(X,{children:h(L,{htmlFor:w?void 0:e,"aria-describedby":z?void 0:R,className:`pkt-inputwrapper__label${w?" pkt-inputwrapper__fieldset":""}`,children:[h(K,{id:`${e}-label`,className:`${w?" pkt-inputwrapper__legend":""}`,children:[n,B!==""&&i("span",{className:W(),children:B})]}),a&&i("div",{className:"pkt-inputwrapper__helptext",id:`${e}-helptext`,dangerouslySetInnerHTML:{__html:a}}),z&&l!==""&&h("div",{children:[i(le,{skin:"tertiary",size:"small",variant:"icon-right",iconName:v?"chevron-thin-up":"chevron-thin-down",className:"pkt-inputwrapper__helptext-expandable pkt-link pkt-link--icon-right",onClick:V,children:i("span",{dangerouslySetInnerHTML:{__html:g}})}),i("div",{className:`pkt-inputwrapper__helptext ${v?"pkt-inputwrapper__helptext-expandable-open":"pkt-inputwrapper__helptext-expandable-closed"}`,children:i("span",{dangerouslySetInnerHTML:{__html:l}})}),!w&&i("label",{htmlFor:e,className:"pkt-sr-only","aria-describedby":q,children:n})]}),i(X,{children:$})]})}):h(X,{children:[!w&&i("label",{htmlFor:e,className:"pkt-sr-only","aria-describedby":q,id:`${e}-label`,children:n}),$]}),u&&d&&i("div",{children:i(Qe,{skin:"error","aria-live":"assertive",id:`${e}-error`,compact:!0,children:d})})]})});de.displayName="PktInputWrapper";const gt=N.forwardRef(({children:e,className:n,iconName:a="user",openInNewTab:l=!1,skin:r="normal",href:o="#",external:s=!1,title:c,...f},u)=>{const d=[n,"pkt-linkcard",r&&`pkt-linkcard--${r}`].filter(Boolean).join(" ");return h("a",{...f,href:o,className:`pkt-linkcard pkt-link ${d}`,target:l?"_blank":"_self",rel:l?"noopener noreferrer":void 0,ref:u,children:[i(C,{className:"pkt-link__icon",name:a}),h("div",{className:"pkt-linkcard__content",children:[i("div",{className:`pkt-linkcard__title ${s?"pkt-link pkt-link--external":""}`,children:c}),i("div",{className:"pkt-linkcard__text",children:e})]})]})});gt.displayName="PktLinkCard";const Mn=({children:e,className:n,compact:a=!1,skin:l="beige",title:r,...o})=>{const s=[n,"pkt-messagebox",l&&`pkt-messagebox--${l}`,a&&"pkt-messagebox--compact"].filter(Boolean).join(" ");return h("div",{...o,className:s,children:[r&&i("div",{className:"pkt-messagebox__title",children:r}),i("div",{className:"pkt-messagebox__text",children:e})]})},Nt=N.forwardRef(({id:e,name:n,label:a,className:l,hasTile:r=!1,disabled:o=!1,checkHelptext:s,hasError:c=!1,...f},u)=>{const d=[l,"pkt-input-check"].filter(Boolean).join(" ");return i("div",{className:d,children:h("div",{className:`pkt-input-check__input ${r?"pkt-input-check__input--tile":""} ${o&&r?"pkt-input-check__input--tile-disabled":""}`,children:[i("input",{ref:u,className:`pkt-input-check__input-checkbox ${c?"pkt-input-check__input-checkbox--error":""}`,type:"radio",id:e,disabled:o,name:n,...f}),h("label",{className:"pkt-input-check__input-label",htmlFor:e,children:[a,s&&i("div",{className:"pkt-input-check__input-helptext",children:s})]})]})})});Nt.displayName="PktRadioButton";const Yn=N.forwardRef(({action:e,appearance:n="local",disabled:a=!1,fullwidth:l=!1,id:r,label:o,method:s="get",name:c,placeholder:f="Søk…",suggestions:u,value:d="",onSearch:k,onSuggestionClick:_,...R},S)=>{const $=(v,j)=>{v?v():_&&_(j)},I=`pkt-searchinput pkt-searchinput--${n} ${l?"pkt-searchinput--fullwidth":""}`;return h(e?"form":"div",{className:I,onSubmit:k&&(()=>k(d)),action:e||void 0,method:e?s:void 0,role:"search",ref:S,...R,children:[h(o?"label":"div",{htmlFor:o?r:void 0,className:o?"pkt-inputwrapper__label":"",children:[o&&i(X,{children:o}),h("div",{className:n==="local"?"pkt-input__container":"pkt-searchinput__field",children:[i("input",{className:`pkt-input ${l?"pkt-input--fullwidth":""}`,type:"search",name:c||r,id:r,placeholder:f,value:d,disabled:a,onInput:k&&(v=>k(v.currentTarget.value)),autoComplete:"off","aria-autocomplete":"list","aria-controls":`${r}-suggestions`}),i(le,{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:a,onClick:k&&(()=>k(d)),onKeyUp:k&&(v=>v.key==="Enter"&&k(d)),children:o||f})]})]}),u&&i("ul",{id:`${r}-suggestions`,className:"pkt-searchinput__suggestions","aria-live":"assertive",children:u.map((v,j)=>i("li",{children:N.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:()=>$(v.onClick,j),onKeyUp:()=>$(v.onClick,j)},h(X,{children:[v.title&&i("h3",{className:"pkt-searchinput__suggestion-title",children:v.title}),v.text&&i("p",{className:"pkt-searchinput__suggestion-text",children:v.text})]}))},`search-suggestion-${j}`))})]})}),Kn=N.forwardRef(({ariaDescribedby:e,ariaLabelledby:n,children:a,className:l,disabled:r=!1,errorMessage:o,hasError:s,helptext:c,helptextDropdown:f,helptextDropdownButton:u,id:d,inline:k=!1,fullwidth:_=!1,label:R,name:S,optionalTag:$=!1,optionalText:I,requiredTag:w=!1,requiredText:E,...v},j)=>{const V=[l,"pkt-select"].join(" ");return i(de,{className:V,forId:d,label:R,helptext:c,helptextDropdown:f,helptextDropdownButton:u,optionalTag:$,optionalText:I,requiredTag:w,requiredText:E,hasError:s,errorMessage:o,disabled:r,inline:k,ariaDescribedby:e,children:i("select",{ref:j,className:`pkt-input ${_?"pkt-input--fullwidth":""}`,"aria-invalid":s,"aria-errormessage":`${d}-error`,"aria-labelledby":n||`${d}-label`,disabled:r,id:d,name:S||d,...v,children:a})})}),Jn=({isResponsive:e,children:n})=>e?i("div",{className:"pkt-table-container",children:n}):i(X,{children:n}),zn=({isResponsive:e,modifiers:{info:n=!1,success:a=!1,strong:l=!1,shadow:r=!1}={},children:o})=>i(Jn,{isResponsive:e,children:i("table",{className:_t("pkt-table",{"pkt-table--info":n,"pkt-table--success":a,"pkt-table--strong":l,"pkt-table--shadow":r}),children:o})}),qn=({children:e})=>i("td",{className:"pkt-table__th",children:e}),Gn=({children:e})=>i("th",{className:"pkt-table__th",children:e}),we=N.forwardRef(({children:e,className:n,skin:a="blue",textStyle:l="normal-text",size:r="medium",closeTag:o=!1,iconName:s="",type:c="button",ariaLabel:f="close",onClick:u=()=>{}},d)=>{const[k,_]=N.useState(!1),R=w=>{_(!0),u(w)},S=["pkt-tag",r&&`pkt-tag--${r}`,a&&`pkt-tag--${a}`,l&&`pkt-tag--${l}`,n].filter(Boolean).join(" "),$=["pkt-tag","pkt-btn","pkt-btn--tertiary",r&&`pkt-tag--${r}`,a&&`pkt-tag--${a}`,l&&`pkt-tag--${l}`,s&&o?"pkt-btn--icons-right-and-left":null,o&&!s?"pkt-btn--icon-right":null,n].filter(Boolean).join(" "),I=!k;return o&&s?i(X,{children:I&&h("button",{className:$,type:c,"aria-label":f,onClick:R,ref:d,children:[i(C,{className:"pkt-tag__icon",name:s}),e,i(C,{className:"pkt-tag__close-btn",name:"close"})]})}):o?i(X,{children:I&&h("button",{className:$,type:c,"aria-label":f,onClick:R,ref:d,children:[i(C,{className:"pkt-tag__close-btn",name:"close"}),e]})}):s?h("span",{className:S,children:[i(C,{className:"pkt-tag__icon",name:s}),e]}):i("span",{className:S,children:e})});we.displayName="PktTag";const Hn=N.forwardRef(({arrowNav:e=!0,tabs:n,onTabSelected:a},l)=>{const r=N.useRef([]);N.useEffect(()=>{r.current=r.current.slice(0,n.length)},[n]);const o=(c,f)=>{f.action&&f.action(c),a&&a(c)},s=(c,f)=>{var u,d;e&&(f.code==="ArrowLeft"&&c!==0&&((u=r.current[c-1])==null||u.focus()),f.code==="ArrowRight"&&c<n.length-1&&((d=r.current[c+1])==null||d.focus()),(f.code==="ArrowDown"||f.code==="Space")&&o(c,n[c]))};return i("div",{className:"pkt-tabs",ref:l,children:i("div",{className:"pkt-tabs__list",role:e?"tablist":"navigation",children:n.map((c,f)=>i(N.Fragment,{children:c.href?h("a",{"aria-selected":!!c.active,role:e?"tab":void 0,href:c.href,"aria-controls":c.controls,className:`pkt-tabs__link ${c.active?"active":""}`,onKeyUp:u=>s(f,u),onClick:()=>o(f,c),tabIndex:c.active||!e?void 0:-1,ref:u=>{r.current[f]=u},children:[c.icon&&i(C,{name:c.icon,className:"pkt-icon--small"}),c.text,c.tag&&i(we,{skin:c.tag.skin,size:"small",children:c.tag.text})]}):h("button",{"aria-selected":!!c.active,role:e?"tab":void 0,type:"button","aria-controls":c.controls,className:`pkt-tabs__button pkt-link-button ${c.active?"active":""}`,onKeyUp:u=>s(f,u),onClick:()=>o(f,c),tabIndex:c.active||!e?void 0:-1,ref:u=>{r.current[f]=u},children:[c.icon&&i(C,{name:c.icon,className:"pkt-icon--small"}),c.text,c.tag&&i(we,{skin:c.tag.skin,size:"small",children:c.tag.text})]},"b-"+f)},f))})})}),Xn=N.forwardRef(({id:e,ariaDescribedby:n,ariaLabelledby:a,counter:l,counterMaxLength:r,className:o,disabled:s,errorMessage:c,hasError:f,helptext:u,helptextDropdown:d,helptextDropdownButton:k,inline:_,fullwidth:R=!1,label:S,name:$,optionalTag:I=!1,optionalText:w,requiredTag:E=!1,requiredText:v,placeholder:j,rows:V,useWrapper:W=!0,onChange:B,...J},M)=>{const G=[o,"pkt-textinput","pkt-textarea"].join(" "),z=a||`${e}-label`,g=N.useRef(null),[L,K]=N.useState(0),q=ee=>{var te,me;if(l&&K(((me=(te=ee.currentTarget)==null?void 0:te.value)==null?void 0:me.length)||0),B)return B(ee)};return N.useEffect(()=>{var ee,te;typeof M=="function"&&M(g.current),l&&K(((te=(ee=g==null?void 0:g.current)==null?void 0:ee.value)==null?void 0:te.length)||0)},[M]),h(de,{ariaDescribedby:n,className:G,disabled:s,errorMessage:c,forId:e,hasError:f,helptext:u,helptextDropdown:d,helptextDropdownButton:k,inline:_,label:S,optionalTag:I,optionalText:w,requiredTag:E,requiredText:v,useWrapper:W,children:[i("textarea",{ref:g,className:`pkt-input ${R?"pkt-input--fullwidth":""} ${r&&L>r?"pkt-input--counter-error":""}`,name:$||e,id:e,placeholder:j,disabled:s,rows:V,"aria-labelledby":z,"aria-invalid":f,"aria-errormessage":`${e}-error`,...J,onChange:q}),l&&h("div",{className:"pkt-input__counter","aria-live":"polite","aria-atomic":!0,children:[L||0,r&&`/${r}`]})]})}),Zn=N.forwardRef(({id:e,ariaDescribedby:n,ariaLabelledby:a,autocomplete:l="off",className:r,disabled:o=!1,errorMessage:s,hasError:c=!1,helptext:f,helptextDropdown:u,helptextDropdownButton:d,iconNameRight:k,inline:_=!1,fullwidth:R=!1,label:S,name:$,optionalTag:I=!1,optionalText:w,requiredTag:E=!1,requiredText:v,placeholder:j,prefix:V,suffix:W,type:B="text",useWrapper:J=!0,omitSearchIcon:M=!1,value:G,...z},g)=>{const L=[r,"pkt-textinput"].join(" "),K=a||`${e}-label`,q=B==="search"&&!k&&!M;return i(de,{ariaDescribedby:n,className:L,disabled:o,errorMessage:s,forId:e,hasError:c,helptext:f,helptextDropdown:u,helptextDropdownButton:d,inline:_,label:S,optionalTag:I,optionalText:w,requiredTag:E,requiredText:v,useWrapper:J,children:h("div",{className:"pkt-input__container",children:[V&&i("div",{className:"pkt-input-prefix",children:V}),i("input",{ref:g,className:`pkt-input ${R?"pkt-input--fullwidth":""}`,type:B,name:$||e,id:e,placeholder:j,autoComplete:l,value:G,disabled:o,"aria-invalid":c,"aria-errormessage":`${e}-error`,"aria-labelledby":K,...z}),W&&h("p",{className:"pkt-input-suffix",children:[W,k&&i(C,{className:"pkt-input-suffix-icon",name:k}),q&&i(C,{className:"pkt-input-suffix-icon",name:"magnifying-glass-big"})]}),!W&&k&&i(C,{className:"pkt-input-icon",name:k}),!W&&q&&i(C,{className:"pkt-input-icon",name:"magnifying-glass-big"})]})})});O.PktAlert=Qe,O.PktBackLink=Gt,O.PktBreadcrumbs=Un,O.PktButton=le,O.PktCheckbox=kt,O.PktFooter=An,O.PktFooterSimple=Vn,O.PktHeader=Bn,O.PktIcon=C,O.PktIconContext=Ze,O.PktInput=bt,O.PktInputWrapper=de,O.PktLinkCard=gt,O.PktMessagebox=Mn,O.PktRadioButton=Nt,O.PktSearchInput=Yn,O.PktSelect=Kn,O.PktTable=zn,O.PktTableData=qn,O.PktTableHeader=Gn,O.PktTabs=Hn,O.PktTag=we,O.PktTextarea=Xn,O.PktTextinput=Zn,Object.defineProperty(O,Symbol.toStringTag,{value:"Module"})});
58
+ */(function(e){(function(){var n={}.hasOwnProperty;function a(){for(var l=[],r=0;r<arguments.length;r++){var o=arguments[r];if(o){var s=typeof o;if(s==="string"||s==="number")l.push(o);else if(Array.isArray(o)){if(o.length){var c=a.apply(null,o);c&&l.push(c)}}else if(s==="object"){if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]")){l.push(o.toString());continue}for(var f in o)n.call(o,f)&&o[f]&&l.push(f)}}}return l.join(" ")}e.exports?(a.default=a,e.exports=a):window.classNames=a})()})(vt);var Wn=vt.exports;const _t=Bt(Wn),Bn=N.forwardRef(({logoLink:e="https://www.oslo.kommune.no/",serviceName:n,fixed:a=!0,scrollToHide:l=!0,user:r,userMenu:o,representing:s,userOptions:c,userMenuFooter:f,canChangeRepresentation:u=!0,showMenuButton:d=!1,showLogOutButton:k=!1,openMenu:_,logOut:R,changeRepresentation:S,...$},I)=>{const w=N.useMemo(()=>typeof(r==null?void 0:r.lastLoggedIn)=="string"?r.lastLoggedIn:r!=null&&r.lastLoggedIn?new Date(r.lastLoggedIn).toLocaleString("nb-NO",{year:"numeric",month:"long",day:"numeric"}):"",[r]),[E,v]=N.useState(!1),[j,V]=N.useState(0),[W,B]=N.useState(!1),J=N.useRef(null);N.useEffect(()=>(document.addEventListener("mouseup",G),window.addEventListener("scroll",z),()=>{document.removeEventListener("mouseup",G),window.removeEventListener("scroll",z)}));const M=()=>{B(!W)},G=g=>{J.current&&!J.current.contains(g.target)&&B(!1)},z=()=>{if(l){const g=window.pageYOffset||document.documentElement.scrollTop;if(g<0||Math.abs(g-j)<60)return;v(g>j),V(g)}};return h("header",{...$,id:"pkt-header","data-testid":"pkt-header","aria-label":"Topp",className:_t("pkt-header",{"pkt-header--fixed":a,"pkt-header--scroll-to-hide":l,"pkt-header--hidden":E}),ref:I,children:[h("div",{className:"pkt-header__logo",children:[typeof e=="string"?i("a",{"aria-label":"Tilbake til forside",className:"pkt-header__logo-link",href:e,children:i(C,{name:"oslologo",className:"pkt-header__logo-svg","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/11.4/logos/"})}):i("button",{"aria-label":"Tilbake til forside",className:"pkt-link-button pkt-link pkt-header__logo-link",onClick:e,children:i(C,{name:"oslologo",className:"pkt-header__logo-svg","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/11.4/logos/"})}),i("span",{className:"pkt-header__logo-service",children:n})]}),i("nav",{className:"pkt-header__actions",children:h("ul",{className:"pkt-header__actions-row",children:[d&&i("li",{children:i(le,{className:"pkt-header__menu-btn",skin:"secondary",variant:"icon-right",iconName:"menu",onClick:_,children:"Meny"})}),(r||s)&&h("li",{"data-testid":"usermenu",className:`pkt-header--has-dropdown ${W&&!E?"pkt-header--open-dropdown":""}`,ref:J,children:[h("button",{className:"pkt-header__user-btn pkt-btn pkt-btn--secondary pkt-btn--icons-right-and-left",type:"button",role:"button","aria-controls":"pktUserDropdown","aria-expanded":W,onClick:M,children:[i(C,{name:"user",className:"pkt-btn__icon"}),i("span",{className:"pkt-header__user-fullname",children:(s==null?void 0:s.name)||(r==null?void 0:r.name)}),i("span",{className:"pkt-header__user-shortname",children:(s==null?void 0:s.shortname)||(r==null?void 0:r.shortname)}),i(C,{name:"chevron-thin-down",className:"pkt-btn--closed"}),i(C,{name:"chevron-thin-up",className:"pkt-btn--open"})]}),h("ul",{id:"pktUserDropdown",className:"pkt-header__dropdown pkt-user-menu",children:[r&&h("li",{children:[i("div",{className:"pkt-user-menu__label",children:"Pålogget som"}),i("div",{className:"pkt-user-menu__name",children:r.name}),r.lastLoggedIn&&h("div",{className:"pkt-user-menu__last-logged-in",children:["Sist pålogget: ",i("time",{children:w})]})]}),o&&i("li",{children:i("ul",{className:"pkt-list",children:o.map((g,L)=>i("li",{children:typeof g.target=="string"?h("a",{href:g.target,className:"pkt-link",children:[g.iconName&&i(C,{name:g.iconName,className:"pkt-link__icon"}),g.title]}):h("button",{className:"pkt-link-button pkt-link",onClick:g.target,children:[g.iconName&&i(C,{name:g.iconName,className:"pkt-link__icon"}),g.title]})},`userMenu-${L}`))})}),(s||u)&&h("li",{children:[s&&h(X,{children:[i("div",{className:"pkt-user-menu__label",children:"Representerer"}),i("div",{className:"pkt-user-menu__name",children:s.name}),s.orgNumber&&h("div",{className:"pkt-user-menu__org-number",children:["Org.nr. ",s.orgNumber]})]}),i("ul",{className:"pkt-list mt-size-16",children:u&&i("li",{children:h("button",{className:"pkt-link-button pkt-link",onClick:S,children:[i(C,{name:"cogwheel",className:"pkt-link__icon"}),"Endre organisasjon"]})})})]}),i("li",{children:i("ul",{className:"pkt-list",children:(c||!k)&&h(X,{children:[c==null?void 0:c.map((g,L)=>i("li",{children:typeof g.target=="string"?h("a",{href:g.target,className:"pkt-link",children:[g.iconName&&i(C,{name:g.iconName,className:"pkt-link__icon"}),g.title]}):h("button",{className:"pkt-link-button pkt-link",onClick:g.target,children:[g.iconName&&i(C,{name:g.iconName,className:"pkt-link__icon"}),g.title]})},`userOptions-${L}`)),!k&&i("li",{children:h("button",{className:"pkt-link-button pkt-link",onClick:R,children:[i(C,{name:"exit",className:"pkt-link__icon"}),"Logg ut"]})})]})})}),f&&i("li",{className:"footer",children:i("ul",{className:"pkt-list-horizontal bordered",children:f.map((g,L)=>i("li",{children:typeof g.target=="string"?i("a",{href:g.target,className:"pkt-link",children:g.title}):i("button",{className:"pkt-link-button pkt-link",onClick:g.target,children:g.title})},`userMenuFooter-${L}`))})})]})]}),k&&i("li",{children:i(le,{className:"pkt-header__user-btn pkt-header__user-btn-logout",iconName:"exit",role:"button",onClick:R,skin:"secondary",variant:"icon-right",children:"Logg ut"})})]})})]})}),bt=N.forwardRef(({label:e,id:n,children:a,...l},r)=>h("div",{className:"pkt-form-group",children:[i("label",{htmlFor:n,className:"pkt-form-label",children:e}),i("input",{className:"pkt-form-input",id:n,...l,ref:r}),a]}));bt.displayName="PktInput";const de=N.forwardRef(({forId:e,label:n,helptext:a,helptextDropdown:l,helptextDropdownButton:r,optionalTag:o=!1,optionalText:s="Valgfritt",requiredTag:c=!1,requiredText:f="Må fylles ut",hasError:u,errorMessage:d,disabled:k,inline:_,ariaDescribedby:R,useWrapper:S=!0,children:$,className:I,hasFieldset:w=!1},E)=>{const[v,j]=N.useState(!1),V=()=>{j(!v)},W=()=>o?"pkt-tag pkt-tag--small pkt-tag--thin-text pkt-tag--blue-light":c?"pkt-tag pkt-tag--small pkt-tag--thin-text pkt-tag--beige":"",B=o?s:c?f:"",J=k?"pkt-inputwrapper--disabled":"",M=_?"pkt-inputwrapper--inline":"",G=u?"pkt-inputwrapper--error":"",z=!!l&&l!=="",g=r||'Les mer <span class="pkt-sr-only">om inputfeltet</span>',L=w?"fieldset":z?"div":"label",K=w?"legend":z?"h2":"span",q=R||(a?`${e}-helptext`:void 0);return h("div",{className:["pkt-inputwrapper",I,J,M,G].join(" "),ref:E,children:[S?i(X,{children:h(L,{htmlFor:w?void 0:e,"aria-describedby":z?void 0:R,className:`pkt-inputwrapper__label${w?" pkt-inputwrapper__fieldset":""}`,children:[h(K,{id:`${e}-label`,className:`${w?" pkt-inputwrapper__legend":""}`,children:[n,B!==""&&i("span",{className:W(),children:B})]}),a&&i("div",{className:"pkt-inputwrapper__helptext",id:`${e}-helptext`,dangerouslySetInnerHTML:{__html:a}}),z&&l!==""&&h("div",{children:[i(le,{skin:"tertiary",size:"small",variant:"icon-right",iconName:v?"chevron-thin-up":"chevron-thin-down",className:"pkt-inputwrapper__helptext-expandable pkt-link pkt-link--icon-right",onClick:V,children:i("span",{dangerouslySetInnerHTML:{__html:g}})}),i("div",{className:`pkt-inputwrapper__helptext ${v?"pkt-inputwrapper__helptext-expandable-open":"pkt-inputwrapper__helptext-expandable-closed"}`,children:i("span",{dangerouslySetInnerHTML:{__html:l}})}),!w&&i("label",{htmlFor:e,className:"pkt-sr-only","aria-describedby":q,children:n})]}),i(X,{children:$})]})}):h(X,{children:[!w&&i("label",{htmlFor:e,className:"pkt-sr-only","aria-describedby":q,id:`${e}-label`,children:n}),$]}),u&&d&&i("div",{children:i(Qe,{skin:"error","aria-live":"assertive",id:`${e}-error`,compact:!0,children:d})})]})});de.displayName="PktInputWrapper";const gt=N.forwardRef(({children:e,className:n,iconName:a="user",openInNewTab:l=!1,skin:r="normal",href:o="#",external:s=!1,title:c,...f},u)=>{const d=[n,"pkt-linkcard",r&&`pkt-linkcard--${r}`].filter(Boolean).join(" ");return h("a",{...f,href:o,className:`pkt-linkcard pkt-link ${d}`,target:l?"_blank":"_self",rel:l?"noopener noreferrer":void 0,ref:u,children:[i(C,{className:"pkt-link__icon",name:a}),h("div",{className:"pkt-linkcard__content",children:[i("div",{className:`pkt-linkcard__title ${s?"pkt-link pkt-link--external":""}`,children:c}),i("div",{className:"pkt-linkcard__text",children:e})]})]})});gt.displayName="PktLinkCard";const Mn=({children:e,className:n,compact:a=!1,skin:l="beige",title:r,...o})=>{const s=[n,"pkt-messagebox",l&&`pkt-messagebox--${l}`,a&&"pkt-messagebox--compact"].filter(Boolean).join(" ");return h("div",{...o,className:s,children:[r&&i("div",{className:"pkt-messagebox__title",children:r}),i("div",{className:"pkt-messagebox__text",children:e})]})},Nt=N.forwardRef(({id:e,name:n,label:a,className:l,hasTile:r=!1,disabled:o=!1,checkHelptext:s,hasError:c=!1,...f},u)=>{const d=[l,"pkt-input-check"].filter(Boolean).join(" ");return i("div",{className:d,children:h("div",{className:`pkt-input-check__input ${r?"pkt-input-check__input--tile":""} ${o&&r?"pkt-input-check__input--tile-disabled":""}`,children:[i("input",{ref:u,className:`pkt-input-check__input-checkbox ${c?"pkt-input-check__input-checkbox--error":""}`,type:"radio",id:e,disabled:o,name:n,...f}),h("label",{className:"pkt-input-check__input-label",htmlFor:e,children:[a,s&&i("div",{className:"pkt-input-check__input-helptext",children:s})]})]})})});Nt.displayName="PktRadioButton";const Yn=N.forwardRef(({action:e,appearance:n="local",disabled:a=!1,fullwidth:l=!1,id:r,label:o,method:s="get",name:c,placeholder:f="Søk…",suggestions:u,value:d="",onSearch:k,onSuggestionClick:_,...R},S)=>{const $=(v,j)=>{v?v():_&&_(j)},I=`pkt-searchinput pkt-searchinput--${n} ${l?"pkt-searchinput--fullwidth":""}`;return h(e?"form":"div",{className:I,onSubmit:k&&(()=>k(d)),action:e||void 0,method:e?s:void 0,role:"search",ref:S,...R,children:[h(o?"label":"div",{htmlFor:o?r:void 0,className:o?"pkt-inputwrapper__label":"",children:[o&&i(X,{children:o}),h("div",{className:n==="local"?"pkt-input__container":"pkt-searchinput__field",children:[i("input",{className:`pkt-input ${l?"pkt-input--fullwidth":""}`,type:"search",name:c||r,id:r,placeholder:f,value:d,disabled:a,onInput:k&&(v=>k(v.currentTarget.value)),autoComplete:"off","aria-autocomplete":"list","aria-controls":`${r}-suggestions`}),i(le,{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:a,onClick:k&&(()=>k(d)),onKeyUp:k&&(v=>v.key==="Enter"&&k(d)),children:o||f})]})]}),u&&i("ul",{id:`${r}-suggestions`,className:"pkt-searchinput__suggestions","aria-live":"assertive",children:u.map((v,j)=>i("li",{children:N.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:()=>$(v.onClick,j),onKeyUp:()=>$(v.onClick,j)},h(X,{children:[v.title&&i("h3",{className:"pkt-searchinput__suggestion-title",children:v.title}),v.text&&i("p",{className:"pkt-searchinput__suggestion-text",children:v.text})]}))},`search-suggestion-${j}`))})]})}),Kn=N.forwardRef(({ariaDescribedby:e,ariaLabelledby:n,children:a,className:l,disabled:r=!1,errorMessage:o,hasError:s,helptext:c,helptextDropdown:f,helptextDropdownButton:u,id:d,inline:k=!1,fullwidth:_=!1,label:R,name:S,optionalTag:$=!1,optionalText:I,requiredTag:w=!1,requiredText:E,...v},j)=>{const V=[l,"pkt-select"].join(" ");return i(de,{className:V,forId:d,label:R,helptext:c,helptextDropdown:f,helptextDropdownButton:u,optionalTag:$,optionalText:I,requiredTag:w,requiredText:E,hasError:s,errorMessage:o,disabled:r,inline:k,ariaDescribedby:e,children:i("select",{ref:j,className:`pkt-input ${_?"pkt-input--fullwidth":""}`,"aria-invalid":s,"aria-errormessage":`${d}-error`,"aria-labelledby":n||`${d}-label`,disabled:r,id:d,name:S||d,...v,children:a})})}),Jn=({isResponsive:e,children:n})=>e?i("div",{className:"pkt-table-container",children:n}):i(X,{children:n}),zn=({isResponsive:e,modifiers:{info:n=!1,success:a=!1,strong:l=!1,shadow:r=!1}={},children:o})=>i(Jn,{isResponsive:e,children:i("table",{className:_t("pkt-table",{"pkt-table--info":n,"pkt-table--success":a,"pkt-table--strong":l,"pkt-table--shadow":r}),children:o})}),qn=({children:e})=>i("td",{className:"pkt-table__th",children:e}),Gn=({children:e})=>i("th",{className:"pkt-table__th",children:e}),we=N.forwardRef(({children:e,className:n,skin:a="blue",textStyle:l="normal-text",size:r="medium",closeTag:o=!1,iconName:s="",type:c="button",ariaLabel:f="close",onClick:u=()=>{}},d)=>{const[k,_]=N.useState(!1),R=w=>{_(!0),u(w)},S=["pkt-tag",r&&`pkt-tag--${r}`,a&&`pkt-tag--${a}`,l&&`pkt-tag--${l}`,n].filter(Boolean).join(" "),$=["pkt-tag","pkt-btn","pkt-btn--tertiary",r&&`pkt-tag--${r}`,a&&`pkt-tag--${a}`,l&&`pkt-tag--${l}`,s&&o?"pkt-btn--icons-right-and-left":null,o&&!s?"pkt-btn--icon-right":null,n].filter(Boolean).join(" "),I=!k;return o&&s?i(X,{children:I&&h("button",{className:$,type:c,"aria-label":f,onClick:R,ref:d,children:[i(C,{className:"pkt-tag__icon",name:s}),e,i(C,{className:"pkt-tag__close-btn",name:"close"})]})}):o?i(X,{children:I&&h("button",{className:$,type:c,"aria-label":f,onClick:R,ref:d,children:[i(C,{className:"pkt-tag__close-btn",name:"close"}),e]})}):s?h("span",{className:S,children:[i(C,{className:"pkt-tag__icon",name:s}),e]}):i("span",{className:S,children:e})});we.displayName="PktTag";const Hn=N.forwardRef(({arrowNav:e=!0,tabs:n,onTabSelected:a},l)=>{const r=N.useRef([]);N.useEffect(()=>{r.current=r.current.slice(0,n.length)},[n]);const o=(c,f)=>{f.action&&f.action(c),a&&a(c)},s=(c,f)=>{var u,d;e&&(f.code==="ArrowLeft"&&c!==0&&((u=r.current[c-1])==null||u.focus()),f.code==="ArrowRight"&&c<n.length-1&&((d=r.current[c+1])==null||d.focus()),(f.code==="ArrowDown"||f.code==="Space")&&o(c,n[c]))};return i("div",{className:"pkt-tabs",ref:l,children:i("div",{className:"pkt-tabs__list",role:e?"tablist":"navigation",children:n.map((c,f)=>i(N.Fragment,{children:c.href?h("a",{"aria-selected":!!c.active,role:e?"tab":void 0,href:c.href,"aria-controls":c.controls,className:`pkt-tabs__link ${c.active?"active":""}`,onKeyUp:u=>s(f,u),onClick:()=>o(f,c),tabIndex:c.active||!e?void 0:-1,ref:u=>{r.current[f]=u},children:[c.icon&&i(C,{name:c.icon,className:"pkt-icon--small"}),c.text,c.tag&&i(we,{skin:c.tag.skin,size:"small",children:c.tag.text})]}):h("button",{"aria-selected":!!c.active,role:e?"tab":void 0,type:"button","aria-controls":c.controls,className:`pkt-tabs__button pkt-link-button ${c.active?"active":""}`,onKeyUp:u=>s(f,u),onClick:()=>o(f,c),tabIndex:c.active||!e?void 0:-1,ref:u=>{r.current[f]=u},children:[c.icon&&i(C,{name:c.icon,className:"pkt-icon--small"}),c.text,c.tag&&i(we,{skin:c.tag.skin,size:"small",children:c.tag.text})]},"b-"+f)},f))})})}),Xn=N.forwardRef(({id:e,ariaDescribedby:n,ariaLabelledby:a,counter:l,counterMaxLength:r,className:o,disabled:s,errorMessage:c,hasError:f,helptext:u,helptextDropdown:d,helptextDropdownButton:k,inline:_,fullwidth:R=!1,label:S,name:$,optionalTag:I=!1,optionalText:w,requiredTag:E=!1,requiredText:v,placeholder:j,rows:V,useWrapper:W=!0,onChange:B,...J},M)=>{const G=[o,"pkt-textinput","pkt-textarea"].join(" "),z=a||`${e}-label`,g=N.useRef(null),[L,K]=N.useState(0),q=ee=>{var te,me;if(l&&K(((me=(te=ee.currentTarget)==null?void 0:te.value)==null?void 0:me.length)||0),B)return B(ee)};return N.useEffect(()=>{var ee,te;typeof M=="function"&&M(g.current),l&&K(((te=(ee=g==null?void 0:g.current)==null?void 0:ee.value)==null?void 0:te.length)||0)},[M]),h(de,{ariaDescribedby:n,className:G,disabled:s,errorMessage:c,forId:e,hasError:f,helptext:u,helptextDropdown:d,helptextDropdownButton:k,inline:_,label:S,optionalTag:I,optionalText:w,requiredTag:E,requiredText:v,useWrapper:W,children:[i("textarea",{ref:g,className:`pkt-input ${R?"pkt-input--fullwidth":""} ${r&&L>r?"pkt-input--counter-error":""}`,name:$||e,id:e,placeholder:j,disabled:s,rows:V,"aria-labelledby":z,"aria-invalid":f,"aria-errormessage":`${e}-error`,...J,onChange:q}),l&&h("div",{className:"pkt-input__counter","aria-live":"polite","aria-atomic":!0,children:[L||0,r&&`/${r}`]})]})}),Zn=N.forwardRef(({id:e,ariaDescribedby:n,ariaLabelledby:a,autocomplete:l="off",className:r,disabled:o=!1,errorMessage:s,hasError:c=!1,helptext:f,helptextDropdown:u,helptextDropdownButton:d,iconNameRight:k,inline:_=!1,fullwidth:R=!1,label:S,name:$,optionalTag:I=!1,optionalText:w,requiredTag:E=!1,requiredText:v,placeholder:j,prefix:V,suffix:W,type:B="text",useWrapper:J=!0,omitSearchIcon:M=!1,value:G,...z},g)=>{const L=[r,"pkt-textinput"].join(" "),K=a||`${e}-label`,q=B==="search"&&!k&&!M;return i(de,{ariaDescribedby:n,className:L,disabled:o,errorMessage:s,forId:e,hasError:c,helptext:f,helptextDropdown:u,helptextDropdownButton:d,inline:_,label:S,optionalTag:I,optionalText:w,requiredTag:E,requiredText:v,useWrapper:J,children:h("div",{className:"pkt-input__container",children:[V&&i("div",{className:"pkt-input-prefix",children:V}),i("input",{ref:g,className:`pkt-input ${R?"pkt-input--fullwidth":""}`,type:B,name:$||e,id:e,placeholder:j,autoComplete:l,value:G,disabled:o,"aria-invalid":c,"aria-errormessage":`${e}-error`,"aria-labelledby":K,...z}),W&&h("p",{className:"pkt-input-suffix",children:[W,k&&i(C,{className:"pkt-input-suffix-icon",name:k}),q&&i(C,{className:"pkt-input-suffix-icon",name:"magnifying-glass-big"})]}),!W&&k&&i(C,{className:"pkt-input-icon",name:k}),!W&&q&&i(C,{className:"pkt-input-icon",name:"magnifying-glass-big"})]})})});O.PktAlert=Qe,O.PktBackLink=Gt,O.PktBreadcrumbs=Un,O.PktButton=le,O.PktCheckbox=kt,O.PktFooter=An,O.PktFooterSimple=Vn,O.PktHeader=Bn,O.PktIcon=C,O.PktIconContext=Ze,O.PktInput=bt,O.PktInputWrapper=de,O.PktLinkCard=gt,O.PktMessagebox=Mn,O.PktRadioButton=Nt,O.PktSearchInput=Yn,O.PktSelect=Kn,O.PktTable=zn,O.PktTableData=qn,O.PktTableHeader=Gn,O.PktTabs=Hn,O.PktTag=we,O.PktTextarea=Xn,O.PktTextinput=Zn,Object.defineProperty(O,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oslokommune/punkt-react",
3
- "version": "11.3.0",
3
+ "version": "11.4.1",
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",
@@ -33,7 +33,7 @@
33
33
  },
34
34
  "devDependencies": {
35
35
  "@oslokommune/punkt-assets": "^11.0.0",
36
- "@oslokommune/punkt-css": "^11.3.0",
36
+ "@oslokommune/punkt-css": "^11.4.1",
37
37
  "@testing-library/jest-dom": "^5.16.5",
38
38
  "@testing-library/react": "^14.0.0",
39
39
  "@testing-library/user-event": "^14.4.3",
@@ -91,5 +91,5 @@
91
91
  "url": "https://github.com/oslokommune/punkt/issues"
92
92
  },
93
93
  "license": "MIT",
94
- "gitHead": "14f97a3b27054b3ef5b50b800e49c039e2b2be23"
94
+ "gitHead": "b413e1c8cd6cff1c930b508a54340e3f719283dc"
95
95
  }
@@ -1,65 +1,72 @@
1
- import '@testing-library/jest-dom/extend-expect';
1
+ import '@testing-library/jest-dom/extend-expect'
2
2
 
3
- import { fireEvent, render, screen } from '@testing-library/react';
3
+ import { fireEvent, render, screen } from '@testing-library/react'
4
4
  import { axe, toHaveNoViolations } from 'jest-axe'
5
5
 
6
- import { PktCheckbox } from './Checkbox';
6
+ import { PktCheckbox } from './Checkbox'
7
7
 
8
8
  expect.extend(toHaveNoViolations)
9
9
 
10
10
  describe('PktCheckbox', () => {
11
11
  // Test case for rendering a basic checkbox
12
12
  it('renders a basic checkbox with label', () => {
13
- const { getByLabelText } = render(<PktCheckbox id="myCheckbox" label="My Checkbox" />);
13
+ const { getByLabelText } = render(<PktCheckbox id="myCheckbox" label="My Checkbox" />)
14
14
 
15
15
  // Check if the label is present in the document
16
- const checkboxLabel = getByLabelText('My Checkbox');
17
- expect(checkboxLabel).toBeInTheDocument();
18
- });
19
-
16
+ const checkboxLabel = getByLabelText('My Checkbox')
17
+ expect(checkboxLabel).toBeInTheDocument()
18
+ })
20
19
 
21
20
  it('renders an error state checkbox', () => {
22
- render(<PktCheckbox id="myCheckbox" label="My Checkbox" hasError />);
23
- const checkbox = screen.getByRole('checkbox', { name: 'My Checkbox' });
21
+ render(<PktCheckbox id="myCheckbox" label="My Checkbox" hasError />)
22
+ const checkbox = screen.getByRole('checkbox', { name: 'My Checkbox' })
24
23
 
25
24
  // Verify that the error class is applied to the checkbox
26
- expect(checkbox).toHaveClass('pkt-input-check__input-checkbox--error');
27
- });
25
+ expect(checkbox).toHaveClass('pkt-input-check__input-checkbox--error')
26
+ })
27
+
28
+ it('renders as Switch', () => {
29
+ render(<PktCheckbox id="myCheckbox" label="My Checkbox" isSwitch />)
30
+ const checkbox = screen.getByRole('switch', { name: 'My Checkbox' })
31
+
32
+ // Verify that the error class is applied to the checkbox
33
+ expect(checkbox).toHaveAttribute('role', 'switch')
34
+ })
28
35
 
29
36
  test('renders a default checked checkbox', () => {
30
37
  const { getByRole } = render(
31
- <PktCheckbox id="myCheckbox" label="My Checkbox" defaultChecked={true} />
32
- );
38
+ <PktCheckbox id="myCheckbox" label="My Checkbox" defaultChecked={true} />,
39
+ )
33
40
  // Find the checkbox element by its "checkbox" role
34
- const checkbox = getByRole('checkbox') as HTMLInputElement;
41
+ const checkbox = getByRole('checkbox') as HTMLInputElement
35
42
  // Verify that the checkbox is initially checked
36
- expect(checkbox).toBeChecked();
37
- });
43
+ expect(checkbox).toBeChecked()
44
+ })
38
45
 
39
46
  test('handles onClick callback', () => {
40
- const onClickMock = jest.fn();
47
+ const onClickMock = jest.fn()
41
48
  const { getByLabelText } = render(
42
- <PktCheckbox id="myCheckbox" label="My Checkbox" onClick={onClickMock} />
43
- );
49
+ <PktCheckbox id="myCheckbox" label="My Checkbox" onClick={onClickMock} />,
50
+ )
44
51
 
45
52
  // Get the checkbox label element
46
- const checkboxLabel = getByLabelText('My Checkbox');
53
+ const checkboxLabel = getByLabelText('My Checkbox')
47
54
 
48
55
  // Simulate a click event on the checkbox label
49
- fireEvent.click(checkboxLabel);
56
+ fireEvent.click(checkboxLabel)
50
57
 
51
58
  // Verify that the onClick callback is called
52
- expect(onClickMock).toHaveBeenCalledTimes(1);
53
- });
54
-
59
+ expect(onClickMock).toHaveBeenCalledTimes(1)
60
+ })
55
61
 
56
62
  describe('accessibility', () => {
57
63
  it('renders with no wcag errors with axe', async () => {
58
- const { container } = render(<PktCheckbox id="accessibilityTest" label="My checkkbox"></PktCheckbox>)
64
+ const { container } = render(
65
+ <PktCheckbox id="accessibilityTest" label="My checkkbox"></PktCheckbox>,
66
+ )
59
67
  const results = await axe(container)
60
68
 
61
69
  expect(results).toHaveNoViolations()
62
70
  })
63
71
  })
64
-
65
72
  })
@@ -1,60 +1,83 @@
1
1
  import React, { ForwardedRef, forwardRef } from 'react'
2
2
 
3
3
  export interface IPktCheckbox extends React.InputHTMLAttributes<HTMLInputElement> {
4
- id: string;
5
- hasTile?: boolean;
6
- disabled?: boolean;
7
- label?: string;
8
- checkHelptext?: string;
9
- hasError?: boolean;
10
- defaultChecked?: boolean;
11
- value?: string;
4
+ id: string
5
+ hasTile?: boolean
6
+ disabled?: boolean
7
+ label?: string
8
+ labelPosition?: 'right' | 'left'
9
+ hideLabel?: boolean
10
+ checkHelptext?: string
11
+ hasError?: boolean
12
+ defaultChecked?: boolean
13
+ isSwitch?: boolean
14
+ value?: string
12
15
  }
13
16
 
14
17
  export const PktCheckbox = forwardRef(
15
- ({
16
- id,
17
- hasTile = false,
18
- disabled = false,
19
- label,
20
- checkHelptext,
21
- hasError = false,
22
- className,
23
- ...props
24
- }: IPktCheckbox,
18
+ (
19
+ {
20
+ id,
21
+ hasTile = false,
22
+ disabled = false,
23
+ label,
24
+ labelPosition = 'right',
25
+ hideLabel = false,
26
+ checkHelptext,
27
+ hasError = false,
28
+ isSwitch = false,
29
+ className,
30
+ ...props
31
+ }: IPktCheckbox,
25
32
  ref: ForwardedRef<HTMLInputElement>,
26
33
  ): React.ReactElement => {
27
-
28
34
  // Define the classes
29
- const classes = [
30
- className,
31
- 'pkt-input-check',
32
- ].filter(Boolean)
33
- .join(' ')
35
+ const classes = [className, 'pkt-input-check'].filter(Boolean).join(' ')
34
36
 
35
37
  return (
36
38
  <div className={classes}>
37
- <div className={`pkt-input-check__input ${hasTile ? 'pkt-input-check__input--tile' : ''} ${disabled && hasTile ? 'pkt-input-check__input--tile-disabled' : ''}`}>
39
+ <div
40
+ className={`pkt-input-check__input ${hasTile ? 'pkt-input-check__input--tile' : ''} ${
41
+ disabled && hasTile ? 'pkt-input-check__input--tile-disabled' : ''
42
+ }`}
43
+ >
44
+ {label && labelPosition === 'left' && (
45
+ <label
46
+ className={`pkt-input-check__input-label ${hideLabel ? 'pkt-sr-only' : ''}`}
47
+ htmlFor={id}
48
+ >
49
+ {label}
50
+ {checkHelptext && (
51
+ <div className="pkt-input-check__input-helptext">{checkHelptext}</div>
52
+ )}
53
+ </label>
54
+ )}
38
55
  <input
39
56
  ref={ref}
40
- className={`pkt-input-check__input-checkbox ${hasError ? 'pkt-input-check__input-checkbox--error' : ''}`}
57
+ className={`pkt-input-check__input-checkbox ${
58
+ hasError ? 'pkt-input-check__input-checkbox--error' : ''
59
+ }`}
41
60
  type="checkbox"
61
+ role={isSwitch ? 'switch' : 'checkbox'}
42
62
  id={id}
43
63
  disabled={disabled}
44
64
  {...props}
45
65
  />
46
- <label className="pkt-input-check__input-label" htmlFor={id}>
47
- {label}
48
- {checkHelptext && (
49
- <div className="pkt-input-check__input-helptext">
50
- {checkHelptext}
51
- </div>
52
- )}
53
- </label>
66
+ {label && labelPosition === 'right' && (
67
+ <label
68
+ className={`pkt-input-check__input-label ${hideLabel ? 'pkt-sr-only' : ''}`}
69
+ htmlFor={id}
70
+ >
71
+ {label}
72
+ {checkHelptext && (
73
+ <div className="pkt-input-check__input-helptext">{checkHelptext}</div>
74
+ )}
75
+ </label>
76
+ )}
54
77
  </div>
55
78
  </div>
56
- );
79
+ )
57
80
  },
58
- );
81
+ )
59
82
 
60
83
  PktCheckbox.displayName = 'PktCheckbox'