PageSourceSearch

https://www.tax-free.no/chunk-BPP3E2TO.js

js tax-free.no collected 2026-10-06 15:03:58 UTC 17,121 bytes, 1 lines download raw bytes

1import{a as K}from"./chunk-6NEIA7KQ.js";import{d as X}from"./chunk-N4SAKXVX.js";import{a as ne}from"./chunk-4Z5MUJO3.js";import{a as j}from"./chunk-A3QLZGQA.js";import{Ue as L,Uf as $,V as I,Z as v,a as B,ka as q,og as H,qa as N,u as O,ua as m,v as k}from"./chunk-PMSJWPYZ.js";import{h as te}from"./chunk-NIF3MU5U.js";var T=te(ne());var x="2.17.3";function l(e){return e.reduce(function(r,n){var i=r.events,r=r.additionalParams;return"index"in n?{additionalParams:r,events:i.concat([n])}:{events:i,additionalParams:n}},{events:[],additionalParams:void 0})}var ie=function(){try{return!!navigator.cookieEnabled}catch(e){return!1}},re=function(){try{return!!navigator.sendBeacon}catch(e){return!1}},se=function(){try{return!!XMLHttpRequest}catch(e){return!1}},oe=function(){try{return fetch!==void 0}catch(e){return!1}},b=function(){};function ae(){try{var e="__test_localStorage__";return globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),globalThis.localStorage}catch(t){}}b.get=function(e){var t=(t=this.store)==null?void 0:t.getItem(e);if(!t)return null;try{return JSON.parse(t)}catch(n){return null}},b.set=function(e,t){var n;try{(n=this.store)!=null&&n.setItem(e,JSON.stringify(t))}catch(i){console.error("Unable to set "+e+" in localStorage, storage may be full.")}},b.remove=function(e){var t;(t=this.store)!=null&&t.removeItem(e)},b.store=ae();var V="AlgoliaObjectQueryCache",ue=5e3,ce=1e3;function w(){var e;return(e=b.get(V))!=null?e:{}}function Q(e){b.set(V,de(e))}function de(e){return Object.keys(e).length>ue?le(e):e}function le(e){return e=Object.entries(e).sort(function(t,n){return t=t[1][1],n[1][1]-t}),e.slice(0,e.length-ce-1).reduce(function(t,r){var i=r[0],r=r[1];return Object.assign(Object.assign({},t),((t={})[i]=r,t))},{})}function U(e,t){return e+"_"+t}function S(e,t,n){var i=w();i[U(e,t)]=[n,Date.now()],Q(i)}function he(e,t){return w()[U(e,t)]}function fe(e,t){var n=w();t.forEach(function(i){delete n[U(e,i)]}),Q(n)}var y=function(e){return e===void 0},ve=function(e){return typeof e=="number"},p=function(e){return typeof e=="function"},pe=function(e){return typeof e?.then=="function"};function ge(e){return function(t){for(var n=[],i=arguments.length-1;0<i--;)n[i]=arguments[i+1];if(t&&p(e[t]))return e[t].apply(e,n);console.warn("The method `"+t+"` doesn't exist.")}}var me=["insights-js ("+x+")","insights-js-browser-esm ("+x+")"];function be(e){this._ua.indexOf(e)===-1&&this._ua.push(e)}function ke(e){return p(e)&&e(this.version),this.version}function C(e,t){var n={};for(r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function ye(e){return e.map(function(t){var n,i;return!Te(t)||(n=[],i=(i=t.objectIDs)==null?void 0:i.map(function(r,s){var o=(o=t.objectData)==null?void 0:o[s];return o!=null&&o.queryID?o:((s=((s=he(t.index,r))!=null?s:[])[0])&&n.push(r),Object.assign(Object.assign({},o),{queryID:s}))}),n.length===0)?t:Object.assign(Object.assign({},t),{objectData:i,objectIDsWithInferredQueryID:n})})}function Te(e){return!e.queryID&&e.eventType==="conversion"}function Oe(e){return function(t,n){var i=this;if(this._userHasOptedOut)return Promise.resolve(!1);if(!(!y(this._apiKey)&&!y(this._appId)||(r=n?.headers)!=null&&r["X-Algolia-Application-Id"]&&((r=n?.headers)!=null&&r["X-Algolia-API-Key"])))throw new Error("Before calling any methods on the analytics, you first need to call the 'init' function with appId and apiKey parameters or provide custom credentials in additional parameters.");!this._userToken&&this._anonymousUserToken&&this.setAnonymousUserToken(!0);var r=(n!=null&&n.inferQueryID?ye(t):t).map(function(a){var o=a.filters,u=C(a,["filters"]),a=Object.assign(Object.assign({},u),{userToken:(u=a?.userToken)!=null?u:i._userToken,authenticatedUserToken:(u=a?.authenticatedUserToken)!=null?u:i._authenticatedUserToken});return y(o)||(a.filters=o.map(encodeURIComponent)),a});return r.length===0?Promise.resolve(!1):(t=je(e,this._ua,this._endpointOrigin,r,this._appId,this._apiKey,n?.headers),pe(t)?t.then(Ie(r)):t)}}function Ie(e){return function(t){return t&&e.filter(function(s){var i=s.eventType,r=s.eventSubtype,s=s.objectIDs;return i==="conversion"&&r==="purchase"&&s?.length}
1).forEach(function(n){return fe(n.index,n.objectIDs)}),t}}function je(e,t,n,i,r,s,d){var u=(d=d===void 0?{}:d)["X-Algolia-Application-Id"],a=d["X-Algolia-API-Key"],d=C(d,["X-Algolia-Application-Id","X-Algolia-API-Key"]),h=Object.assign({"X-Algolia-Application-Id":u??r,"X-Algolia-API-Key":a??s,"X-Algolia-Agent":encodeURIComponent(t.join("; "))},d);return e(n+"/1/events?"+Object.keys(h).map(function(f){return f+"="+h[f]}).join("&"),{events:i})}function _(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return(e==="x"?t:3&t|8).toString(16)})}var A="_ALGOLIA",W=2592e6,J=function(e,t,r){var i=new Date,r=(i.setTime(i.getTime()+r),"expires="+i.toUTCString());document.cookie=e+"="+t+";"+r+";path=/"},G=function(e){for(var t=e+"=",n=document.cookie.split(";"),i=0;i<n.length;i++){for(var r=n[i];r.charAt(0)===" ";)r=r.substring(1);if(r.indexOf(t)===0)return r.substring(t.length,r.length)}return""};function xe(e){return typeof e!="number"&&e.indexOf("anonymous-")===0}function Ae(){var e=G(A);!this._userToken||e&&e!==""&&e.indexOf("anonymous-")===0||J(A,this._userToken,this._cookieDuration)}function De(e){(e=e!==void 0&&e)?this.setUserToken("anonymous-"+_()):ie()&&((e=G(A))&&e!==""&&e.indexOf("anonymous-")===0?this.setUserToken(e):(e=this.setUserToken("anonymous-"+_()),J(A,e,this._cookieDuration)))}function _e(e){return this._userToken=e,p(this._onUserTokenChangeCallback)&&this._onUserTokenChangeCallback(this._userToken),this._userToken}function we(e,t){return p(t)&&t(null,this._userToken),this._userToken}function Ue(e,t){this._onUserTokenChangeCallback=e,t&&t.immediate&&p(this._onUserTokenChangeCallback)&&this._onUserTokenChangeCallback(this._userToken)}function Se(e){return this._authenticatedUserToken=e,p(this._onAuthenticatedUserTokenChangeCallback)&&this._onAuthenticatedUserTokenChangeCallback(this._authenticatedUserToken),this._authenticatedUserToken}function Ce(e,t){return p(t)&&t(null,this._authenticatedUserToken),this._authenticatedUserToken}function Ee(e,t){this._onAuthenticatedUserTokenChangeCallback=e,t&&t.immediate&&p(this._onAuthenticatedUserTokenChangeCallback)&&this._onAuthenticatedUserTokenChangeCallback(this._authenticatedUserToken)}function g(e,t){return t.map(function(n){return Object.assign({eventType:e},n)})}function D(e,t,n){return n.map(function(i){return Object.assign({eventType:e,eventSubtype:t},i)})}function Pe(){for(var e=this,t=[],n=arguments.length;n--;)t[n]=arguments[n];var r=l(t),i=r.events,r=r.additionalParams;return i.forEach(function(s){var o=s.index,u=s.queryID;return s.objectIDs.forEach(function(a){return!e._userHasOptedOut&&S(o,a,u)})}),this.sendEvents(g("click",i),r)}function Re(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var i=l(e),n=i.events,i=i.additionalParams;return this.sendEvents(g("click",n),i)}function Fe(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var i=l(e),n=i.events,i=i.additionalParams;return this.sendEvents(g("click",n),i)}function Be(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var i=l(e),n=i.events,i=i.additionalParams;return this.sendEvents(g("conversion",n),i)}function qe(){for(var e=this,t=[],n=arguments.length;n--;)t[n]=arguments[n];var r=l(t),i=r.events,r=r.additionalParams;return i.forEach(function(s){var o=s.index,u=s.queryID,a=s.objectIDs,d=s.objectData;return a.forEach(function(h,f){f=(f=(f=d?.[f])==null?void 0:f.queryID)!=null?f:u,!e._userHasOptedOut&&f&&S(o,h,f)})}),this.sendEvents(D("conversion","addToCart",i),r)}function Ne(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var i=l(e),n=i.events,i=i.additionalParams;return this.sendEvents(D("conversion","purchase",n),i)}function Le(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var i=l(e),n=i.events,i=i.additionalParams;return this.sendEvents(g("conversion",n),i)}function $e(){for(var e=this,t=[],n=arguments.length;n--;)t[n]=arguments[n];var r=l(t),i=r.events,r=r.additionalParams;return i.forEach(function(s){var o=s.index,u=s.objectIDs,a=s.objectData;return u.forEach(function(d,h){h=(h=a?.[h])==null?void 0:h.queryID,!e._userHasOptedOut&&h&&S(o,d,h)})}),this.sendEvents(D("conversion","addToCart",i),r)}function He(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var i=l(e),n=i.events,i=i.additionalParams;return this.sendEvents(D("conversion","purchase",n),i)}function Ke(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var i=l(e),n=i.events,i=i.additionalParams;return this.sendEvents(g("conversion",n),i)}var M=["de","us"];function Xe(e){var t;if(!y((e=e===void 0?{}:e).region)&&M.indexOf(e.region)===-1)throw new Error("optional region is incorrect, please provide either one of: "+M.join(", ")+".");if(!(y(e.cookieDuration)||ve(e.cookieDuration)&&isFinite(e.cookieDuration)&&Math.floor(e.cookieDuration)===e.cookieDuration))throw new Error("optional cookieDuration is incorrect, expected an integer.");Me(this,e,{_userHasOptedOut:!!e.userHasOptedOut,_region:e.region,_host:e.host,_anonymousUserToken:(t=e.anonymousUserToken)==null||t,_useCookie:(t=e.useCookie)!=null&&t,_cookieDuration:e.cookieDuration||6*W}),this._endpointOrigin=this._host||(this._region?"https://insights."+this._region+".algolia.io":"https://insights.algolia.io"),this._ua=[].concat(me),e.authenticatedUserToken&&this.setAuthenticatedUserToken(e.authenticatedUserToken),e.userToken?this.setUserToken(e.userToken):this._userToken||this._userHasOptedOut||!this._useCookie?Ve(this)&&this.saveTokenAsCookie():this.setAnonymousUserToken()}function Me(e,t,n){var i=t.partial,r=C(t,["partial"]);i||Object.assign(e,n),Object.assign(e,Object.keys(r).reduce(function(s,o){return Object.assign(Object.assign({},s),((s={})["_"+o]=r[o],s))},{}))}function Ve(e){return e._userToken!==void 0&&xe(e._userToken)&&e._useCookie&&!e._userHasOptedOut}function Qe(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var i=l(e),n=i.events,i=i.additionalParams;return this.sendEvents(g("view",n),i)}function We(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var i=l(e),n=i.events,i=i.additionalParams;return this.sendEvents(g("view",n),i)}var Je=function(e){e=e.requestFn,this._endpointOrigin="https://insights.algolia.io",this._anonymousUserToken=!0,this._userHasOptedOut=!1,this._useCookie=!1,this._cookieDuration=6*W,this._ua=[],this.version=x,this.sendEvents=Oe(e).bind(this),this.init=Xe.bind(this),this.addAlgoliaAgent=be.bind(this),this.saveTokenAsCookie
1=Ae.bind(this),this.setUserToken=_e.bind(this),this.setAnonymousUserToken=De.bind(this),this.getUserToken=we.bind(this),this.onUserTokenChange=Ue.bind(this),this.setAuthenticatedUserToken=Se.bind(this),this.getAuthenticatedUserToken=Ce.bind(this),this.onAuthenticatedUserTokenChange=Ee.bind(this),this.clickedObjectIDsAfterSearch=Pe.bind(this),this.clickedObjectIDs=Re.bind(this),this.clickedFilters=Fe.bind(this),this.convertedObjectIDsAfterSearch=Be.bind(this),this.purchasedObjectIDsAfterSearch=Ne.bind(this),this.addedToCartObjectIDsAfterSearch=qe.bind(this),this.convertedObjectIDs=Le.bind(this),this.addedToCartObjectIDs=$e.bind(this),this.purchasedObjectIDs=He.bind(this),this.convertedFilters=Ke.bind(this),this.viewedObjectIDs=Qe.bind(this),this.viewedFilters=We.bind(this),this.getVersion=ke.bind(this)};function Ge(n){var t,n=ge(new Je({requestFn:n}));if(typeof window=="object"&&!window.AlgoliaAnalyticsObject){for(;t=_(),window[t]!==void 0;);window.AlgoliaAnalyticsObject=t,window[window.AlgoliaAnalyticsObject]=n}return n.version=x,n}var Y=function(e,t){return new Promise(function(n,i){var r=JSON.stringify(t),s=new XMLHttpRequest;s.addEventListener("readystatechange",function(){s.readyState===4&&s.status===200?n(!0):s.readyState===4&&n(!1)}),s.addEventListener("error",function(){return i()}),s.addEventListener("timeout",function(){return n(!1)}),s.open("POST",e),s.setRequestHeader("Content-Type","application/json"),s.send(r)})},Ye=function(e,t){var n=JSON.stringify(t),n=navigator.sendBeacon(e,n);return Promise.resolve(!!n||Y(e,t))},ze=function(e,t){return new Promise(function(n,i){fetch(e,{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json"}}).then(function(r){n(r.status===200)}).catch(function(r){i(r)})})};function Ze(){if(re())return Ye;if(se())return Y;if(oe())return ze;throw new Error("Could not find a supported HTTP request client in this environment.")}var z=Ge(Ze());var Z=z;var c=[];for(let e=0;e<256;++e)c.push((e+256).toString(16).slice(1));function ee(e,t=0){return(c[e[t+0]]+c[e[t+1]]+c[e[t+2]]+c[e[t+3]]+"-"+c[e[t+4]]+c[e[t+5]]+"-"+c[e[t+6]]+c[e[t+7]]+"-"+c[e[t+8]]+c[e[t+9]]+"-"+c[e[t+10]]+c[e[t+11]]+c[e[t+12]]+c[e[t+13]]+c[e[t+14]]+c[e[t+15]]).toLowerCase()}var E,et=new Uint8Array(16);function P(){if(!E){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");E=crypto.getRandomValues.bind(crypto)}return E(et)}var tt=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),R={randomUUID:tt};function nt(e,t,n){if(R.randomUUID&&!t&&!e)return R.randomUUID();e=e||{};let i=e.random??e.rng?.()??P();if(i.length<16)throw new Error("Random bytes length must be >= 16");if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,t){if(n=n||0,n<0||n+16>t.length)throw new RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let r=0;r<16;++r)t[n+r]=i[r];return t}return ee(i)}var F=nt;var At=(()=>{class e{userIdService=m($);userService=m(X);currencyService=m(H);localStorageService=m(K);winRef=m(L);client=Z;storageKey="search-insight-user-token";marketingId$=this.userService.get().pipe(O(n=>n?.marketingId),I());anonymousUserToken$=this.localStorageService.getItem$(this.storageKey).pipe(O(n=>n||`anonymous-${F()}`),I());userToken$=k([this.marketingId$,this.anonymousUserToken$]).pipe(O(([n,i])=>n||i),I(),q(n=>this.localStorageService.setItem(this.storageKey,n)));sub=new B;constructor(){this.winRef.isBrowser()&&(this.client("init",{appId:j.algoliaConfig.appId,apiKey:j.algoliaConfig.apiKey}),this.sub.add(this.userToken$.subscribe(n=>this.client("setUserToken",n))))}ngOnDestroy(){this.sub.unsubscribe()}viewedObjectIDs(n){this.winRef.isBrowser()&&this.userToken$.pipe(v()).subscribe(i=>{let r=(0,T.chunk)(n.objectIDs,20);r.length&&this.client("sendEvents",r.map(s=>Object.assign({},{eventType:"view",eventName:"Viewed products",userToken:i},n,{objectIDs:s})))})}viewedFilters(n,i){if(!this.winRef.isBrowser())return;let r=(i||[]).filter(s=>s.type!=="numeric").slice(0,10).map(s=>`${s.attributeName}:${s.value}`);r.length!==0&&this.userToken$.pipe(v()).subscribe(s=>{this.client("viewedFilters",Object.assign({},{eventName:"View filters",userToken:s,filters:r},n))})}clickedFilters(n){this.winRef.isBrowser()&&this.userToken$.pipe(v()).subscribe(i=>{this.client("clickedFilters",Object.assign({},{eventName:"Click filters",userToken:i},n))})}purchasedObjectIDs(n){this.winRef.isBrowser()&&k({userToken:this.userToken$,currency:this.currencyService.getActive()}).pipe(v()).subscribe(({userToken:i,currency:r})=>{this.client("purchasedObjectIDs",Object.assign({},{eventName:"Purchased products",index:j.algoliaConfig.index.products.relevance,userToken:i,currency:r},n))})}addedToCartObjectIDsAfterSearch(n){this.winRef.isBrowser()&&k({userToken:this.userToken$,currency:this.currencyService.getActive()}).pipe(v()).subscribe(({userToken:i,currency:r})=>this.client("addedToCartObjectIDsAfterSearch",Object.assign({},{eventName:"Product added to cart",userToken:i,currency:r},n)))}addedToCartObjectIDs(n){this.winRef.isBrowser()&&k({userToken:this.userToken$,currency:this.currencyService.getActive()}).pipe(v()).subscribe(({userToken:i,currency:r})=>this.client("addedToCartObjectIDs",Object.assign({},{eventName:"Product added to cart",userToken:i,currency:r},n)))}clickedObjectIDsAfterSearch(n){this.winRef.isBrowser()&&this.userToken$.pipe(v()).subscribe(i=>this.client("clickedObjectIDsAfterSearch",Object.assign({},{eventName:"Product click",userToken:i},n)))}clickedObjectIDs(n){this.winRef.isBrowser()&&this.userToken$.pipe(v()).subscribe(i=>this.client("clickedObjectIDs",Object.assign({},{eventName:"Product click",userToken:i},n)))}static productToObjectData(n,i=1,r){let s=n?.standardPrice?.value,o=n?.displayPrice?.value,u=Math.min(0,s-o);return(0,T.omitBy)({price:o,discount:u||null,queryID:r,quantity:i},a=>!a)}static orderEntryToObjectData(n,i=1,r){let s=n?.totalDisplayPriceWithoutDiscounts?.value,o=n?.totalDisplayPrice?.value,u=Math.min(0,s-o);return(0,T.omitBy)({price:o,discount:u||null,queryID:r,quantity:i},a=>!a)}static \u0275fac=function(i){return new(i||e)};static \u0275prov=N({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();export{At as a};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.