@kartverket/geonorge-web-components
Advanced tools
Comparing version 2.20.0 to 2.20.2
@@ -1,2 +0,2 @@ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.geonorge=e():(t.geonorge=t.geonorge||{},t.geonorge.GnIcon=e())}(self,(()=>(()=>{var t={1986:(t,e,o)=>{"use strict";o.r(e),o.d(e,{default:()=>c});var n=o(4663),s=o.n(n),r=o(7638),i=o.n(r)()(s());i.push([t.id,":host{display:inline-block}#icon{display:block}","",{version:3,sources:["webpack://./stories/gn-icon/template.scss"],names:[],mappings:"AAAA,MACI,oBAAA,CAGJ,MACI,aAAA",sourcesContent:[":host {\n display: inline-block;\n}\n\n#icon {\n display: block;\n}\n"],sourceRoot:""}]);const c=i},2117:(t,e,o)=>{"use strict";o.r(e),o.d(e,{default:()=>n});const n='<template>\n <span id="icon"> </span>\n</template>\n'},7638:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var o="",n=void 0!==e[5];return e[4]&&(o+="@supports (".concat(e[4],") {")),e[2]&&(o+="@media ".concat(e[2]," {")),n&&(o+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),o+=t(e),n&&(o+="}"),e[2]&&(o+="}"),e[4]&&(o+="}"),o})).join("")},e.i=function(t,o,n,s,r){"string"==typeof t&&(t=[[null,t,void 0]]);var i={};if(n)for(var c=0;c<this.length;c++){var l=this[c][0];null!=l&&(i[l]=!0)}for(var a=0;a<t.length;a++){var u=[].concat(t[a]);n&&i[u[0]]||(void 0!==r&&(void 0===u[5]||(u[1]="@layer".concat(u[5].length>0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=r),o&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=o):u[2]=o),s&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=s):u[4]="".concat(s)),e.push(u))}},e}},4663:t=>{"use strict";t.exports=function(t){var e=t[1],o=t[3];if(!o)return e;if("function"==typeof btoa){var n=btoa(unescape(encodeURIComponent(JSON.stringify(o)))),s="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(n),r="/*# ".concat(s," */");return[e].concat([r]).join("\n")}return[e].join("\n")}},1397:function(t,e,o){"use strict";var n=this&&this.__awaiter||function(t,e,o,n){return new(o||(o=Promise))((function(s,r){function i(t){try{l(n.next(t))}catch(t){r(t)}}function c(t){try{l(n.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?s(t.value):(e=t.value,e instanceof o?e:new o((function(t){t(e)}))).then(i,c)}l((n=n.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.Component=void 0;const s=o(5969),r=o(5773),i=o(3804);e.Component=t=>e=>{var o;const c=t.tag||i.toKebabCase(e.prototype.constructor.name),l=((o=class extends e{constructor(){super(),this.props={},this.showShadowRoot=null==t.shadow||t.shadow,!this.shadowRoot&&this.showShadowRoot&&this.attachShadow({mode:"open"})}static get observedAttributes(){return Object.keys(this.propsInit||{}).map((t=>i.toKebabCase(t)))}attributeChangedCallback(t,e,o){this.onAttributeChange(t,e,o)}onAttributeChange(t,e,o,n=!0){if(e!=o){n&&(this[i.toCamelCase(t)]=o);const s=this.constructor.watchAttributes;if(s&&s[t]){const n=s[t];this.__connected&&"function"==typeof this[n]&&this[n]({old:e,new:o})}}}connectedCallback(){const t=Object.create(null,{connectedCallback:{get:()=>super.connectedCallback}});return n(this,void 0,void 0,(function*(){yield this.render(),t.connectedCallback&&t.connectedCallback.call(this),this.__connected=!0,s.addEventListeners(this),r.initializeProps(this)}))}render(){return n(this,void 0,void 0,(function*(){if(this.__connected)return;const e=document.createElement("template");e.innerHTML=yield this.getStyle(),t.template instanceof Promise?e.content.appendChild(yield this.getExternalTemplate()):"string"==typeof t.template&&(e.innerHTML+=t.template),(this.showShadowRoot?this.shadowRoot:this).appendChild(e.content.cloneNode(!0))}))}getExternalTemplate(){return n(this,void 0,void 0,(function*(){const e=(yield t.template).default.toString(),o=document.createRange().createContextualFragment(e);return 1===o.children.length&&"TEMPLATE"===o.children[0].nodeName?o.firstChild.content:o}))}getStyle(){return n(this,void 0,void 0,(function*(){let e;return t.style instanceof Promise?e=(yield t.style).default.toString():"string"==typeof t.style&&(e=t.style),e?`<style>${e}</style>`:""}))}}).__connected=!1,o.ready=new Promise(((t,e)=>t(!0))),o);return customElements.get(c)||customElements.define(c,l),l}},985:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CustomElement=void 0;class o extends HTMLElement{constructor(){super()}connect(t){this.isConnected||document.querySelector(t).appendChild(this)}}e.CustomElement=o},265:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getShadowRootElement=e.getElement=void 0,e.getElement=t=>document.querySelector(t),e.getShadowRootElement=(t,e)=>t.shadowRoot.querySelector(e)},406:function(t,e,o){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,o,n){void 0===n&&(n=o),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[o]}})}:function(t,e,o,n){void 0===n&&(n=o),t[n]=e[o]}),s=this&&this.__exportStar||function(t,e){for(var o in t)"default"===o||Object.prototype.hasOwnProperty.call(e,o)||n(e,t,o)};Object.defineProperty(e,"__esModule",{value:!0}),s(o(1397),e),s(o(985),e),s(o(265),e),s(o(5969),e),s(o(5773),e),s(o(4271),e),s(o(9766),e),s(o(4938),e)},5969:(t,e,o)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Dispatch=e.addEventListeners=e.Listen=void 0;const n=o(3804);e.Listen=(t,e)=>(o,n)=>{o.constructor.listeners||(o.constructor.listeners=[]),o.constructor.listeners.push({selector:e,eventName:t,handler:o[n]})},e.addEventListeners=t=>{if(t.constructor.listeners){const e=t.shadowRoot||t;for(const o of t.constructor.listeners){const n=o.selector?e.querySelector(o.selector)?e.querySelector(o.selector):null:t;n&&n.addEventListener(o.eventName,(e=>{o.handler.call(t,e)}))}}},e.Dispatch=t=>(e,o)=>{Object.defineProperty(e,o,{get:function(){const e=this;return{emit(s){const r=t||n.toDotCase(o);e.dispatchEvent(new CustomEvent(r,s))}}}})}},5773:(t,e,o)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.initializeProps=e.Prop=void 0;const n=o(3804);e.Prop=()=>(t,e)=>{const o=n.toKebabCase(e);t.constructor.propsInit||(t.constructor.propsInit={}),t.constructor.propsInit[e]=null,Object.defineProperty(t,e,{get:function(){return this.props[e]?this.props[e]:this.getAttribute(o)},set:function(t){if(this.__connected){const s=this.props[e];this.props[e]=n.tryParseInt(t),"object"!=typeof t?this.setAttribute(o,t):this.onAttributeChange(o,s,t,!1)}else this.hasAttribute(n.toKebabCase(e))||(this.constructor.propsInit[e]=t)}})},e.initializeProps=t=>{const e=t.constructor.watchAttributes;for(let o of(t=>{const e=t.constructor.watchAttributes,o=Object.assign({},e);Object.keys(o).forEach((t=>o[t]=""));const n=Object.assign(Object.assign({},o),t.constructor.propsInit);return Object.keys(n)})(t)){if(e)if(null==e[n.toKebabCase(o)])e[n.toKebabCase(o)]="";else{const s=t.props[o]||t.getAttribute(n.toKebabCase(o));"function"==typeof t[e[o]]&&t[e[o]]({new:s})}t.constructor.propsInit[o]&&(t.hasAttribute(n.toKebabCase(o))||(t[o]=t.constructor.propsInit[o]))}}},4271:(t,e,o)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Toggle=void 0;const n=o(3804);e.Toggle=()=>(t,e)=>{t.constructor.propsInit||(t.constructor.propsInit={}),t.constructor.propsInit[e]=null,Object.defineProperty(t,e,{get:function(){return(t=>{if(this.hasAttribute(t)){const e=this.getAttribute(t);return!!/^(true|false|^$)$/.test(e)&&("true"==e||""==e)}return!1})(e)},set:function(t){const o=t;if(null!=t)switch(typeof t){case"boolean":break;case"string":/^(true|false|^$)$/.test(t)?t="true"==o||""==o:(console.warn(`TypeError: Cannot set boolean toggle property '${e}' to '${t}'`),t=!1);break;default:throw`TypeError: Cannot set boolean toggle property '${e}' to '${t}'`}this.__connected?(this.props[e]=t||!1,""!==o&&null!==o?this.setAttribute(e,t):t?this.setAttribute(e,""):this.removeAttribute(e)):this.hasAttribute(n.toKebabCase(e))||(this.constructor.propsInit[e]=t)}})}},9766:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},3804:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.tryParseInt=e.toDotCase=e.toCamelCase=e.toKebabCase=void 0,e.toKebabCase=t=>t.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),e.toCamelCase=t=>t.toLowerCase().replace(/(\-\w)/g,(t=>t[1].toUpperCase())),e.toDotCase=t=>t.replace(/(?!^)([A-Z])/g," $1").replace(/[_\s]+(?=[a-zA-Z])/g,".").toLowerCase(),e.tryParseInt=t=>parseInt(t)==t&&NaN!==parseFloat(t)?parseInt(t):t},4938:(t,e,o)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Watch=void 0;const n=o(3804);e.Watch=t=>(e,o)=>{e.constructor.watchAttributes||(e.constructor.watchAttributes={}),e.constructor.watchAttributes[n.toKebabCase(t)]=o,e.constructor.propsInit||(e.constructor.propsInit={}),e.constructor.propsInit[t]=null}},9998:t=>{t.exports='<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 18 18" style="enable-background:new 0 0 18 18;" xml:space="preserve"><style type="text/css"> .__Pci0kwJ__st0{fill:#ff4a2e;stroke:#333333;stroke-miterlimit:10;} .__Pci0kwJ__st1{fill:#333333;} .__Pci0kwJ__st2{fill:none;stroke:#FFFFFF;stroke-miterlimit:10;} .__Pci0kwJ__st3{fill:none;stroke:#333333;stroke-miterlimit:10;} </style><circle class="__Pci0kwJ__st0 " cx="9" cy="9" r="8.5"></circle><circle class="__Pci0kwJ__st1 " cx="6" cy="6" r="1.5"></circle><circle class="__Pci0kwJ__st1 " cx="12" cy="6" r="1.5"></circle><path class="__Pci0kwJ__st2 " d="M8.8,14.4"></path><path class="__Pci0kwJ__st3 " d="M8.9,11c2,0,3.8,0.9,4.6,2 M8.9,11c-2,0-3.6,0.9-4.4,2"></path></svg>'},6844:t=>{t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18"><circle cx="9" cy="9" r="8.5" fill="#8fff33" stroke="#333"></circle><g fill="#333"><circle cx="6" cy="6" r="1.5"></circle><circle cx="12" cy="6" r="1.5"></circle></g><g stroke="#333" stroke-miterlimit="10"><path d="M9.1 14.915c-2 0-4.584-1.86-4.6-4.086m4.6 4.086c2 0 4.408-2.129 4.4-4.111" fill="none" stroke-width="1.399"></path><path d="M9.622 11.403l-4.546.003m.989-.025l6.855.049" fill="url(#C)" stroke-width="1.22"></path></g><g fill="#333"><path d="M5.224 11.744h7.391v1.869H5.224zm1.338 2.379h3.844v.467H6.562z"></path><path d="M6.775 13.571h4.226v.743H6.775z"></path></g><path d="M3.738 8.792h11.001v2.081H3.738z" fill="#8fff33"></path></svg>'},4572:t=>{t.exports='<svg viewBox="0 0 18 18" style="enable-background:new 0 0 18 18;" xmlns="http://www.w3.org/2000/svg"><defs><style type="text/css"> .__2A8fAMn__st0{fill:#ffEb3b;stroke:#333333;stroke-miterlimit:10;} .__2A8fAMn__st1{fill:#333333;} .__2A8fAMn__st2{fill:none;stroke:#FFFFFF;stroke-miterlimit:10;} .__2A8fAMn__st3{fill:none;stroke:#333333;stroke-miterlimit:10;} </style></defs><circle class="__2A8fAMn__st0 " cx="9" cy="9" r="8.5"></circle><circle class="__2A8fAMn__st1 " cx="6" cy="6" r="1.5"></circle><circle class="__2A8fAMn__st1 " cx="12" cy="6" r="1.5"></circle><path class="__2A8fAMn__st2 " d="M8.8,14.4"></path><path class="__2A8fAMn__st3 " d="M9.1,13c-2,0-3.8-0.9-4.6-2 M9.1,13c2,0,3.6-0.9,4.4-2"></path></svg>'},4871:t=>{t.exports='<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 18 18" style="enable-background:new 0 0 18 18;" xml:space="preserve"><style type="text/css"> .__3phJTh6__st0{fill:#ffEb3b;stroke:#333333;stroke-miterlimit:10;} .__3phJTh6__st1{fill:#333333;} .__3phJTh6__st2{fill:none;stroke:#FFFFFF;stroke-miterlimit:10;} .__3phJTh6__st3{fill:none;stroke:#333333;stroke-miterlimit:10;} </style><circle class="__3phJTh6__st0 " cx="9" cy="9" r="8.5"></circle><circle class="__3phJTh6__st1 " cx="6" cy="6" r="1.5"></circle><circle class="__3phJTh6__st1 " cx="12" cy="6" r="1.5"></circle><path class="__3phJTh6__st2 " d="M8.8,14.4"></path><line class="__3phJTh6__st3 " x1="4.5" y1="12" x2="13.5" y2="12"></line></svg>'},9081:function(t,e,o){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,o,n){void 0===n&&(n=o);var s=Object.getOwnPropertyDescriptor(e,o);s&&!("get"in s?!e.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return e[o]}}),Object.defineProperty(t,n,s)}:function(t,e,o,n){void 0===n&&(n=o),t[n]=e[o]}),s=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),r=this&&this.__decorate||function(t,e,o,n){var s,r=arguments.length,i=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(t,e,o,n);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(i=(r<3?s(i):r>3?s(e,o,i):s(e,o))||i);return r>3&&i&&Object.defineProperty(e,o,i),i},i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var o in t)"default"!==o&&Object.prototype.hasOwnProperty.call(t,o)&&n(e,t,o);return s(e,t),e},c=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.GnIcon=void 0;const l=o(406),a=c(o(9998)),u=c(o(6844)),p=c(o(4572)),h=c(o(4871));let d=class extends l.CustomElement{constructor(){super()}setup(t){this.connect(t.container),t.id&&(this.id=t.id)}getGeonorgeIcon(t){switch(t){case"status-deficient":return a.default;case"status-good":return u.default;case"status-satisfactory":return p.default;case"status-useable":return h.default;default:return null}}renderIcon(t){this.iconElement=(0,l.getShadowRootElement)(this,"#icon"),this.iconElement.innerHTML=this.getGeonorgeIcon(t)}setIconWidth(t){this.iconElement=(0,l.getShadowRootElement)(this,"#icon"),this.iconElement.style.width=(null==t?void 0:t.length)?t:"1em"}setIconHeight(t){this.iconElement=(0,l.getShadowRootElement)(this,"#icon"),this.iconElement.style.height=(null==t?void 0:t.length)?t:"1em"}connectedCallback(){this.renderIcon(this.icon),this.setIconWidth(this.width),this.setIconHeight(this.height)}iconChanged(){this.icon&&this.renderIcon(this.icon)}widthChanged(){this.setIconWidth(this.width)}heightChanged(){this.setIconHeight(this.height)}static setup(t,e){}};d.elementSelector="gn-icon",r([(0,l.Prop)()],d.prototype,"id",void 0),r([(0,l.Prop)()],d.prototype,"icon",void 0),r([(0,l.Prop)()],d.prototype,"width",void 0),r([(0,l.Prop)()],d.prototype,"height",void 0),r([(0,l.Watch)("icon")],d.prototype,"iconChanged",null),r([(0,l.Watch)("width")],d.prototype,"widthChanged",null),r([(0,l.Watch)("height")],d.prototype,"heightChanged",null),d=r([(0,l.Component)({tag:"gn-icon",template:Promise.resolve().then((()=>i(o(2117)))),style:Promise.resolve().then((()=>i(o(1986))))})],d),e.GnIcon=d}},e={};function o(n){var s=e[n];if(void 0!==s)return s.exports;var r=e[n]={id:n,exports:{}};return t[n].call(r.exports,r,r.exports,o),r.exports}return o.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return o.d(e,{a:e}),e},o.d=(t,e)=>{for(var n in e)o.o(e,n)&&!o.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),o.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o(9081)})())); | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.geonorge=e():(t.geonorge=t.geonorge||{},t.geonorge.GnIcon=e())}(self,(()=>(()=>{var t={9173:(t,e,o)=>{"use strict";o.r(e),o.d(e,{default:()=>c});var n=o(5052),s=o.n(n),r=o(164),i=o.n(r)()(s());i.push([t.id,":host{display:inline-block}#icon{display:block}","",{version:3,sources:["webpack://./stories/gn-icon/template.scss"],names:[],mappings:"AAAA,MACI,oBAAA,CAGJ,MACI,aAAA",sourcesContent:[":host {\n display: inline-block;\n}\n\n#icon {\n display: block;\n}\n"],sourceRoot:""}]);const c=i},1322:(t,e,o)=>{"use strict";o.r(e),o.d(e,{default:()=>n});const n='<template>\n <span id="icon"> </span>\n</template>\n'},164:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var o="",n=void 0!==e[5];return e[4]&&(o+="@supports (".concat(e[4],") {")),e[2]&&(o+="@media ".concat(e[2]," {")),n&&(o+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),o+=t(e),n&&(o+="}"),e[2]&&(o+="}"),e[4]&&(o+="}"),o})).join("")},e.i=function(t,o,n,s,r){"string"==typeof t&&(t=[[null,t,void 0]]);var i={};if(n)for(var c=0;c<this.length;c++){var l=this[c][0];null!=l&&(i[l]=!0)}for(var a=0;a<t.length;a++){var u=[].concat(t[a]);n&&i[u[0]]||(void 0!==r&&(void 0===u[5]||(u[1]="@layer".concat(u[5].length>0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=r),o&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=o):u[2]=o),s&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=s):u[4]="".concat(s)),e.push(u))}},e}},5052:t=>{"use strict";t.exports=function(t){var e=t[1],o=t[3];if(!o)return e;if("function"==typeof btoa){var n=btoa(unescape(encodeURIComponent(JSON.stringify(o)))),s="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(n),r="/*# ".concat(s," */");return[e].concat([r]).join("\n")}return[e].join("\n")}},8631:function(t,e,o){"use strict";var n=this&&this.__awaiter||function(t,e,o,n){return new(o||(o=Promise))((function(s,r){function i(t){try{l(n.next(t))}catch(t){r(t)}}function c(t){try{l(n.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?s(t.value):(e=t.value,e instanceof o?e:new o((function(t){t(e)}))).then(i,c)}l((n=n.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.Component=void 0;const s=o(169),r=o(6999),i=o(2466);e.Component=t=>e=>{var o;const c=t.tag||i.toKebabCase(e.prototype.constructor.name),l=((o=class extends e{constructor(){super(),this.props={},this.showShadowRoot=null==t.shadow||t.shadow,!this.shadowRoot&&this.showShadowRoot&&this.attachShadow({mode:"open"})}static get observedAttributes(){return Object.keys(this.propsInit||{}).map((t=>i.toKebabCase(t)))}attributeChangedCallback(t,e,o){this.onAttributeChange(t,e,o)}onAttributeChange(t,e,o,n=!0){if(e!=o){n&&(this[i.toCamelCase(t)]=o);const s=this.constructor.watchAttributes;if(s&&s[t]){const n=s[t];this.__connected&&"function"==typeof this[n]&&this[n]({old:e,new:o})}}}connectedCallback(){const t=Object.create(null,{connectedCallback:{get:()=>super.connectedCallback}});return n(this,void 0,void 0,(function*(){yield this.render(),t.connectedCallback&&t.connectedCallback.call(this),this.__connected=!0,s.addEventListeners(this),r.initializeProps(this)}))}render(){return n(this,void 0,void 0,(function*(){if(this.__connected)return;const e=document.createElement("template");e.innerHTML=yield this.getStyle(),t.template instanceof Promise?e.content.appendChild(yield this.getExternalTemplate()):"string"==typeof t.template&&(e.innerHTML+=t.template),(this.showShadowRoot?this.shadowRoot:this).appendChild(e.content.cloneNode(!0))}))}getExternalTemplate(){return n(this,void 0,void 0,(function*(){const e=(yield t.template).default.toString(),o=document.createRange().createContextualFragment(e);return 1===o.children.length&&"TEMPLATE"===o.children[0].nodeName?o.firstChild.content:o}))}getStyle(){return n(this,void 0,void 0,(function*(){let e;return t.style instanceof Promise?e=(yield t.style).default.toString():"string"==typeof t.style&&(e=t.style),e?`<style>${e}</style>`:""}))}}).__connected=!1,o.ready=new Promise(((t,e)=>t(!0))),o);return customElements.get(c)||customElements.define(c,l),l}},3704:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CustomElement=void 0;class o extends HTMLElement{constructor(){super()}connect(t){this.isConnected||document.querySelector(t).appendChild(this)}}e.CustomElement=o},3365:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getShadowRootElement=e.getElement=void 0,e.getElement=t=>document.querySelector(t),e.getShadowRootElement=(t,e)=>t.shadowRoot.querySelector(e)},3128:function(t,e,o){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,o,n){void 0===n&&(n=o),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[o]}})}:function(t,e,o,n){void 0===n&&(n=o),t[n]=e[o]}),s=this&&this.__exportStar||function(t,e){for(var o in t)"default"===o||Object.prototype.hasOwnProperty.call(e,o)||n(e,t,o)};Object.defineProperty(e,"__esModule",{value:!0}),s(o(8631),e),s(o(3704),e),s(o(3365),e),s(o(169),e),s(o(6999),e),s(o(3982),e),s(o(8861),e),s(o(1063),e)},169:(t,e,o)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Dispatch=e.addEventListeners=e.Listen=void 0;const n=o(2466);e.Listen=(t,e)=>(o,n)=>{o.constructor.listeners||(o.constructor.listeners=[]),o.constructor.listeners.push({selector:e,eventName:t,handler:o[n]})},e.addEventListeners=t=>{if(t.constructor.listeners){const e=t.shadowRoot||t;for(const o of t.constructor.listeners){const n=o.selector?e.querySelector(o.selector)?e.querySelector(o.selector):null:t;n&&n.addEventListener(o.eventName,(e=>{o.handler.call(t,e)}))}}},e.Dispatch=t=>(e,o)=>{Object.defineProperty(e,o,{get:function(){const e=this;return{emit(s){const r=t||n.toDotCase(o);e.dispatchEvent(new CustomEvent(r,s))}}}})}},6999:(t,e,o)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.initializeProps=e.Prop=void 0;const n=o(2466);e.Prop=()=>(t,e)=>{const o=n.toKebabCase(e);t.constructor.propsInit||(t.constructor.propsInit={}),t.constructor.propsInit[e]=null,Object.defineProperty(t,e,{get:function(){return this.props[e]?this.props[e]:this.getAttribute(o)},set:function(t){if(this.__connected){const s=this.props[e];this.props[e]=n.tryParseInt(t),"object"!=typeof t?this.setAttribute(o,t):this.onAttributeChange(o,s,t,!1)}else this.hasAttribute(n.toKebabCase(e))||(this.constructor.propsInit[e]=t)}})},e.initializeProps=t=>{const e=t.constructor.watchAttributes;for(let o of(t=>{const e=t.constructor.watchAttributes,o=Object.assign({},e);Object.keys(o).forEach((t=>o[t]=""));const n=Object.assign(Object.assign({},o),t.constructor.propsInit);return Object.keys(n)})(t)){if(e)if(null==e[n.toKebabCase(o)])e[n.toKebabCase(o)]="";else{const s=t.props[o]||t.getAttribute(n.toKebabCase(o));"function"==typeof t[e[o]]&&t[e[o]]({new:s})}t.constructor.propsInit[o]&&(t.hasAttribute(n.toKebabCase(o))||(t[o]=t.constructor.propsInit[o]))}}},3982:(t,e,o)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Toggle=void 0;const n=o(2466);e.Toggle=()=>(t,e)=>{t.constructor.propsInit||(t.constructor.propsInit={}),t.constructor.propsInit[e]=null,Object.defineProperty(t,e,{get:function(){return(t=>{if(this.hasAttribute(t)){const e=this.getAttribute(t);return!!/^(true|false|^$)$/.test(e)&&("true"==e||""==e)}return!1})(e)},set:function(t){const o=t;if(null!=t)switch(typeof t){case"boolean":break;case"string":/^(true|false|^$)$/.test(t)?t="true"==o||""==o:(console.warn(`TypeError: Cannot set boolean toggle property '${e}' to '${t}'`),t=!1);break;default:throw`TypeError: Cannot set boolean toggle property '${e}' to '${t}'`}this.__connected?(this.props[e]=t||!1,""!==o&&null!==o?this.setAttribute(e,t):t?this.setAttribute(e,""):this.removeAttribute(e)):this.hasAttribute(n.toKebabCase(e))||(this.constructor.propsInit[e]=t)}})}},8861:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},2466:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.tryParseInt=e.toDotCase=e.toCamelCase=e.toKebabCase=void 0,e.toKebabCase=t=>t.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),e.toCamelCase=t=>t.toLowerCase().replace(/(\-\w)/g,(t=>t[1].toUpperCase())),e.toDotCase=t=>t.replace(/(?!^)([A-Z])/g," $1").replace(/[_\s]+(?=[a-zA-Z])/g,".").toLowerCase(),e.tryParseInt=t=>parseInt(t)==t&&NaN!==parseFloat(t)?parseInt(t):t},1063:(t,e,o)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Watch=void 0;const n=o(2466);e.Watch=t=>(e,o)=>{e.constructor.watchAttributes||(e.constructor.watchAttributes={}),e.constructor.watchAttributes[n.toKebabCase(t)]=o,e.constructor.propsInit||(e.constructor.propsInit={}),e.constructor.propsInit[t]=null}},1268:t=>{t.exports='<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 18 18" style="enable-background:new 0 0 18 18;" xml:space="preserve"><style type="text/css"> .__Pci0kwJ__st0{fill:#ff4a2e;stroke:#333333;stroke-miterlimit:10;} .__Pci0kwJ__st1{fill:#333333;} .__Pci0kwJ__st2{fill:none;stroke:#FFFFFF;stroke-miterlimit:10;} .__Pci0kwJ__st3{fill:none;stroke:#333333;stroke-miterlimit:10;} </style><circle class="__Pci0kwJ__st0 " cx="9" cy="9" r="8.5"></circle><circle class="__Pci0kwJ__st1 " cx="6" cy="6" r="1.5"></circle><circle class="__Pci0kwJ__st1 " cx="12" cy="6" r="1.5"></circle><path class="__Pci0kwJ__st2 " d="M8.8,14.4"></path><path class="__Pci0kwJ__st3 " d="M8.9,11c2,0,3.8,0.9,4.6,2 M8.9,11c-2,0-3.6,0.9-4.4,2"></path></svg>'},248:t=>{t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18"><circle cx="9" cy="9" r="8.5" fill="#8fff33" stroke="#333"></circle><g fill="#333"><circle cx="6" cy="6" r="1.5"></circle><circle cx="12" cy="6" r="1.5"></circle></g><g stroke="#333" stroke-miterlimit="10"><path d="M9.1 14.915c-2 0-4.584-1.86-4.6-4.086m4.6 4.086c2 0 4.408-2.129 4.4-4.111" fill="none" stroke-width="1.399"></path><path d="M9.622 11.403l-4.546.003m.989-.025l6.855.049" fill="url(#C)" stroke-width="1.22"></path></g><g fill="#333"><path d="M5.224 11.744h7.391v1.869H5.224zm1.338 2.379h3.844v.467H6.562z"></path><path d="M6.775 13.571h4.226v.743H6.775z"></path></g><path d="M3.738 8.792h11.001v2.081H3.738z" fill="#8fff33"></path></svg>'},1941:t=>{t.exports='<svg viewBox="0 0 18 18" style="enable-background:new 0 0 18 18;" xmlns="http://www.w3.org/2000/svg"><defs><style type="text/css"> .__2A8fAMn__st0{fill:#ffEb3b;stroke:#333333;stroke-miterlimit:10;} .__2A8fAMn__st1{fill:#333333;} .__2A8fAMn__st2{fill:none;stroke:#FFFFFF;stroke-miterlimit:10;} .__2A8fAMn__st3{fill:none;stroke:#333333;stroke-miterlimit:10;} </style></defs><circle class="__2A8fAMn__st0 " cx="9" cy="9" r="8.5"></circle><circle class="__2A8fAMn__st1 " cx="6" cy="6" r="1.5"></circle><circle class="__2A8fAMn__st1 " cx="12" cy="6" r="1.5"></circle><path class="__2A8fAMn__st2 " d="M8.8,14.4"></path><path class="__2A8fAMn__st3 " d="M9.1,13c-2,0-3.8-0.9-4.6-2 M9.1,13c2,0,3.6-0.9,4.4-2"></path></svg>'},3100:t=>{t.exports='<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 18 18" style="enable-background:new 0 0 18 18;" xml:space="preserve"><style type="text/css"> .__3phJTh6__st0{fill:#ffEb3b;stroke:#333333;stroke-miterlimit:10;} .__3phJTh6__st1{fill:#333333;} .__3phJTh6__st2{fill:none;stroke:#FFFFFF;stroke-miterlimit:10;} .__3phJTh6__st3{fill:none;stroke:#333333;stroke-miterlimit:10;} </style><circle class="__3phJTh6__st0 " cx="9" cy="9" r="8.5"></circle><circle class="__3phJTh6__st1 " cx="6" cy="6" r="1.5"></circle><circle class="__3phJTh6__st1 " cx="12" cy="6" r="1.5"></circle><path class="__3phJTh6__st2 " d="M8.8,14.4"></path><line class="__3phJTh6__st3 " x1="4.5" y1="12" x2="13.5" y2="12"></line></svg>'},2148:function(t,e,o){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,o,n){void 0===n&&(n=o);var s=Object.getOwnPropertyDescriptor(e,o);s&&!("get"in s?!e.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return e[o]}}),Object.defineProperty(t,n,s)}:function(t,e,o,n){void 0===n&&(n=o),t[n]=e[o]}),s=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),r=this&&this.__decorate||function(t,e,o,n){var s,r=arguments.length,i=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(t,e,o,n);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(i=(r<3?s(i):r>3?s(e,o,i):s(e,o))||i);return r>3&&i&&Object.defineProperty(e,o,i),i},i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var o in t)"default"!==o&&Object.prototype.hasOwnProperty.call(t,o)&&n(e,t,o);return s(e,t),e},c=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.GnIcon=void 0;const l=o(3128),a=c(o(1268)),u=c(o(248)),p=c(o(1941)),h=c(o(3100));let d=class extends l.CustomElement{constructor(){super()}setup(t){this.connect(t.container),t.id&&(this.id=t.id)}getGeonorgeIcon(t){switch(t){case"status-deficient":return a.default;case"status-good":return u.default;case"status-satisfactory":return p.default;case"status-useable":return h.default;default:return null}}renderIcon(t){this.iconElement=(0,l.getShadowRootElement)(this,"#icon"),this.iconElement.innerHTML=this.getGeonorgeIcon(t)}setIconWidth(t){this.iconElement=(0,l.getShadowRootElement)(this,"#icon"),this.iconElement.style.width=(null==t?void 0:t.length)?t:"1em"}setIconHeight(t){this.iconElement=(0,l.getShadowRootElement)(this,"#icon"),this.iconElement.style.height=(null==t?void 0:t.length)?t:"1em"}connectedCallback(){this.renderIcon(this.icon),this.setIconWidth(this.width),this.setIconHeight(this.height)}iconChanged(){this.icon&&this.renderIcon(this.icon)}widthChanged(){this.setIconWidth(this.width)}heightChanged(){this.setIconHeight(this.height)}static setup(t,e){}};d.elementSelector="gn-icon",r([(0,l.Prop)()],d.prototype,"id",void 0),r([(0,l.Prop)()],d.prototype,"icon",void 0),r([(0,l.Prop)()],d.prototype,"width",void 0),r([(0,l.Prop)()],d.prototype,"height",void 0),r([(0,l.Watch)("icon")],d.prototype,"iconChanged",null),r([(0,l.Watch)("width")],d.prototype,"widthChanged",null),r([(0,l.Watch)("height")],d.prototype,"heightChanged",null),d=r([(0,l.Component)({tag:"gn-icon",template:Promise.resolve().then((()=>i(o(1322)))),style:Promise.resolve().then((()=>i(o(9173))))})],d),e.GnIcon=d}},e={};function o(n){var s=e[n];if(void 0!==s)return s.exports;var r=e[n]={id:n,exports:{}};return t[n].call(r.exports,r,r.exports,o),r.exports}return o.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return o.d(e,{a:e}),e},o.d=(t,e)=>{for(var n in e)o.o(e,n)&&!o.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),o.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o(2148)})())); | ||
//# sourceMappingURL=GnIcon.js.map |
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.geonorge=t():(e.geonorge=e.geonorge||{},e.geonorge.MainSearchField=t())}(self,(()=>(()=>{var e={9915:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>a});var r=n(4663),s=n.n(r),o=n(7638),i=n.n(o)()(s());i.push([e.id,'*{box-sizing:border-box}div.main-search-field{font-family:"Open Sans",sans-serif;display:flex;height:37px;margin-top:.25em;position:relative;width:100%}@media(min-width: 37.5em){div.main-search-field{margin-top:0}}div.main-search-field .mainSearchLabel{width:0;height:0;overflow:hidden;opacity:0}div.main-search-field input{-webkit-appearance:none;-moz-appearance:none;appearance:none;-webkit-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px;height:37px;width:100%;outline-offset:-2px;background:#fff;border:1px solid #dfdcda;border-right:0;font-family:"Open Sans",sans-serif;font-size:18px;font-weight:normal;flex:1;margin:0;padding:0 .75em}div.main-search-field button{-webkit-appearance:button;-moz-appearance:button;appearance:button;-webkit-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0;margin:0;background:#fff;border:1px solid #dfdcda;border-left:0;display:inline-block;padding:0 .75em;height:100%}div.main-search-field button svg{height:22px;width:21px}div.search-results-container{-webkit-box-shadow:0 5px 5px -3px rgba(0,0,0,.2),0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12);-moz-box-shadow:0 5px 5px -3px rgba(0,0,0,.2),0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12);box-shadow:0 5px 5px -3px rgba(0,0,0,.2),0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12);-webkit-border-radius:0 0 3px 3px;border-radius:0 0 3px 3px;position:absolute;background:#fbfcfd;display:none;top:37px;z-index:1}div.search-results-container.open{display:block;width:100%;overflow-y:auto}div.search-results-container a{color:#3767c7;text-decoration:none}div.search-results-container a:hover{color:#0056b3;text-decoration:underline}div.search-results-container div.search-results-for-type:nth-child(odd){background-color:#fbfcfd}div.search-results-container div.search-results-for-type:nth-child(even){background-color:#f5f6f7}div.search-results-container div.search-results-for-type a.search-results-for-type-title{font-family:"Open Sans",sans-serif;padding:6px 16px;font-size:18px;display:inline-block;font-weight:normal}div.search-results-container div.search-results-for-type a.search-results-for-type-title span.search-results-for-type-number-badge{-webkit-border-radius:6px;border-radius:6px;padding:1px 4px;color:#fff;background-color:#fe5000;display:inline-block;font-size:.7em;vertical-align:middle;text-align:center;min-width:24px;font-weight:bold}div.search-results-container div.search-results-for-type ul.search-results-for-type-list{list-style:none;padding:0 16px 12px 32px;margin:0}div.search-results-container div.search-results-for-type ul.search-results-for-type-list li a{font-family:"Open Sans",sans-serif;padding:2px 0;display:block;font-size:14px;font-weight:normal}.hidden{height:0;width:0;position:absolute;color:rgba(0,0,0,0);overflow:hidden}',"",{version:3,sources:["webpack://./stories/main-navigation/main-search-field/main-search-field.scss","webpack://./style/variables/_typography.scss","webpack://./style/mixins/_breakpoints.scss","webpack://./style/mixins/_appearance.scss","webpack://./style/mixins/_border-radius.scss","webpack://./style/mixins/_box-shadow.scss","webpack://./style/variables/_colors.scss"],names:[],mappings:"AAEA,EACE,qBAAA,CAGF,sBACE,kCCPa,CDQb,YAAA,CACA,WAAA,CACA,gBAAA,CACA,iBAAA,CACA,UAAA,CEEM,0BFRR,sBAQI,YAAA,CAAA,CAGF,uCACE,OAAA,CACA,QAAA,CACA,eAAA,CACA,SAAA,CAGF,4BGvBE,uBHwBoB,CGvBpB,oBHuBoB,CGtBpB,eHsBoB,CIxBtB,iCJyByB,CIxBzB,yBJwByB,CACvB,WAAA,CACA,UAAA,CACA,mBAAA,CACA,eAAA,CACA,wBAAA,CACA,cAAA,CACA,kCCjCW,CDkCX,cAAA,CACA,kBAAA,CACA,MAAA,CACA,QAAA,CACA,eAAA,CAGF,6BGxCE,yBHyCoB,CGxCpB,sBHwCoB,CGvCpB,iBHuCoB,CIzCtB,iCJ0CyB,CIzCzB,yBJyCyB,CACvB,QAAA,CACA,eAAA,CACA,wBAAA,CACA,aAAA,CACA,oBAAA,CACA,eAAA,CACA,WAAA,CAEA,iCACE,WAAA,CACA,UAAA,CAKN,6BK1DI,8GL2DF,CK1DE,2GL0DF,CKzDE,sGLyDF,CI3DA,iCJgEuB,CI/DvB,yBJ+DuB,CACvB,iBAAA,CACA,kBAAA,CACA,YAAA,CACA,QAAA,CACA,SAAA,CAEA,kCACE,aAAA,CACA,UAAA,CACA,eAAA,CAGF,+BACE,aMhEW,CNiEX,oBAAA,CACA,qCACE,aMlEc,CNmEd,yBAAA,CAKF,wEACE,wBAAA,CAEF,yEACE,wBAAA,CAEF,yFACE,kCC/FS,CDgGT,gBAAA,CACA,cAAA,CACA,oBAAA,CACA,kBAAA,CACA,mIInGJ,yBJoG6B,CInG7B,iBJmG6B,CACvB,eAAA,CACA,UAAA,CACA,wBM7FQ,CN8FR,oBAAA,CACA,cAAA,CACA,qBAAA,CACA,iBAAA,CACA,cAAA,CACA,gBAAA,CAGJ,yFACE,eAAA,CACA,wBAAA,CACA,QAAA,CAEE,8FACE,kCCvHK,CDwHL,aAAA,CACA,aAAA,CACA,cAAA,CACA,kBAAA,CAOV,QACE,QAAA,CACA,OAAA,CACA,iBAAA,CACA,mBAAA,CACA,eAAA",sourcesContent:['@import "../../../style/all";\n\n* {\n box-sizing: border-box;\n}\n\ndiv.main-search-field {\n font-family: $default-font;\n display: flex;\n height: 37px;\n margin-top: 0.25em;\n position: relative;\n width: 100%;\n @include breakpoint(phablet) {\n margin-top: 0;\n }\n\n .mainSearchLabel {\n width: 0;\n height: 0;\n overflow: hidden;\n opacity: 0;\n }\n\n input {\n @include appearance(none);\n @include border-radius(4px 0 0 4px);\n height: 37px;\n width: 100%;\n outline-offset: -2px;\n background: #fff;\n border: 1px solid #dfdcda;\n border-right: 0;\n font-family: $default-font;\n font-size: 18px;\n font-weight: normal;\n flex: 1;\n margin: 0;\n padding: 0 0.75em;\n }\n\n button {\n @include appearance(button);\n @include border-radius(0 4px 4px 0);\n margin: 0;\n background: #fff;\n border: 1px solid #dfdcda;\n border-left: 0;\n display: inline-block;\n padding: 0 0.75em;\n height: 100%;\n\n svg {\n height: 22px;\n width: 21px;\n }\n }\n}\n\ndiv.search-results-container {\n @include box-shadow(\n 0 5px 5px -3px rgba(0, 0, 0, 0.2),\n 0 8px 10px 1px rgba(0, 0, 0, 0.14),\n 0 3px 14px 2px rgba(0, 0, 0, 0.12)\n );\n @include border-radius(0 0 3px 3px);\n position: absolute;\n background: #fbfcfd;\n display: none;\n top: 37px;\n z-index: 1;\n\n &.open {\n display: block;\n width: 100%;\n overflow-y: auto;\n }\n\n a {\n color: $primary-text;\n text-decoration: none;\n &:hover {\n color: $primary-text-hover;\n text-decoration: underline;\n }\n }\n\n div.search-results-for-type {\n &:nth-child(odd) {\n background-color: #fbfcfd;\n }\n &:nth-child(even) {\n background-color: #f5f6f7;\n }\n a.search-results-for-type-title {\n font-family: $default-font;\n padding: 6px 16px;\n font-size: 18px;\n display: inline-block;\n font-weight: normal;\n span.search-results-for-type-number-badge {\n @include border-radius(6px);\n padding: 1px 4px;\n color: #fff;\n background-color: $primary-brand;\n display: inline-block;\n font-size: 0.7em;\n vertical-align: middle;\n text-align: center;\n min-width: 24px;\n font-weight: bold;\n }\n }\n ul.search-results-for-type-list {\n list-style: none;\n padding: 0 16px 12px 32px;\n margin: 0;\n li {\n a {\n font-family: $default-font;\n padding: 2px 0;\n display: block;\n font-size: 14px;\n font-weight: normal;\n }\n }\n }\n }\n}\n\n.hidden {\n height: 0;\n width: 0;\n position: absolute;\n color: transparent;\n overflow: hidden;\n}\n','$default-font: "Open Sans", sans-serif;\n$header-font: "Raleway", sans-serif;\n$default-font-size: 15px;\n',"@mixin breakpoint($point) {\n @if $point == desktop {\n @media (min-width: $screen-desktop) {\n @content;\n }\n } @else if $point == laptop {\n @media (min-width: $screen-laptop) {\n @content;\n }\n } @else if $point == tablet {\n @media (min-width: $screen-tablet) {\n @content;\n }\n } @else if $point == phablet {\n @media (min-width: $screen-phablet) {\n @content;\n }\n }\n}\n","\ufeff@mixin appearance ($value) {\n -webkit-appearance: $value;\n -moz-appearance: $value;\n appearance: $value;\n}\n","@mixin border-radius($radius) {\n -webkit-border-radius: $radius;\n border-radius: $radius;\n}\n\n// Single side border-radius\n\n@mixin border-top-radius($radius) {\n -webkit-border-top-right-radius: $radius;\n border-top-right-radius: $radius;\n -webkit-border-top-left-radius: $radius;\n border-top-left-radius: $radius;\n}\n@mixin border-right-radius($radius) {\n -webkit-border-bottom-right-radius: $radius;\n border-bottom-right-radius: $radius;\n -webkit-border-top-right-radius: $radius;\n border-top-right-radius: $radius;\n}\n@mixin border-bottom-radius($radius) {\n -webkit-border-bottom-right-radius: $radius;\n border-bottom-right-radius: $radius;\n -webkit-border-bottom-left-radius: $radius;\n border-bottom-left-radius: $radius;\n}\n@mixin border-left-radius($radius) {\n -webkit-border-bottom-left-radius: $radius;\n border-bottom-left-radius: $radius;\n -webkit-border-top-left-radius: $radius;\n border-top-left-radius: $radius;\n}","\ufeff@mixin box-shadow($shadows...) {\n -webkit-box-shadow: $shadows;\n -moz-box-shadow: $shadows;\n box-shadow: $shadows;\n}\n","$body-background: #ffffff;\n$navigation-bar-background: #f7f7f7;\n$hover-background: rgba(0,0,0,.05);\n$default-border: #d8d8d8;\n\n$default-background: #eee;\n$default-background-hover: #ddd;\n$default-text:#2F3940;\n\n$light-gray: #f6f5f4;\n\n$primary-brand: #FE5000;\n\n$primary-background: #3767C7;\n$primary-background-hover: #FE5000;\n$primary-text: #3767C7;\n$primary-text-hover:#0056b3;\n\n\n$success-background: #06A755;\n$success-background-hover: #009745;\n$success-text: #06A755;\n\n\n$warning-background: #C38621;\n$warning-background-hover: #B37611;\n$warning-text: #C38621;\n\n$danger-background: #E00d0D;\n$danger-background-hover: #D00000;\n$danger-text: #E00d0D;\n\n$disabled-background: #f4f4f4;\n$disabled-border: #dedede;\n$disabled-text: #707070;\n\n\n$light-green: #8fff33;\n$light-yellow: #ffEb3b;\n$light-red: #ff4a2e;\n"],sourceRoot:""}]);const a=i},3006:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>r});const r='<template>\n <div class="main-search-field">\n <label id="main-search-input-label" for="main-search-input" class="hidden">søk</label>\n <input id="main-search-input" autocomplete="off" type="search" value="" />\n <button id="search-submit-button"></button>\n <div id="search-results-container" class="search-results-container">\n \n </div>\n </div>\n </template>'},7638:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,r,s,o){"string"==typeof e&&(e=[[null,e,void 0]]);var i={};if(r)for(var a=0;a<this.length;a++){var c=this[a][0];null!=c&&(i[c]=!0)}for(var l=0;l<e.length;l++){var d=[].concat(e[l]);r&&i[d[0]]||(void 0!==o&&(void 0===d[5]||(d[1]="@layer".concat(d[5].length>0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=o),n&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=n):d[2]=n),s&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=s):d[4]="".concat(s)),t.push(d))}},t}},4663:e=>{"use strict";e.exports=function(e){var t=e[1],n=e[3];if(!n)return t;if("function"==typeof btoa){var r=btoa(unescape(encodeURIComponent(JSON.stringify(n)))),s="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(r),o="/*# ".concat(s," */");return[t].concat([o]).join("\n")}return[t].join("\n")}},1397:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(s,o){function i(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,a)}c((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.Component=void 0;const s=n(5969),o=n(5773),i=n(3804);t.Component=e=>t=>{var n;const a=e.tag||i.toKebabCase(t.prototype.constructor.name),c=((n=class extends t{constructor(){super(),this.props={},this.showShadowRoot=null==e.shadow||e.shadow,!this.shadowRoot&&this.showShadowRoot&&this.attachShadow({mode:"open"})}static get observedAttributes(){return Object.keys(this.propsInit||{}).map((e=>i.toKebabCase(e)))}attributeChangedCallback(e,t,n){this.onAttributeChange(e,t,n)}onAttributeChange(e,t,n,r=!0){if(t!=n){r&&(this[i.toCamelCase(e)]=n);const s=this.constructor.watchAttributes;if(s&&s[e]){const r=s[e];this.__connected&&"function"==typeof this[r]&&this[r]({old:t,new:n})}}}connectedCallback(){const e=Object.create(null,{connectedCallback:{get:()=>super.connectedCallback}});return r(this,void 0,void 0,(function*(){yield this.render(),e.connectedCallback&&e.connectedCallback.call(this),this.__connected=!0,s.addEventListeners(this),o.initializeProps(this)}))}render(){return r(this,void 0,void 0,(function*(){if(this.__connected)return;const t=document.createElement("template");t.innerHTML=yield this.getStyle(),e.template instanceof Promise?t.content.appendChild(yield this.getExternalTemplate()):"string"==typeof e.template&&(t.innerHTML+=e.template),(this.showShadowRoot?this.shadowRoot:this).appendChild(t.content.cloneNode(!0))}))}getExternalTemplate(){return r(this,void 0,void 0,(function*(){const t=(yield e.template).default.toString(),n=document.createRange().createContextualFragment(t);return 1===n.children.length&&"TEMPLATE"===n.children[0].nodeName?n.firstChild.content:n}))}getStyle(){return r(this,void 0,void 0,(function*(){let t;return e.style instanceof Promise?t=(yield e.style).default.toString():"string"==typeof e.style&&(t=e.style),t?`<style>${t}</style>`:""}))}}).__connected=!1,n.ready=new Promise(((e,t)=>e(!0))),n);return customElements.get(a)||customElements.define(a,c),c}},985:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CustomElement=void 0;class n extends HTMLElement{constructor(){super()}connect(e){this.isConnected||document.querySelector(e).appendChild(this)}}t.CustomElement=n},265:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getShadowRootElement=t.getElement=void 0,t.getElement=e=>document.querySelector(e),t.getShadowRootElement=(e,t)=>e.shadowRoot.querySelector(t)},406:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),s=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),s(n(1397),t),s(n(985),t),s(n(265),t),s(n(5969),t),s(n(5773),t),s(n(4271),t),s(n(9766),t),s(n(4938),t)},5969:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Dispatch=t.addEventListeners=t.Listen=void 0;const r=n(3804);t.Listen=(e,t)=>(n,r)=>{n.constructor.listeners||(n.constructor.listeners=[]),n.constructor.listeners.push({selector:t,eventName:e,handler:n[r]})},t.addEventListeners=e=>{if(e.constructor.listeners){const t=e.shadowRoot||e;for(const n of e.constructor.listeners){const r=n.selector?t.querySelector(n.selector)?t.querySelector(n.selector):null:e;r&&r.addEventListener(n.eventName,(t=>{n.handler.call(e,t)}))}}},t.Dispatch=e=>(t,n)=>{Object.defineProperty(t,n,{get:function(){const t=this;return{emit(s){const o=e||r.toDotCase(n);t.dispatchEvent(new CustomEvent(o,s))}}}})}},5773:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.initializeProps=t.Prop=void 0;const r=n(3804);t.Prop=()=>(e,t)=>{const n=r.toKebabCase(t);e.constructor.propsInit||(e.constructor.propsInit={}),e.constructor.propsInit[t]=null,Object.defineProperty(e,t,{get:function(){return this.props[t]?this.props[t]:this.getAttribute(n)},set:function(e){if(this.__connected){const s=this.props[t];this.props[t]=r.tryParseInt(e),"object"!=typeof e?this.setAttribute(n,e):this.onAttributeChange(n,s,e,!1)}else this.hasAttribute(r.toKebabCase(t))||(this.constructor.propsInit[t]=e)}})},t.initializeProps=e=>{const t=e.constructor.watchAttributes;for(let n of(e=>{const t=e.constructor.watchAttributes,n=Object.assign({},t);Object.keys(n).forEach((e=>n[e]=""));const r=Object.assign(Object.assign({},n),e.constructor.propsInit);return Object.keys(r)})(e)){if(t)if(null==t[r.toKebabCase(n)])t[r.toKebabCase(n)]="";else{const s=e.props[n]||e.getAttribute(r.toKebabCase(n));"function"==typeof e[t[n]]&&e[t[n]]({new:s})}e.constructor.propsInit[n]&&(e.hasAttribute(r.toKebabCase(n))||(e[n]=e.constructor.propsInit[n]))}}},4271:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Toggle=void 0;const r=n(3804);t.Toggle=()=>(e,t)=>{e.constructor.propsInit||(e.constructor.propsInit={}),e.constructor.propsInit[t]=null,Object.defineProperty(e,t,{get:function(){return(e=>{if(this.hasAttribute(e)){const t=this.getAttribute(e);return!!/^(true|false|^$)$/.test(t)&&("true"==t||""==t)}return!1})(t)},set:function(e){const n=e;if(null!=e)switch(typeof e){case"boolean":break;case"string":/^(true|false|^$)$/.test(e)?e="true"==n||""==n:(console.warn(`TypeError: Cannot set boolean toggle property '${t}' to '${e}'`),e=!1);break;default:throw`TypeError: Cannot set boolean toggle property '${t}' to '${e}'`}this.__connected?(this.props[t]=e||!1,""!==n&&null!==n?this.setAttribute(t,e):e?this.setAttribute(t,""):this.removeAttribute(t)):this.hasAttribute(r.toKebabCase(t))||(this.constructor.propsInit[t]=e)}})}},9766:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},3804:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tryParseInt=t.toDotCase=t.toCamelCase=t.toKebabCase=void 0,t.toKebabCase=e=>e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),t.toCamelCase=e=>e.toLowerCase().replace(/(\-\w)/g,(e=>e[1].toUpperCase())),t.toDotCase=e=>e.replace(/(?!^)([A-Z])/g," $1").replace(/[_\s]+(?=[a-zA-Z])/g,".").toLowerCase(),t.tryParseInt=e=>parseInt(e)==e&&NaN!==parseFloat(e)?parseInt(e):e},4938:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Watch=void 0;const r=n(3804);t.Watch=e=>(t,n)=>{t.constructor.watchAttributes||(t.constructor.watchAttributes={}),t.constructor.watchAttributes[r.toKebabCase(e)]=n,t.constructor.propsInit||(t.constructor.propsInit={}),t.constructor.propsInit[e]=null}},4768:e=>{e.exports='<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 34 35" style="enable-background:new 0 0 34 35;" xml:space="preserve"><style type="text/css"> .__24nL31r__st0{fill:#B0A9A2;} </style><g><path class="__24nL31r__st0 " d="M23.6,22.8c2.2-2.4,3.6-5.7,3.6-9.2C27.2,6.1,21.1,0,13.6,0C6.1,0,0,6.1,0,13.6c0,7.5,6.1,13.6,13.6,13.6 c3.1,0,5.9-1,8.1-2.7l10.1,10.1c0.2,0.2,0.6,0.4,0.9,0.4c0.3,0,0.6-0.1,0.9-0.4c0.5-0.5,0.5-1.3,0-1.7L23.6,22.8z M2.5,13.6 c0-6.1,5-11.1,11.1-11.1c6.1,0,11.1,5,11.1,11.1s-5,11.1-11.1,11.1S2.5,19.7,2.5,13.6L2.5,13.6z"></path></g></svg>'},9480:function(e,t){"use strict";var n=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(s,o){function i(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,a)}c((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.fetchDropdownSearchResults=t.fetchMenuItems=t.getGeonorgeMenuUrl=t.getKartkatalogApiUrl=void 0,t.getKartkatalogApiUrl=e=>`https://kartkatalog.${"dev"===e||"test"===e?e+".":""}geonorge.no/api`,t.getGeonorgeMenuUrl=(e,t)=>`https://www.${"dev"===t||"test"===t?"test.":""}geonorge.no/${"en"===e?"en/":""}api/menu/get?omitLinks=1`,t.fetchMenuItems=(e="no",n="")=>{const r=(0,t.getGeonorgeMenuUrl)(e,n);return fetch(r).then((e=>e.json())).then((e=>e))},t.fetchDropdownSearchResults=(e="",r="no",s="")=>n(void 0,void 0,void 0,(function*(){const o={dataset:`search?text=${e=e.toString()}&facets%5B1%5Dname=type&facets%5B1%5Dvalue=dataset`,series:`search?text=${e}&facets%5B1%5Dname=type&facets%5B1%5Dvalue=series`,service:`search?text=${e}&facets%5B1%5Dname=type&facets%5B1%5Dvalue=service`,servicelayer:`search?text=${e}&facets%5B1%5Dname=type&facets%5B1%5Dvalue=servicelayer`,software:`search?text=${e}&facets%5B1%5Dname=type&facets%5B1%5Dvalue=software`,articles:`articles?text=${e}`},i={headers:new Headers({"Accept-Language":r})};return e&&e.length?yield Promise.all(Object.keys(o).map((e=>n(void 0,void 0,void 0,(function*(){const n=(0,t.getKartkatalogApiUrl)(s);return fetch(`${n}/${o[e]}&limit=5`,i).then((e=>e.json())).then((t=>Object.assign(Object.assign({},t),{searchResultsType:e})))}))))):null}))},1406:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.renderDropdownResultLink=t.convertTextToUrlSlug=t.getGeonorgeNedlastingUrl=t.getGeonorgeUrl=t.getKartkatalogUrl=void 0,t.getKartkatalogUrl=e=>`https://kartkatalog.${"dev"===e||"test"===e?e+".":""}geonorge.no`,t.getGeonorgeUrl=(e,t)=>`https://www.${"dev"===t||"test"===t?"test.":""}geonorge.no/${"en"===e?"en/":""}`,t.getGeonorgeNedlastingUrl=e=>`https://nedlasting.${"dev"===e||"test"===e?"test.":""}geonorge.no`;const n=(e,t,n)=>(e=(e=(e=e.replace(new RegExp(`([^s])([${t}])([^s])`,"ig"),`$1 ${n} $3`)).replace(new RegExp(`([^s])([${t}])`,"ig"),`$1 ${n}`)).replace(new RegExp(`([${t}])([^s])`,"ig"),`${n} $2`)).replace(new RegExp(`[${t}]`,"ig"),n);t.convertTextToUrlSlug=(e="")=>(e=e.toLowerCase(),e=n(e,"&","and"),(e=(e=(e=(e=(e=(e=(e=(e=(e=n(e,"+","plus")).replace("æ","ae")).replace("ä","ae")).replace("ø","oe")).replace("ö","oe")).replace("å","aa")).replace(/( - )/g,"-")).replace(/[\s]+/g,"-")).replace(/[^a-z0-9-]+/gi,"")).replace(/^[^A-Z0-9]*|[^a-z0-9]*$/gi,""));const r=(e,t)=>{if(!t)return!1;t({event:"updateSearchString",category:"metadataSearch",activity:"dropDownResultsClick",searchString:e})};t.renderDropdownResultLink=(e,n,s,o,i)=>"articles"===n?`<a onClick="${r(s,i)}" href="${e.ShowDetailsUrl?e.ShowDetailsUrl:"#"}">${e.Title}</a>`:`<a onClick="${r(s,i)}" href="${(0,t.getKartkatalogUrl)(o)}/metadata/${(0,t.convertTextToUrlSlug)(e.Title)}/${e.Uuid}">${e.Title}</a>`},1369:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var s=Object.getOwnPropertyDescriptor(t,n);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,s)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__decorate||function(e,t,n,r){var s,o=arguments.length,i=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(i=(o<3?s(i):o>3?s(t,n,i):s(t,n))||i);return o>3&&i&&Object.defineProperty(t,n,i),i},i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return s(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.MainSearchField=void 0;const c=n(406),l=n(9480),d=n(1406),u=a(n(4768));let h=class extends c.CustomElement{constructor(){super(),this.searchstring="",this.renderSearchResultsForType=e=>{const t=e.Results[0].TypeTranslated,n=e.searchResultsType,r=e.Results.map((e=>`<li>${(0,d.renderDropdownResultLink)(e,n,this.searchstring,this.environment)}</li>`)).join("");return`\n <div class="search-results-for-type">\n <a href="${"articles"===n?`${(0,d.getKartkatalogUrl)(this.environment)}/articles?text=${this.searchstring}`:`${(0,d.getKartkatalogUrl)(this.environment)}/metadata?text=${this.searchstring}&type=${n}`}" class="search-results-for-type-title">\n ${t}\n <span class="search-results-for-type-number-badge">\n ${e.NumFound}\n </span>\n </a>\n <ul class="search-results-for-type-list">\n ${r}\n </ul>\n </div>`},this.renderSearchResults=e=>`<div>${e.map((e=>this.renderSearchResultsForType(e))).join("")}</div>`,this.hideSearchResultsContainer=()=>{this.showSearchResults=!1},this.clickOutsideSearchResultsContainer=this.clickOutsideSearchResultsContainer.bind(this)}setup(e){this.connect(e.container),e.id&&(this.id=e.id)}connectedCallback(){this.searchField=(0,c.getShadowRootElement)(this,"#main-search-input"),this.searchFieldLabel=(0,c.getShadowRootElement)(this,"#main-search-input-label"),this.searchButton=(0,c.getShadowRootElement)(this,"#search-submit-button"),this.searchFieldLabel.innerHTML="en"===this.language?"Search":"Søk",this.searchButton.innerHTML=u.default,this.searchResultsContainer=(0,c.getShadowRootElement)(this,"#search-results-container"),this.searchResultsContainer.style.maxHeight=window.innerHeight-61+"px",this.searchField&&this.searchstring&&this.searchField.setAttribute("value",this.searchstring),document.addEventListener("click",this.clickOutsideSearchResultsContainer)}disconnectedCallback(){document.removeEventListener("click",this.clickOutsideSearchResultsContainer)}clickOutsideSearchResultsContainer(e){var t;const n=e.composedPath()[0];if(n.closest("#search-results-container")||n.closest("#main-search-input")){const e=n.closest("a");(null===(t=null==e?void 0:e.href)||void 0===t?void 0:t.length)&&this.hideSearchResultsContainer()}else this.hideSearchResultsContainer()}submitSearch(){var e;this.hideSearchResultsContainer(),this.preventRedirect?this.onSearch.emit({detail:{searchString:this.searchstring}}):window.location.href=`${(0,d.getKartkatalogUrl)(this.environment)}/metadata?text=${(null===(e=this.searchstring)||void 0===e?void 0:e.length)?encodeURI(this.searchstring.toString()):""}`}searchFieldKeyUp(e){var t,n,r;e.key&&"Enter"===e.key&&(null===(t=this.searchstring)||void 0===t?void 0:t.toString().length)?this.submitSearch():this.searchstring=(null===(r=null===(n=this.searchField)||void 0===n?void 0:n.value)||void 0===r?void 0:r.toString())||""}onSearchSubmitted(e){this.submitSearch()}searchStringChanged(){this.searchField&&this.searchField.setAttribute("value",this.searchstring),(0,l.fetchDropdownSearchResults)(this.searchstring,this.language,this.environment).then((e=>{this.searchResultsResponses=e}))}languageChanged(){this.searchField&&this.searchField.setAttribute("aria-label","en"===this.language?"Enter your search query":"Skriv inn det du vil søke etter"),this.searchFieldLabel&&(this.searchFieldLabel.innerText="en"===this.language?"Search":"Søk"),this.searchButton&&this.searchButton.setAttribute("aria-label","en"===this.language?"Search":"Søk")}showSearchResultsChanged(){this.showSearchResults?this.searchResultsContainer.classList.add("open"):this.searchResultsContainer.classList.remove("open")}searchResultsResponseChanged(){const e=this.searchResultsResponses&&this.searchResultsResponses.length?this.searchResultsResponses.filter((e=>e.NumFound>0)):[];this.searchResultsContainer.innerHTML=e.length?this.renderSearchResults(e):"",this.showSearchResults=!!e.length}static setup(e,t){const n=(0,c.getElement)(e);t.onClick&&n.addEventListener("searchButtonClick",t.onClick),t.active&&(n.showSearchResults=t.active)}};h.elementSelector="main-search-field",o([(0,c.Prop)()],h.prototype,"id",void 0),o([(0,c.Prop)()],h.prototype,"environment",void 0),o([(0,c.Toggle)()],h.prototype,"showSearchResults",void 0),o([(0,c.Toggle)()],h.prototype,"preventRedirect",void 0),o([(0,c.Prop)()],h.prototype,"searchstring",void 0),o([(0,c.Prop)()],h.prototype,"language",void 0),o([(0,c.Prop)()],h.prototype,"searchResultsResponses",void 0),o([(0,c.Dispatch)("searchResultsChanged")],h.prototype,"onTextChanged",void 0),o([(0,c.Dispatch)("onSearchStringChange")],h.prototype,"onSearchStringChange",void 0),o([(0,c.Dispatch)("onSearch")],h.prototype,"onSearch",void 0),o([(0,c.Listen)("keyup","input")],h.prototype,"searchFieldKeyUp",null),o([(0,c.Listen)("click","#search-submit-button")],h.prototype,"onSearchSubmitted",null),o([(0,c.Watch)("searchstring")],h.prototype,"searchStringChanged",null),o([(0,c.Watch)("language")],h.prototype,"languageChanged",null),o([(0,c.Watch)("showsearchresults")],h.prototype,"showSearchResultsChanged",null),o([(0,c.Watch)("searchResultsResponses")],h.prototype,"searchResultsResponseChanged",null),h=o([(0,c.Component)({tag:"main-search-field",template:Promise.resolve().then((()=>i(n(3006)))),style:Promise.resolve().then((()=>i(n(9915))))})],h),t.MainSearchField=h}},t={};function n(r){var s=t[r];if(void 0!==s)return s.exports;var o=t[r]={id:r,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.exports}return n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n(1369)})())); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.geonorge=t():(e.geonorge=e.geonorge||{},e.geonorge.MainSearchField=t())}(self,(()=>(()=>{var e={5533:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>a});var r=n(5052),s=n.n(r),o=n(164),i=n.n(o)()(s());i.push([e.id,'*{box-sizing:border-box}div.main-search-field{font-family:"Open Sans",sans-serif;display:flex;height:37px;margin-top:.25em;position:relative;width:100%}@media(min-width: 37.5em){div.main-search-field{margin-top:0}}div.main-search-field .mainSearchLabel{width:0;height:0;overflow:hidden;opacity:0}div.main-search-field input{-webkit-appearance:none;-moz-appearance:none;appearance:none;-webkit-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px;height:37px;width:100%;outline-offset:-2px;background:#fff;border:1px solid #dfdcda;border-right:0;font-family:"Open Sans",sans-serif;font-size:18px;font-weight:normal;flex:1;margin:0;padding:0 .75em}div.main-search-field button{-webkit-appearance:button;-moz-appearance:button;appearance:button;-webkit-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0;margin:0;background:#fff;border:1px solid #dfdcda;border-left:0;display:inline-block;padding:0 .75em;height:100%}div.main-search-field button svg{height:22px;width:21px}div.search-results-container{-webkit-box-shadow:0 5px 5px -3px rgba(0,0,0,.2),0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12);-moz-box-shadow:0 5px 5px -3px rgba(0,0,0,.2),0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12);box-shadow:0 5px 5px -3px rgba(0,0,0,.2),0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12);-webkit-border-radius:0 0 3px 3px;border-radius:0 0 3px 3px;position:absolute;background:#fbfcfd;display:none;top:37px;z-index:1}div.search-results-container.open{display:block;width:100%;overflow-y:auto}div.search-results-container a{color:#3767c7;text-decoration:none}div.search-results-container a:hover{color:#0056b3;text-decoration:underline}div.search-results-container div.search-results-for-type:nth-child(odd){background-color:#fbfcfd}div.search-results-container div.search-results-for-type:nth-child(even){background-color:#f5f6f7}div.search-results-container div.search-results-for-type a.search-results-for-type-title{font-family:"Open Sans",sans-serif;padding:6px 16px;font-size:18px;display:inline-block;font-weight:normal}div.search-results-container div.search-results-for-type a.search-results-for-type-title span.search-results-for-type-number-badge{-webkit-border-radius:6px;border-radius:6px;padding:1px 4px;color:#fff;background-color:#fe5000;display:inline-block;font-size:.7em;vertical-align:middle;text-align:center;min-width:24px;font-weight:bold}div.search-results-container div.search-results-for-type ul.search-results-for-type-list{list-style:none;padding:0 16px 12px 32px;margin:0}div.search-results-container div.search-results-for-type ul.search-results-for-type-list li a{font-family:"Open Sans",sans-serif;padding:2px 0;display:block;font-size:14px;font-weight:normal}.hidden{height:0;width:0;position:absolute;color:rgba(0,0,0,0);overflow:hidden}',"",{version:3,sources:["webpack://./stories/main-navigation/main-search-field/main-search-field.scss","webpack://./style/variables/_typography.scss","webpack://./style/mixins/_breakpoints.scss","webpack://./style/mixins/_appearance.scss","webpack://./style/mixins/_border-radius.scss","webpack://./style/mixins/_box-shadow.scss","webpack://./style/variables/_colors.scss"],names:[],mappings:"AAEA,EACE,qBAAA,CAGF,sBACE,kCCPa,CDQb,YAAA,CACA,WAAA,CACA,gBAAA,CACA,iBAAA,CACA,UAAA,CEEM,0BFRR,sBAQI,YAAA,CAAA,CAGF,uCACE,OAAA,CACA,QAAA,CACA,eAAA,CACA,SAAA,CAGF,4BGvBE,uBHwBoB,CGvBpB,oBHuBoB,CGtBpB,eHsBoB,CIxBtB,iCJyByB,CIxBzB,yBJwByB,CACvB,WAAA,CACA,UAAA,CACA,mBAAA,CACA,eAAA,CACA,wBAAA,CACA,cAAA,CACA,kCCjCW,CDkCX,cAAA,CACA,kBAAA,CACA,MAAA,CACA,QAAA,CACA,eAAA,CAGF,6BGxCE,yBHyCoB,CGxCpB,sBHwCoB,CGvCpB,iBHuCoB,CIzCtB,iCJ0CyB,CIzCzB,yBJyCyB,CACvB,QAAA,CACA,eAAA,CACA,wBAAA,CACA,aAAA,CACA,oBAAA,CACA,eAAA,CACA,WAAA,CAEA,iCACE,WAAA,CACA,UAAA,CAKN,6BK1DI,8GL2DF,CK1DE,2GL0DF,CKzDE,sGLyDF,CI3DA,iCJgEuB,CI/DvB,yBJ+DuB,CACvB,iBAAA,CACA,kBAAA,CACA,YAAA,CACA,QAAA,CACA,SAAA,CAEA,kCACE,aAAA,CACA,UAAA,CACA,eAAA,CAGF,+BACE,aMhEW,CNiEX,oBAAA,CACA,qCACE,aMlEc,CNmEd,yBAAA,CAKF,wEACE,wBAAA,CAEF,yEACE,wBAAA,CAEF,yFACE,kCC/FS,CDgGT,gBAAA,CACA,cAAA,CACA,oBAAA,CACA,kBAAA,CACA,mIInGJ,yBJoG6B,CInG7B,iBJmG6B,CACvB,eAAA,CACA,UAAA,CACA,wBM7FQ,CN8FR,oBAAA,CACA,cAAA,CACA,qBAAA,CACA,iBAAA,CACA,cAAA,CACA,gBAAA,CAGJ,yFACE,eAAA,CACA,wBAAA,CACA,QAAA,CAEE,8FACE,kCCvHK,CDwHL,aAAA,CACA,aAAA,CACA,cAAA,CACA,kBAAA,CAOV,QACE,QAAA,CACA,OAAA,CACA,iBAAA,CACA,mBAAA,CACA,eAAA",sourcesContent:['@import "../../../style/all";\n\n* {\n box-sizing: border-box;\n}\n\ndiv.main-search-field {\n font-family: $default-font;\n display: flex;\n height: 37px;\n margin-top: 0.25em;\n position: relative;\n width: 100%;\n @include breakpoint(phablet) {\n margin-top: 0;\n }\n\n .mainSearchLabel {\n width: 0;\n height: 0;\n overflow: hidden;\n opacity: 0;\n }\n\n input {\n @include appearance(none);\n @include border-radius(4px 0 0 4px);\n height: 37px;\n width: 100%;\n outline-offset: -2px;\n background: #fff;\n border: 1px solid #dfdcda;\n border-right: 0;\n font-family: $default-font;\n font-size: 18px;\n font-weight: normal;\n flex: 1;\n margin: 0;\n padding: 0 0.75em;\n }\n\n button {\n @include appearance(button);\n @include border-radius(0 4px 4px 0);\n margin: 0;\n background: #fff;\n border: 1px solid #dfdcda;\n border-left: 0;\n display: inline-block;\n padding: 0 0.75em;\n height: 100%;\n\n svg {\n height: 22px;\n width: 21px;\n }\n }\n}\n\ndiv.search-results-container {\n @include box-shadow(\n 0 5px 5px -3px rgba(0, 0, 0, 0.2),\n 0 8px 10px 1px rgba(0, 0, 0, 0.14),\n 0 3px 14px 2px rgba(0, 0, 0, 0.12)\n );\n @include border-radius(0 0 3px 3px);\n position: absolute;\n background: #fbfcfd;\n display: none;\n top: 37px;\n z-index: 1;\n\n &.open {\n display: block;\n width: 100%;\n overflow-y: auto;\n }\n\n a {\n color: $primary-text;\n text-decoration: none;\n &:hover {\n color: $primary-text-hover;\n text-decoration: underline;\n }\n }\n\n div.search-results-for-type {\n &:nth-child(odd) {\n background-color: #fbfcfd;\n }\n &:nth-child(even) {\n background-color: #f5f6f7;\n }\n a.search-results-for-type-title {\n font-family: $default-font;\n padding: 6px 16px;\n font-size: 18px;\n display: inline-block;\n font-weight: normal;\n span.search-results-for-type-number-badge {\n @include border-radius(6px);\n padding: 1px 4px;\n color: #fff;\n background-color: $primary-brand;\n display: inline-block;\n font-size: 0.7em;\n vertical-align: middle;\n text-align: center;\n min-width: 24px;\n font-weight: bold;\n }\n }\n ul.search-results-for-type-list {\n list-style: none;\n padding: 0 16px 12px 32px;\n margin: 0;\n li {\n a {\n font-family: $default-font;\n padding: 2px 0;\n display: block;\n font-size: 14px;\n font-weight: normal;\n }\n }\n }\n }\n}\n\n.hidden {\n height: 0;\n width: 0;\n position: absolute;\n color: transparent;\n overflow: hidden;\n}\n','$default-font: "Open Sans", sans-serif;\n$header-font: "Raleway", sans-serif;\n$default-font-size: 15px;\n',"@mixin breakpoint($point) {\n @if $point == desktop {\n @media (min-width: $screen-desktop) {\n @content;\n }\n } @else if $point == laptop {\n @media (min-width: $screen-laptop) {\n @content;\n }\n } @else if $point == tablet {\n @media (min-width: $screen-tablet) {\n @content;\n }\n } @else if $point == phablet {\n @media (min-width: $screen-phablet) {\n @content;\n }\n }\n}\n","\ufeff@mixin appearance ($value) {\n -webkit-appearance: $value;\n -moz-appearance: $value;\n appearance: $value;\n}\n","@mixin border-radius($radius) {\n -webkit-border-radius: $radius;\n border-radius: $radius;\n}\n\n// Single side border-radius\n\n@mixin border-top-radius($radius) {\n -webkit-border-top-right-radius: $radius;\n border-top-right-radius: $radius;\n -webkit-border-top-left-radius: $radius;\n border-top-left-radius: $radius;\n}\n@mixin border-right-radius($radius) {\n -webkit-border-bottom-right-radius: $radius;\n border-bottom-right-radius: $radius;\n -webkit-border-top-right-radius: $radius;\n border-top-right-radius: $radius;\n}\n@mixin border-bottom-radius($radius) {\n -webkit-border-bottom-right-radius: $radius;\n border-bottom-right-radius: $radius;\n -webkit-border-bottom-left-radius: $radius;\n border-bottom-left-radius: $radius;\n}\n@mixin border-left-radius($radius) {\n -webkit-border-bottom-left-radius: $radius;\n border-bottom-left-radius: $radius;\n -webkit-border-top-left-radius: $radius;\n border-top-left-radius: $radius;\n}","\ufeff@mixin box-shadow($shadows...) {\n -webkit-box-shadow: $shadows;\n -moz-box-shadow: $shadows;\n box-shadow: $shadows;\n}\n","$body-background: #ffffff;\n$navigation-bar-background: #f7f7f7;\n$hover-background: rgba(0,0,0,.05);\n$default-border: #d8d8d8;\n\n$default-background: #eee;\n$default-background-hover: #ddd;\n$default-text:#2F3940;\n\n$light-gray: #f6f5f4;\n\n$primary-brand: #FE5000;\n\n$primary-background: #3767C7;\n$primary-background-hover: #FE5000;\n$primary-text: #3767C7;\n$primary-text-hover:#0056b3;\n\n\n$success-background: #06A755;\n$success-background-hover: #009745;\n$success-text: #06A755;\n\n\n$warning-background: #C38621;\n$warning-background-hover: #B37611;\n$warning-text: #C38621;\n\n$danger-background: #E00d0D;\n$danger-background-hover: #D00000;\n$danger-text: #E00d0D;\n\n$disabled-background: #f4f4f4;\n$disabled-border: #dedede;\n$disabled-text: #707070;\n\n\n$light-green: #8fff33;\n$light-yellow: #ffEb3b;\n$light-red: #ff4a2e;\n"],sourceRoot:""}]);const a=i},2979:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>r});const r='<template>\n <div class="main-search-field">\n <label id="main-search-input-label" for="main-search-input" class="hidden">søk</label>\n <input id="main-search-input" autocomplete="off" type="search" value="" />\n <button id="search-submit-button"></button>\n <div id="search-results-container" class="search-results-container">\n \n </div>\n </div>\n </template>'},164:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,r,s,o){"string"==typeof e&&(e=[[null,e,void 0]]);var i={};if(r)for(var a=0;a<this.length;a++){var c=this[a][0];null!=c&&(i[c]=!0)}for(var l=0;l<e.length;l++){var d=[].concat(e[l]);r&&i[d[0]]||(void 0!==o&&(void 0===d[5]||(d[1]="@layer".concat(d[5].length>0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=o),n&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=n):d[2]=n),s&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=s):d[4]="".concat(s)),t.push(d))}},t}},5052:e=>{"use strict";e.exports=function(e){var t=e[1],n=e[3];if(!n)return t;if("function"==typeof btoa){var r=btoa(unescape(encodeURIComponent(JSON.stringify(n)))),s="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(r),o="/*# ".concat(s," */");return[t].concat([o]).join("\n")}return[t].join("\n")}},8631:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(s,o){function i(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,a)}c((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.Component=void 0;const s=n(169),o=n(6999),i=n(2466);t.Component=e=>t=>{var n;const a=e.tag||i.toKebabCase(t.prototype.constructor.name),c=((n=class extends t{constructor(){super(),this.props={},this.showShadowRoot=null==e.shadow||e.shadow,!this.shadowRoot&&this.showShadowRoot&&this.attachShadow({mode:"open"})}static get observedAttributes(){return Object.keys(this.propsInit||{}).map((e=>i.toKebabCase(e)))}attributeChangedCallback(e,t,n){this.onAttributeChange(e,t,n)}onAttributeChange(e,t,n,r=!0){if(t!=n){r&&(this[i.toCamelCase(e)]=n);const s=this.constructor.watchAttributes;if(s&&s[e]){const r=s[e];this.__connected&&"function"==typeof this[r]&&this[r]({old:t,new:n})}}}connectedCallback(){const e=Object.create(null,{connectedCallback:{get:()=>super.connectedCallback}});return r(this,void 0,void 0,(function*(){yield this.render(),e.connectedCallback&&e.connectedCallback.call(this),this.__connected=!0,s.addEventListeners(this),o.initializeProps(this)}))}render(){return r(this,void 0,void 0,(function*(){if(this.__connected)return;const t=document.createElement("template");t.innerHTML=yield this.getStyle(),e.template instanceof Promise?t.content.appendChild(yield this.getExternalTemplate()):"string"==typeof e.template&&(t.innerHTML+=e.template),(this.showShadowRoot?this.shadowRoot:this).appendChild(t.content.cloneNode(!0))}))}getExternalTemplate(){return r(this,void 0,void 0,(function*(){const t=(yield e.template).default.toString(),n=document.createRange().createContextualFragment(t);return 1===n.children.length&&"TEMPLATE"===n.children[0].nodeName?n.firstChild.content:n}))}getStyle(){return r(this,void 0,void 0,(function*(){let t;return e.style instanceof Promise?t=(yield e.style).default.toString():"string"==typeof e.style&&(t=e.style),t?`<style>${t}</style>`:""}))}}).__connected=!1,n.ready=new Promise(((e,t)=>e(!0))),n);return customElements.get(a)||customElements.define(a,c),c}},3704:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CustomElement=void 0;class n extends HTMLElement{constructor(){super()}connect(e){this.isConnected||document.querySelector(e).appendChild(this)}}t.CustomElement=n},3365:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getShadowRootElement=t.getElement=void 0,t.getElement=e=>document.querySelector(e),t.getShadowRootElement=(e,t)=>e.shadowRoot.querySelector(t)},3128:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),s=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),s(n(8631),t),s(n(3704),t),s(n(3365),t),s(n(169),t),s(n(6999),t),s(n(3982),t),s(n(8861),t),s(n(1063),t)},169:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Dispatch=t.addEventListeners=t.Listen=void 0;const r=n(2466);t.Listen=(e,t)=>(n,r)=>{n.constructor.listeners||(n.constructor.listeners=[]),n.constructor.listeners.push({selector:t,eventName:e,handler:n[r]})},t.addEventListeners=e=>{if(e.constructor.listeners){const t=e.shadowRoot||e;for(const n of e.constructor.listeners){const r=n.selector?t.querySelector(n.selector)?t.querySelector(n.selector):null:e;r&&r.addEventListener(n.eventName,(t=>{n.handler.call(e,t)}))}}},t.Dispatch=e=>(t,n)=>{Object.defineProperty(t,n,{get:function(){const t=this;return{emit(s){const o=e||r.toDotCase(n);t.dispatchEvent(new CustomEvent(o,s))}}}})}},6999:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.initializeProps=t.Prop=void 0;const r=n(2466);t.Prop=()=>(e,t)=>{const n=r.toKebabCase(t);e.constructor.propsInit||(e.constructor.propsInit={}),e.constructor.propsInit[t]=null,Object.defineProperty(e,t,{get:function(){return this.props[t]?this.props[t]:this.getAttribute(n)},set:function(e){if(this.__connected){const s=this.props[t];this.props[t]=r.tryParseInt(e),"object"!=typeof e?this.setAttribute(n,e):this.onAttributeChange(n,s,e,!1)}else this.hasAttribute(r.toKebabCase(t))||(this.constructor.propsInit[t]=e)}})},t.initializeProps=e=>{const t=e.constructor.watchAttributes;for(let n of(e=>{const t=e.constructor.watchAttributes,n=Object.assign({},t);Object.keys(n).forEach((e=>n[e]=""));const r=Object.assign(Object.assign({},n),e.constructor.propsInit);return Object.keys(r)})(e)){if(t)if(null==t[r.toKebabCase(n)])t[r.toKebabCase(n)]="";else{const s=e.props[n]||e.getAttribute(r.toKebabCase(n));"function"==typeof e[t[n]]&&e[t[n]]({new:s})}e.constructor.propsInit[n]&&(e.hasAttribute(r.toKebabCase(n))||(e[n]=e.constructor.propsInit[n]))}}},3982:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Toggle=void 0;const r=n(2466);t.Toggle=()=>(e,t)=>{e.constructor.propsInit||(e.constructor.propsInit={}),e.constructor.propsInit[t]=null,Object.defineProperty(e,t,{get:function(){return(e=>{if(this.hasAttribute(e)){const t=this.getAttribute(e);return!!/^(true|false|^$)$/.test(t)&&("true"==t||""==t)}return!1})(t)},set:function(e){const n=e;if(null!=e)switch(typeof e){case"boolean":break;case"string":/^(true|false|^$)$/.test(e)?e="true"==n||""==n:(console.warn(`TypeError: Cannot set boolean toggle property '${t}' to '${e}'`),e=!1);break;default:throw`TypeError: Cannot set boolean toggle property '${t}' to '${e}'`}this.__connected?(this.props[t]=e||!1,""!==n&&null!==n?this.setAttribute(t,e):e?this.setAttribute(t,""):this.removeAttribute(t)):this.hasAttribute(r.toKebabCase(t))||(this.constructor.propsInit[t]=e)}})}},8861:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},2466:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tryParseInt=t.toDotCase=t.toCamelCase=t.toKebabCase=void 0,t.toKebabCase=e=>e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),t.toCamelCase=e=>e.toLowerCase().replace(/(\-\w)/g,(e=>e[1].toUpperCase())),t.toDotCase=e=>e.replace(/(?!^)([A-Z])/g," $1").replace(/[_\s]+(?=[a-zA-Z])/g,".").toLowerCase(),t.tryParseInt=e=>parseInt(e)==e&&NaN!==parseFloat(e)?parseInt(e):e},1063:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Watch=void 0;const r=n(2466);t.Watch=e=>(t,n)=>{t.constructor.watchAttributes||(t.constructor.watchAttributes={}),t.constructor.watchAttributes[r.toKebabCase(e)]=n,t.constructor.propsInit||(t.constructor.propsInit={}),t.constructor.propsInit[e]=null}},8289:e=>{e.exports='<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 34 35" style="enable-background:new 0 0 34 35;" xml:space="preserve"><style type="text/css"> .__24nL31r__st0{fill:#B0A9A2;} </style><g><path class="__24nL31r__st0 " d="M23.6,22.8c2.2-2.4,3.6-5.7,3.6-9.2C27.2,6.1,21.1,0,13.6,0C6.1,0,0,6.1,0,13.6c0,7.5,6.1,13.6,13.6,13.6 c3.1,0,5.9-1,8.1-2.7l10.1,10.1c0.2,0.2,0.6,0.4,0.9,0.4c0.3,0,0.6-0.1,0.9-0.4c0.5-0.5,0.5-1.3,0-1.7L23.6,22.8z M2.5,13.6 c0-6.1,5-11.1,11.1-11.1c6.1,0,11.1,5,11.1,11.1s-5,11.1-11.1,11.1S2.5,19.7,2.5,13.6L2.5,13.6z"></path></g></svg>'},8914:function(e,t){"use strict";var n=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(s,o){function i(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,a)}c((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.fetchDropdownSearchResults=t.fetchMenuItems=t.getGeonorgeMenuUrl=t.getKartkatalogApiUrl=void 0,t.getKartkatalogApiUrl=e=>`https://kartkatalog.${"dev"===e||"test"===e?e+".":""}geonorge.no/api`,t.getGeonorgeMenuUrl=(e,t)=>`https://www.${"dev"===t||"test"===t?"test.":""}geonorge.no/${"en"===e?"en/":""}api/menu/get?omitLinks=1`,t.fetchMenuItems=(e="no",n="")=>{const r=(0,t.getGeonorgeMenuUrl)(e,n);return fetch(r).then((e=>e.json())).then((e=>e))},t.fetchDropdownSearchResults=(e="",r="no",s="")=>n(void 0,void 0,void 0,(function*(){const o={dataset:`search?text=${e=e.toString()}&facets%5B1%5Dname=type&facets%5B1%5Dvalue=dataset`,series:`search?text=${e}&facets%5B1%5Dname=type&facets%5B1%5Dvalue=series`,service:`search?text=${e}&facets%5B1%5Dname=type&facets%5B1%5Dvalue=service`,servicelayer:`search?text=${e}&facets%5B1%5Dname=type&facets%5B1%5Dvalue=servicelayer`,software:`search?text=${e}&facets%5B1%5Dname=type&facets%5B1%5Dvalue=software`,articles:`articles?text=${e}`},i={headers:new Headers({"Accept-Language":r})};return e&&e.length?yield Promise.all(Object.keys(o).map((e=>n(void 0,void 0,void 0,(function*(){const n=(0,t.getKartkatalogApiUrl)(s);return fetch(`${n}/${o[e]}&limit=5`,i).then((e=>e.json())).then((t=>Object.assign(Object.assign({},t),{searchResultsType:e})))}))))):null}))},2781:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.renderDropdownResultLink=t.convertTextToUrlSlug=t.getGeonorgeNedlastingUrl=t.getGeonorgeUrl=t.getKartkatalogUrl=void 0,t.getKartkatalogUrl=e=>`https://kartkatalog.${"dev"===e||"test"===e?e+".":""}geonorge.no`,t.getGeonorgeUrl=(e,t)=>`https://www.${"dev"===t||"test"===t?"test.":""}geonorge.no/${"en"===e?"en/":""}`,t.getGeonorgeNedlastingUrl=e=>`https://nedlasting.${"dev"===e||"test"===e?"test.":""}geonorge.no`;const n=(e,t,n)=>(e=(e=(e=e.replace(new RegExp(`([^s])([${t}])([^s])`,"ig"),`$1 ${n} $3`)).replace(new RegExp(`([^s])([${t}])`,"ig"),`$1 ${n}`)).replace(new RegExp(`([${t}])([^s])`,"ig"),`${n} $2`)).replace(new RegExp(`[${t}]`,"ig"),n);t.convertTextToUrlSlug=(e="")=>(e=e.toLowerCase(),e=n(e,"&","and"),(e=(e=(e=(e=(e=(e=(e=(e=(e=n(e,"+","plus")).replace("æ","ae")).replace("ä","ae")).replace("ø","oe")).replace("ö","oe")).replace("å","aa")).replace(/( - )/g,"-")).replace(/[\s]+/g,"-")).replace(/[^a-z0-9-]+/gi,"")).replace(/^[^A-Z0-9]*|[^a-z0-9]*$/gi,""));const r=(e,t)=>{if(!t)return!1;t({event:"updateSearchString",category:"metadataSearch",activity:"dropDownResultsClick",searchString:e})};t.renderDropdownResultLink=(e,n,s,o,i)=>"articles"===n?`<a onClick="${r(s,i)}" href="${e.ShowDetailsUrl?e.ShowDetailsUrl:"#"}">${e.Title}</a>`:`<a onClick="${r(s,i)}" href="${(0,t.getKartkatalogUrl)(o)}/metadata/${(0,t.convertTextToUrlSlug)(e.Title)}/${e.Uuid}">${e.Title}</a>`},1517:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var s=Object.getOwnPropertyDescriptor(t,n);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,s)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__decorate||function(e,t,n,r){var s,o=arguments.length,i=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(i=(o<3?s(i):o>3?s(t,n,i):s(t,n))||i);return o>3&&i&&Object.defineProperty(t,n,i),i},i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return s(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.MainSearchField=void 0;const c=n(3128),l=n(8914),d=n(2781),u=a(n(8289));let h=class extends c.CustomElement{constructor(){super(),this.searchstring="",this.renderSearchResultsForType=e=>{const t=e.Results[0].TypeTranslated,n=e.searchResultsType,r=e.Results.map((e=>`<li>${(0,d.renderDropdownResultLink)(e,n,this.searchstring,this.environment)}</li>`)).join("");return`\n <div class="search-results-for-type">\n <a href="${"articles"===n?`${(0,d.getKartkatalogUrl)(this.environment)}/articles?text=${this.searchstring}`:`${(0,d.getKartkatalogUrl)(this.environment)}/metadata?text=${this.searchstring}&type=${n}`}" class="search-results-for-type-title">\n ${t}\n <span class="search-results-for-type-number-badge">\n ${e.NumFound}\n </span>\n </a>\n <ul class="search-results-for-type-list">\n ${r}\n </ul>\n </div>`},this.renderSearchResults=e=>`<div>${e.map((e=>this.renderSearchResultsForType(e))).join("")}</div>`,this.hideSearchResultsContainer=()=>{this.showSearchResults=!1},this.clickOutsideSearchResultsContainer=this.clickOutsideSearchResultsContainer.bind(this)}setup(e){this.connect(e.container),e.id&&(this.id=e.id)}connectedCallback(){this.searchField=(0,c.getShadowRootElement)(this,"#main-search-input"),this.searchFieldLabel=(0,c.getShadowRootElement)(this,"#main-search-input-label"),this.searchButton=(0,c.getShadowRootElement)(this,"#search-submit-button"),this.searchFieldLabel.innerHTML="en"===this.language?"Search":"Søk",this.searchButton.innerHTML=u.default,this.searchResultsContainer=(0,c.getShadowRootElement)(this,"#search-results-container"),this.searchResultsContainer.style.maxHeight=window.innerHeight-61+"px",this.searchField&&this.searchstring&&this.searchField.setAttribute("value",this.searchstring),document.addEventListener("click",this.clickOutsideSearchResultsContainer)}disconnectedCallback(){document.removeEventListener("click",this.clickOutsideSearchResultsContainer)}clickOutsideSearchResultsContainer(e){var t;const n=e.composedPath()[0];if(n.closest("#search-results-container")||n.closest("#main-search-input")){const e=n.closest("a");(null===(t=null==e?void 0:e.href)||void 0===t?void 0:t.length)&&this.hideSearchResultsContainer()}else this.hideSearchResultsContainer()}submitSearch(){var e;this.hideSearchResultsContainer(),this.preventRedirect?this.onSearch.emit({detail:{searchString:this.searchstring}}):window.location.href=`${(0,d.getKartkatalogUrl)(this.environment)}/metadata?text=${(null===(e=this.searchstring)||void 0===e?void 0:e.length)?encodeURI(this.searchstring.toString()):""}`}searchFieldKeyUp(e){var t,n,r;e.key&&"Enter"===e.key&&(null===(t=this.searchstring)||void 0===t?void 0:t.toString().length)?this.submitSearch():this.searchstring=(null===(r=null===(n=this.searchField)||void 0===n?void 0:n.value)||void 0===r?void 0:r.toString())||""}onSearchSubmitted(e){this.submitSearch()}searchStringChanged(){this.searchField&&this.searchField.setAttribute("value",this.searchstring),(0,l.fetchDropdownSearchResults)(this.searchstring,this.language,this.environment).then((e=>{this.searchResultsResponses=e}))}languageChanged(){this.searchField&&this.searchField.setAttribute("aria-label","en"===this.language?"Enter your search query":"Skriv inn det du vil søke etter"),this.searchFieldLabel&&(this.searchFieldLabel.innerText="en"===this.language?"Search":"Søk"),this.searchButton&&this.searchButton.setAttribute("aria-label","en"===this.language?"Search":"Søk")}showSearchResultsChanged(){this.showSearchResults?this.searchResultsContainer.classList.add("open"):this.searchResultsContainer.classList.remove("open")}searchResultsResponseChanged(){const e=this.searchResultsResponses&&this.searchResultsResponses.length?this.searchResultsResponses.filter((e=>e.NumFound>0)):[];this.searchResultsContainer.innerHTML=e.length?this.renderSearchResults(e):"",this.showSearchResults=!!e.length}static setup(e,t){const n=(0,c.getElement)(e);t.onClick&&n.addEventListener("searchButtonClick",t.onClick),t.active&&(n.showSearchResults=t.active)}};h.elementSelector="main-search-field",o([(0,c.Prop)()],h.prototype,"id",void 0),o([(0,c.Prop)()],h.prototype,"environment",void 0),o([(0,c.Toggle)()],h.prototype,"showSearchResults",void 0),o([(0,c.Toggle)()],h.prototype,"preventRedirect",void 0),o([(0,c.Prop)()],h.prototype,"searchstring",void 0),o([(0,c.Prop)()],h.prototype,"language",void 0),o([(0,c.Prop)()],h.prototype,"searchResultsResponses",void 0),o([(0,c.Dispatch)("searchResultsChanged")],h.prototype,"onTextChanged",void 0),o([(0,c.Dispatch)("onSearchStringChange")],h.prototype,"onSearchStringChange",void 0),o([(0,c.Dispatch)("onSearch")],h.prototype,"onSearch",void 0),o([(0,c.Listen)("keyup","input")],h.prototype,"searchFieldKeyUp",null),o([(0,c.Listen)("click","#search-submit-button")],h.prototype,"onSearchSubmitted",null),o([(0,c.Watch)("searchstring")],h.prototype,"searchStringChanged",null),o([(0,c.Watch)("language")],h.prototype,"languageChanged",null),o([(0,c.Watch)("showsearchresults")],h.prototype,"showSearchResultsChanged",null),o([(0,c.Watch)("searchResultsResponses")],h.prototype,"searchResultsResponseChanged",null),h=o([(0,c.Component)({tag:"main-search-field",template:Promise.resolve().then((()=>i(n(2979)))),style:Promise.resolve().then((()=>i(n(5533))))})],h),t.MainSearchField=h}},t={};function n(r){var s=t[r];if(void 0!==s)return s.exports;var o=t[r]={id:r,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.exports}return n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n(1517)})())); | ||
//# sourceMappingURL=MainSearchField.js.map |
@@ -1,2 +0,2 @@ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.geonorge=e():(t.geonorge=t.geonorge||{},t.geonorge.NavigationTabContent=e())}(self,(()=>(()=>{"use strict";var t={4540:(t,e,o)=>{o.r(e),o.d(e,{default:()=>c});var n=o(4663),r=o.n(n),s=o(7638),i=o.n(s)()(r());i.push([t.id,"","",{version:3,sources:[],names:[],mappings:"",sourceRoot:""}]);const c=i},8349:(t,e,o)=>{o.r(e),o.d(e,{default:()=>n});const n='<template>\n <slot name="tab-content"></slot>\n</template>'},7638:t=>{t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var o="",n=void 0!==e[5];return e[4]&&(o+="@supports (".concat(e[4],") {")),e[2]&&(o+="@media ".concat(e[2]," {")),n&&(o+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),o+=t(e),n&&(o+="}"),e[2]&&(o+="}"),e[4]&&(o+="}"),o})).join("")},e.i=function(t,o,n,r,s){"string"==typeof t&&(t=[[null,t,void 0]]);var i={};if(n)for(var c=0;c<this.length;c++){var a=this[c][0];null!=a&&(i[a]=!0)}for(var u=0;u<t.length;u++){var l=[].concat(t[u]);n&&i[l[0]]||(void 0!==s&&(void 0===l[5]||(l[1]="@layer".concat(l[5].length>0?" ".concat(l[5]):""," {").concat(l[1],"}")),l[5]=s),o&&(l[2]?(l[1]="@media ".concat(l[2]," {").concat(l[1],"}"),l[2]=o):l[2]=o),r&&(l[4]?(l[1]="@supports (".concat(l[4],") {").concat(l[1],"}"),l[4]=r):l[4]="".concat(r)),e.push(l))}},e}},4663:t=>{t.exports=function(t){var e=t[1],o=t[3];if(!o)return e;if("function"==typeof btoa){var n=btoa(unescape(encodeURIComponent(JSON.stringify(o)))),r="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(n),s="/*# ".concat(r," */");return[e].concat([s]).join("\n")}return[e].join("\n")}},1397:function(t,e,o){var n=this&&this.__awaiter||function(t,e,o,n){return new(o||(o=Promise))((function(r,s){function i(t){try{a(n.next(t))}catch(t){s(t)}}function c(t){try{a(n.throw(t))}catch(t){s(t)}}function a(t){var e;t.done?r(t.value):(e=t.value,e instanceof o?e:new o((function(t){t(e)}))).then(i,c)}a((n=n.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.Component=void 0;const r=o(5969),s=o(5773),i=o(3804);e.Component=t=>e=>{var o;const c=t.tag||i.toKebabCase(e.prototype.constructor.name),a=((o=class extends e{constructor(){super(),this.props={},this.showShadowRoot=null==t.shadow||t.shadow,!this.shadowRoot&&this.showShadowRoot&&this.attachShadow({mode:"open"})}static get observedAttributes(){return Object.keys(this.propsInit||{}).map((t=>i.toKebabCase(t)))}attributeChangedCallback(t,e,o){this.onAttributeChange(t,e,o)}onAttributeChange(t,e,o,n=!0){if(e!=o){n&&(this[i.toCamelCase(t)]=o);const r=this.constructor.watchAttributes;if(r&&r[t]){const n=r[t];this.__connected&&"function"==typeof this[n]&&this[n]({old:e,new:o})}}}connectedCallback(){const t=Object.create(null,{connectedCallback:{get:()=>super.connectedCallback}});return n(this,void 0,void 0,(function*(){yield this.render(),t.connectedCallback&&t.connectedCallback.call(this),this.__connected=!0,r.addEventListeners(this),s.initializeProps(this)}))}render(){return n(this,void 0,void 0,(function*(){if(this.__connected)return;const e=document.createElement("template");e.innerHTML=yield this.getStyle(),t.template instanceof Promise?e.content.appendChild(yield this.getExternalTemplate()):"string"==typeof t.template&&(e.innerHTML+=t.template),(this.showShadowRoot?this.shadowRoot:this).appendChild(e.content.cloneNode(!0))}))}getExternalTemplate(){return n(this,void 0,void 0,(function*(){const e=(yield t.template).default.toString(),o=document.createRange().createContextualFragment(e);return 1===o.children.length&&"TEMPLATE"===o.children[0].nodeName?o.firstChild.content:o}))}getStyle(){return n(this,void 0,void 0,(function*(){let e;return t.style instanceof Promise?e=(yield t.style).default.toString():"string"==typeof t.style&&(e=t.style),e?`<style>${e}</style>`:""}))}}).__connected=!1,o.ready=new Promise(((t,e)=>t(!0))),o);return customElements.get(c)||customElements.define(c,a),a}},985:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CustomElement=void 0;class o extends HTMLElement{constructor(){super()}connect(t){this.isConnected||document.querySelector(t).appendChild(this)}}e.CustomElement=o},265:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getShadowRootElement=e.getElement=void 0,e.getElement=t=>document.querySelector(t),e.getShadowRootElement=(t,e)=>t.shadowRoot.querySelector(e)},406:function(t,e,o){var n=this&&this.__createBinding||(Object.create?function(t,e,o,n){void 0===n&&(n=o),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[o]}})}:function(t,e,o,n){void 0===n&&(n=o),t[n]=e[o]}),r=this&&this.__exportStar||function(t,e){for(var o in t)"default"===o||Object.prototype.hasOwnProperty.call(e,o)||n(e,t,o)};Object.defineProperty(e,"__esModule",{value:!0}),r(o(1397),e),r(o(985),e),r(o(265),e),r(o(5969),e),r(o(5773),e),r(o(4271),e),r(o(9766),e),r(o(4938),e)},5969:(t,e,o)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Dispatch=e.addEventListeners=e.Listen=void 0;const n=o(3804);e.Listen=(t,e)=>(o,n)=>{o.constructor.listeners||(o.constructor.listeners=[]),o.constructor.listeners.push({selector:e,eventName:t,handler:o[n]})},e.addEventListeners=t=>{if(t.constructor.listeners){const e=t.shadowRoot||t;for(const o of t.constructor.listeners){const n=o.selector?e.querySelector(o.selector)?e.querySelector(o.selector):null:t;n&&n.addEventListener(o.eventName,(e=>{o.handler.call(t,e)}))}}},e.Dispatch=t=>(e,o)=>{Object.defineProperty(e,o,{get:function(){const e=this;return{emit(r){const s=t||n.toDotCase(o);e.dispatchEvent(new CustomEvent(s,r))}}}})}},5773:(t,e,o)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.initializeProps=e.Prop=void 0;const n=o(3804);e.Prop=()=>(t,e)=>{const o=n.toKebabCase(e);t.constructor.propsInit||(t.constructor.propsInit={}),t.constructor.propsInit[e]=null,Object.defineProperty(t,e,{get:function(){return this.props[e]?this.props[e]:this.getAttribute(o)},set:function(t){if(this.__connected){const r=this.props[e];this.props[e]=n.tryParseInt(t),"object"!=typeof t?this.setAttribute(o,t):this.onAttributeChange(o,r,t,!1)}else this.hasAttribute(n.toKebabCase(e))||(this.constructor.propsInit[e]=t)}})},e.initializeProps=t=>{const e=t.constructor.watchAttributes;for(let o of(t=>{const e=t.constructor.watchAttributes,o=Object.assign({},e);Object.keys(o).forEach((t=>o[t]=""));const n=Object.assign(Object.assign({},o),t.constructor.propsInit);return Object.keys(n)})(t)){if(e)if(null==e[n.toKebabCase(o)])e[n.toKebabCase(o)]="";else{const r=t.props[o]||t.getAttribute(n.toKebabCase(o));"function"==typeof t[e[o]]&&t[e[o]]({new:r})}t.constructor.propsInit[o]&&(t.hasAttribute(n.toKebabCase(o))||(t[o]=t.constructor.propsInit[o]))}}},4271:(t,e,o)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Toggle=void 0;const n=o(3804);e.Toggle=()=>(t,e)=>{t.constructor.propsInit||(t.constructor.propsInit={}),t.constructor.propsInit[e]=null,Object.defineProperty(t,e,{get:function(){return(t=>{if(this.hasAttribute(t)){const e=this.getAttribute(t);return!!/^(true|false|^$)$/.test(e)&&("true"==e||""==e)}return!1})(e)},set:function(t){const o=t;if(null!=t)switch(typeof t){case"boolean":break;case"string":/^(true|false|^$)$/.test(t)?t="true"==o||""==o:(console.warn(`TypeError: Cannot set boolean toggle property '${e}' to '${t}'`),t=!1);break;default:throw`TypeError: Cannot set boolean toggle property '${e}' to '${t}'`}this.__connected?(this.props[e]=t||!1,""!==o&&null!==o?this.setAttribute(e,t):t?this.setAttribute(e,""):this.removeAttribute(e)):this.hasAttribute(n.toKebabCase(e))||(this.constructor.propsInit[e]=t)}})}},9766:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},3804:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.tryParseInt=e.toDotCase=e.toCamelCase=e.toKebabCase=void 0,e.toKebabCase=t=>t.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),e.toCamelCase=t=>t.toLowerCase().replace(/(\-\w)/g,(t=>t[1].toUpperCase())),e.toDotCase=t=>t.replace(/(?!^)([A-Z])/g," $1").replace(/[_\s]+(?=[a-zA-Z])/g,".").toLowerCase(),e.tryParseInt=t=>parseInt(t)==t&&NaN!==parseFloat(t)?parseInt(t):t},4938:(t,e,o)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Watch=void 0;const n=o(3804);e.Watch=t=>(e,o)=>{e.constructor.watchAttributes||(e.constructor.watchAttributes={}),e.constructor.watchAttributes[n.toKebabCase(t)]=o,e.constructor.propsInit||(e.constructor.propsInit={}),e.constructor.propsInit[t]=null}},7108:function(t,e,o){var n=this&&this.__createBinding||(Object.create?function(t,e,o,n){void 0===n&&(n=o);var r=Object.getOwnPropertyDescriptor(e,o);r&&!("get"in r?!e.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return e[o]}}),Object.defineProperty(t,n,r)}:function(t,e,o,n){void 0===n&&(n=o),t[n]=e[o]}),r=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__decorate||function(t,e,o,n){var r,s=arguments.length,i=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(t,e,o,n);else for(var c=t.length-1;c>=0;c--)(r=t[c])&&(i=(s<3?r(i):s>3?r(e,o,i):r(e,o))||i);return s>3&&i&&Object.defineProperty(e,o,i),i},i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var o in t)"default"!==o&&Object.prototype.hasOwnProperty.call(t,o)&&n(e,t,o);return r(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.NavigationTabContent=void 0;const c=o(406);let a=0,u=class extends c.CustomElement{static get observedAttributes(){return["selected"]}constructor(){super()}setup(t){this.connect(t.container),t.id&&(this.id=t.id)}connectedCallback(){this.setAttribute("role","tabpanel"),this.id||(this.id="navigation-tab-content-"+a++)}disconnectedCallback(){}static setup(t,e){(0,c.getElement)(t)}};u.elementSelector="navigation-tab-content",s([(0,c.Prop)()],u.prototype,"id",void 0),u=s([(0,c.Component)({tag:"navigation-tab-content",template:Promise.resolve().then((()=>i(o(8349)))),style:Promise.resolve().then((()=>i(o(4540))))})],u),e.NavigationTabContent=u}},e={};function o(n){var r=e[n];if(void 0!==r)return r.exports;var s=e[n]={id:n,exports:{}};return t[n].call(s.exports,s,s.exports,o),s.exports}return o.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return o.d(e,{a:e}),e},o.d=(t,e)=>{for(var n in e)o.o(e,n)&&!o.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),o.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o(7108)})())); | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.geonorge=e():(t.geonorge=t.geonorge||{},t.geonorge.NavigationTabContent=e())}(self,(()=>(()=>{"use strict";var t={1064:(t,e,o)=>{o.r(e),o.d(e,{default:()=>c});var n=o(5052),r=o.n(n),s=o(164),i=o.n(s)()(r());i.push([t.id,"","",{version:3,sources:[],names:[],mappings:"",sourceRoot:""}]);const c=i},5090:(t,e,o)=>{o.r(e),o.d(e,{default:()=>n});const n='<template>\n <slot name="tab-content"></slot>\n</template>'},164:t=>{t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var o="",n=void 0!==e[5];return e[4]&&(o+="@supports (".concat(e[4],") {")),e[2]&&(o+="@media ".concat(e[2]," {")),n&&(o+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),o+=t(e),n&&(o+="}"),e[2]&&(o+="}"),e[4]&&(o+="}"),o})).join("")},e.i=function(t,o,n,r,s){"string"==typeof t&&(t=[[null,t,void 0]]);var i={};if(n)for(var c=0;c<this.length;c++){var a=this[c][0];null!=a&&(i[a]=!0)}for(var u=0;u<t.length;u++){var l=[].concat(t[u]);n&&i[l[0]]||(void 0!==s&&(void 0===l[5]||(l[1]="@layer".concat(l[5].length>0?" ".concat(l[5]):""," {").concat(l[1],"}")),l[5]=s),o&&(l[2]?(l[1]="@media ".concat(l[2]," {").concat(l[1],"}"),l[2]=o):l[2]=o),r&&(l[4]?(l[1]="@supports (".concat(l[4],") {").concat(l[1],"}"),l[4]=r):l[4]="".concat(r)),e.push(l))}},e}},5052:t=>{t.exports=function(t){var e=t[1],o=t[3];if(!o)return e;if("function"==typeof btoa){var n=btoa(unescape(encodeURIComponent(JSON.stringify(o)))),r="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(n),s="/*# ".concat(r," */");return[e].concat([s]).join("\n")}return[e].join("\n")}},8631:function(t,e,o){var n=this&&this.__awaiter||function(t,e,o,n){return new(o||(o=Promise))((function(r,s){function i(t){try{a(n.next(t))}catch(t){s(t)}}function c(t){try{a(n.throw(t))}catch(t){s(t)}}function a(t){var e;t.done?r(t.value):(e=t.value,e instanceof o?e:new o((function(t){t(e)}))).then(i,c)}a((n=n.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.Component=void 0;const r=o(169),s=o(6999),i=o(2466);e.Component=t=>e=>{var o;const c=t.tag||i.toKebabCase(e.prototype.constructor.name),a=((o=class extends e{constructor(){super(),this.props={},this.showShadowRoot=null==t.shadow||t.shadow,!this.shadowRoot&&this.showShadowRoot&&this.attachShadow({mode:"open"})}static get observedAttributes(){return Object.keys(this.propsInit||{}).map((t=>i.toKebabCase(t)))}attributeChangedCallback(t,e,o){this.onAttributeChange(t,e,o)}onAttributeChange(t,e,o,n=!0){if(e!=o){n&&(this[i.toCamelCase(t)]=o);const r=this.constructor.watchAttributes;if(r&&r[t]){const n=r[t];this.__connected&&"function"==typeof this[n]&&this[n]({old:e,new:o})}}}connectedCallback(){const t=Object.create(null,{connectedCallback:{get:()=>super.connectedCallback}});return n(this,void 0,void 0,(function*(){yield this.render(),t.connectedCallback&&t.connectedCallback.call(this),this.__connected=!0,r.addEventListeners(this),s.initializeProps(this)}))}render(){return n(this,void 0,void 0,(function*(){if(this.__connected)return;const e=document.createElement("template");e.innerHTML=yield this.getStyle(),t.template instanceof Promise?e.content.appendChild(yield this.getExternalTemplate()):"string"==typeof t.template&&(e.innerHTML+=t.template),(this.showShadowRoot?this.shadowRoot:this).appendChild(e.content.cloneNode(!0))}))}getExternalTemplate(){return n(this,void 0,void 0,(function*(){const e=(yield t.template).default.toString(),o=document.createRange().createContextualFragment(e);return 1===o.children.length&&"TEMPLATE"===o.children[0].nodeName?o.firstChild.content:o}))}getStyle(){return n(this,void 0,void 0,(function*(){let e;return t.style instanceof Promise?e=(yield t.style).default.toString():"string"==typeof t.style&&(e=t.style),e?`<style>${e}</style>`:""}))}}).__connected=!1,o.ready=new Promise(((t,e)=>t(!0))),o);return customElements.get(c)||customElements.define(c,a),a}},3704:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CustomElement=void 0;class o extends HTMLElement{constructor(){super()}connect(t){this.isConnected||document.querySelector(t).appendChild(this)}}e.CustomElement=o},3365:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getShadowRootElement=e.getElement=void 0,e.getElement=t=>document.querySelector(t),e.getShadowRootElement=(t,e)=>t.shadowRoot.querySelector(e)},3128:function(t,e,o){var n=this&&this.__createBinding||(Object.create?function(t,e,o,n){void 0===n&&(n=o),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[o]}})}:function(t,e,o,n){void 0===n&&(n=o),t[n]=e[o]}),r=this&&this.__exportStar||function(t,e){for(var o in t)"default"===o||Object.prototype.hasOwnProperty.call(e,o)||n(e,t,o)};Object.defineProperty(e,"__esModule",{value:!0}),r(o(8631),e),r(o(3704),e),r(o(3365),e),r(o(169),e),r(o(6999),e),r(o(3982),e),r(o(8861),e),r(o(1063),e)},169:(t,e,o)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Dispatch=e.addEventListeners=e.Listen=void 0;const n=o(2466);e.Listen=(t,e)=>(o,n)=>{o.constructor.listeners||(o.constructor.listeners=[]),o.constructor.listeners.push({selector:e,eventName:t,handler:o[n]})},e.addEventListeners=t=>{if(t.constructor.listeners){const e=t.shadowRoot||t;for(const o of t.constructor.listeners){const n=o.selector?e.querySelector(o.selector)?e.querySelector(o.selector):null:t;n&&n.addEventListener(o.eventName,(e=>{o.handler.call(t,e)}))}}},e.Dispatch=t=>(e,o)=>{Object.defineProperty(e,o,{get:function(){const e=this;return{emit(r){const s=t||n.toDotCase(o);e.dispatchEvent(new CustomEvent(s,r))}}}})}},6999:(t,e,o)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.initializeProps=e.Prop=void 0;const n=o(2466);e.Prop=()=>(t,e)=>{const o=n.toKebabCase(e);t.constructor.propsInit||(t.constructor.propsInit={}),t.constructor.propsInit[e]=null,Object.defineProperty(t,e,{get:function(){return this.props[e]?this.props[e]:this.getAttribute(o)},set:function(t){if(this.__connected){const r=this.props[e];this.props[e]=n.tryParseInt(t),"object"!=typeof t?this.setAttribute(o,t):this.onAttributeChange(o,r,t,!1)}else this.hasAttribute(n.toKebabCase(e))||(this.constructor.propsInit[e]=t)}})},e.initializeProps=t=>{const e=t.constructor.watchAttributes;for(let o of(t=>{const e=t.constructor.watchAttributes,o=Object.assign({},e);Object.keys(o).forEach((t=>o[t]=""));const n=Object.assign(Object.assign({},o),t.constructor.propsInit);return Object.keys(n)})(t)){if(e)if(null==e[n.toKebabCase(o)])e[n.toKebabCase(o)]="";else{const r=t.props[o]||t.getAttribute(n.toKebabCase(o));"function"==typeof t[e[o]]&&t[e[o]]({new:r})}t.constructor.propsInit[o]&&(t.hasAttribute(n.toKebabCase(o))||(t[o]=t.constructor.propsInit[o]))}}},3982:(t,e,o)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Toggle=void 0;const n=o(2466);e.Toggle=()=>(t,e)=>{t.constructor.propsInit||(t.constructor.propsInit={}),t.constructor.propsInit[e]=null,Object.defineProperty(t,e,{get:function(){return(t=>{if(this.hasAttribute(t)){const e=this.getAttribute(t);return!!/^(true|false|^$)$/.test(e)&&("true"==e||""==e)}return!1})(e)},set:function(t){const o=t;if(null!=t)switch(typeof t){case"boolean":break;case"string":/^(true|false|^$)$/.test(t)?t="true"==o||""==o:(console.warn(`TypeError: Cannot set boolean toggle property '${e}' to '${t}'`),t=!1);break;default:throw`TypeError: Cannot set boolean toggle property '${e}' to '${t}'`}this.__connected?(this.props[e]=t||!1,""!==o&&null!==o?this.setAttribute(e,t):t?this.setAttribute(e,""):this.removeAttribute(e)):this.hasAttribute(n.toKebabCase(e))||(this.constructor.propsInit[e]=t)}})}},8861:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},2466:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.tryParseInt=e.toDotCase=e.toCamelCase=e.toKebabCase=void 0,e.toKebabCase=t=>t.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),e.toCamelCase=t=>t.toLowerCase().replace(/(\-\w)/g,(t=>t[1].toUpperCase())),e.toDotCase=t=>t.replace(/(?!^)([A-Z])/g," $1").replace(/[_\s]+(?=[a-zA-Z])/g,".").toLowerCase(),e.tryParseInt=t=>parseInt(t)==t&&NaN!==parseFloat(t)?parseInt(t):t},1063:(t,e,o)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Watch=void 0;const n=o(2466);e.Watch=t=>(e,o)=>{e.constructor.watchAttributes||(e.constructor.watchAttributes={}),e.constructor.watchAttributes[n.toKebabCase(t)]=o,e.constructor.propsInit||(e.constructor.propsInit={}),e.constructor.propsInit[t]=null}},3676:function(t,e,o){var n=this&&this.__createBinding||(Object.create?function(t,e,o,n){void 0===n&&(n=o);var r=Object.getOwnPropertyDescriptor(e,o);r&&!("get"in r?!e.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return e[o]}}),Object.defineProperty(t,n,r)}:function(t,e,o,n){void 0===n&&(n=o),t[n]=e[o]}),r=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__decorate||function(t,e,o,n){var r,s=arguments.length,i=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(t,e,o,n);else for(var c=t.length-1;c>=0;c--)(r=t[c])&&(i=(s<3?r(i):s>3?r(e,o,i):r(e,o))||i);return s>3&&i&&Object.defineProperty(e,o,i),i},i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var o in t)"default"!==o&&Object.prototype.hasOwnProperty.call(t,o)&&n(e,t,o);return r(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.NavigationTabContent=void 0;const c=o(3128);let a=0,u=class extends c.CustomElement{static get observedAttributes(){return["selected"]}constructor(){super()}setup(t){this.connect(t.container),t.id&&(this.id=t.id)}connectedCallback(){this.setAttribute("role","tabpanel"),this.id||(this.id="navigation-tab-content-"+a++)}disconnectedCallback(){}static setup(t,e){(0,c.getElement)(t)}};u.elementSelector="navigation-tab-content",s([(0,c.Prop)()],u.prototype,"id",void 0),u=s([(0,c.Component)({tag:"navigation-tab-content",template:Promise.resolve().then((()=>i(o(5090)))),style:Promise.resolve().then((()=>i(o(1064))))})],u),e.NavigationTabContent=u}},e={};function o(n){var r=e[n];if(void 0!==r)return r.exports;var s=e[n]={id:n,exports:{}};return t[n].call(s.exports,s,s.exports,o),s.exports}return o.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return o.d(e,{a:e}),e},o.d=(t,e)=>{for(var n in e)o.o(e,n)&&!o.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),o.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o(3676)})())); | ||
//# sourceMappingURL=NavigationTabContent.js.map |
{ | ||
"name": "@kartverket/geonorge-web-components", | ||
"version": "2.20.0", | ||
"version": "2.20.2", | ||
"description": "Geonorge Web Components", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.geonorge=t():(e.geonorge=e.geonorge||{},e.geonorge.SearchTypeSelector=t())}(self,(()=>(()=>{"use strict";var e={727:(e,t,r)=>{r.r(t),r.d(t,{default:()=>i});var n=r(4663),o=r.n(n),a=r(7638),s=r.n(a)()(o());s.push([e.id,'div.search-type-selector{width:180px}div.search-type-selector label{font-size:14px;display:block;cursor:pointer;height:18px;font-weight:normal}div.search-type-selector label .search-type-counter{font-size:.9em}div.search-type-selector label .search-type-counter::before{content:"("}div.search-type-selector label .search-type-counter::after{content:")"}div.search-type-selector input[type=radio]{-webkit-border-radius:50%;border-radius:50%;-webkit-appearance:none;-moz-appearance:none;appearance:none;margin:0;font:inherit;color:currentColor;width:16px;height:16px;border:2px solid #7d746d;transform:translateY(-0.075em);display:inline-grid;place-content:center}div.search-type-selector input[type=radio]::before{-webkit-border-radius:50%;border-radius:50%;content:"";width:8px;height:8px;transform:scale(0);transition:120ms transform ease-in-out}div.search-type-selector input[type=radio]:checked{border-color:#3767c7}div.search-type-selector input[type=radio]:checked::before{transform:scale(1);background-color:#3767c7}div.search-type-selector input[type=radio]:focus-visible{outline:max(2px,.1em) solid #3767c7;outline-offset:max(2px,.1em)}',"",{version:3,sources:["webpack://./stories/main-navigation/search-type-selector/search-type-selector.scss","webpack://./style/mixins/_border-radius.scss","webpack://./style/mixins/_appearance.scss","webpack://./style/variables/_colors.scss"],names:[],mappings:"AAEA,yBACI,WAAA,CACA,+BACI,cAAA,CACA,aAAA,CACA,cAAA,CACA,WAAA,CACA,kBAAA,CACA,oDACI,cAAA,CACA,4DACI,WAAA,CAEJ,2DACI,WAAA,CAIZ,2CCnBF,yBDoB6B,CCnB7B,iBDmB6B,CEpB3B,uBFqBwB,CEpBxB,oBFoBwB,CEnBxB,eFmBwB,CACpB,QAAA,CACA,YAAA,CACA,kBAAA,CACA,UAAA,CACA,WAAA,CACA,wBAAA,CACA,8BAAA,CACA,mBAAA,CACA,oBAAA,CAGJ,mDCjCF,yBDkC6B,CCjC7B,iBDiC6B,CACvB,UAAA,CACA,SAAA,CACA,UAAA,CACA,kBAAA,CACA,sCAAA,CAGJ,mDACI,oBG7BO,CH8BP,2DACI,kBAAA,CACA,wBGhCG,CHoCX,yDACI,mCAAA,CACA,4BAAA",sourcesContent:['@import "../../../style/all";\n\ndiv.search-type-selector {\n width: 180px;\n label {\n font-size: 14px;\n display: block;\n cursor: pointer;\n height: 18px;\n font-weight: normal;\n .search-type-counter {\n font-size: 0.9em;\n &::before {\n content: "(";\n }\n &::after {\n content: ")";\n }\n }\n }\n input[type="radio"] {\n @include border-radius(50%);\n @include appearance(none);\n margin: 0;\n font: inherit;\n color: currentColor;\n width: 16px;\n height: 16px;\n border: 2px solid rgb(125, 116, 109);\n transform: translateY(-0.075em);\n display: inline-grid;\n place-content: center;\n }\n\n input[type="radio"]::before {\n @include border-radius(50%);\n content: "";\n width: 8px;\n height: 8px;\n transform: scale(0);\n transition: 120ms transform ease-in-out;\n }\n\n input[type="radio"]:checked {\n border-color: $primary-text;\n &::before {\n transform: scale(1);\n background-color: $primary-text;\n }\n }\n\n input[type="radio"]:focus-visible {\n outline: max(2px, 0.1em) solid $primary-text;\n outline-offset: max(2px, 0.1em);\n }\n}\n',"@mixin border-radius($radius) {\n -webkit-border-radius: $radius;\n border-radius: $radius;\n}\n\n// Single side border-radius\n\n@mixin border-top-radius($radius) {\n -webkit-border-top-right-radius: $radius;\n border-top-right-radius: $radius;\n -webkit-border-top-left-radius: $radius;\n border-top-left-radius: $radius;\n}\n@mixin border-right-radius($radius) {\n -webkit-border-bottom-right-radius: $radius;\n border-bottom-right-radius: $radius;\n -webkit-border-top-right-radius: $radius;\n border-top-right-radius: $radius;\n}\n@mixin border-bottom-radius($radius) {\n -webkit-border-bottom-right-radius: $radius;\n border-bottom-right-radius: $radius;\n -webkit-border-bottom-left-radius: $radius;\n border-bottom-left-radius: $radius;\n}\n@mixin border-left-radius($radius) {\n -webkit-border-bottom-left-radius: $radius;\n border-bottom-left-radius: $radius;\n -webkit-border-top-left-radius: $radius;\n border-top-left-radius: $radius;\n}","\ufeff@mixin appearance ($value) {\n -webkit-appearance: $value;\n -moz-appearance: $value;\n appearance: $value;\n}\n","$body-background: #ffffff;\n$navigation-bar-background: #f7f7f7;\n$hover-background: rgba(0,0,0,.05);\n$default-border: #d8d8d8;\n\n$default-background: #eee;\n$default-background-hover: #ddd;\n$default-text:#2F3940;\n\n$light-gray: #f6f5f4;\n\n$primary-brand: #FE5000;\n\n$primary-background: #3767C7;\n$primary-background-hover: #FE5000;\n$primary-text: #3767C7;\n$primary-text-hover:#0056b3;\n\n\n$success-background: #06A755;\n$success-background-hover: #009745;\n$success-text: #06A755;\n\n\n$warning-background: #C38621;\n$warning-background-hover: #B37611;\n$warning-text: #C38621;\n\n$danger-background: #E00d0D;\n$danger-background-hover: #D00000;\n$danger-text: #E00d0D;\n\n$disabled-background: #f4f4f4;\n$disabled-border: #dedede;\n$disabled-text: #707070;\n\n\n$light-green: #8fff33;\n$light-yellow: #ffEb3b;\n$light-red: #ff4a2e;\n"],sourceRoot:""}]);const i=s},8771:(e,t,r)=>{r.r(t),r.d(t,{default:()=>n});const n='<template>\n <div id="search-type-selector" class="search-type-selector">\n <label for="search-type-metadata">\n <input name="search-type" type="radio" id="search-type-metadata" value="metadata" />\n <span id="search-type-metadata-name">Kartkatalogen</span>\n <span id="search-type-metadata-counter" class="search-type-counter"></span>\n </label>\n <label for="search-type-article">\n <input name="search-type" type="radio" id="search-type-article" value="articles" />\n <span id="search-type-article-name">Artikler</span>\n <span id="search-type-article-counter" class="search-type-counter"></span>\n </label>\n </div>\n</template>'},7638:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var r="",n=void 0!==t[5];return t[4]&&(r+="@supports (".concat(t[4],") {")),t[2]&&(r+="@media ".concat(t[2]," {")),n&&(r+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),r+=e(t),n&&(r+="}"),t[2]&&(r+="}"),t[4]&&(r+="}"),r})).join("")},t.i=function(e,r,n,o,a){"string"==typeof e&&(e=[[null,e,void 0]]);var s={};if(n)for(var i=0;i<this.length;i++){var c=this[i][0];null!=c&&(s[c]=!0)}for(var l=0;l<e.length;l++){var d=[].concat(e[l]);n&&s[d[0]]||(void 0!==a&&(void 0===d[5]||(d[1]="@layer".concat(d[5].length>0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=a),r&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=r):d[2]=r),o&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=o):d[4]="".concat(o)),t.push(d))}},t}},4663:e=>{e.exports=function(e){var t=e[1],r=e[3];if(!r)return t;if("function"==typeof btoa){var n=btoa(unescape(encodeURIComponent(JSON.stringify(r)))),o="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(n),a="/*# ".concat(o," */");return[t].concat([a]).join("\n")}return[t].join("\n")}},1397:function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,a){function s(e){try{c(n.next(e))}catch(e){a(e)}}function i(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,i)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.Component=void 0;const o=r(5969),a=r(5773),s=r(3804);t.Component=e=>t=>{var r;const i=e.tag||s.toKebabCase(t.prototype.constructor.name),c=((r=class extends t{constructor(){super(),this.props={},this.showShadowRoot=null==e.shadow||e.shadow,!this.shadowRoot&&this.showShadowRoot&&this.attachShadow({mode:"open"})}static get observedAttributes(){return Object.keys(this.propsInit||{}).map((e=>s.toKebabCase(e)))}attributeChangedCallback(e,t,r){this.onAttributeChange(e,t,r)}onAttributeChange(e,t,r,n=!0){if(t!=r){n&&(this[s.toCamelCase(e)]=r);const o=this.constructor.watchAttributes;if(o&&o[e]){const n=o[e];this.__connected&&"function"==typeof this[n]&&this[n]({old:t,new:r})}}}connectedCallback(){const e=Object.create(null,{connectedCallback:{get:()=>super.connectedCallback}});return n(this,void 0,void 0,(function*(){yield this.render(),e.connectedCallback&&e.connectedCallback.call(this),this.__connected=!0,o.addEventListeners(this),a.initializeProps(this)}))}render(){return n(this,void 0,void 0,(function*(){if(this.__connected)return;const t=document.createElement("template");t.innerHTML=yield this.getStyle(),e.template instanceof Promise?t.content.appendChild(yield this.getExternalTemplate()):"string"==typeof e.template&&(t.innerHTML+=e.template),(this.showShadowRoot?this.shadowRoot:this).appendChild(t.content.cloneNode(!0))}))}getExternalTemplate(){return n(this,void 0,void 0,(function*(){const t=(yield e.template).default.toString(),r=document.createRange().createContextualFragment(t);return 1===r.children.length&&"TEMPLATE"===r.children[0].nodeName?r.firstChild.content:r}))}getStyle(){return n(this,void 0,void 0,(function*(){let t;return e.style instanceof Promise?t=(yield e.style).default.toString():"string"==typeof e.style&&(t=e.style),t?`<style>${t}</style>`:""}))}}).__connected=!1,r.ready=new Promise(((e,t)=>e(!0))),r);return customElements.get(i)||customElements.define(i,c),c}},985:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CustomElement=void 0;class r extends HTMLElement{constructor(){super()}connect(e){this.isConnected||document.querySelector(e).appendChild(this)}}t.CustomElement=r},265:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getShadowRootElement=t.getElement=void 0,t.getElement=e=>document.querySelector(e),t.getShadowRootElement=(e,t)=>e.shadowRoot.querySelector(t)},406:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(1397),t),o(r(985),t),o(r(265),t),o(r(5969),t),o(r(5773),t),o(r(4271),t),o(r(9766),t),o(r(4938),t)},5969:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Dispatch=t.addEventListeners=t.Listen=void 0;const n=r(3804);t.Listen=(e,t)=>(r,n)=>{r.constructor.listeners||(r.constructor.listeners=[]),r.constructor.listeners.push({selector:t,eventName:e,handler:r[n]})},t.addEventListeners=e=>{if(e.constructor.listeners){const t=e.shadowRoot||e;for(const r of e.constructor.listeners){const n=r.selector?t.querySelector(r.selector)?t.querySelector(r.selector):null:e;n&&n.addEventListener(r.eventName,(t=>{r.handler.call(e,t)}))}}},t.Dispatch=e=>(t,r)=>{Object.defineProperty(t,r,{get:function(){const t=this;return{emit(o){const a=e||n.toDotCase(r);t.dispatchEvent(new CustomEvent(a,o))}}}})}},5773:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.initializeProps=t.Prop=void 0;const n=r(3804);t.Prop=()=>(e,t)=>{const r=n.toKebabCase(t);e.constructor.propsInit||(e.constructor.propsInit={}),e.constructor.propsInit[t]=null,Object.defineProperty(e,t,{get:function(){return this.props[t]?this.props[t]:this.getAttribute(r)},set:function(e){if(this.__connected){const o=this.props[t];this.props[t]=n.tryParseInt(e),"object"!=typeof e?this.setAttribute(r,e):this.onAttributeChange(r,o,e,!1)}else this.hasAttribute(n.toKebabCase(t))||(this.constructor.propsInit[t]=e)}})},t.initializeProps=e=>{const t=e.constructor.watchAttributes;for(let r of(e=>{const t=e.constructor.watchAttributes,r=Object.assign({},t);Object.keys(r).forEach((e=>r[e]=""));const n=Object.assign(Object.assign({},r),e.constructor.propsInit);return Object.keys(n)})(e)){if(t)if(null==t[n.toKebabCase(r)])t[n.toKebabCase(r)]="";else{const o=e.props[r]||e.getAttribute(n.toKebabCase(r));"function"==typeof e[t[r]]&&e[t[r]]({new:o})}e.constructor.propsInit[r]&&(e.hasAttribute(n.toKebabCase(r))||(e[r]=e.constructor.propsInit[r]))}}},4271:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Toggle=void 0;const n=r(3804);t.Toggle=()=>(e,t)=>{e.constructor.propsInit||(e.constructor.propsInit={}),e.constructor.propsInit[t]=null,Object.defineProperty(e,t,{get:function(){return(e=>{if(this.hasAttribute(e)){const t=this.getAttribute(e);return!!/^(true|false|^$)$/.test(t)&&("true"==t||""==t)}return!1})(t)},set:function(e){const r=e;if(null!=e)switch(typeof e){case"boolean":break;case"string":/^(true|false|^$)$/.test(e)?e="true"==r||""==r:(console.warn(`TypeError: Cannot set boolean toggle property '${t}' to '${e}'`),e=!1);break;default:throw`TypeError: Cannot set boolean toggle property '${t}' to '${e}'`}this.__connected?(this.props[t]=e||!1,""!==r&&null!==r?this.setAttribute(t,e):e?this.setAttribute(t,""):this.removeAttribute(t)):this.hasAttribute(n.toKebabCase(t))||(this.constructor.propsInit[t]=e)}})}},9766:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},3804:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.tryParseInt=t.toDotCase=t.toCamelCase=t.toKebabCase=void 0,t.toKebabCase=e=>e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),t.toCamelCase=e=>e.toLowerCase().replace(/(\-\w)/g,(e=>e[1].toUpperCase())),t.toDotCase=e=>e.replace(/(?!^)([A-Z])/g," $1").replace(/[_\s]+(?=[a-zA-Z])/g,".").toLowerCase(),t.tryParseInt=e=>parseInt(e)==e&&NaN!==parseFloat(e)?parseInt(e):e},4938:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Watch=void 0;const n=r(3804);t.Watch=e=>(t,r)=>{t.constructor.watchAttributes||(t.constructor.watchAttributes={}),t.constructor.watchAttributes[n.toKebabCase(e)]=r,t.constructor.propsInit||(t.constructor.propsInit={}),t.constructor.propsInit[e]=null}},249:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__decorate||function(e,t,r,n){var o,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var i=e.length-1;i>=0;i--)(o=e[i])&&(s=(a<3?o(s):a>3?o(t,r,s):o(t,r))||s);return a>3&&s&&Object.defineProperty(t,r,s),s},s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.SearchTypeSelector=void 0;const i=r(406);let c=class extends i.CustomElement{constructor(){super(),this.handleSearchTypeOnChange=this.handleSearchTypeOnChange.bind(this)}setup(e){this.connect(e.container),e.id&&(this.id=e.id)}connectedCallback(){this.searchTypeSelector=(0,i.getShadowRootElement)(this,"#search-type-selector"),this.metadataNameElement=(0,i.getShadowRootElement)(this,"#search-type-metadata-name"),this.metadataCounterElement=(0,i.getShadowRootElement)(this,"#search-type-metadata-counter"),this.articleNameElement=(0,i.getShadowRootElement)(this,"#search-type-article-name"),this.articleCounterElement=(0,i.getShadowRootElement)(this,"#search-type-article-counter"),this.searchTypeSelector.querySelectorAll("input[name=search-type]").forEach((e=>{e.onchange=this.handleSearchTypeOnChange})),this.searchTypeSelector.querySelector(`input[value=${this.searchtype}]`)}disconnectedCallback(){}updateNameElements(e){this.metadataNameElement.innerHTML="en"===e?"Map catalog":"Kartkatalogen",this.articleNameElement.innerHTML="en"===e?"Articles":"Artikler"}handleSearchTypeOnChange(e){if(this.onSearchTypeChange){const t=e.composedPath()[0];this.onSearchTypeChange.emit({detail:{value:t.value}})}}languageChanged(){this.updateNameElements(this.language)}metadataResultsFoundChanged(){this.metadataCounterElement.innerHTML=this.metadataresultsfound}articlesResultsFoundChanged(){this.articleCounterElement.innerHTML=this.articlesresultsfound}searchTypeChanged(){const e=this.searchTypeSelector.querySelector(`input[value=${this.searchtype}]`);e&&(e.checked=!0)}static setup(e,t){(0,i.getElement)(e)}};c.elementSelector="search-type-selector",a([(0,i.Prop)()],c.prototype,"id",void 0),a([(0,i.Prop)()],c.prototype,"metadataresultsfound",void 0),a([(0,i.Prop)()],c.prototype,"articlesresultsfound",void 0),a([(0,i.Prop)()],c.prototype,"language",void 0),a([(0,i.Prop)()],c.prototype,"searchtype",void 0),a([(0,i.Dispatch)("onSearchTypeChange")],c.prototype,"onSearchTypeChange",void 0),a([(0,i.Watch)("language")],c.prototype,"languageChanged",null),a([(0,i.Watch)("metadataresultsfound")],c.prototype,"metadataResultsFoundChanged",null),a([(0,i.Watch)("articlesresultsfound")],c.prototype,"articlesResultsFoundChanged",null),a([(0,i.Watch)("searchtype")],c.prototype,"searchTypeChanged",null),c=a([(0,i.Component)({tag:"search-type-selector",template:Promise.resolve().then((()=>s(r(8771)))),style:Promise.resolve().then((()=>s(r(727))))})],c),t.SearchTypeSelector=c}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var a=t[n]={id:n,exports:{}};return e[n].call(a.exports,a,a.exports,r),a.exports}return r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r(249)})())); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.geonorge=t():(e.geonorge=e.geonorge||{},e.geonorge.SearchTypeSelector=t())}(self,(()=>(()=>{"use strict";var e={9545:(e,t,r)=>{r.r(t),r.d(t,{default:()=>i});var n=r(5052),o=r.n(n),a=r(164),s=r.n(a)()(o());s.push([e.id,'div.search-type-selector{width:180px}div.search-type-selector label{font-size:14px;display:block;cursor:pointer;height:18px;font-weight:normal}div.search-type-selector label .search-type-counter{font-size:.9em}div.search-type-selector label .search-type-counter::before{content:"("}div.search-type-selector label .search-type-counter::after{content:")"}div.search-type-selector input[type=radio]{-webkit-border-radius:50%;border-radius:50%;-webkit-appearance:none;-moz-appearance:none;appearance:none;margin:0;font:inherit;color:currentColor;width:16px;height:16px;border:2px solid #7d746d;transform:translateY(-0.075em);display:inline-grid;place-content:center}div.search-type-selector input[type=radio]::before{-webkit-border-radius:50%;border-radius:50%;content:"";width:8px;height:8px;transform:scale(0);transition:120ms transform ease-in-out}div.search-type-selector input[type=radio]:checked{border-color:#3767c7}div.search-type-selector input[type=radio]:checked::before{transform:scale(1);background-color:#3767c7}div.search-type-selector input[type=radio]:focus-visible{outline:max(2px,.1em) solid #3767c7;outline-offset:max(2px,.1em)}',"",{version:3,sources:["webpack://./stories/main-navigation/search-type-selector/search-type-selector.scss","webpack://./style/mixins/_border-radius.scss","webpack://./style/mixins/_appearance.scss","webpack://./style/variables/_colors.scss"],names:[],mappings:"AAEA,yBACI,WAAA,CACA,+BACI,cAAA,CACA,aAAA,CACA,cAAA,CACA,WAAA,CACA,kBAAA,CACA,oDACI,cAAA,CACA,4DACI,WAAA,CAEJ,2DACI,WAAA,CAIZ,2CCnBF,yBDoB6B,CCnB7B,iBDmB6B,CEpB3B,uBFqBwB,CEpBxB,oBFoBwB,CEnBxB,eFmBwB,CACpB,QAAA,CACA,YAAA,CACA,kBAAA,CACA,UAAA,CACA,WAAA,CACA,wBAAA,CACA,8BAAA,CACA,mBAAA,CACA,oBAAA,CAGJ,mDCjCF,yBDkC6B,CCjC7B,iBDiC6B,CACvB,UAAA,CACA,SAAA,CACA,UAAA,CACA,kBAAA,CACA,sCAAA,CAGJ,mDACI,oBG7BO,CH8BP,2DACI,kBAAA,CACA,wBGhCG,CHoCX,yDACI,mCAAA,CACA,4BAAA",sourcesContent:['@import "../../../style/all";\n\ndiv.search-type-selector {\n width: 180px;\n label {\n font-size: 14px;\n display: block;\n cursor: pointer;\n height: 18px;\n font-weight: normal;\n .search-type-counter {\n font-size: 0.9em;\n &::before {\n content: "(";\n }\n &::after {\n content: ")";\n }\n }\n }\n input[type="radio"] {\n @include border-radius(50%);\n @include appearance(none);\n margin: 0;\n font: inherit;\n color: currentColor;\n width: 16px;\n height: 16px;\n border: 2px solid rgb(125, 116, 109);\n transform: translateY(-0.075em);\n display: inline-grid;\n place-content: center;\n }\n\n input[type="radio"]::before {\n @include border-radius(50%);\n content: "";\n width: 8px;\n height: 8px;\n transform: scale(0);\n transition: 120ms transform ease-in-out;\n }\n\n input[type="radio"]:checked {\n border-color: $primary-text;\n &::before {\n transform: scale(1);\n background-color: $primary-text;\n }\n }\n\n input[type="radio"]:focus-visible {\n outline: max(2px, 0.1em) solid $primary-text;\n outline-offset: max(2px, 0.1em);\n }\n}\n',"@mixin border-radius($radius) {\n -webkit-border-radius: $radius;\n border-radius: $radius;\n}\n\n// Single side border-radius\n\n@mixin border-top-radius($radius) {\n -webkit-border-top-right-radius: $radius;\n border-top-right-radius: $radius;\n -webkit-border-top-left-radius: $radius;\n border-top-left-radius: $radius;\n}\n@mixin border-right-radius($radius) {\n -webkit-border-bottom-right-radius: $radius;\n border-bottom-right-radius: $radius;\n -webkit-border-top-right-radius: $radius;\n border-top-right-radius: $radius;\n}\n@mixin border-bottom-radius($radius) {\n -webkit-border-bottom-right-radius: $radius;\n border-bottom-right-radius: $radius;\n -webkit-border-bottom-left-radius: $radius;\n border-bottom-left-radius: $radius;\n}\n@mixin border-left-radius($radius) {\n -webkit-border-bottom-left-radius: $radius;\n border-bottom-left-radius: $radius;\n -webkit-border-top-left-radius: $radius;\n border-top-left-radius: $radius;\n}","\ufeff@mixin appearance ($value) {\n -webkit-appearance: $value;\n -moz-appearance: $value;\n appearance: $value;\n}\n","$body-background: #ffffff;\n$navigation-bar-background: #f7f7f7;\n$hover-background: rgba(0,0,0,.05);\n$default-border: #d8d8d8;\n\n$default-background: #eee;\n$default-background-hover: #ddd;\n$default-text:#2F3940;\n\n$light-gray: #f6f5f4;\n\n$primary-brand: #FE5000;\n\n$primary-background: #3767C7;\n$primary-background-hover: #FE5000;\n$primary-text: #3767C7;\n$primary-text-hover:#0056b3;\n\n\n$success-background: #06A755;\n$success-background-hover: #009745;\n$success-text: #06A755;\n\n\n$warning-background: #C38621;\n$warning-background-hover: #B37611;\n$warning-text: #C38621;\n\n$danger-background: #E00d0D;\n$danger-background-hover: #D00000;\n$danger-text: #E00d0D;\n\n$disabled-background: #f4f4f4;\n$disabled-border: #dedede;\n$disabled-text: #707070;\n\n\n$light-green: #8fff33;\n$light-yellow: #ffEb3b;\n$light-red: #ff4a2e;\n"],sourceRoot:""}]);const i=s},9575:(e,t,r)=>{r.r(t),r.d(t,{default:()=>n});const n='<template>\n <div id="search-type-selector" class="search-type-selector">\n <label for="search-type-metadata">\n <input name="search-type" type="radio" id="search-type-metadata" value="metadata" />\n <span id="search-type-metadata-name">Kartkatalogen</span>\n <span id="search-type-metadata-counter" class="search-type-counter"></span>\n </label>\n <label for="search-type-article">\n <input name="search-type" type="radio" id="search-type-article" value="articles" />\n <span id="search-type-article-name">Artikler</span>\n <span id="search-type-article-counter" class="search-type-counter"></span>\n </label>\n </div>\n</template>'},164:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var r="",n=void 0!==t[5];return t[4]&&(r+="@supports (".concat(t[4],") {")),t[2]&&(r+="@media ".concat(t[2]," {")),n&&(r+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),r+=e(t),n&&(r+="}"),t[2]&&(r+="}"),t[4]&&(r+="}"),r})).join("")},t.i=function(e,r,n,o,a){"string"==typeof e&&(e=[[null,e,void 0]]);var s={};if(n)for(var i=0;i<this.length;i++){var c=this[i][0];null!=c&&(s[c]=!0)}for(var l=0;l<e.length;l++){var d=[].concat(e[l]);n&&s[d[0]]||(void 0!==a&&(void 0===d[5]||(d[1]="@layer".concat(d[5].length>0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=a),r&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=r):d[2]=r),o&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=o):d[4]="".concat(o)),t.push(d))}},t}},5052:e=>{e.exports=function(e){var t=e[1],r=e[3];if(!r)return t;if("function"==typeof btoa){var n=btoa(unescape(encodeURIComponent(JSON.stringify(r)))),o="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(n),a="/*# ".concat(o," */");return[t].concat([a]).join("\n")}return[t].join("\n")}},8631:function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,a){function s(e){try{c(n.next(e))}catch(e){a(e)}}function i(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,i)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.Component=void 0;const o=r(169),a=r(6999),s=r(2466);t.Component=e=>t=>{var r;const i=e.tag||s.toKebabCase(t.prototype.constructor.name),c=((r=class extends t{constructor(){super(),this.props={},this.showShadowRoot=null==e.shadow||e.shadow,!this.shadowRoot&&this.showShadowRoot&&this.attachShadow({mode:"open"})}static get observedAttributes(){return Object.keys(this.propsInit||{}).map((e=>s.toKebabCase(e)))}attributeChangedCallback(e,t,r){this.onAttributeChange(e,t,r)}onAttributeChange(e,t,r,n=!0){if(t!=r){n&&(this[s.toCamelCase(e)]=r);const o=this.constructor.watchAttributes;if(o&&o[e]){const n=o[e];this.__connected&&"function"==typeof this[n]&&this[n]({old:t,new:r})}}}connectedCallback(){const e=Object.create(null,{connectedCallback:{get:()=>super.connectedCallback}});return n(this,void 0,void 0,(function*(){yield this.render(),e.connectedCallback&&e.connectedCallback.call(this),this.__connected=!0,o.addEventListeners(this),a.initializeProps(this)}))}render(){return n(this,void 0,void 0,(function*(){if(this.__connected)return;const t=document.createElement("template");t.innerHTML=yield this.getStyle(),e.template instanceof Promise?t.content.appendChild(yield this.getExternalTemplate()):"string"==typeof e.template&&(t.innerHTML+=e.template),(this.showShadowRoot?this.shadowRoot:this).appendChild(t.content.cloneNode(!0))}))}getExternalTemplate(){return n(this,void 0,void 0,(function*(){const t=(yield e.template).default.toString(),r=document.createRange().createContextualFragment(t);return 1===r.children.length&&"TEMPLATE"===r.children[0].nodeName?r.firstChild.content:r}))}getStyle(){return n(this,void 0,void 0,(function*(){let t;return e.style instanceof Promise?t=(yield e.style).default.toString():"string"==typeof e.style&&(t=e.style),t?`<style>${t}</style>`:""}))}}).__connected=!1,r.ready=new Promise(((e,t)=>e(!0))),r);return customElements.get(i)||customElements.define(i,c),c}},3704:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CustomElement=void 0;class r extends HTMLElement{constructor(){super()}connect(e){this.isConnected||document.querySelector(e).appendChild(this)}}t.CustomElement=r},3365:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getShadowRootElement=t.getElement=void 0,t.getElement=e=>document.querySelector(e),t.getShadowRootElement=(e,t)=>e.shadowRoot.querySelector(t)},3128:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(8631),t),o(r(3704),t),o(r(3365),t),o(r(169),t),o(r(6999),t),o(r(3982),t),o(r(8861),t),o(r(1063),t)},169:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Dispatch=t.addEventListeners=t.Listen=void 0;const n=r(2466);t.Listen=(e,t)=>(r,n)=>{r.constructor.listeners||(r.constructor.listeners=[]),r.constructor.listeners.push({selector:t,eventName:e,handler:r[n]})},t.addEventListeners=e=>{if(e.constructor.listeners){const t=e.shadowRoot||e;for(const r of e.constructor.listeners){const n=r.selector?t.querySelector(r.selector)?t.querySelector(r.selector):null:e;n&&n.addEventListener(r.eventName,(t=>{r.handler.call(e,t)}))}}},t.Dispatch=e=>(t,r)=>{Object.defineProperty(t,r,{get:function(){const t=this;return{emit(o){const a=e||n.toDotCase(r);t.dispatchEvent(new CustomEvent(a,o))}}}})}},6999:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.initializeProps=t.Prop=void 0;const n=r(2466);t.Prop=()=>(e,t)=>{const r=n.toKebabCase(t);e.constructor.propsInit||(e.constructor.propsInit={}),e.constructor.propsInit[t]=null,Object.defineProperty(e,t,{get:function(){return this.props[t]?this.props[t]:this.getAttribute(r)},set:function(e){if(this.__connected){const o=this.props[t];this.props[t]=n.tryParseInt(e),"object"!=typeof e?this.setAttribute(r,e):this.onAttributeChange(r,o,e,!1)}else this.hasAttribute(n.toKebabCase(t))||(this.constructor.propsInit[t]=e)}})},t.initializeProps=e=>{const t=e.constructor.watchAttributes;for(let r of(e=>{const t=e.constructor.watchAttributes,r=Object.assign({},t);Object.keys(r).forEach((e=>r[e]=""));const n=Object.assign(Object.assign({},r),e.constructor.propsInit);return Object.keys(n)})(e)){if(t)if(null==t[n.toKebabCase(r)])t[n.toKebabCase(r)]="";else{const o=e.props[r]||e.getAttribute(n.toKebabCase(r));"function"==typeof e[t[r]]&&e[t[r]]({new:o})}e.constructor.propsInit[r]&&(e.hasAttribute(n.toKebabCase(r))||(e[r]=e.constructor.propsInit[r]))}}},3982:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Toggle=void 0;const n=r(2466);t.Toggle=()=>(e,t)=>{e.constructor.propsInit||(e.constructor.propsInit={}),e.constructor.propsInit[t]=null,Object.defineProperty(e,t,{get:function(){return(e=>{if(this.hasAttribute(e)){const t=this.getAttribute(e);return!!/^(true|false|^$)$/.test(t)&&("true"==t||""==t)}return!1})(t)},set:function(e){const r=e;if(null!=e)switch(typeof e){case"boolean":break;case"string":/^(true|false|^$)$/.test(e)?e="true"==r||""==r:(console.warn(`TypeError: Cannot set boolean toggle property '${t}' to '${e}'`),e=!1);break;default:throw`TypeError: Cannot set boolean toggle property '${t}' to '${e}'`}this.__connected?(this.props[t]=e||!1,""!==r&&null!==r?this.setAttribute(t,e):e?this.setAttribute(t,""):this.removeAttribute(t)):this.hasAttribute(n.toKebabCase(t))||(this.constructor.propsInit[t]=e)}})}},8861:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},2466:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.tryParseInt=t.toDotCase=t.toCamelCase=t.toKebabCase=void 0,t.toKebabCase=e=>e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),t.toCamelCase=e=>e.toLowerCase().replace(/(\-\w)/g,(e=>e[1].toUpperCase())),t.toDotCase=e=>e.replace(/(?!^)([A-Z])/g," $1").replace(/[_\s]+(?=[a-zA-Z])/g,".").toLowerCase(),t.tryParseInt=e=>parseInt(e)==e&&NaN!==parseFloat(e)?parseInt(e):e},1063:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Watch=void 0;const n=r(2466);t.Watch=e=>(t,r)=>{t.constructor.watchAttributes||(t.constructor.watchAttributes={}),t.constructor.watchAttributes[n.toKebabCase(e)]=r,t.constructor.propsInit||(t.constructor.propsInit={}),t.constructor.propsInit[e]=null}},6417:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__decorate||function(e,t,r,n){var o,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var i=e.length-1;i>=0;i--)(o=e[i])&&(s=(a<3?o(s):a>3?o(t,r,s):o(t,r))||s);return a>3&&s&&Object.defineProperty(t,r,s),s},s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.SearchTypeSelector=void 0;const i=r(3128);let c=class extends i.CustomElement{constructor(){super(),this.handleSearchTypeOnChange=this.handleSearchTypeOnChange.bind(this)}setup(e){this.connect(e.container),e.id&&(this.id=e.id)}connectedCallback(){this.searchTypeSelector=(0,i.getShadowRootElement)(this,"#search-type-selector"),this.metadataNameElement=(0,i.getShadowRootElement)(this,"#search-type-metadata-name"),this.metadataCounterElement=(0,i.getShadowRootElement)(this,"#search-type-metadata-counter"),this.articleNameElement=(0,i.getShadowRootElement)(this,"#search-type-article-name"),this.articleCounterElement=(0,i.getShadowRootElement)(this,"#search-type-article-counter"),this.searchTypeSelector.querySelectorAll("input[name=search-type]").forEach((e=>{e.onchange=this.handleSearchTypeOnChange})),this.searchTypeSelector.querySelector(`input[value=${this.searchtype}]`)}disconnectedCallback(){}updateNameElements(e){this.metadataNameElement.innerHTML="en"===e?"Map catalog":"Kartkatalogen",this.articleNameElement.innerHTML="en"===e?"Articles":"Artikler"}handleSearchTypeOnChange(e){if(this.onSearchTypeChange){const t=e.composedPath()[0];this.onSearchTypeChange.emit({detail:{value:t.value}})}}languageChanged(){this.updateNameElements(this.language)}metadataResultsFoundChanged(){this.metadataCounterElement.innerHTML=this.metadataresultsfound}articlesResultsFoundChanged(){this.articleCounterElement.innerHTML=this.articlesresultsfound}searchTypeChanged(){const e=this.searchTypeSelector.querySelector(`input[value=${this.searchtype}]`);e&&(e.checked=!0)}static setup(e,t){(0,i.getElement)(e)}};c.elementSelector="search-type-selector",a([(0,i.Prop)()],c.prototype,"id",void 0),a([(0,i.Prop)()],c.prototype,"metadataresultsfound",void 0),a([(0,i.Prop)()],c.prototype,"articlesresultsfound",void 0),a([(0,i.Prop)()],c.prototype,"language",void 0),a([(0,i.Prop)()],c.prototype,"searchtype",void 0),a([(0,i.Dispatch)("onSearchTypeChange")],c.prototype,"onSearchTypeChange",void 0),a([(0,i.Watch)("language")],c.prototype,"languageChanged",null),a([(0,i.Watch)("metadataresultsfound")],c.prototype,"metadataResultsFoundChanged",null),a([(0,i.Watch)("articlesresultsfound")],c.prototype,"articlesResultsFoundChanged",null),a([(0,i.Watch)("searchtype")],c.prototype,"searchTypeChanged",null),c=a([(0,i.Component)({tag:"search-type-selector",template:Promise.resolve().then((()=>s(r(9575)))),style:Promise.resolve().then((()=>s(r(9545))))})],c),t.SearchTypeSelector=c}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var a=t[n]={id:n,exports:{}};return e[n].call(a.exports,a,a.exports,r),a.exports}return r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r(6417)})())); | ||
//# sourceMappingURL=SearchTypeSelector.js.map |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
72675643