@schibsted/advertory 2.63.2 → 2.63.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/core/aftenposten/es/index.css +1 -1
  2. package/core/aftenposten/es/index.js +1 -1
  3. package/core/aftenposten/index.js +1 -1
  4. package/core/aftenpostenv2/es/index.css +1 -1
  5. package/core/aftenpostenv2/es/index.js +1 -1
  6. package/core/aftonbladet/es/index.css +1 -1
  7. package/core/aftonbladetv2/es/index.css +1 -1
  8. package/core/aftonbladetv2/es/index.js +1 -1
  9. package/core/bt/es/index.css +1 -1
  10. package/core/bt/es/index.js +1 -1
  11. package/core/bt/index.js +1 -1
  12. package/core/e24/es/index.css +1 -1
  13. package/core/e24/es/index.js +1 -1
  14. package/core/e24/index.js +1 -1
  15. package/core/fotbollskanalen/es/index.css +1 -1
  16. package/core/fotbollskanalen/es/index.js +1 -1
  17. package/core/fotbollskanalen/index.js +1 -1
  18. package/core/godare/index.js +1 -1
  19. package/core/godt/index.js +1 -1
  20. package/core/klart/index.js +1 -1
  21. package/core/koket/es/index.js +1 -1
  22. package/core/koket/index.js +1 -1
  23. package/core/kompakt/index.js +1 -1
  24. package/core/minmote/index.js +1 -1
  25. package/core/pent/index.js +1 -1
  26. package/core/sa/es/index.css +1 -1
  27. package/core/sa/es/index.js +1 -1
  28. package/core/sa/index.js +1 -1
  29. package/core/svd/es/index.css +1 -1
  30. package/core/svdv2/es/index.css +1 -1
  31. package/core/svdv2/es/index.js +1 -1
  32. package/core/tek/index.js +1 -1
  33. package/core/tv4/es/index.css +1 -1
  34. package/core/tv4/es/index.js +1 -1
  35. package/core/tv4/index.js +1 -1
  36. package/core/tvnu/index.js +1 -1
  37. package/core/vg/es/index.css +1 -1
  38. package/core/vg/es/index.js +1 -1
  39. package/core/vg/index.js +1 -1
  40. package/core/vgv2/es/index.css +1 -1
  41. package/core/vgv2/es/index.js +1 -1
  42. package/features/ad-native/index.js +1 -1
  43. package/package.json +1 -1
  44. package/sites/aftenposten/es/index.css +1 -1
  45. package/sites/aftenposten/es/index.js +1 -1
  46. package/sites/aftenposten/index.js +1 -1
  47. package/sites/aftenpostenv2/es/index.css +1 -1
  48. package/sites/aftenpostenv2/es/index.js +1 -1
  49. package/sites/aftonbladet/es/index.css +1 -1
  50. package/sites/aftonbladetv2/es/index.css +1 -1
  51. package/sites/bt/es/index.css +1 -1
  52. package/sites/bt/es/index.js +1 -1
  53. package/sites/bt/index.js +1 -1
  54. package/sites/e24/es/index.css +1 -1
  55. package/sites/e24/index.js +1 -1
  56. package/sites/koket/es/index.css +1 -1
  57. package/sites/sa/es/index.css +1 -1
  58. package/sites/sa/es/index.js +1 -1
  59. package/sites/sa/index.js +1 -1
  60. package/sites/svd/es/index.css +1 -1
  61. package/sites/svd/es/index.js +1 -1
  62. package/sites/svd/index.js +1 -1
  63. package/sites/svdv2/es/index.css +1 -1
  64. package/sites/svdv2/es/index.js +1 -1
  65. package/sites/tv4/es/index.css +1 -1
  66. package/sites/tvnu/index.js +1 -1
  67. package/sites/vg/es/index.css +1 -1
  68. package/sites/vg/es/index.js +1 -1
  69. package/sites/vg/index.js +1 -1
  70. package/sites/vgv2/es/index.css +1 -1
  71. package/sites/vgv2/es/index.js +1 -1
  72. package/styles/aftenpostenv2/styles.css +1 -1
  73. package/styles/e24/styles.css +1 -1
  74. package/types/features/ad-scale/index.d.ts +2 -1
  75. /package/types/{core/handlers/scale/index.d.ts → features/ad-scale/scale-ad.d.ts} +0 -0
  76. /package/types/{core/handlers/scale/index.test.d.ts → features/ad-scale/scale-ad.test.d.ts} +0 -0
@@ -1 +1 @@
1
- "use strict";function e(e,t,n,r){return new(n||(n=Promise))(function(i,o){function a(e){try{d(r.next(e))}catch(e){o(e)}}function s(e){try{d(r.throw(e))}catch(e){o(e)}}function d(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)}d((r=r.apply(e,t||[])).next())})}function t(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var n,r;require("react/jsx-runtime"),"function"==typeof SuppressedError&&SuppressedError;var i=t(function(){if(r)return n;r=1;var e=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var n=Object.prototype.toString.call(e);return"[object RegExp]"===n||"[object Date]"===n||function(e){return e.$$typeof===t}(e)}(e)},t="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function i(e,t){return!1!==t.clone&&t.isMergeableObject(e)?l((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function o(e,t,n){return e.concat(t).map(function(e){return i(e,n)})}function a(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}(e))}function s(e,t){try{return t in e}catch(e){return!1}}function d(e,t,n){var r={};return n.isMergeableObject(e)&&a(e).forEach(function(t){r[t]=i(e[t],n)}),a(t).forEach(function(o){(function(e,t){return s(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,o)||(s(e,o)&&n.isMergeableObject(t[o])?r[o]=function(e,t){if(!t.customMerge)return l;var n=t.customMerge(e);return"function"==typeof n?n:l}(o,n)(e[o],t[o],n):r[o]=i(t[o],n))}),r}function l(t,n,r){(r=r||{}).arrayMerge=r.arrayMerge||o,r.isMergeableObject=r.isMergeableObject||e,r.cloneUnlessOtherwiseSpecified=i;var a=Array.isArray(n);return a===Array.isArray(t)?a?r.arrayMerge(t,n,r):d(t,n,r):i(n,r)}return l.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(e,n){return l(e,n,t)},{})},n=l}());const o=["deviceType","pageType","placements","takeover","refreshConfig","editableConfiguration"],a={adRequested:()=>{},adAvailable:e=>{},adLoaded:e=>{},adNoBid:e=>{},adError:(e,t)=>{},adCollapse:()=>{},adRequestFailure:e=>{},adBadRequest:e=>{},adLoadedMediated:e=>{},adNoBidMediated:e=>{}},s=6;class d{set(e){this.config=e}modifyConfigProperties(e){if(!this.config)throw new Error("Config was accessed before it had been initialized.");const t={};for(const n of o){const r=e[n];void 0!==r&&(t[n]=r)}Object.assign(this.config,t),Object.prototype.hasOwnProperty.call(e,"pageOptions")&&void 0!==e.pageOptions&&(this.config.pageOptions=Object.assign(Object.assign({},this.config.pageOptions),e.pageOptions)),Object.prototype.hasOwnProperty.call(e,"tcf")&&void 0!==e.tcf&&(this.config.tcf=Object.assign(Object.assign({},this.config.tcf),e.tcf))}get(){if(!this.config)throw new Error("Config was accessed before it had been initialized.");return this.config}getHandlers(){if(!this.siteHandlers)throw new Error("Handlers were accessed before it had been initialized.");return this.siteHandlers}setHandlers(e){this.siteHandlers=i(d.DEFAULT_SITE_HANDLERS,e)}}d.DEFAULT_SITE_HANDLERS={siteEvents:a,initNativeAd:function(){}};const l=new d,c=l.modifyConfigProperties.bind(l),u=(e,t)=>{const n="[Advertory LOG]: ";location.search.includes("ast_debug=true")&&(t?console.log(n,e,t):console.log(n,e))},v=864e5,p=(()=>{const e=e=>{const t=window.localStorage.getItem(e);if(!t)return null;try{return JSON.parse(t)}catch(e){return u("Error with parsing localStorage data"),null}},t=(e,t)=>{window.localStorage.setItem(e,JSON.stringify(t))};return{get:e,set:t,setWithTimestamp:(e,n,r=v)=>{const i={data:n,expirationTime:(new Date).getTime()+r};t(e,JSON.stringify(i))},getByTimestamp:(t,n=v)=>{const r=e(t);if(!r)return null;if(!n)return r;try{const{expirationTime:e,data:t}=JSON.parse(r);return(new Date).getTime()<=e?t:null}catch(e){return u("Error with parsing localStorage data"),null}}}})(),g="glimrTags",h=["glwe_","glwet_"],m={geofenceTags:[],geoTags:[],weatherTags:[]},y=e=>new Promise(t=>{if(!window._tcf_||!(null==e?void 0:e.enabled))return void t(!1);const n=(()=>{if(!window._tcf_)return null;const e=window._tcf_.getPermissionSync("CMP:advertising");if(null===e)return null;const t=Number(e);return u("Advertising permission value obtained synchronously: ",e),Boolean(t)})();if(null!==n)return void t(n);let r=!1;const i=e=>{r||(u("Resolving advertising permission value obtained"),r=!0,t(e))},o=setTimeout(()=>{u("Advertising permission timed out, resolving with false"),i(!1)},3e3);window._tcf_.onTcfReady(()=>{u("On Tcf Ready called, waiting for permission"),clearTimeout(o)}),window._tcf_.getPermission("CMP:advertising",e=>{clearTimeout(o);const t=Number(e);u("Advertising permission value obtained asynchronously: ",e),i(Boolean(t))})}),f={NO:"no",SE:"se"},w="cmp:loaded";let b,E=!1;const I=(t,n,r)=>{const i=!!(null==t?void 0:t.enabled),o=(null==t?void 0:t.timeout)||3e3,a=(s="bypass_tcf",new URLSearchParams(window.location.search).get(s));var s;const d=()=>{if(!(null==t?void 0:t.enabled))return!0;if(((e,t)=>e?!!t&&(u("TCF bypass param detected, returning consent: true"),!0):(u("TCF is not enabled, returning consent: true"),!0))(i,a))return!0;if(E)return null;if(!b)throw new Error("[Advertory]: getConsentSync method was called before the tcfManager was available.");const e=b.getConsentedToAllSync();return u(`TCF consented to all is: ${e}`),b.getConsentedToAllSync()};return{initConsentManager:()=>(null==t?void 0:t.enabled)?new Promise((e,t)=>{if(u("Getting TCF consent manager..."),window._tcf_)return u("TCF consent manager is already available"),b=window._tcf_,void e(b);u("TCF consent manager is not available");const n=()=>{u("CMP loaded, resolving consent manager..."),r&&clearTimeout(r),window._tcf_?(b=window._tcf_,e(b)):t(new Error("CMP loaded but window._tcf_ is not defined"))},r=setTimeout(()=>{document.removeEventListener(w,n),E=!0,t(new Error("Timeout waiting for CMP to load"))},o);u("Listening for CMP loaded event..."),document.addEventListener(w,n,{once:!0})}):Promise.resolve(null),getConsentSync:d,getConsentAsync:()=>e(void 0,void 0,void 0,function*(){if(null==t?void 0:t.schibstedAdChoicesOverrideValue)return u(`Schibsted Ad Choices override value is set, returning override value: ${t.schibstedAdChoicesOverrideValue}`),Boolean(Number(t.schibstedAdChoicesOverrideValue));const e=(null==t?void 0:t.schibstedAdChoicesEnabled)&&r===f.SE,i=(null==t?void 0:t.schibstedAdChoicesEnabled)&&!n&&r===f.NO;if(e||i)return u("Schibsted Ad Choices is enabled, getting advertising permissions..."),yield y(t);if(!(null==t?void 0:t.enabled))return!0;const a=d();return null!==a?a:yield new Promise((e,t)=>{try{if(!b)throw new Error("[Advertory]: getConsentAsync method was called before the tcfManager was available.");let t=!1;const n=n=>{t||(t=!0,e(n))},r=setTimeout(()=>{u("TCF isConsentedToAll timed out, resolving with false"),n(!1)},o);b.onTcfReady(()=>{u("On Tcf Ready called, waiting for consent"),clearTimeout(r)}),b.isConsentedToAll(t=>{clearTimeout(r),e(t)})}catch(e){t(e)}})})}},A=(t,n,r,...i)=>e(void 0,[t,n,r,...i],void 0,function*(e,t,n,r="NOT SPECIFIED FEATURE"){if(!(null==e?void 0:e.schibstedConsentToPayEnabled))return u(`Schibsted Consent to Pay is not enabled, returning true for ${r}`),!0;if(null==e?void 0:e.schibstedAdChoicesOverrideValue)return u(`Schibsted Ad Choices override value is set, returning override value: ${null==e?void 0:e.schibstedAdChoicesOverrideValue} for ${r}`),Boolean(Number(null==e?void 0:e.schibstedAdChoicesOverrideValue));const{getConsentAsync:i}=I(e,t,n);return(yield i())?(u(`Schibsted Ad Choices consent given according to TCF consent manager for ${r}`),!0):(u(`Schibsted Ad Choices consent not given according to TCF consent manager for ${r}`),!1)}),k=()=>e(void 0,void 0,void 0,function*(){const{tcf:e,isMobileApp:t,country:n}=l.get();if(null==e?void 0:e.schibstedConsentToPayEnabled){return yield A(e,t,n,"glimr")}const{getConsentAsync:r}=I(e,t,n);return yield r()}),T=()=>e(void 0,void 0,void 0,function*(){const{glimr:t}=l.get();if(!(yield k())||!(null==t?void 0:t.enabled))return void u("No consent for glimr data fetching.");const n=yield(r=500,e(void 0,void 0,void 0,function*(){return yield Promise.race([e(void 0,void 0,void 0,function*(){const e=yield import("glimr-sdk");return e.default||e}),new Promise(e=>setTimeout(()=>e(!1),r))])}));var r;if(n)try{n.setTagCacheTimeInSeconds(300),yield new Promise(e=>{n.getTags(t.clientId,(t,n)=>{p.setWithTimestamp(g,{tags:t,tagMappings:n}),e(!0)})})}catch(e){u(`Error during getting glimr data: ${e}`)}else u("Timeout (500ms) while loading glimr package. Skipping glimr data fetching.",{glimr:n})}),C=()=>{const{country:e}=l.get();return e===f.NO?"no-sno":"se-generic"},S=()=>{const{country:e,publisher:t}=l.get();return`${e}-${t}`},P={svd:"svd",vg:"vg",godare:"godare",aftenposten:"no-aftenposten",sa:"no-stavangeraftenblad",bt:"no-bergenstidende",aftonbladet:"aftonbladet",e24:"e24",minmote:"minmote",pent:"pent",godt:"godt",tek:"no-tek"},O=e=>h.some(t=>e.startsWith(t)),x=e=>e.startsWith("glgc_"),L=e=>!O(e)&&!x(e),j=e=>{const t=$();if(!t)return m;const n=((e=[])=>e.filter(O))(t),r=((e=[])=>e.filter(x))(t),i=((e=[],t)=>{const n=e.filter(L);if(t){const{publisher:e}=l.get(),t=P[e]||e;n.push(t)}return n})(t,e);return{geoTags:i,geofenceTags:r,weatherTags:n}},$=()=>{const e=p.getByTimestamp(g);return e&&"string"!=typeof e?null==e?void 0:e.tags:null},N={get:(t,n)=>e(void 0,void 0,void 0,function*(){const e=yield fetch(t,n);if(!e.ok)throw new Error(e.statusText);return yield e.json()}),post:(t,n,r)=>e(void 0,void 0,void 0,function*(){const e=JSON.stringify(r),i=yield fetch(t,{method:"POST",headers:n,body:e});if(!i.ok)throw new Error(i.statusText);return yield i.json()})},q="advertory:ppids-cache",_={[f.SE]:`SCH${f.SE.toUpperCase()}-EnvHash`,[f.NO]:`SCH${f.NO.toUpperCase()}-EnvHash`},D={[f.SE]:`SCH${f.SE.toUpperCase()}-UserHash`,[f.NO]:`SCH${f.NO.toUpperCase()}-UserHash`},M={[f.SE]:`sch${f.SE}-envhash-v3`,[f.NO]:`sch${f.NO}-envhash-v3`},B={[f.SE]:`sch${f.SE}-userhash-v3`,[f.NO]:`sch${f.NO}-userhash-v3`},F={[f.SE]:`'sch${f.SE}-iosid-v3'`,[f.NO]:`'sch${f.NO}-iosid-v3'`},R={[f.SE]:`sch${f.SE}-androidid-v3`,[f.NO]:`sch${f.NO}-androidid-v3`},V={[f.SE]:"sdrn:schibsted.com:user",[f.NO]:"sdrn:spid.no:user"};class U{constructor(){this.eids=[]}add(e,t){return e&&this.eids.push({id:e,source:t}),this}buildRyEids(){return this.eids.map(({id:e,source:t})=>({source:t,uids:[{id:e,atype:1,ext:{stype:"ppuid"}}]}))}buildEids(){return[...this.eids]}buildVideoEids(){return this.eids.map(({id:e,source:t})=>`${t},${e}`).join("|")}buildNorstatPath(){const e=this.eids[0];return e?`${e.source}-${e.id}`:""}buildNorstatQuery(e){const t=new URLSearchParams;return this.eids.slice(1).forEach(({id:n,source:r})=>{t.append(e,`${r}-${n}`)}),t}}const H=new class{constructor(){this.ppid1=null,this.ppid2=null}processPPIDs(t){return e(this,arguments,void 0,function*(e,t=1e4){var n,r;const i=yield Promise.race([new Promise(e=>{setTimeout(()=>e({xandr:{ppId1:"",ppId2:""}}),t)}),e.instance.getAdvertisingIdentifiers()]);this.setPPIDs(null===(n=i.xandr)||void 0===n?void 0:n.ppId1,null===(r=i.xandr)||void 0===r?void 0:r.ppId2)})}getPPIDs(){var e,t;return null!==this.ppid1&&null!==this.ppid2||u("PPIDv2s accessed before they have been initialized"),{ppid1:null!==(e=this.ppid1)&&void 0!==e?e:"",ppid2:null!==(t=this.ppid2)&&void 0!==t?t:""}}setPPIDs(e,t){this.ppid1=null!=e?e:"",this.ppid2=null!=t?t:""}},z=new class{constructor(){this.ppid1=null,this.ppid2=null,this.idfv=null,this.anId=null}processPPIDs(t,n){return e(this,void 0,void 0,function*(){var e,r,i,o,a,s,d,l,c,u,v;const g=p.get(q),h=yield this.getNewPPIDs(t,n);if(this.shouldHash(g,h)){const n=null!==(e=t.hasherUrl)&&void 0!==e?e:"https://hasher.schibsted.com/api/v1/hash",l=this.createHasherPayload(h),c=yield this.hashPPIDs(l,n);return c?(this.cachePPIDs(l,c,null===(r=h.idfv)||void 0===r?void 0:r.plain,null===(i=h.anId)||void 0===i?void 0:i.plain),void this.setPPIDs(null!==(o=c.userId)&&void 0!==o?o:"",null!==(a=c.environmentId)&&void 0!==a?a:"",null===(s=h.idfv)||void 0===s?void 0:s.plain,null===(d=h.anId)||void 0===d?void 0:d.plain)):void this.setPPIDs("","")}this.setPPIDs(null!==(l=null==g?void 0:g.userId.hashed)&&void 0!==l?l:"",null!==(c=null==g?void 0:g.environmentId.hashed)&&void 0!==c?c:"",null===(u=null==h?void 0:h.idfv)||void 0===u?void 0:u.plain,null===(v=null==h?void 0:h.anId)||void 0===v?void 0:v.plain)})}getPPIDs(){var e,t;return null!==this.ppid1&&null!==this.ppid2||u("PPIDv3s accessed before they have been initialized"),{ppid1:null!==(e=this.ppid1)&&void 0!==e?e:"",ppid2:null!==(t=this.ppid2)&&void 0!==t?t:"",idfv:this.idfv,anId:this.anId}}setPPIDs(e,t,n,r){this.ppid1=null!=e?e:"",this.ppid2=null!=t?t:"",this.idfv=null!=n?n:null,this.anId=null!=r?r:null}shouldHash(e,t){var n,r;if(!e)return!0;for(const i in e){if((null===(n=e[i])||void 0===n?void 0:n.plain)!==(null===(r=t[i])||void 0===r?void 0:r.plain))return!0}return!1}cachePPIDs(e,t,n,r){const i=Object.assign(Object.assign({clientId:{plain:e.clientId},userId:{plain:e.userId,hashed:t.userId},environmentId:{plain:e.environmentId,hashed:t.environmentId},trackerType:{plain:e.trackerType},trackerVersion:{plain:e.trackerVersion}},n?{idfv:{plain:n}}:{}),r?{anId:{plain:r}}:{});p.set(q,i)}hashPPIDs(t,n){return e(this,void 0,void 0,function*(){try{const e=new Headers({"Content-Type":"application/json"});return yield N.post(n,e,t)}catch(e){return u("Error with hashing PPIDs",e),null}})}getNewPPIDs(t,n){return e(this,arguments,void 0,function*({clientId:t,instance:n},r){const i=yield((t,n)=>e(void 0,void 0,void 0,function*(){const e=yield t.getUserId();return e?`${V[n]}:${e}`:null}))(n,r),o=yield(t=>e(void 0,void 0,void 0,function*(){const e=yield t.getEnvironmentId();return e?`sdrn:schibsted:environment:${e}`:null}))(n),a=window.advertory_idfv,s=window.advertory_anId;return Object.assign(Object.assign({clientId:{plain:t},userId:{plain:i},environmentId:{plain:o},trackerType:{plain:"Advertory"},trackerVersion:{plain:"1.0.0"}},a?{idfv:{plain:a}}:{}),s?{anId:{plain:s}}:{})})}createHasherPayload({clientId:e,trackerType:t,trackerVersion:n,userId:r,environmentId:i}){return{clientId:e.plain,trackerType:t.plain,trackerVersion:n.plain,userId:r.plain,environmentId:i.plain}}},W=t=>e(void 0,void 0,void 0,function*(){const{tracker:e,tcf:n,country:r,isMobileApp:i}=t;if(!(yield A(n,i,r,"setXandrPPIDs")))return;if(!e)return;(yield Promise.allSettled([H.processPPIDs(e,null==n?void 0:n.timeout),z.processPPIDs(e,r)])).forEach((e,t)=>{if("rejected"===e.status){u(`Cannot fetch PPIDs v${t+2}`,e.reason)}})}),K=e=>{const{ppid1:t,ppid2:n}=H.getPPIDs(),{ppid1:r,ppid2:i,idfv:o,anId:a}=z.getPPIDs();return{userIds:[{type:"extendedIDs",eids:(new U).add(n,_[e]).add(t,D[e]).add(i,M[e]).add(r,B[e]).add(o,F[e]).add(a,R[e]).buildEids()}]}},J=e=>{const{ppid1:t,ppid2:n}=H.getPPIDs(),{ppid1:r,ppid2:i,idfv:o,anId:a}=z.getPPIDs();if(!n)return{};return{userSync:{userIds:[{name:"pubProvidedId",params:{eids:(new U).add(n,_[e]).add(t,D[e]).add(i,M[e]).add(r,B[e]).add(o,F[e]).add(a,R[e]).buildRyEids()}}]}}},G=e=>{const t=encodeURIComponent(e).replace(/[-.+*]/g,"\\$&"),n=new RegExp(`(?:(?:^|.*;)\\s*${t}\\s*\\=\\s*([^;]*).*$)|^.*$`);return decodeURIComponent(document.cookie.replace(n,"$1"))||null},Y={MOBILE:"mobile",TABLET:"tablet",DESKTOP:"desktop"},Q=9826;class X{constructor(){this.getSupplyTypeKeywords=()=>{const{deviceType:e=Y.DESKTOP,isMobileApp:t}=l.get();if(t){return{"aa-sch-supply_type":`app_${e===Y.MOBILE?"phone":Y.TABLET}`}}return{"aa-sch-supply_type":`web_${this.getPageOptionsFormatDevice(e)}`}}}prepare(t){return e(this,void 0,void 0,function*(){return Object.assign(Object.assign({},t),{keywords:Object.assign(Object.assign(Object.assign(Object.assign({},t.keywords),this.getSupplyTypeKeywords()),yield this.getFormattedExternalIdKeywords()),this.getHasContextKeywords(t.keywords)),user:{externalUid:yield this.getExternalUid(),dnt:yield this.isTrackingForbidden()}})})}getFormattedExternalIdKeywords(){return e(this,void 0,void 0,function*(){const e=yield this.getExternalUid(),t=this.getUserId();return{"aa-sch-externalid_src":Number(!!e)+Number(!!t)}})}getUserId(){return(()=>{const e=G("_pulse2data");return e?e.split(",")[2]:void 0})()}getExternalUid(){return e(this,void 0,void 0,function*(){return yield e(void 0,void 0,void 0,function*(){const{tcf:e,isMobileApp:t,country:n}=l.get(),{getConsentAsync:r}=I(e,t,n);if(!(yield r()))return;const i=G("_pulse2data");return i?i.split(",")[9]:void 0})})}isTrackingForbidden(){return e(this,void 0,void 0,function*(){return(null===navigator||void 0===navigator?void 0:navigator.globalPrivacyControl)||"1"===(null===navigator||void 0===navigator?void 0:navigator.doNotTrack)||"DO_NOT_TRACK"===(yield this.getExternalUid())})}getMember(){const{pageOptions:{member:e},testMember:t=Q}=l.get();return window.location.search.includes("inventory_test=true")?t:e}getCMPValue(e){return localStorage.getItem(`CMP:${e}`)?"0"===localStorage.getItem(`CMP:${e}`)?"0":"1":"0"}getPublisherKeywords(){const{publisher:e}=l.get();return{"aa-sch-publisher":`${e}`}}getAnalyticsConsentKeywords(){return{"aa-sch-cmp_analytics":this.getCMPValue("analytics")}}getAdvertisingConsentKeywords(){return e(this,void 0,void 0,function*(){const{tcf:e,isMobileApp:t,country:n}=l.get(),{getConsentAsync:r}=I(e,t,n);return{"aa-sch-cmp_advertising":(yield r())?"1":"0"}})}getPageTypeKeywords(){const{pageType:e}=l.get();return{"aa-sch-page_type":e}}getCountryCodeKeywords(e){return{"aa-sch-country_code":e}}getInventoryTypeKeywords(){return{"aa-sch-inventory_type":"editorial"}}getHasContextKeywords(e){const t=e["aa-sch-context_keyword"];return{"aa-sch-has_context_keyword":Array.isArray(t)&&t.length?1:0}}getPageOptionsFormatDevice(e="desktop"){return"mobile"===e?"phone":e}getSponsorsKeywords(){var e;const{publisher:t,keywordsConfig:n}=l.get(),r=null===(e=null==n?void 0:n.sponsors)||void 0===e?void 0:e.split(":").map(e=>`${t}_${e}`);return r?{"no-sno-news-sponsors":r}:{}}}const Z=new X;Z.prepare.bind(Z);const ee=new class extends X{prepare(t){return e(this,void 0,void 0,function*(){const n=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({"aa-sch-country_code":f.SE},this.getPublisherKeywords()),this.getPageTypeKeywords()),yield this.getFormattedExternalIdKeywords()),this.getSupplyTypeKeywords()),yield this.getAdvertisingConsentKeywords()),this.getAnalyticsConsentKeywords()),yield e(void 0,void 0,void 0,function*(){const{glimr:e}=l.get(),{addPublisherToGeo:t}={},n=yield k();if(!(null==e?void 0:e.enabled)||!n)return u("No consent for getting glimr tags."),{};const r=C(),i=j(t);return{[`${r}-geo`]:i.geoTags,[`${r}-weather`]:i.weatherTags,[`${r}-geofence`]:i.geofenceTags}})),(()=>{const{ppid1:e,ppid2:t}=H.getPPIDs();return{"aa-sch-schuserhash":e?"1":"0","aa-sch-schenvhash":t?"1":"0"}})()),this.getHasContextKeywords(t.keywords)),t.keywords);return Object.assign(Object.assign({},t),{keywords:n,user:Object.assign(Object.assign({},K(f.SE)),{externalUid:yield this.getExternalUid()}),member:this.getMember()})})}};var te=ee.prepare.bind(ee);const ne="ABSOLUTE_FULLSCREEN",re="ANY_FULLSCREEN",ie="VERTICAL_FULLWIDTH",oe="FULLWIDTH",ae="TAKEOVER",se="VELVET_TAKEOVER",de="WALLPAPER",le="COLLAPSE",ce={ANY_FULLSCREEN:[{width:6,height:6},{width:1920,height:1080},{width:3,height:3}],ABSOLUTE_FULLSCREEN:[{width:6,height:6}],VERTICAL_FULLWIDTH:[{width:1080,height:1920}],FIXED_FULLSCREEN:[{width:1920,height:1080},{width:3,height:3}],FULLWIDTH:[{width:5},{width:400,height:400}],NATIVE_AD:[{width:1,height:1}],TAKEOVER:[{width:4,height:4}],VELVET_TAKEOVER:[{width:7,height:7}],WALLPAPER:[{width:2,height:2}],COLLAPSE:[{width:2,height:1}]},ue={wallpaper:1600,"l-format":1600},ve=e=>{const{banner:t,targetId:n}=e;return!(!t||(null==n?void 0:n.includes("takeover")))&&Ce(e,re)},pe=e=>{const{native:t}=e;return!!t},ge=e=>Ce(e,oe),he=e=>{const{targetId:t}=e;return t.includes("takeover")||Ce(e,ae)},me=e=>Ce(e,ae),ye=e=>Ce(e,de),fe=e=>Ce(e,le),we=e=>e.targetId.includes("sponsorstripe"),be=e=>{const t=document.querySelector(`#${e}`);return!!t&&"true"===t.dataset.isFinnBlinkPlacement},Ee=e=>e.targetId.startsWith("panorama")||e.targetId.startsWith("modul"),Ie=e=>e.targetId.startsWith("midboard"),Ae=e=>e.targetId.startsWith("widescreen"),ke=e=>e.width>=1260&&e.width<=1280,Te=e=>e.width>=1600&&e.width<=1620,Ce=(e,t)=>{const n=ce[t];if(!n)return!1;return!!n.find(t=>{var n,r;const i=(null===(n=e.banner)||void 0===n?void 0:n.width)||e.width,o=(null===(r=e.banner)||void 0===r?void 0:r.height)||e.height,a=t.width===i,s=!t.height||t.height===o;return a&&s})},Se={adRequested:()=>{},adAvailable:e=>{},adLoaded:e=>{const t=document.querySelector(`#${e.targetId}`),n=null==t?void 0:t.parentElement;var r,i;t&&n&&(Te(e)&&(r=n,t.classList.add("advertory-tvnu-hformat__ad"),r.classList.add("advertory-tvnu-hformat-wrapper__ad"),null===(i=document.getElementById("layout-wrapper"))||void 0===i||i.classList.add("layout-hformat-adjustment"),window.dispatchEvent(new CustomEvent("advertory:hFormatLoaded",{detail:{data:{loaded:!0}},bubbles:!0,cancelable:!0}))),Ae(e)&&(e=>{const t=!!document.querySelector(".advertory-tvnu-hformat-wrapper__ad"),n=e.parentElement;t&&n&&n.classList.add("with-h-format")})(n),(e=>5===e.width&&65===e.height)(e)&&((e,t)=>{e.classList.add("advertory-tvnu-calendar-format__ad"),t.classList.add("advertory-tvnu-calendar-format-wrapper__ad")})(t,n))},adNoBid:e=>{},adError:(e,t)=>{},adCollapse:()=>{},adRequestFailure:e=>{},adBadRequest:e=>{},adLoadedMediated:e=>{},adNoBidMediated:e=>{}},Pe="svd",Oe="vg",xe="godare",Le="aftonbladet",je="e24",$e={publisherClassName:"tvnu",fullWidthFormatClassName:"panorama"};class Ne{initialize(){this.DATA=Object.assign({},Ne.INITIAL_DATA)}getData(e){if(!this.DATA)throw new Error("Storage was accessed with invalid data.");return this.DATA[e]}setData(e,t){if(!this.DATA)throw new Error("Storage was accessed before it had been initialized.");this.DATA[e]=Object.assign(Object.assign({},this.DATA[e]),t)}}Ne.INITIAL_DATA={wallpaper:{isAvailable:!1},horseshoe:{isAvailable:!1},initialClassNames:{},alertoryConfigKeywords:{}};const qe=new Ne,_e=()=>(window.apntag||(window.apntag={anq:[],defineTag:e=>({targetId:""}),showTag:e=>{},onEvent:(e,t,n)=>{},offEvent:(e,t)=>{},refresh:e=>{},modifyTag:(e,t)=>{},loadTags:e=>{},emitEvent:(e,t)=>{},setPageOpts:e=>{},resizeAd:(e,t,n)=>{},getAstVersion:()=>"",setEndpoint:(e,t)=>{},fireImpressionTrackers:e=>{},setKeywords:()=>{},clearRequest:()=>{}}),window.apntag),De=()=>(window.relevantDigital||(window.relevantDigital={cmd:[]}),window.relevantDigital),Me=(e={},t)=>{const{prebid:{externalUidInAuctionEnabled:n,forwardGlimrTags:r=!1}={}}=l.get(),i=[`${C()}-geo`],o=["aa-sch-context_keyword","aa-sch-publisher","se-aftonbladet-section","se-svd-section","se-generic-section","no-sno-news-section","no-sno-news-subsection",...r?i:[]],a=Object.fromEntries(Object.entries(e).filter(([e])=>o.includes(e))),s=t&&n?{id:t}:{};return{ortb2:Object.assign({site:{ext:{data:a}}},s)}},Be=(t,...n)=>e(void 0,[t,...n],void 0,function*(e,{timeout:t}={timeout:1e3}){document.querySelector(`script[src="${e}"]:not([type="module"])`)||(yield new Promise((n,r)=>{const i=document.createElement("script");i.async=!0,i.src=e;const o=()=>{s(),n()},a=()=>{s(),r(new Error(`Failed to load ${e}`))},s=()=>{i.removeEventListener("load",o),i.removeEventListener("error",a),clearTimeout(d)};i.addEventListener("load",o),i.addEventListener("error",a);const d=setTimeout(()=>{s(),r(new Error(`Loading script timed out: ${e}`))},t);document.head.appendChild(i)}).catch(e=>{console.error(e)}))}),Fe=e=>e.includes("snoap.no"),Re=e=>{var t,n,r,i,o;return!!(null===(o=null===(i=null===(r=null===(n=null===(t=window.apntag)||void 0===t?void 0:t.requests)||void 0===n?void 0:n.tags[e])||void 0===r?void 0:r.adResponse)||void 0===i?void 0:i.ads[1])||void 0===o?void 0:o.rtb)},Ve=(e,t=(...e)=>{})=>{const n=t.toString();if(0===e.length)return n;const r=n.substring(0,n.indexOf("=>")).replace("(","").replace(")","").split(",").map(e=>e.trim()),i=n.substring(n.indexOf("{")+1,n.lastIndexOf("}")),o=r.map((t,n)=>`${t} = "${e[n]}"`);return new Function(...o,i).toString()},Ue=Ve([],()=>{const e=({width:e,height:t})=>{var n;const r=null===(n=document.querySelector("#sf_align"))||void 0===n?void 0:n.querySelector("div");if(!r)return;const{clientWidth:i,clientHeight:o}=r,a=e/i,s=t/o;r.style.transform=`scale(${a},${s})`,r.style.transformOrigin="left top"},t=()=>{const{innerWidth:t,innerHeight:n}=window;e({width:t,height:n})};window.addEventListener("resize",t=>{if(!t.currentTarget)return;const n={width:innerWidth,height:innerHeight};e(n)});const n=window.frameElement;(null==n?void 0:n.contentWindow)?n.contentWindow.document.body.onload=t:document.body.onload=t}),He=e=>{const t=Ve([],()=>{new MutationObserver((e,t)=>{document.querySelector("iframe")&&((()=>{const e=document.querySelector("iframe");e&&(e.onload=()=>{if(!e.contentDocument)return;document.body.style.height="100%",document.documentElement.style.height="100%",e.height="100%",e.width="100%";const t=e.contentDocument.createElement("style");t.textContent="\n adfm-ad {\n height: 100% !important;\n width: 100% !important;\n }\n ",e.contentDocument.head.appendChild(t);const n=e.contentDocument.querySelector("iframe");if(!(null==n?void 0:n.contentDocument))return;const r=n.contentDocument.createElement("style");r.textContent="\n #image {\n background-size: cover !important;\n }\n ",new MutationObserver((e,t)=>{n.contentDocument&&(n.contentDocument.head.appendChild(r),t.disconnect())}).observe(e.contentDocument,{childList:!0,subtree:!0})})})(),t.disconnect())}).observe(document.body,{childList:!0,subtree:!0})}),n=document.createElement("script");n.textContent=`(${t})()`;return e+n.outerHTML},ze=[],We={},Ke=(e,t)=>{e.forEach(({target:e,isIntersecting:n})=>{const r=Ge(e);n?(Je(r,n),Ye(e,r,t)):(Je(r,n),Qe(e,r,t))})},Je=(e,t)=>{var n,r;const i=null===(n=document.getElementById(e))||void 0===n?void 0:n.querySelector("iframe");if(!i)return;const o=t?"showFullscreen":"hideFullscreen";null===(r=i.contentWindow)||void 0===r||r.postMessage(`advertory:${o}-${e}`,"*")},Ge=e=>{var t;return null===(t=e.children[0])||void 0===t?void 0:t.id},Ye=(e,t,n)=>{e.classList.add("in-screen"),document.body.classList.add("fullscreen-scroll-in-screen"),window.dispatchEvent(new CustomEvent("advertory:fullscreenScrollInView")),ze.includes(t)||ze.push(t),n&&window.addEventListener("scroll",We[t],{passive:!0})},Qe=(e,t,n)=>{ze.includes(t)&&(n&&window.removeEventListener("scroll",We[t]),document.body.classList.remove("fullscreen-scroll-in-screen"),e.classList.remove("in-screen"),window.dispatchEvent(new CustomEvent("advertory:fullscreenScrollNotInView")))},Xe=(e,t={fadingHeaderEnabled:!1,headerSelectors:[".js-masthead"],skyscraperSelectors:[".skyscraper_r"],headerZIndex:3})=>{const{headerSelectors:n=[".js-masthead"],skyscraperSelectors:r=[".skyscraper_r"],headerZIndex:i=3}=t,o=[],a=[];return n.forEach(e=>{var t;const n=null!==(t=document.querySelector(e))&&void 0!==t?t:document.querySelector("header");n&&o.push(n)}),r.forEach(e=>{const t=document.querySelector(e);t&&a.push(t)}),()=>{o.length&&Ze(e,o,i,0),a.length&&Ze(e,a,i,40)}},Ze=(e,t,n,r)=>{const i=e.offsetHeight,o=window.scrollY,a=e.getBoundingClientRect().top+o;t.forEach(e=>{const t=e.offsetHeight;let s;s=a>o?(a-o)/t-r:(o+t-(a+i))/t;const d=s<=0;e.style.visibility=d?"hidden":"",e.style.zIndex=d?"":n.toString(),e.style.pointerEvents=d?"none":"all",e.style.opacity=s.toString()})};function et(e){if(!e||"undefined"==typeof window)return;const t=document.createElement("style");return t.setAttribute("type","text/css"),t.innerHTML=e,document.head.appendChild(t),e}et('body.fullscreen-scroll-in-screen{overflow-x:hidden}.advertory-fullscreen-scroll-wrapper{visibility:hidden;overflow:visible;width:100% !important;height:var(--advertory-fullscreen-scroll-vh, 100vh) !important;position:relative;margin:var(--advertory-fullscreen-scroll-wrapper-margin);z-index:1;display:block !important;min-height:250px;padding:0 !important;clip-path:polygon(0 0, 100vw 0, 100vw 100dvh, 0 100dvh);-webkit-clip-path:polygon(0 0, 100vw 0, 100vw 100dvh, 0 100dvh)}.advertory-fullscreen-scroll-wrapper>div{position:fixed;top:0;left:0;height:var(--advertory-fullscreen-scroll-vh, 100vh) !important;width:100vw !important;overflow:hidden}html[data-app-platform=iOS] .advertory-fullscreen-scroll-wrapper>div{height:calc(var(--advertory-fullscreen-scroll-vh, 100vh) - env(safe-area-inset-top) + var(--advertory-ios-safe-area-top-fix, 0px) - env(safe-area-inset-bottom)) !important;top:unset !important;bottom:env(safe-area-inset-bottom) !important}.advertory-fullscreen-scroll-wrapper>div>iframe{height:inherit !important;width:inherit !important;display:none !important}.advertory-fullscreen-scroll-wrapper.in-screen{visibility:visible;overflow:visible;width:100vw !important}.advertory-fullscreen-scroll-wrapper.in-screen>div>iframe{display:block !important}.advertory-fullscreen-scroll-wrapper.in-screen:before{content:"";width:100vw;height:150dvh;position:relative !important;display:block;transform:translateX(-50%);overflow:visible;z-index:1;left:50%;top:-150dvh;padding:0 !important}.advertory-fullscreen-scroll-wrapper.in-screen:after{content:"";width:100vw;height:150dvh;position:relative !important;display:block;transform:translateX(-50%);overflow:visible;z-index:1;left:50%;top:-50dvh}.advertory-fullscreen-scroll{position:fixed;top:var(--advertory-fullscreen-scroll-top, 0px);left:var(--advertory-fullscreen-scroll-left, 0px);width:var(--advertory-fullscreen-scroll-vw, 100vw);height:var(--advertory-fullscreen-scroll-vh, 100vh);overflow:hidden}.advertory-fullscreen-scroll::before{content:attr(data-ad-label);box-sizing:border-box;position:fixed;top:0}html[data-app-platform=iOS] .advertory-fullscreen-scroll::before{top:calc(env(safe-area-inset-top) - var(--advertory-ios-safe-area-top-fix, 0px)) !important}.advertory-fullscreen-scroll::before{left:calc(50vw - 628px);width:calc(100% - 36px);max-width:1250px;text-align:left;background-color:hsla(0,0%,100%,.6);color:#212121;font-family:Ester Blenda,Arial,sans-serif;font-size:11px;font-weight:400;font-style:normal;text-transform:lowercase;line-height:1;margin:16px 2px;padding:10px;z-index:1;visibility:inherit !important}@media screen and (max-width: 1290px){.advertory-fullscreen-scroll::before{left:16px}}.advertory-fullscreen-scroll[data-move-cogwheel-to-the-left=true]>div[role=button]{left:calc(50vw - 623px);right:unset}@media screen and (max-width: 1290px){.advertory-fullscreen-scroll[data-move-cogwheel-to-the-left=true]>div[role=button]{left:22px;right:unset}}.advertory-fullscreen-scroll[data-move-cogwheel-to-the-left=true]::before{padding-left:32px}.advertory-fullscreen-scroll>div[id*=utif]{display:block;width:var(--advertory-fullscreen-scroll-vw, 100vw) !important;height:var(--advertory-fullscreen-scroll-vh, 100vh) !important}html[data-app-platform=iOS] .advertory-fullscreen-scroll>div[id*=utif]{height:calc(var(--advertory-fullscreen-scroll-vh, 100vh) - env(safe-area-inset-top) + var(--advertory-ios-safe-area-top-fix, 0px) - env(safe-area-inset-bottom)) !important}.advertory-fullscreen-scroll>div[id*=utif]{overflow:hidden}.advertory-fullscreen-scroll>div[id*=utif]>iframe{display:block;height:inherit !important;width:inherit !important}.advertory-fullscreen-scroll>div[role=button]{z-index:1;opacity:1;background:rgba(0,0,0,0) !important;left:unset;position:fixed !important;right:calc(50vw - 623px);top:19px !important;width:26px !important;height:26px !important}html[data-app-platform=iOS] .advertory-fullscreen-scroll>div[role=button]{top:calc(env(safe-area-inset-top) - var(--advertory-ios-safe-area-top-fix) + 19px) !important}@media screen and (max-width: 1290px){.advertory-fullscreen-scroll>div[role=button]{right:22px}}');const tt={no:{adText:"ANNONSE",adFrom:"ANNONSE FRA",adContent:"ANNONSØRINNHOLD",adContentFrom:"ANNONSØRINNHOLD FRA"},se:{adText:"ANNONS",adFrom:"ANNONS FRÅN",adContent:"EXTERN LÄNK",adContentFrom:"EXTERN LÄNK FRÅN"}};let nt=null;const rt=(e,t)=>{let n=e;return n=(e=>{const t=document.createElement("script");return t.textContent="\n {\n const frame = window.frameElement;\n \n if (frame) {\n frame.contentWindow.document.body.onload = onLoad;\n } else {\n document.body.onload = onLoad;\n }\n \n function onLoad() {\n window.addEventListener('message', function(event) {\n if (event.data === 'advertory:showFullscreen-'+document.body.id) {\n document.body.style.display= \"block\";\n } else if (event.data === 'advertory:hideFullscreen-'+document.body.id) {\n document.body.style.display= \"none\";\n }\n });\n }\n }\n ",e+t.outerHTML})(e),n=(e=>{const t=document.createElement("script");return t.textContent=`(${Ue})()`,e+t.outerHTML})(n),n=(e=>{if((e=>e.includes("google"))(e))return e;const t=document.createElement("div");t.innerHTML=e;const n=t.querySelector("img");return n?(n.style.width="100%",n.style.height="100%",n.style.objectFit="cover",n.style.position="fixed",t.innerHTML):e})(n),n=(e=>{if(Fe(e))return e;const t=document.createElement("style");return t.textContent="\n .GoogleActiveViewClass, .GoogleActiveViewElement {\n transform: translate(calc(-50% + 50vw), 0);\n width: 100vw !important;\n height: 100vh !important;\n }\n .GoogleActiveViewClass img, .GoogleActiveViewElement img {\n width: 100vw;\n height: 100vh;\n object-fit: cover;\n }\n .GoogleActiveViewClass iframe {\n width: 100vw !important;\n height: 100vh !important;\n }\n ",e+t.outerHTML})(n),(e=>e.includes("adform"))(n)&&(n=(e=>{const t=document.createElement("script");t.textContent='\n var frame = window.frameElement;\n if (frame) {\n frame.style.removeProperty("width");\n frame.style.removeProperty("height");\n frame.contentWindow.document.body.onload = onLoad;\n } else {\n document.body.onload = onLoad;\n }\n \n function onLoad() {\n var iframe = document.querySelector("adfm-ad iframe");\n if (iframe) {\n var image = iframe.contentWindow.document.getElementById("image");\n if (!image) return;\n image.style.backgroundSize = "cover";\n } else {\n var iframe = document.querySelector(".adform-adbox iframe");\n if (iframe) {\n var style = document.createElement("style");\n style.textContent = "#banner {width: 100% !important; height: 100% !important;} #banner img {object-fit: cover;}";\n iframe.contentDocument.body.append(style);\n iframe.style = "width: 100vw; height: 100vh;";\n } else {\n var observer = new MutationObserver(function(mutations, obs) {\n for (var mutation of mutations) {\n var iframe = mutation.addedNodes[0];\n if (iframe && iframe.nodeName === "IFRAME") {\n iframe.style = "width: 100vw; height: 100vh;";\n iframe.dataset.contents += "<style>#banner {width: 100% !important; height: 100% !important;} #banner img {object-fit: cover;}</style>";\n obs.disconnect();\n }\n }\n });\n observer.observe(document.body, { childList: true, subtree: true });\n }\n }\n }\n ';const n=document.createElement("style");return n.textContent="\n html, body, adfm-ad, #sf_align, .adform-adbox, .adform-adbox img {\n width: 100% !important;\n height: 100% !important;\n object-fit: cover;\n max-width: 100vw;\n }\n ",e+n.outerHTML+t.outerHTML})(n)),(e=>e.includes("529299503"))(n)&&(n=He(n)),(e=>e.includes("de17a"))(n)&&(n=(e=>Fe(e)?e:e.replace("<iframe ","<iframe onload=\"\n var f = document.querySelector('iframe');\n if (!f) return;\n var s = f.style;\n s.transform = 'scale(' + (window.innerHeight / Number(f.height)).toFixed(2) + ')';\n s.right = parseInt((Number(f.width) - window.innerWidth) / 2) + 'px';\n s.bottom = parseInt((Number(f.height) - window.innerHeight) / 2) + 'px';\n s.position = 'relative';\n \" "))(n)),Fe(n)&&(n=(e=>{let t=e.replace("<html>",'<html style="height: 100%;">');return t=t.replace("</iframe>","</iframe><style>#sf_align {height: 100%;} #sf_align iframe {height: 100vh;}</style>"),t=t.replace('<body style="','<body style="height: 100%; '),t})(n)),(e=>e.includes("kreateam.io"))(n)&&(n=(e=>{let t=e.replace("<html>",'<html style="height: 100%;">');return t=t.replace("</div>","</div><style>#sf_align {height: 100%;} #sf_align iframe {height: 100vh;}</style>"),t=t.replace('<body style="','<body style="height: 100%; '),t})(n)),Re(t)&&(n=(e=>{const t=document.createElement("script");t.textContent='var frame = window.frameElement;\n if (frame) {\n frame.style.width = "100vw";\n frame.style.height = "100vh";\n }';const n=document.createElement("div");return n.innerHTML=e,n.appendChild(t),n.innerHTML})(n)),n},it=()=>{nt=null;const e=window.visualViewport,t=e?e.height:window.innerHeight,n=e?e.width:window.innerWidth,r=e?e.offsetLeft:0,i=document.documentElement;i.style.setProperty("--advertory-fullscreen-scroll-vh",`${t}px`),i.style.setProperty("--advertory-fullscreen-scroll-vw",`${n}px`),i.style.setProperty("--advertory-fullscreen-scroll-left",`${r}px`)},ot=()=>{nt||(nt=window.requestAnimationFrame(it))},at=(e,t)=>{var n,r,i,o;const{country:a}=l.get(),{targetId:s}=e;document.documentElement.style.setProperty("--advertory-ios-safe-area-top-fix",null!==(n=null==t?void 0:t.iosSafeAreaTopFix)&&void 0!==n?n:"0px"),(e=>{const{articlesContainerWidth:t=1302,backgroundColor:n="#fff",foregroundColor:r="#fff",margin:i="16px 0",beforeContentValue:o=""}=e,a=t/2,s=document.createElement("style");s.innerHTML=`\n :root {\n --background: linear-gradient(\n to right,\n ${n} 0px,\n ${n} calc(50% - ${a}px),\n ${r} calc(50% - ${a}px),\n ${r} calc(50% + ${a}px),\n ${n} calc(50% + ${a}px),\n ${n} 100%\n ) !important;\n \n --advertory-fullscreen-scroll-wrapper-margin: ${i};\n }\n \n .advertory-fullscreen-scroll-wrapper {\n ${o&&"clip-path: polygon(0 -16px, 100vw -16px, 100vw 100dvh, 0 100dvh);\n -webkit-clip-path: polygon(0 -16px, 100vw -16px, 100vw 100dvh, 0 100dvh);"}\n }\n\n .advertory-fullscreen-scroll-wrapper:before, .advertory-fullscreen-scroll-wrapper:after {\n background: var(--background);\n content: '${o}' !important;\n }`,s.id="ad-fullscreen-scroll-wrapper-style",document.head.appendChild(s)})(null!==(r=null==t?void 0:t.overlayStyles)&&void 0!==r?r:{});const d=document.getElementById(s),c=null==d?void 0:d.parentElement;if(!d||!c)return;((e,t)=>{const n=(null==t?void 0:t.fadingHeaderEnabled)||!1,r=new IntersectionObserver(e=>Ke(e,n),{}),i=Ge(e);r.observe(e),n&&(We[i]=Xe(e,t))})(c,t),d.className="advertory-fullscreen-scroll";const u=Ce(e,ne)?"absolute":"fixed";d.style.position=u,c.className="advertory-fullscreen-scroll-wrapper",c.dataset.showTagSubscribeId=s,d.setAttribute("data-ad-label",tt[a].adText),(null==t?void 0:t.moveCogwheelToTheLeft)&&(d.dataset.moveCogwheelToTheLeft="true"),ot(),window.addEventListener("resize",ot),null===(i=window.visualViewport)||void 0===i||i.addEventListener("resize",ot),null===(o=window.visualViewport)||void 0===o||o.addEventListener("scroll",ot)},st=({targetId:e})=>{const t=(e=>{const{requests:t}=window.apntag,n=Re(e)?1:0;return null==t?void 0:t.tags[e].adResponse.ads[n].rtb.banner.content})(e);if(!t)return;((e,t)=>{const{requests:n}=window.apntag,r=Re(e)?1:0;n&&(n.tags[e].adResponse.ads[r].rtb.banner.content=t)})(e,rt(t,e))},dt=()=>e(void 0,void 0,void 0,function*(){const{prebid:e,tcf:t,country:n,isMobileApp:r,fullscreenScroll:i}=l.get();if(!(null==e?void 0:e.enabled))return;const{initNativeAd:o}=l.getHandlers(),{getConsentAsync:a}=I(t,r,n),s=yield a(),d=(()=>{let e=!1,t=[];const n={relevantCb:{timeout:1e3},auctionCb:{timeout:2e3}};return{getCancel:()=>e,setCancel:t=>{e=t},events:n,failsafeOnTimeout:r=>{const i=_e(),{prebid:{relevantCbTimeout:o}={}}=l.get(),a="relevantCb"===r&&o?o:n[r].timeout,s=setTimeout(()=>{!n[r].done&&!e&&(console.warn(`Doing failsafe loadTags() call after waiting too long for '${r}'`),e=!0,i.loadTags&&i.loadTags())},a);t.push(s)},cleanup:()=>{t.forEach(e=>clearTimeout(e)),t=[],e=!1,n.relevantCb.done=!1,n.auctionCb.done=!1}}})(),c=_e(),v=(()=>{const{requests:{user:e={userIds:[]},keywords:t={}}={}}=_e();return{user:e,keywords:t}})();d.failsafeOnTimeout("relevantCb");const{user:{externalUid:p=""}={},keywords:g}=v;(()=>{const e=De();return e.cmd||(e.cmd=[]),e.cmd})().push(()=>{if(d.getCancel()||!c.loadTags)return u("core loadTags() call was cancelled",{cancel:d.getCancel(),apnTagLoadTags:!c.loadTags,condition:"or"}),void d.cleanup();const t=De();d.events.relevantCb.done=!0,d.failsafeOnTimeout("auctionCb");const r=s?{gdpr:{cmpApi:"iab",timeout:8e3}}:{cmpApi:"none"};u("prebid consentManagement",r),t.addPrebidConfig(Object.assign(Object.assign({consentManagement:r,enableSendAllBids:!1},J(n)),Me(g,p))),u("core add prebid config",Object.assign(Object.assign({consentManagement:r,enableSendAllBids:!1},J(n)),Me(g,p))),t.loadPrebid({configId:e.id,manageAdserver:!1,collapseEmptyDivs:!1,collapseBeforeAdFetch:!1,noGpt:!0,noSlotReload:!0,loadUnknownSlots:!0,apntagCalls:{showTag:()=>{},loadTags:e=>{d.getCancel()||(d.events.auctionCb.done=!0,c.loadTags(e)),d.cleanup()}},customNativeRender:e=>{lt(e,o)},directRenderFn:e=>{const{settings:t,renderFn:n}=e,{bid:r,adDiv:o}=t||{};if(!o)return;const a=n(t),s=Object.assign(Object.assign({},r),{targetId:o.id,banner:!0});ve(s)&&(at(s,i),(e=>{const t=()=>{const t=e.contentDocument;if(!(null==t?void 0:t.body))return;const n=()=>{const e=t.querySelector("iframe");if(!e)return!1;const n=()=>{var t;const n=null===(t=e.contentDocument)||void 0===t?void 0:t.querySelector(".adn-ttpa-container");n&&(n.style.setProperty("bottom","10px","important"),n.style.setProperty("top","unset","important"))};return e.addEventListener("load",n),n(),!0};if(n())return;const r=new MutationObserver(()=>{n()&&r.disconnect()});r.observe(t.body,{childList:!0,subtree:!0})};e.addEventListener("load",t),t()})(a))}}),u("core load prebid",{configId:e.id,manageAdserver:!1,collapseEmptyDivs:!1,collapseBeforeAdFetch:!1,noGpt:!0,noSlotReload:!0,loadUnknownSlots:!0,apntagCalls:{showTag:()=>{},loadTags:e=>{d.getCancel()||(d.events.auctionCb.done=!0,c.loadTags(e))}},customNativeRender:e=>{lt(e,o)},directRenderFn:()=>{}})})}),lt=(e,t)=>{var n;const{divId:r,native:i,bid:o}=e,a=document.querySelectorAll(`[id^=${r}]`)[0],s=`RY-${a.id}`;((e,t)=>{e.childNodes.forEach(e=>e.style.cssText="position: absolute; z-index: -1;");const n=document.createElement("div");n.setAttribute("id",t),e.appendChild(n)})(a,s);const d=null===(n=a.getElementsByTagName("iframe")[0])||void 0===n?void 0:n.contentWindow;t({native:i,targetId:s},l.get()),null==d||d.postMessage(JSON.stringify({message:"Prebid Response",ad:"\x3c!-- nothing --\x3e",adId:o.adId}),"*")},ct="0123456789abcdefghijklmnopqrstuvwxyz",ut=()=>Promise.resolve(),vt=()=>{},pt=e=>{window.apntag.anq.push(e)},gt=new Promise(e=>{"undefined"!=typeof document&&document.prerendering?document.addEventListener("prerenderingchange",()=>e()):e()}),ht=new Promise(e=>{if("undefined"==typeof document||!document.hidden)return void e();const t=()=>{document.hidden||(document.removeEventListener("visibilitychange",t),e())};document.addEventListener("visibilitychange",t,{once:!0})}),mt=e=>{const t=e.split("-"),n=t[t.length-1];return 6===n.length&&n.match(/^[a-zA-Z0-9]+$/)?t.slice(0,-1).join("-"):e};let yt="";const ft=new Map,wt="advertory-wallpaper-background",bt=()=>{const e=document.querySelector(`.${wt}`);e&&e.remove()},Et=/^wallpaper:url:(http[s]?:\/\/)?[^\s(["<,>]*\.[^\s[",><]*/,It=e=>{if(window.location.href.includes("collapse_ad=0"))return;const t=document.querySelector(`div[id^="${e}"]`);if(!t)return;const n=t.parentElement;n&&(t.style.setProperty("width","0","important"),t.style.setProperty("height","0","important"),t.style.setProperty("display","none","important"),n.style.setProperty("display","none","important"),e.includes("wallpaper")&&bt())},At=e=>{const t=document.querySelector(`div[id^="${e}"]`);if(!t)return;const n=t.parentElement;n&&(t.style.removeProperty("width"),t.style.removeProperty("height"),t.style.removeProperty("display"),n.style.removeProperty("display"))},kt=e=>{var t;const n=null===(t=document.querySelector(`#${e}`))||void 0===t?void 0:t.parentElement,r=(null==n?void 0:n.offsetHeight)||0;n&&(n.style.minHeight=`${r}px`)},Tt=e=>{const t=e.parentElement;if(!e||!t)return;const{container:n,wrapper:r}=(e=>{const t=qe.getData("initialClassNames")[e.id];return{wrapper:(null==t?void 0:t.wrapper)?t.wrapper.join(" "):"",container:(null==t?void 0:t.container)?t.container.join(" "):""}})(e);e.className=n,t.className=r},Ct=()=>{bt();document.querySelectorAll('[data-advertory-ad-rendered="true"]').forEach(e=>{It(e.id),Tt(e),(e=>{const t=document.querySelector(`#${e}`),n=null==t?void 0:t.getAttribute("data-probable-height"),r=null==t?void 0:t.getAttribute("data-probable-width");n&&r&&(null==t||t.style.setProperty("min-height",n+"px"),null==t||t.style.setProperty("min-probable-width",r+"px"))})(e.id),e.innerHTML="",e.id=mt(e.id)}),pt(()=>window.apntag.clearRequest())},St="noGroupedPlacements",Pt=e=>{const t=e.replace(/[0-9]/g,"");return"_"===t.slice(-1)?t.substring(0,t.length-1):t},Ot=e=>{if(!(null==e?void 0:e.minViewWidth))return!0;return window.innerWidth>=e.minViewWidth},xt=e=>{var t;if(!(null===(t=null===window||void 0===window?void 0:window.advertory)||void 0===t?void 0:t.initialized))return[];const{placements:n,queryConfig:r,deviceType:i}=l.get(),o=n[i].filter(Ot)||[],a=e?document.querySelector(e):document;if(!a)return[];const s=o.reduce((e,t)=>{const n=Pt(t.id);return!n||e.includes(n)||e.push(n),e},[]).flatMap(e=>{const t=new RegExp(`^${e}(_(\\d+))?$`),n=o.filter(({id:e})=>e.match(t)),s=(null==r?void 0:r.queryByDataDevice)?`div[id^="${e}"][data-device=${i}], div[id^="${e}"][data-device=all]`:`div[id^="${e}"]:not([data-disabled="true"])`,d=a.querySelectorAll(s),c=Array.from(d).filter(({id:e})=>e.match(t)).map((e,t)=>{var r;const i=Lt(e,t,n),o=i.finnBlink&&!i.finnBlink.renderOnlyWithAdBlock,a=o&&(null===(r=i.finnBlink)||void 0===r?void 0:r.loadOnlyFinnBlink),s=`${e.id}-${((e=6)=>{if(e<=0)return"";let t="";for(let n=0;n<e;n++)t+=ct[Math.floor(36*Math.random())];return t})(6)}`;return e.id=s,e.setAttribute("data-advertory-ad-rendered","true"),o&&e.setAttribute("data-is-finn-blink-placement","true"),a&&e.setAttribute("data-is-finn-blink-only-placement","true"),(e=>{var t;const n=e.id;n&&qe.setData("initialClassNames",{[n]:{wrapper:null===(t=e.parentElement)||void 0===t?void 0:t.className.split(" "),container:e.className.split(" ")}})})(e),Object.assign(Object.assign({},i),{id:s})});return(e=>{const{keywordsConfig:t}=l.get();return(null==t?void 0:t.includeCountingKeywordInTags)?(yt!==window.location.pathname&&(ft.clear(),yt=window.location.pathname),e.map(e=>{var t;const n=e.invCode.replace(/_\d+$/,""),r=null!==(t=ft.get(n))&&void 0!==t?t:0;return e.keywords=Object.assign({},e.keywords),e.keywords[`${S()}-count`]=r,ft.set(n,r+1),e})):e})(c)});return(e=>{const t=Array.from(document.querySelectorAll('div[class^="advertory"]'));return e.sort((e,n)=>t.findIndex(t=>t.id===e.id)-t.findIndex(e=>e.id===n.id))})(s)},Lt=(e,t,n)=>{const r=n[t],i=n[n.length-1],o=n.filter(({id:t})=>t===e.id)[0];return(null==e?void 0:e.id)===(null==r?void 0:r.id)?r:(null==e?void 0:e.id)===(null==i?void 0:i.id)?i:o||i},jt=e=>{const{queryConfig:{placementBatches:t}={},deviceType:n}=l.get(),r=(null==t?void 0:t[n])||{},i=Object.values(r).flat(),o=(e=>{const t={};return e.forEach(e=>{const n=mt(e.id);e.isBackfill&&(t[n]=[e])}),t})(e),a=((e,t)=>{const n={};for(const[r,i]of Object.entries(t))n[r]=e.filter(e=>i.includes(mt(e.id)));return n})(e,r),s=Object.keys(o),d=((e,t)=>e.filter(e=>!t.has(mt(e.id))))(e,new Set([...s,...i]));return Object.assign(Object.assign(Object.assign({},a),o),{[St]:d})},$t=(e,t,n)=>{const r=document.getElementById(`div_utif_${e}`);if(!r)return;const{apntag:i}=window,[o,a]=t;if(!r.dataset.lockedsize&&a&&o)r.style.width=`${o}px`,r.style.height=`${a}px`,n&&(i.resizeAd(r.id,[o,a]),r.dataset.lockedsize="true",r.dataset.lockedwidth=o.toString(),r.dataset.lockedheight=a.toString());else if(null==r?void 0:r.dataset.lockedsize){const{lockedwidth:e,lockedheight:t}=r.dataset;e&&t&&i.resizeAd(r.id,[e,t])}},Nt=["netboard","board"];class qt{constructor(e,t){this.identityFacade=e,this.tracker=t}buildUrl(e,t){var n,r;const{editionName:i}=e,o=(()=>{const e=window.location.href;return new URL(e).searchParams.get("dre_override_inv_code")||""})(),a=JSON.stringify(null!==(r=null===(n=window.advertory)||void 0===n?void 0:n.renderedDrEditionAds)&&void 0!==r?r:[]),s=new URL("https://dr-edition-teaser-server.inventory.schibsted.io/editions"),{envId:d,spid:l}=t;return s.searchParams.append("editionName",i),o&&s.searchParams.append("urlData",o),a&&s.searchParams.append("excludedItems",a),l&&s.searchParams.append("spid",l),d&&s.searchParams.append("envid",d),s.toString()}fetchData(t){return e(this,void 0,void 0,function*(){var e,n,r;const i=yield this.identityFacade.getIdentityUser(),o=null!==(r=yield null===(n=null===(e=this.tracker)||void 0===e?void 0:e.getEnvironmentId)||void 0===n?void 0:n.call(e))&&void 0!==r?r:"",a=(null==i?void 0:i.userId)?String(i.userId):"",s=this.buildUrl(t,{envId:o,spid:a});try{u("Starting fetching DrEdition ad from URL:",s);const e={method:"GET"},t=yield N.get(s,e);return u("Fetch operation completed successfully."),t}catch(e){u("Error during fetch operation:",e)}return null})}}let _t=class{getDrEditionUTMParams(e,t){var n;const{title:r="",clientName:i,creativeId:o}=null!==(n=null==e?void 0:e.pulseData)&&void 0!==n?n:{},{editionName:a}=t,s=r.replace(/<[^>]*>/g,"");return Object.assign({utm_source:"vgfront",utm_content:a,utm_campaign:i,utm_medium:s},o&&{utm_id:`df-${o}`})}getUrlSearchParams(e,t,n){if(!e)return"";const r=this.getDrEditionUTMParams(t,n),i=new URLSearchParams(decodeURIComponent(e.search)),o=new URLSearchParams(e.search);return Object.entries(r).forEach(([e,t])=>{i.has(e)||o.set(e,null!=t?t:"")}),o.toString().replace(/\+/g,"%20")}getUrlWithParams(e,t){var n;const r=null===(n=null==e?void 0:e.pulseData)||void 0===n?void 0:n.url;if(!r)return"";const i=this.getDrEditionUTMParams(e,t),o=new URL(r);return Object.entries(i).forEach(([e,t])=>{o.searchParams.has(e)||o.searchParams.set(e,null!=t?t:"")}),o.toString()}handleVideo(t,n){return e(this,void 0,void 0,function*(){const{id:e,autoplay:r,mute:i,videoLoop:o,vendor:a}=n.videoConfiguration;t.classList.add("vgtv-video-container"),Object.assign(t.dataset,{vgtvVideoId:e,vgtvVendor:a,vgtvAutoplay:r,vgtvMuted:i,vgtvLoop:!!o,vgtvNa:!0,vgtvRecommended:!1,vgtvPulseProvider:"vg",vgtvPulseProductTag:"partnerstudio"})})}getPulseObjectId(){return"sdrn:vg:content:partnerstudio:element:partnerstudio:stats"}getPulsePageId(){return"sdrn:vg:frontpage:front"}getTags(e){var t;let n;if(n=e instanceof HTMLAnchorElement?e.href:null===(t=null==e?void 0:e.querySelector("a"))||void 0===t?void 0:t.href,!n)return[];const{host:r,pathname:i}=new URL(n);if(!r.includes("www.vg.no")&&!i.includes("annonsorinnhold"))return[n];const o=i.split("/");return o.length?[...o.filter(Boolean).slice(1).map(e=>e),n]:[n]}};const Dt=e=>{const t=e.parentElement;t?t.classList.remove("dr-edition-lock-height"):u("Dr. Edition container does not have a parent element, cannot remove height lock.")};class Mt{constructor(e,t,n,r){this.drEditionService=e,this.rendererManager=t,this.videoManager=n,this.pulseManager=r,this.drEditionAds=[]}fetchAndRenderAd(t,n){return e(this,void 0,void 0,function*(){var e,r;const{drEditionConfig:{containerSelector:i},renderAsBackfill:o=!1}=n,a=t.querySelector(i);if(!a)return void u(`Container with selector "${i}" not found.`);const s=yield this.drEditionService.fetchData(n);return(null==s?void 0:s.itemId)||o?!(null==s?void 0:s.itemId)&&o?(u("No Dr. Edition ads available to render. Collapsing whole placement."),It(t.id),void Dt(a)):((null==s?void 0:s.itemId)&&o&&(u("Dr. Edition ad available to render as a Xandr backfill."),At(t.id)),void(s?(s.css&&((e,t)=>{const n=document.createElement("link");n.rel="preload",n.href=e,n.as=t,document.head.appendChild(n)})(s.css,"style"),yield this.rendererManager.render(a,s,n),yield null===(e=this.videoManager)||void 0===e?void 0:e.handle(s,n),Dt(a),this.drEditionAds.push(s),window.advertory=window.advertory||{},window.advertory.renderedDrEditionAds=window.advertory.renderedDrEditionAds||[],window.advertory.renderedDrEditionAds.push(s.itemId),this.observeAdView(t,s,n),null===(r=t.querySelector("a"))||void 0===r||r.addEventListener("pointerup",()=>null)):Dt(a))):(u("No Dr. Edition ads available to render. Hiding Dr. Edition and rendering Xandr backfill."),this.hideDrEdition(a),this.showBackfill(t),void Dt(a))})}observeAdView(e,t,n){this.observeCarousel(e,t,n)||((e,t,n={threshold:.5})=>{new IntersectionObserver(([e],n)=>{e.isIntersecting&&(t(),n.disconnect())},n).observe(e)})(e,()=>this.pulseManager.trackContentView(e,t,n),{threshold:.5})}showBackfill(e){var t;const n=e.querySelector(".fallback");if(!n)return;n.style.display="block";const r=null!==(t=n.dataset.fallbackTargetId)&&void 0!==t?t:"";At(r)}hideDrEdition(e){e.style.display="none"}observeCarousel(e,t,n){const r=e.querySelector(".dr-edition-slider");if(!r)return!1;let i=null;const o=new IntersectionObserver(e=>{e.forEach(e=>{e.isIntersecting&&e.intersectionRatio>=.9&&(i&&clearTimeout(i),i=setTimeout(()=>{e.target.onclick=()=>this.pulseManager.trackContentClick(e.target,t,n),this.pulseManager.trackContentView(e.target,t,n)},500)),[...r.children].forEach(e=>{o.observe(e)})})},{threshold:[.9]});return[...r.children].forEach(e=>{o.observe(e)}),!0}}class Bt{constructor(e,t){this.newsroomStrategy=e,this.pulseManager=t}render(t,n,r){return e(this,void 0,void 0,function*(){if(!(null==n?void 0:n.itemId))return;const{getConsentAsync:e}=I(r.tcf,r.isMobileApp,r.country),i=yield e(),o=r.device===Y.MOBILE?n.mobileHTML:n.desktopHTML;const a=i?o:o.replace(/<img [^>]*class="tracking-pixel"[^>]*>/g,"");t.innerHTML=a,t.querySelectorAll("a").forEach(e=>{var t,i,o;e.search=null!==(o=null===(i=(t=this.newsroomStrategy).getUrlSearchParams)||void 0===i?void 0:i.call(t,e,n,r))&&void 0!==o?o:"",e.onclick=()=>this.pulseManager.trackContentClick(e,n,r)})})}}class Ft{constructor(e){this.strategy=e}handle(t,n){return e(this,void 0,void 0,function*(){const{videoConfiguration:{id:e,preview:r}={}}=t;(e||r)&&(yield this.importScript(n),yield this.createVideoElement(t,n))})}importScript(t){return e(this,void 0,void 0,function*(){const e=t.drEditionConfig.videoScriptUrl,n=document.querySelector(`script[src="${e}"]`);if(e&&!window.autoplayQueue&&!n)try{yield Be(e)}catch(e){u("Error! Failed to prepare SVP player script for Dr. Edition!",e)}})}createVideoElement(t,n){return e(this,void 0,void 0,function*(){const e=document.createElement("div"),{node:r}=t.videoConfiguration,i=[...document.querySelectorAll(`#${r}`)||[]].find(e=>0===e.children.length);if(this.handlePreviewVideo(t,n))return;this.strategy.handleVideo(e,t),null==i||i.appendChild(e),window.autoplayQueue=window.autoplayQueue||[],window.autoplayQueue.push(e=>{e.parse()});const o=null==i?void 0:i.parentNode;if(!o)return;const a=o.closest("a");o.addEventListener("click",e=>{const t=e.target.closest("a");a!==t&&t||(e.stopPropagation(),e.preventDefault())})})}handlePreviewVideo(e,t){var n,r,i;const{preview:{url:o,thumbnail:a}}=null!==(n=e.videoConfiguration)&&void 0!==n?n:{};if(!o)return!1;const s=document.querySelector(".dr-edition-preview .preview-video");return!!s&&(s.setAttribute("src",o),s.setAttribute("playsinline",""),!(!s||!a)&&(null===(i=(r=t.drEditionConfig).addPreviewVideo)||void 0===i||i.call(r,s),!0))}}let Rt=class{constructor(e,t){this.pulse=e,this.newsroomStrategy=t}getEventInput(e,t,n,r){return{}}mapPageType(e){return{front:"Frontpage",article:"Article",section:"Article",collection:"Article",other:"Article"}[e||"front"]||"Frontpage"}getArticleId(){return location.pathname.split("/").slice(-2,-1).pop()||""}getTeaserElementText(e,t){if(!e)return"";const n=e.querySelector({title:".dr-edition-title",subtitle:".dr-edition-subtitle",image:"img.teaser-main-image"}[t]);if(!n)return"";if("image"===t)return n.src||"";const r=null==n?void 0:n.textContent;return r?r.trim():""}getEventTarget(e,t){const{itemId:n,pulseData:{url:r}={}}=t,i=this.getTeaserElementText(e,"title");return{id:n,name:this.normalizePlacementTitle(null!=i?i:""),type:"Page",url:r}}normalizePlacementTitle(e){return e.replace(/<[^>]+>/gi,"").replace(/[^a-z0-9æøå\s_-]/gi,"")}trackContentView(t,n,r){return e(this,void 0,void 0,function*(){var e,i,o,a,s,d,l,c;if(!this.pulse)return;const u=this.getEventInput(t,n,r,"view");(null===(e=this.pulse)||void 0===e?void 0:e.trackLegacyViewUIElement)?null===(o=null===(i=this.pulse)||void 0===i?void 0:i.trackLegacyViewUIElement)||void 0===o||o.call(i,u):(null===(a=this.pulse)||void 0===a?void 0:a.trackViewUIElement)?null===(d=null===(s=this.pulse)||void 0===s?void 0:s.trackViewUIElement)||void 0===d||d.call(s,u):null===(c=null===(l=this.pulse)||void 0===l?void 0:l.trackElementView)||void 0===c||c.call(l,u)})}trackContentClick(t,n,r){return e(this,void 0,void 0,function*(){var e,i,o,a,s,d;if(!this.pulse)return;const l=this.getEventInput(t,n,r,"click");this.pulse.trackLegacyClickUIElement?null===(i=(e=this.pulse).trackLegacyClickUIElement)||void 0===i||i.call(e,l):this.pulse.trackClickUIElement?null===(a=(o=this.pulse).trackClickUIElement)||void 0===a||a.call(o,l):null===(d=(s=this.pulse).trackElementClick)||void 0===d||d.call(s,l)})}};class Vt extends Rt{constructor(e,t,n){super(e,t),this.pulse=e,this.newsroomStrategy=t,this.pageType=n}getEventBaseData(e,t,n){const{pulseData:{title:r,clientName:i="",creativeId:o}={}}=t,{columnName:a,primaryPosition:s}=n;return{"@type":"UIElement",elementType:"Teaser",layout:{elementSize:"large",imageUrl:"",name:"large"},name:r,placement:{columnName:a,primaryPosition:s},"spt:custom":{is_sponsored:!0,sponsor:i,"spt:creativeId":o},url:location.origin}}getEventInput(e,t,n){return{object:this.getEventBaseData(e,t,n),target:this.getEventTarget(e,t)}}}let Ut=class extends Rt{constructor(e,t,n){super(e,t),this.pulse=e,this.newsroomStrategy=t,this.pageType=n}getEventBaseData(e,t,n){var r,i,o,a,s,d;const{itemId:l,pulseData:{clientName:c,creativeId:u}={}}=t,v=n.editionName,p=this.mapPageType(this.pageType),g=null===(r=this.newsroomStrategy)||void 0===r?void 0:r.getPulsePageId(this.pageType||"front",this.getArticleId());return{"@id":null!==(a=null===(o=null===(i=this.newsroomStrategy)||void 0===i?void 0:i.getPulseObjectId)||void 0===o?void 0:o.call(i))&&void 0!==a?a:v,"@type":"UIElement",position:v,elementType:"Article",custom:{customer:c,creativeId:null!=u?u:l},page:{"@id":null!=g?g:v,"@type":p,url:location.origin},tags:null===(d=null===(s=this.newsroomStrategy)||void 0===s?void 0:s.getTags)||void 0===d?void 0:d.call(s,e)}}getEventInput(e,t,n,r){return{object:this.getEventBaseData(e,t,n),partnerstudio:this.getEventPartnerstudioData(e,t,n,r),target:this.getEventTarget(e,t),provider:this.getProviderData()}}getEventPartnerstudioData(e,t,n,r){var i,o,a,s;const{pulseData:{algorithm:d="sov",clientName:l,creativeId:c,editionId:u,itemId:v,url:p,probability:g}={}}=t,h=Math.floor(Date.now()/1e3),m=this.getTeaserElementText(e,"title"),y=this.getTeaserElementText(e,"subtitle"),f=this.getTeaserElementText(e,"image"),w=null!==(s=null!==(a=null===(o=null===(i=this.newsroomStrategy)||void 0===i?void 0:i.getUrlWithParams)||void 0===o?void 0:o.call(i,t,n))&&void 0!==a?a:p)&&void 0!==s?s:"";return{algorithm:d,clientName:l,probability:g,creativeId:c,device:n.device,editionId:u,itemId:v,link:w,placement:n.editionName,subtitle:y,time:h,title:m,type:r,imageUrl:f,frontId:86,tracking_type:"ad",xandrAdLoaded:!1}}getProviderData(){return{productTag:"partnerstudio"}}};const Ht="front",zt=t=>e(void 0,void 0,void 0,function*(){var e,n;return(null===(e=null===window||void 0===window?void 0:window.SVP)||void 0===e?void 0:e.Player)?new window.SVP.Player(t):((()=>{const e="svp-player-sdk",t=document.querySelector(e),n=Array.from(document.querySelectorAll('script[src^="https://cdn.stream.schibsted.media/player"]'));if(t||n.length>0)return;const r=document.createElement("script");r.id=e,r.src="https://cdn.stream.schibsted.media/player/3.78.1/player.min.js",r.async=!0;try{r.src=r.src.replace("player.min","player.next.min")}catch(e){console.error("Failed to set player.next.min source:",e)}document.head.insertBefore(r,document.head.firstChild)})(),(null===(n=window.SVP)||void 0===n?void 0:n.isLoaded)?new window.SVP.Player(t):yield new Promise(e=>{window.addEventListener("onSvpPlayerReady",()=>e(new window.SVP.Player(t)))}))}),Wt={ContentMutePlugin:e=>{window.SVP.Player.Plugins.register({getName:()=>"ContentMutePlugin",initialize(){},setup(){const t=this.player.config.get("mute");this.container=e||this.player.getContainer(),this.muted=t,t&&this.listenToOnce(this.player,"ready",this.renderButtonElement,this)},getButtonElement(){const e=document.createElement("button");e.className="player-plugin-content-mute";const t=document.createElement("span");return t.className="volume-button-icon",e.appendChild(t),e},renderButtonElement(){this.buttonElement=this.getButtonElement(),this.buttonElement.addEventListener("click",this.onButtonClick.bind(this)),this.container.appendChild(this.buttonElement),this.isVideo()||(this.buttonElement.style.display="none"),this.getJWPlayer()&&this.getJWPlayer().on("mute",this.onMuteChange,this)},onButtonClick(){this.getJWPlayer()&&(this.container.classList.add("has-interacted"),this.muted=!this.muted,this.getJWPlayer().setMute(this.muted))},onMuteChange(e){this.muted=e.mute,this.muted?this.buttonElement.classList.remove("content-video-volume-on"):this.buttonElement.classList.add("content-video-volume-on")},isVideo(){return"video"===this.player.getRawAsset().assetType},getJWPlayer(){return this.player.model.player}})},IntegrationMenu:()=>{window.SVP.Player.Plugins.register({getName:()=>"IntegrationMenu",setup(){return e(this,void 0,void 0,function*(){yield Promise.resolve().then(function(){return Si})})}})}};class Kt{handleVideo(t,n){return e(this,arguments,void 0,function*(t,{videoConfiguration:{id:n,node:r,autoplay:i,mute:o,vendor:a}}){yield e(void 0,void 0,void 0,function*(){return yield new Promise(e=>{var t;Boolean(null===(t=window.SVP)||void 0===t?void 0:t.Player)?e(!0):window.addEventListener("onSvpPlayerReady",()=>e(!0))})});const s=["ContentMutePlugin"],d=this.createPlayerOverlay(t);var l,c;c=d,null==(l=s)||l.forEach(e=>{Wt[e](c)});const u={id:n,node:r,autoplay:i,mute:o,vendor:a,autopause:"viewable",maxBitrate:600,pulse:{provider:"e24"},recommended:{autoplay:!1,next:{countdown:10}},skin:{name:"e24-default",url:""}},v=yield zt(u);v.once("assetReady",()=>{((e,t)=>{null==t||t.forEach(t=>{const n=window.SVP.Player.Plugins.get(t);e.addPlugin(new n)})})(v,s)}),v.once("ready",()=>{const e=t;new MutationObserver(t=>{t.forEach(({type:t,attributeName:n})=>{"attributes"===t&&"class"===n&&(e.classList.contains("jw-state-playing")?d.classList.add("is-playing"):d.classList.remove("is-playing"),e.classList.contains("jw-flag-user-inactive")?d.classList.add("is-inactive"):d.classList.remove("is-inactive"))})}).observe(e,{attributes:!0,attributeFilter:["class"]})}),v.once("PulseStats:ready",()=>e(this,void 0,void 0,function*(){const e=yield v.getPlugin("PulseStats").getTracker();null==e||e.update({provider:{id:"e24",productTag:"partnerstudio"}})}))})}getPulseObjectId(){return"sdrn:e24:content:partnerstudio:element:partnerstudio:stats"}getPulsePageId(e,t){return e===Ht?"sdrn:e24:frontpage:front":`sdrn:e24:article:${t}`}getTags(e){var t;let n;if(n=e instanceof HTMLAnchorElement?e.href:null===(t=null==e?void 0:e.querySelector("a"))||void 0===t?void 0:t.href,!n)return[];if(!n.includes("https://e24.no/annonsorinnhold/"))return[n];const{pathname:r}=new URL(n),i=r.split("/").filter(Boolean);return i.length?[...i.slice(1),n]:[n]}createPlayerOverlay(e){const t=document.createElement("div");t.classList.add("cm-custom-video-overlay"),e.parentElement&&(t.innerHTML=e.parentElement.innerHTML,e.parentElement.replaceChild(t,e));return t.addEventListener("click",e=>{e.stopPropagation(),e.preventDefault(),t.classList.add("has-interacted")}),t}}const Jt="https://www.aftonbladet.se/video-player-extras/latest/";class Gt{handleVideo(t,n){return e(this,arguments,void 0,function*(e,{videoConfiguration:{id:t,node:n,autoplay:r,mute:i,vendor:o}}){const a={id:t,node:n,autoplay:r,mute:i,vendor:o,autopause:"viewable",maxBitrate:600,pulse:{provider:"aftonbladet"},recommended:{autoplay:!1,next:{countdown:10}},skin:{name:"",url:""},plugins:{[`${Jt}cta-button.js`]:{name:"CtaButton",options:{type:"unmute"}},[`${Jt}external-link.js`]:{name:"ExternalLink"}}};yield zt(a),this.addEditionVideoClass(e)})}addEditionVideoClass(e){var t;(null===(t=null==e?void 0:e.parentElement)||void 0===t?void 0:t.parentElement)&&e.parentElement.parentElement.classList.add("dr-edition-video-player")}getPulseObjectId(){return""}getPulsePageId(){return""}}const Yt=e=>null!==e&&"object"==typeof e&&!Array.isArray(e);class Qt{handleVideo(t,n){return e(this,arguments,void 0,function*(t,{videoConfiguration:{id:n,node:r,autoplay:i,mute:o,vendor:a}}){const s={id:n,node:r,autoplay:i,mute:o,vendor:a,locale:"se",autopause:"viewable",maxBitrate:600,sharing:!1,recommended:!1,pulse:{provider:"svdse",decorator:(e,t)=>Object.assign(Object.assign({},Yt(e)?e:{}),{provider:Object.assign(Object.assign({},Yt(null==e?void 0:e.provider)?e.provider:{}),{productTag:"partnerstudio"})})},skin:{name:"svd-player",url:""},settings:{pulse:{host:"se-aftonbladet.videoplaza.tv",contentMetadata:{category:"SvD",tags:["standard-linears","pause",`video-${n}`]},requestSettings:{}}}},d=yield zt(s);d.once("PulseStats:ready",()=>e(this,void 0,void 0,function*(){const e=yield d.getPlugin("PulseStats").getTracker();null==e||e.update({provider:{id:"svdse",productTag:"partnerstudio"}})}))})}getPulseObjectId(){return"sdrn:svdse:content:partnerstudio:element:partnerstudio:stats"}getPulsePageId(e,t){return e===Ht?"sdrn:svdse:frontpage:front":`sdrn:svdse:article:${t}`}}let Xt=class{handleVideo(e,t){}getPulseObjectId(){return""}getPulsePageId(e,t){return""}};const Zt=(e,t,n)=>{var r;const{publisher:i,pageType:o,country:a}=e,s={[Oe]:new _t,[je]:new Kt,[Le]:new Gt,[Pe]:new Qt}[i]||new Xt,d=new(a===f.SE?Vt:Ut)(n,s,o),l=new qt(t,null!==(r=null==n?void 0:n.pulseTracker)&&void 0!==r?r:n),c=new Bt(s,d),u=new Ft(s);return new Mt(l,c,u,d)},en=()=>e(void 0,void 0,void 0,function*(){return yield new Promise(e=>{if("undefined"!=typeof window)if(window.Identity)e(window.Identity);else{const t=()=>{e(window.Identity)};window.addEventListener("identity-initialized",t,{once:!0})}else e(void 0)})});class tn{constructor(e){this.identity=e,this.getIdentityUser=this.getIdentityUser.bind(this),this.isUserLoggedIn=this.isUserLoggedIn.bind(this),this.onIdentityLogout=this.onIdentityLogout.bind(this)}getIdentityUser(){return e(this,void 0,void 0,function*(){var e;try{const t=yield null===(e=this.identity)||void 0===e?void 0:e.getUser();return null!=t?t:null}catch(e){return u("[Privacy Broker] User is not logged in."),null}})}isUserLoggedIn(){return e(this,void 0,void 0,function*(){var e,t;return null!==(t=yield null===(e=this.identity)||void 0===e?void 0:e.isLoggedIn())&&void 0!==t&&t})}onIdentityLogout(e){var t;null===(t=this.identity)||void 0===t||t.on("logout",e)}}const nn=(e,t,n)=>{const{wrapperSelector:r}=null==e?void 0:e.drEditionConfig,i=document.querySelectorAll(r),o=new IntersectionObserver((r,i)=>((e,t,n,r,i)=>{const o=Zt(n,r,i);e.forEach(e=>{var r,i,a;if(!e.isIntersecting)return;const s=e.target,d=null!==(r=s.dataset.editionName)&&void 0!==r?r:"",l=null!==(i=s.dataset.pulseColumnname)&&void 0!==i?i:"",c=null!==(a=s.dataset.pulsePrimaryposition)&&void 0!==a?a:"";o.fetchAndRenderAd(s,Object.assign(Object.assign({},n),{editionName:d,columnName:l,primaryPosition:c})),t.unobserve(s)})})(r,i,e,t,n),{rootMargin:"400% 0px"});i.forEach(e=>o.observe(e))},rn=[],on=(t,n)=>e(void 0,void 0,void 0,function*(){var e;const{pulse:r,tcf:i,deviceType:o,drEdition:a,publisher:s,pageType:d,country:l,isMobileApp:c}=t;if(!(yield A(i,c,l,"handleDrEditionBackfill")))return;const v=((e,t)=>{var n;const{deviceType:r,placements:i,drEdition:{fallbackGlobalEditionName:o}={}}=e,a=i[r]||i.desktop,s=mt(t.targetId),d=a.find(e=>e.id===s),l=Nt.some(e=>s.startsWith(e)),c=rn.includes(s),u=(null===(n=null==d?void 0:d.drEdition)||void 0===n?void 0:n.editionName)||o;return d&&l&&!c&&u?(rn.push(s),Object.assign(Object.assign({},d),{drEdition:Object.assign(Object.assign({},d.drEdition),{editionName:u})})):null})(t,n);if(!v)return;if(!(null==r?void 0:r.instance))return void u("Pulse has not been passed as a prop, aborting");const p=yield en(),g=new tn(p),h=Zt({publisher:s,pageType:d,country:l},g,null==r?void 0:r.instance),m=document.getElementById(n.targetId);if(!m||!a)return;m.classList.value="";const y=document.createElement("div");y.className=a.containerSelector.replace(/^[.#:[\]]+/,""),m.innerHTML=y.outerHTML;const f={editionName:(null===(e=null==v?void 0:v.drEdition)||void 0===e?void 0:e.editionName)||"",drEditionConfig:a,device:o,tcf:i,isMobileApp:c,country:l,renderAsBackfill:!0};yield h.fetchAndRenderAd(m,f)}),an="collapseAd",sn="hideAd",dn="resizeAd",ln="renderDrEditionFallback",cn="wallpaperImageUrl",un="wallpaperColor",vn="velvet",pn=[dn,cn,un,an,sn,ln,vn];let gn;const hn=e=>{if("object"==typeof e)return e;if(t=e,Et.test(t)){const t=e.replace(/^wallpaper:url:/,"");return{name:cn,wallpaperImageUrl:t}}var t;if((e=>e.startsWith("wallpaper:color:"))(e)){const t=e.replace(/^wallpaper:color:/,"");return{name:un,wallpaperColor:t}}if(e.startsWith(ln)){const t=e.split(":")[1];return{name:ln,targetId:t}}if(e.startsWith(an)||e.startsWith(sn)){const t=e.split(":")[1];return{name:an,targetId:t}}if(e.includes("name")&&pn.some(t=>e.includes(t)))try{return JSON.parse(e)}catch(e){}},mn=e=>{if(!["http://acdn.adnxs-simple.com","https://acdn.adnxs-simple.com","https://crcdn01.adnxs-simple.com","http://crcdn01.adnxs-simple.com","https://acdn.adnxs.com","http://acdn.adnxs.com","https://adsdk.microsoft.com","https://adsdk.bing.net","https://adsdkprod.azureedge.net"].includes(e.origin.trim()))return;const{data:t}=e;if(!t)return;const n=hn(t);if(!n)return;if(!n.name||!pn.some(e=>n.name===e))return;const{name:r,targetId:i,wallpaperImageUrl:o,wallpaperColor:a,cmd:s,size:d}=n;r===vn&&s&&(s.includes("noScroll")&&(gn=(e=>{if(!e)return()=>{};const t=e.style.overflow;return e.style.setProperty("overflow","hidden"),()=>{e.style.setProperty("overflow",t)}})(document.querySelector("body"))),(s.includes("close")||s.includes("ended"))&&(null==gn||gn(),dispatchEvent(new CustomEvent("advertory:closeTakeover",{})))),r!==an&&r!==sn||!i||It(i),r===dn&&i&&s&&$t(i,s),r===ln&&i&&(It(i),on(l.get(),{targetId:i})),"resizeMediationAd"===r&&i&&d&&$t(i,d,!0),r===cn&&o&&(e=>{const t=document.querySelector(`.${wt}`);t&&(t.style.backgroundImage=`url(${e})`)})(o),r===un&&a&&(e=>{const t=document.querySelector(`.${wt}`);t&&(t.style.backgroundColor=e)})(a)},yn=e=>({rootMargin:`${e}px 0px ${e}px 0px`}),fn=()=>{const{publisher:t,country:n,finnBlink:r}=l.get(),{loadFinnBlinkAd:i,wallpaperHandlers:{adjustAdToHorseshoe:o}}=l.getHandlers(),a=window.apntag,s={publisher:t,country:n,finnBlink:r},d=e=>{At(e),pt(()=>a.showTag(e))};return{withXandrAd:d,withFinnBlinkAd:t=>e(void 0,void 0,void 0,function*(){yield i(t,s,null)}),withFullAdsChain:t=>e(void 0,void 0,void 0,function*(){yield i(t,s,d,()=>{qe.getData("horseshoe").isAvailable&&o(t)})})}},wn=(e,t,n)=>{const r="true"===n.dataset.isFinnBlinkOnlyPlacement;return be(t)&&r?(u(`loading finn blink ad for blink only placement for ${t}`),void fn().withFinnBlinkAd(t)):be(t)?(u(`loading finn blink ad with full ads chain for ${t}`),void fn().withFullAdsChain(t)):void pt(()=>(u("core showTag",{id:t}),e.showTag(t)))},bn=(t,n)=>e(void 0,void 0,void 0,function*(){yield gt,yield ht;const e=new IntersectionObserver((e,n)=>((e,t,n,r)=>{e.filter(({isIntersecting:e,target:{id:t}})=>e&&!t.includes("wallpaper")).forEach(e=>{const{target:i}=e,o=(e=>{const t=e.dataset.showTagSubscribeId;return!e.id.length&&t?t:e.id})(i),a=document.getElementById(o);u("core log from intersection observer handler",{targetId:o,element:a}),n(window.apntag,o,r),a&&(t.unobserve(a),t.disconnect())})})(e,n,wn,t),yn(n));e.observe(t)}),En=new Map,In=["no-stavangeraftenblad","sa","no-aftenposten","aftenposten","no-bergenstidende","bt"],An=".brandstudio-premium-content-widget",kn=({adWrapper:e,placementContainer:t})=>t.offsetHeight+(({adWrapper:e})=>{const{paddingTop:t,paddingBottom:n}=getComputedStyle(e);return parseFloat(t)+parseFloat(n)})({adWrapper:e}),Tn=({adWrapper:e,placementContainer:t})=>{const n=kn({adWrapper:e,placementContainer:t});var r;null==e||e.style.setProperty("height",`${n}px`),Tt(r=t),r.innerHTML=""},Cn=e=>{e&&e.style.getPropertyValue("height")&&e.style.removeProperty("height")},Sn=({adWrapper:e,placementContainer:t})=>{const{publisher:n}=l.get(),r=In.includes(n)&&Boolean(t.closest(An));const i=r?t.closest(An):null,o=new MutationObserver(t=>{t.forEach(({addedNodes:t})=>{t.forEach(t=>{const n=t instanceof HTMLElement,a=n&&t.matches("iframe, article")&&e;if(!n||!r&&!a||r&&!i)return;if(a)return Cn(e),void o.disconnect();const s=t.closest('[style*="height"]'),d=i;s&&d.contains(s)?Cn(s):d.hasAttribute("style")&&Cn(d),o.disconnect()})})});try{o.observe(t,{childList:!0,subtree:!0})}catch(e){o.disconnect()}},Pn=(e,t,n,r,i,o)=>{var a;const s=performance.now(),d=null!==(a=En.get(t))&&void 0!==a?a:0,l=((e,t)=>!!t&&e+t<(new Date).getTime())(r,i)&&n<0;s-d>=i&&l&&(En.set(t,s),((e,t,n)=>{const r=null==n?void 0:n.parentElement;r&&n&&Tn({adWrapper:r,placementContainer:n}),pt(()=>{e.setKeywords([t],{[`${C()}-adreload`]:"1"},{overrideKeyValue:!0}),e.refresh([t])})})(e,t,o))},On=(e,t,n)=>{const r=new IntersectionObserver((e,r)=>((e,t,n,r)=>{e.filter(({isIntersecting:e})=>e).forEach(e=>{const{target:i,boundingClientRect:o}=e;t(window.apntag,i.id,o.y,n,r,i)})})(e,Pn,t,n),yn(300));r.observe(e)},xn=(e,t=6)=>{const n=[];for(let r=0;r<e.length;r+=t){const i=e.slice(r,r+t);n.push(i)}return n},Ln=()=>navigator&&navigator.userAgent.match(/chrome/i)?null:navigator&&navigator.userAgent.match(/apple/i),jn=(e,t=0)=>{const n=e.getBoundingClientRect(),r=window.innerHeight;return n.bottom>-t&&n.top<r+t},$n=e=>{const{refreshConfig:{visibilityStateRefreshEnabled:t=!1}={}}=l.get();if(!t)return;const n=()=>{"visible"===document.visibilityState&&document.removeEventListener("visibilitychange",n),Mn(e)};"visible"!==document.visibilityState&&document.addEventListener("visibilitychange",n)},Nn=(e,t,n)=>{const r=document.querySelectorAll('[data-bf-cache-refresh="true"]');for(const i of r){const r=e.find(e=>{var t;return e.id===(null===(t=i.firstElementChild)||void 0===t?void 0:t.id)&&e.bfCacheRefresh}),o=null==r?void 0:r.threshold;jn(i,o)&&r&&(kt(r.id),n.length&&i.classList.remove(...n),Mn([r],t))}},qn=e=>{const{refreshConfig:{backForwardNavigationRefreshEnabled:t=!1}={},siteSpecificConfig:{classesToRemoveOnRefresh:n=[]}={},isMobileApp:r}=l.get();t&&(e.forEach(({id:e})=>{const t=_n(e);t&&(t.dataset.bfCacheRefresh="true")}),r?((e,t)=>{document.addEventListener("visibilitychange",()=>{Nn(e,!0,t)})})(e,n):((e,t)=>{window.addEventListener("pageshow",n=>{const r=()=>{window.scrollY>0&&(window.removeEventListener("scroll",r),Nn(e,!1,t))};n.persisted&&(Ln()?window.addEventListener("scroll",r,{passive:!0}):Nn(e,!1,t))})})(e,n))},_n=e=>{var t,n;return null!==(n=null===(t=document.querySelector(`#${e}`))||void 0===t?void 0:t.parentElement)&&void 0!==n?n:null},Dn=e=>{const{id:t,allowedFormats:n}=e,r=(e=>{if(!e)return[];try{return JSON.parse(e.dataset.adSizes||"[]")}catch(e){return[]}})(_n(t)),i=(e=>1===e[0]&&1===e[1])(r),o={sizes:[r],allowedFormats:i?n:n.filter(e=>"native"!==e),allowSmallerSizes:!1};return i||(o.native=void 0),o},Mn=(e,t=!1)=>{const{requestSize:n=s}=l.get(),r=e.map(({id:e})=>e),i=xn(r,n);if(t)for(const t of e){const e=Dn(t);window.apntag.modifyTag(t.id,e)}for(const e of i)pt(()=>window.apntag.refresh(e))};const Bn="#fff",Fn="#0098da",Rn="splash",Vn="welcomePage",Un="topscroller",Hn="velvet",zn="takeover-displayed",Wn="takeover-visit-count",Kn=14400,Jn=()=>{const e=G(Wn);return e?parseInt(e):0},Gn=()=>{const{takeover:{enabled:e=!1,secondVisitEnabled:t=!1}={}}=l.get();return!window.location.href.includes("takeover=0")&&(!!window.location.href.includes("takeover=1")||!(!e||(()=>{var e;const t=(null===(e=l.get().takeover)||void 0===e?void 0:e.cookieCapName)||zn;return"true"===G(t)})())&&(!t||Yn()))},Yn=()=>{const e=Jn();return 0===e?((()=>{const e=Jn(),{takeover:{cookieCapTime:t=Kn}={}}=l.get(),n=document.location.hostname;window.document.cookie=`${Wn}=${e+1}; max-age=${t}; domain=${n}; path=/`})(),!1):1===e},Qn=(e,t)=>[[1,1],[1920,1080]].some(([n,r])=>n===e&&r===t),Xn=()=>{const{takeover:e}=l.get();return Boolean(null==e?void 0:e.topscroller)},Zn=()=>e(void 0,void 0,void 0,function*(){const e=document.location.hostname,{takeover:{cookieCapName:t=zn,cookieCapTime:n=Kn}={},isMobileApp:r,tcf:i,country:o}=l.get(),a=yield A(i,r,o,"ad-takeover-cookiecap");n&&a&&(window.document.cookie=`${t}=true; max-age=${n}; domain=${e}; path=/`)}),er=e=>{var t;const n=!!(null===(t=l.get().takeover)||void 0===t?void 0:t.setCookieCapForNotShownAd);return he(e)&&n},tr=(e,t)=>{var n;if(t===Un){const{topscroller:t}=e;return null!=t?t:{}}if(t===Rn){const{splash:t}=e;return null!=t?t:{}}return null!==(n=e.welcomePage)&&void 0!==n?n:{}},nr=(e,t)=>{t!==Rn?(e=>{var t,n,r;const i=null===(n=null===(t=l.get().takeover)||void 0===t?void 0:t.welcomePage)||void 0===n?void 0:n.headerElementSelector,o=null===(r=l.get().takeover)||void 0===r?void 0:r.topscroller;if(!i||o)return;const a=document.querySelector(i),s=document.querySelector(".welcome-page-wrapper"),d=document.querySelector(`#${e.targetId}`),c=document.querySelector(".advertory-welcome-page-scroll");if(!(a&&s&&c&&d))return;const u=null==a?void 0:a.offsetHeight,v=me(e)?"60svh":`calc(100svh - ${u}px)`,p=me(e)?"calc(40svh + 30px)":`calc(${u}px + 30px)`;s.style.setProperty("height",v,"important"),d.style.setProperty("height",v,"important"),c.style.setProperty("bottom",p,"important")})(e):(e=>{var t;if(!(null===(t=l.get().takeover)||void 0===t?void 0:t.splash))return;const n=document.querySelector(".advertory-splash-navbar-wrapper"),r=document.querySelector(`#${e.targetId}`);if(!n||!r)return;const i=`calc(100svh - ${n.offsetHeight}px)`;r.style.setProperty("height",i,"important")})(e)},rr=Ve([],()=>{new MutationObserver((e,t)=>{document.querySelector("iframe")&&((()=>{const e=document.querySelector("iframe");e&&(e.onload=()=>{if(!e.contentDocument)return;document.body.style.height="100%",document.documentElement.style.height="100%",e.height="100%",e.width="100%";const t=e.contentDocument.createElement("style");t.textContent="\n .adform-adbox {\n height: 100% !important;\n width: 100% !important;\n }\n img {\n height: 100% !important;\n width: 100% !important;\n object-fit: cover !important;\n object-position: top !important;\n }\n ",e.contentDocument.head.appendChild(t)})})(),t.disconnect())}).observe(document.body,{childList:!0,subtree:!0})}),ir=(e,t=!0)=>{(e===Vn||e===Un)&&(e=>{e?setTimeout(()=>window.scrollTo(0,0),100):window.scrollTo(0,10)})(t)},or=()=>{const e=parseInt(document.body.dataset.scrollY||"0",10);document.body.style.top="",window.scrollTo(0,e),document.body.classList.remove("page-locked")},ar=e=>{document.body.style.overflow=e?"initial":"hidden"},sr=e=>{const t=lr(e),n=dr(e);(e=>{e.classList.toggle("takeover-ad-hidden",!0)})(e),ar(!0),e.style.display="none",window.removeEventListener("keydown",t),window.removeEventListener("advertory:closeTakeover",n)},dr=e=>{const t=()=>sr(e);return window.addEventListener("advertory:closeTakeover",t),or(),t},lr=e=>{const t=t=>{["Enter","Escape"].includes(t.key)&&sr(e)};return or(),window.addEventListener("keydown",t),t},cr=e=>{const t=e.querySelector(".advertory-splash-navbar-wrapper");t&&(lr(e),dr(e),or(),t.addEventListener("click",()=>{sr(e)}),ar(!1))},ur=e=>{(e=>{window.addEventListener("scroll",()=>{e.getBoundingClientRect().bottom,(e=>{const t=e.getBoundingClientRect().bottom;e.style.opacity=""+t/e.offsetHeight})(e)},{passive:!0})})(e),dr(e);const t=document.querySelector("header");document.querySelectorAll(".smooth-close-takeover").forEach(e=>e.addEventListener("click",()=>null==t?void 0:t.scrollIntoView({behavior:"smooth"})))},vr=e=>{(e=>{window.addEventListener("advertory:closeTakeover",()=>sr(e))})(e)},pr=e=>{const{takeover:{splash:{showAnnonsLabel:t=!1}={}}={}}=l.get(),n=e.querySelectorAll(".advertory-splash-navbar-wrapper"),r=document.querySelector(".advertory-takeover-label");Array.from(n).forEach(e=>e.style.display="flex"),t&&r&&(r.style.display="flex",r.innerText=tt.se.adText),e.classList.toggle("advertory-splash-wrapper",!0)},gr=e=>{const t=document.querySelectorAll(".advertory-topscroller-elements");Array.from(t).forEach(e=>e.style.display="flex");const n=document.querySelector(".advertory-takeover-label");n&&(n.style.display="flex",n.innerText=tt.no.adText,n.classList.add("takeover-topscroller-label"),e.classList.toggle("topscroller-wrapper",!0))},hr=e=>{const t=document.querySelectorAll(".advertory-welcome-page-elements");Array.from(t).forEach(e=>{e.style.display="flex",e.style.animation="elementsAnimation 1.5s ease-out forwards"});const n=document.querySelector(".advertory-takeover-label");n&&(n.style.display="flex",n.innerText=tt.se.adText,e.classList.toggle("welcome-page-wrapper",!0))},mr=e=>{const t=document.querySelector(".advertory-takeover-label");t&&(t.style.display="flex",t.innerText=tt.se.adText,e.classList.toggle("advertory-impact-wrapper",!0))},yr=()=>{const e=document.querySelector(".welcome-page-wrapper, .topscroller-wrapper, .advertory-splash-wrapper");if(!e)return;let t=0;new IntersectionObserver(e=>{e.forEach(e=>{var n;if(e.isIntersecting){window.dispatchEvent(new CustomEvent("advertory:takeoverInView"));(null!==(n=Array.from(e.target.classList))&&void 0!==n?n:[]).includes("advertory-splash-wrapper")&&(()=>{const e=window.scrollY||0;document.body.dataset.scrollY=e.toString(),document.body.style.top="0",document.body.classList.add("page-locked"),document.documentElement.scrollTop=0})(),t++}else t>0&&window.dispatchEvent(new CustomEvent("advertory:takeoverNotInView"))})},{root:null,rootMargin:"0px",threshold:0}).observe(e)},fr=(e,t)=>{let n=e;return e.includes("529299503")&&(n=(e=>{const t=document.createElement("script");return t.textContent=`(${rr})()`,e+t.outerHTML})(e)),n},wr=e=>{const t=(e=>{const{requests:t}=window.apntag,n=Re(e)?1:0;return null==t?void 0:t.tags[e].adResponse.ads[n].rtb.banner.content})(e);if(!t)return;((e,t)=>{const{requests:n}=window.apntag,r=Re(e)?1:0;n&&(n.tags[e].adResponse.ads[r].rtb.banner.content=t)})(e,fr(t))},br=t=>e(void 0,void 0,void 0,function*(){const{takeover:e}=l.get(),{targetId:n}=t,r=document.querySelector(`#${n}`),i=document.querySelector(".advertory-takeover-wrapper");if(!r||!i||!e)return;const o=(e=>{const{width:t,height:n}=e;return Qn(t,n)?Rn:Ce(e,se)?Hn:Xn()?Un:Vn})(t),a=i.offsetHeight,s=window.scrollY>a;i.style.display="block",!s&&ir(o,!1),((e,t)=>{({[Vn]:hr,[Rn]:pr,[Un]:gr,[Hn]:mr})[t](e)})(i,o),yr(),((e,t)=>{({[Vn]:ur,[Un]:ur,[Rn]:cr,[Hn]:vr})[t](e)})(i,o),((e,t,n)=>{if(!n)return;({[Vn]:()=>{const{buttonLabel:r}=tr(n,t);["#advertory-welcome-page-scroll-label","#advertory-welcome-page-scroll-image"].forEach(t=>{const n=e.querySelector(`${t}`);n&&(n.innerText=null!=r?r:"")})},[Rn]:()=>{const{themeColors:r,logotype:i,buttonLabel:o,showArrowIcon:a}=tr(n,t);["#advertory-splash-close-label",".advertory-splash-close","#advertory-splash-logotype",".advertory-splash-navbar-wrapper"].forEach(t=>{const n=e.querySelector(`${t}`);if(n){if("#advertory-splash-close-label"===t&&(n.innerText=null!=o?o:""),".advertory-splash-close"===t&&a){const e=document.createElement("img");e.setAttribute("src","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAAfQAAAH0Bx0gPAAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAABzSURBVDiNtdPJCYBADEDRzzRmE3ZgEV6tRHHpzELiIQrBZRajA7lk4EE2RIQjgApYgdbmY8EJaADZo3sDBKAvQa4JRYZc5D6pyJiDPMuKTCkkXp8icwxJd1mRxSC1/Q94328luJroGqNrkdyrzAfHVHzOG+8CKlLk+LO+AAAAAElFTkSuQmCC"),e.setAttribute("alt","close ad"),n.appendChild(e)}if("#advertory-splash-logotype"===t&&i&&(n.setAttribute("src",i.url),n.setAttribute("alt",i.alt)),".advertory-splash-navbar-wrapper"===t&&r){const{backgroundColor:e,color:t}=r;n.style.setProperty("background-color",null!=e?e:Bn,"important"),n.style.color=null!=t?t:Fn}}})},[Un]:()=>{const{buttonLabel:r,showArrowIcon:i,showCloseButton:o=!0}=tr(n,t);["#advertory-topscroller-scroll-label","#advertory-topscroller-scroll-image",".advertory-topscroller-close"].forEach(t=>{const n=e.querySelector(`${t}`);n&&(".advertory-topscroller-close"!==t||o||(n.style.display="none"),"#advertory-topscroller-scroll-image"!==t||i||(n.style.display="none"),"#advertory-topscroller-scroll-label"===t&&(n.innerText=null!=r?r:""))})},[Hn]:()=>{}})[t]()})(i,o,e),yield Zn(),!s&&ir(o,!0),nr(t,o)});et(".advertory-brandmetrics-survey{width:100%}");const Er="advertory-brandmetrics-survey",Ir=()=>e(void 0,void 0,void 0,function*(){const{norstat:{enabled:t}={},country:n,isMobileApp:r,tcf:i}=l.get(),o=yield A(i,r,n,"norstat");if(!t||r||!o)return;const a=(e=>{const{ppid1:t,ppid2:n}=H.getPPIDs(),{ppid1:r,ppid2:i}=z.getPPIDs(),o=(new U).add(n,_[e]).add(t,D[e]).add(i,M[e]).add(r,B[e]);return`${o.buildNorstatPath()}?${o.buildNorstatQuery("alias").toString()}`})(n);((t,n,...r)=>{e(void 0,[t,n,...r],void 0,function*(e,t,n=!0){if(document.getElementById(t))return;const r=document.createElement("img");r.src=e,r.id=null!=t?t:"",n&&(r.style.display="none"),document.body.appendChild(r)})})(`https://sch-map.norstatsurveys.com/api/nids/${n===f.NO?"schibsted":"schibstedse"}/map/${a}`,"norstat")}),Ar={nativeAd:e=>pe(e)&&!we(e),buyrecipe:e=>e.targetId.startsWith("buyrecipe"),fullwidthAd:ge,fullscreenScroll:ve,topscroller:e=>he(e)&&Xn(),splash:e=>he(e)&&Qn(e.width,e.height),welcomePage:he,wallpaper:ye,skyscraper:e=>e.targetId.includes("skyscraper")&&!!e.banner,lFormat:ke,hFormat:Te,toppanorama:e=>e.targetId.startsWith("toppanorama")&&!Te(e)&&!ke(e),topboard:e=>e.targetId.startsWith("topboard")&&!he(e),widescreen:Ae,insider:e=>e.targetId.startsWith("insider"),sponsorstripe:we,brandboard:e=>(e=>(980===e.width||1920===e.width&&e.targetId.includes("brandboard"))&&!e.targetId.includes("topboard")&&!e.targetId.includes("companion")&&!Ee(e))(e)&&!(e=>e.targetId.includes("backfill"))(e)&&!Ie(e),outstream:e=>"https://acdn.adnxs.com/video/outstream/ANOutstreamVideo.js"===e.renderer_url,netboard:e=>(e=>e.targetId.startsWith("netboard"))(e)||(e=>e.targetId.startsWith("board"))(e),panorama:Ee,midboard:Ie},kr=({adObj:e,preferredTestIdData:t})=>{var n,r;const i=null!==(n=null==t?void 0:t.targetId)&&void 0!==n?n:null==e?void 0:e.targetId;if(!i)return;const o=null===(r=document.querySelector(`#${i}`))||void 0===r?void 0:r.parentElement;if(!o)return;if(((e,t)=>{var n,r,i,o;const a=null===(o=null===(i=null===(r=null===(n=window.apntag)||void 0===n?void 0:n.requests)||void 0===r?void 0:r.tags)||void 0===i?void 0:i[e])||void 0===o?void 0:o.invCode;a&&(t.dataset.invCode=a)})(i,o),null==t?void 0:t.testId)return void(o.dataset.testid=t.testId);const a="DIV"===(null==o?void 0:o.tagName);e&&a&&((e,t)=>{var n,r;for(const[i,o]of Object.entries(Ar))if(o(e)){if("nativeAd"===i){const o="default";t.dataset.testid=`${i}-${null!==(r=null===(n=null==e?void 0:e.native)||void 0===n?void 0:n.desc2)&&void 0!==r?r:o}`;break}t.dataset.testid=i;break}})(e,o)},Tr=e=>{var t;return(null===(t=Object.entries(Ar).find(([,t])=>t(e)))||void 0===t?void 0:t[0])||""},Cr=(e,t)=>{const n=e.width,r=(null!=t?t:window.screen.width)/n;return r<1?r:1},Sr=new Map;Sr.set("insider",{scale:.82,transformOrigin:"left center",cogwheelAdjust:!0}),Sr.set("panorama",{scale:.79,transformOrigin:"center center"}),Sr.set("outstream",{scale:.79,transformOrigin:"center center"}),Sr.set("integration",{scale:.79,transformOrigin:"center center"}),Sr.set("toppanorama",{scale:.8,transformOrigin:"left center"});const Pr=e=>{if(!((null===(t=null===document||void 0===document?void 0:document.body)||void 0===t?void 0:t.clientWidth)>767&&(null===(n=null===document||void 0===document?void 0:document.body)||void 0===n?void 0:n.clientWidth)<=853))return;var t,n;const r=Tr(e),i=Sr.get(r),o=document.querySelector(`#${e.targetId}`);if(!o||!i)return;if(o.style.transformOrigin=i.transformOrigin,o.style.transform=`scale(${i.scale})`,!(null==i?void 0:i.cogwheelAdjust))return;const a=document.querySelector(`div[class*="gdpr-cogwheel-button"][id$="${e.targetId}"]`),s=null==o?void 0:o.offsetWidth;a&&"number"==typeof s&&!isNaN(s)&&a.style.setProperty("right",String(-1*s*.2)+"px")},Or=(e,t)=>t?Object.assign(Object.assign({},e),{"aa-sch-ssa-native-ad":"true","aa-sch-ssa-format":"NATIVE_CONTENT","aa-sch-ssa-market":"XNO","aa-sch-ssa-cat":["ssa_1","ssa_2","ssa_3","ssa_4","ssa_5","ssa_6","ssa_7","ssa_8","ssa_9","ssa_10","ssa_11","ssa_12","ssa_13","ssa_14","ssa_15","ssa_16","ssa_17","ssa_18","ssa_19","ssa_20","ssa_21","ssa_22","ssa_23","ssa_24","ssa_25","ssa_26","ssa_27","ssa_28","ssa_29","ssa_30"]}):e,xr=e=>`externalImpId:'${e}'`,Lr=e=>{var t;const{forwardExternalImpId:n=!1,tracker:r}=l.get(),i=(e=>{var t;if(!e.positionConfig)return e;const n=e.keywords[`${S()}-count`],r=e.positionConfig.find(e=>e.adPositionIndex===n);if(!r)return e;const i=r.keywords?Object.assign(Object.assign({},e.keywords),r.keywords):e.keywords;return Object.assign(Object.assign({},e),{sizes:null!==(t=null==r?void 0:r.sizes)&&void 0!==t?t:e.sizes,keywords:i})})(e),{id:o,sizes:a,keywords:s,allowedFormats:d,invCode:c,ssa:v=!1,nativeCustomProperties:p,safeframeConfig:g,dynamicSizeWidthCheck:h=!1}=(e=>{var t;if(!e.takeoverCookieCapForSharedPlacement||Gn())return e;const n=null===(t=e.keywords)||void 0===t?void 0:t["no-sno-adformat"],r=null==n?void 0:n.filter(e=>e!==Un),i=Object.assign(Object.assign({},e.keywords),n&&{"no-sno-adformat":r}),o=e.sizes.filter(([e,t])=>4!==e||4!==t);return Object.assign(Object.assign({},e),{sizes:o,keywords:i})})(i),m=Object.assign({invCode:c,sizes:a,targetId:o,keywords:Or(s,v),allowedFormats:d,dynamicSizeWidthCheck:h},g&&{safeframeConfig:g}),y=(e=>{var t,n,r,i,o,a,s;return e?(null===(t=null==e?void 0:e.instance)||void 0===t?void 0:t.state)?(null===(r=null===(n=null==e?void 0:e.instance)||void 0===n?void 0:n.state)||void 0===r?void 0:r.pageViewId)?(u("Tracker state pageViewId is:",null===(o=null===(i=null==e?void 0:e.instance)||void 0===i?void 0:i.state)||void 0===o?void 0:o.pageViewId),null===(s=null===(a=null==e?void 0:e.instance)||void 0===a?void 0:a.state)||void 0===s?void 0:s.pageViewId):(u("Tracker state does not contain field pageViewId or it is empty"),""):(u("Tracker state is empty"),""):(u("Tracker is not configured in initAdvertory function"),"")})(r);n&&y&&(u("External Impression ID assigned to defineTag:",xr(y)),m.externalImpId=xr(y));const f=(e=>Object.entries({video:{required:!1},address:{required:!1},saleprice:{required:!1},rating:{required:!1},price:{required:!1},phone:{required:!1},likes:{required:!1},downloads:{required:!1},customIcon2:{required:!1}}).reduce((t,[n,r])=>((null==e?void 0:e.includes(n))&&(t[n]=r),t),{customTitle1:{required:!1},customTitle2:{required:!1},customTitle3:{required:!1},customTitle4:{required:!1},title:{required:!1},body:{required:!1},image:{required:!1},icon:{required:!1},sponsoredBy:{required:!1},cta:{required:!1},clickUrl:{required:!1},desc2:{required:!1},displayUrl:{required:!1},description:{required:!1}}))(p);return(null===(t=e.allowedFormats)||void 0===t?void 0:t.includes("native"))&&(m.native=f),m},jr=e=>!e.includes("takeover")||Gn(),$r=e=>{const{source:t}=e;return"csm"===t},Nr=e=>{if(!e)return e;const t=e[`${C()}-targetid`],n=t?mt(t[0]):"";return Object.assign(Object.assign({},e),t&&{[`${C()}-targetid`]:[n]})},qr=e=>Object.assign(Object.assign(Object.assign(Object.assign({},e),e[`${C()}-geo`]&&{[`${C()}-geo`]:["geo-test-value"]}),e[`${C()}-geofence`]&&{[`${C()}-geofence`]:["geofence-test-value"]}),e[`${C()}-weather`]&&{[`${C()}-weather`]:["weather-test-value"]}),_r=e=>{(e=>{const t=new URLSearchParams(window.location.search);if("true"!==t.get("scrollToFirstInvCode"))return;const n=t.get("ast_override_inv_code");if(!n)return;const r=n.split(",")[0].split(":")[0],i=e.find(e=>e.invCode===r),o=document.querySelector(`[id^=${null==i?void 0:i.id}]`);o&&o.scrollIntoView({behavior:"smooth",block:"start"})})(e),(()=>{var e;const t=new URLSearchParams(window.location.search).get("scrollToDrEditionPlacement");if(!t)return;const n=null!==(e=document.querySelector(`[id*="${t}}"]`))&&void 0!==e?e:document.querySelector(`a[aria-label*="${t}"]`);n&&n.scrollIntoView({behavior:"smooth",block:"start"})})()},Dr=(t,n)=>e(void 0,void 0,void 0,function*(){return yield new Promise(e=>{t().then(t=>{e(null!=t?t:null)}).catch(t=>{e(null)})})}),Mr=()=>e(void 0,void 0,void 0,function*(){try{(()=>{const e=document.createElement("script");e.setAttribute("src","https://ads.inventory.schibsted.io/ad-service/ad-banner-sponsor-advertisement/ad.js"),e.setAttribute("type","text/javascript"),e.setAttribute("async","true"),document.head.appendChild(e)})(),(()=>{const e=document.createElement("div");e.setAttribute("id","ads-advertory-anchor"),e.classList.add("subscribe_box"),e.classList.add("ad-box"),e.classList.add("leftAd"),e.classList.add("netboard"),e.classList.add("advert"),e.classList.add("module"),e.classList.add("banner"),e.classList.add("leaderboard"),e.classList.add("adsbygoogle"),e.classList.add("ad-banner"),e.classList.add("ad-container"),e.classList.add("adsbox"),e.classList.add("sidebar-ads"),e.classList.add("banner-ads"),e.style.opacity="0",e.style.width="1px",e.style.height="1px",e.style.minWidth="0px",e.style.minHeight="0px",e.style.maxWidth="1px",e.style.maxHeight="1px",e.style.position="absolute",e.style.top="0",e.style.boxSizing="border-box",e.style.margin="0",e.style.padding="0",document.body.appendChild(e)})()}catch(e){console.error("Error running adblock scripts:",e)}}),Br={arrayMerge:(e,t)=>t},Fr=t=>e(void 0,void 0,void 0,function*(){if(!(e=>{const{editableConfiguration:{useS3Config:t=!1,pageTypeToFetch:n}={},siteSpecificConfig:r}=e;return Boolean(t&&n&&(null==r?void 0:r.publisherClassName))})(t))return t;try{const n=yield(t=>e(void 0,void 0,void 0,function*(){const e=(e=>{const{siteSpecificConfig:t,editableConfiguration:{pageTypeToFetch:n}={}}=e;return(null==t?void 0:t.publisherClassName)&&n?`https://alertory-cdn.staging.inventory.schibsted.io/editable-configurations/${t.publisherClassName}/${n.toUpperCase()}.json`:null})(t);if(!e)return null;const n=new AbortController,r=setTimeout(()=>n.abort(),5e3);try{return yield N.get(e,{method:"GET",signal:n.signal})}catch(t){throw u("Failed to fetch S3 config",{error:t,url:e}),t}finally{clearTimeout(r)}}))(t);return n?(({siteConfig:e,configOverrides:t})=>{var n;const{keywords:r,refresh:o,placements:a,threshold:s,batchSize:d}=t,l=i.all([e.placements,a],Br),c=i(e.pageOptions,{keywords:r},Br),u=i(e.appearanceConfig,{defaultThreshold:s},Br),v=i(null!==(n=e.refreshConfig)&&void 0!==n?n:{},{scrollRefreshEnabled:o},Br);return Object.assign(Object.assign({},e),{placements:l,requestSize:null!=d?d:e.requestSize,pageOptions:c,appearanceConfig:u,refreshConfig:v})})({siteConfig:t,configOverrides:n}):t}catch(e){return u("Error fetching S3 config, using site config",{error:e}),t}}),Rr=".advertory-right-column-track",Vr="--advertory-right-column-track-height",Ur=e=>e.getBoundingClientRect().top+window.scrollY,Hr=e=>{const{marginTop:t,marginBottom:n}=getComputedStyle(e);return e.getBoundingClientRect().height+parseFloat(t||"0")+parseFloat(n||"0")},zr=(e,t)=>{const n=(r=t,`${Math.max(0,Math.round(r))}px`);var r;document.body.style.setProperty(e,n)},Wr=(e,t)=>`${e}-${t}`,Kr=(e,t,n)=>{var r;const i=Array.from(null!==(r=e.querySelectorAll(t))&&void 0!==r?r:[]),o=(e=>e.map(e=>{var t;return null===(t=document.querySelector(`[id^="${e}"]`))||void 0===t?void 0:t.parentElement}).map((e,t)=>({point:e,originalIndex:t})).filter(e=>Boolean(e.point)))(n);if(0===o.length)return;const a=Ur(e);(()=>{const e=document.querySelector("header");if(!e)return;const t=Hr(e);zr("--advertory-newsroom-header-height",t)})(),o.forEach(({point:e,originalIndex:t})=>{((e,t,n)=>{const r=Ur(e),i=Wr(Vr,t),o=r-n,a=Wr("--advertory-right-column-split-point-height",t),s=Hr(e);zr(i,o),zr(a,s)})(e,t+1,a),(e=>{const t=null==e?void 0:e.id;if(!t)return;const n=Wr("--advertory-right-column-ad-height",t),r=Hr(e);zr(n,r)})(i[t])});((e,t)=>{const n=Ur(e);zr(Vr,n-t)})(o[Math.min(i.length,o.length-1)].point,a)};let Jr=!1;class Gr{getPulseObjectId(){return"sdrn:vg:content:partnerstudio:element:partnerstudio:stats"}getPulsePageId(){return"sdrn:vg:frontpage:front"}getTags(e){var t;let n;if(n=e instanceof HTMLAnchorElement?e.href:null===(t=null==e?void 0:e.querySelector("a"))||void 0===t?void 0:t.href,!n)return[];const{host:r,pathname:i}=new URL(n);if(!r.includes("www.vg.no")&&!i.includes("annonsorinnhold"))return[n];const o=i.split("/");return o.length?[...o.filter(Boolean).slice(1).map(e=>e),n]:[n]}}class Yr{getPulseObjectId(){return""}getPulsePageId(e,t){return""}}class Qr{constructor(e,t){this.pulse=e,this.newsroomStrategy=t}getEventInput(e,t){return{}}parseKilkayaData(e){const t=e.querySelector("article");if(!t)return{};const n=t.dataset.k5aTeaserAnalytics;try{return n?JSON.parse(n):{}}catch(e){return{}}}mapPageType(e){return{front:"Frontpage",article:"Article",section:"Article",collection:"Article",other:"Article"}[e||"front"]||"Frontpage"}getArticleId(){return location.pathname.split("/").slice(-2,-1).pop()||""}getEventTarget(e){const{url:t,title:n,itemId:r}=this.parseKilkayaData(e);return{id:r,name:this.normalizePlacementTitle(null!=n?n:""),type:"Page",url:t}}normalizePlacementTitle(e){return e.replace(/<[^>]+>/gi,"").replace(/[^a-z0-9æøå\s_-]/gi,"")}trackContentView(t){return e(this,void 0,void 0,function*(){var e,n,r,i,o,a,s,d;if(!this.pulse)return;const l=this.getEventInput(t,"view");(null===(e=this.pulse)||void 0===e?void 0:e.trackLegacyViewUIElement)?null===(r=null===(n=this.pulse)||void 0===n?void 0:n.trackLegacyViewUIElement)||void 0===r||r.call(n,l):(null===(i=this.pulse)||void 0===i?void 0:i.trackViewUIElement)?null===(a=null===(o=this.pulse)||void 0===o?void 0:o.trackViewUIElement)||void 0===a||a.call(o,l):null===(d=null===(s=this.pulse)||void 0===s?void 0:s.trackElementView)||void 0===d||d.call(s,l)})}trackContentClick(t){return e(this,void 0,void 0,function*(){var e,n,r,i,o,a;if(!this.pulse)return;const s=this.getEventInput(t,"click");this.pulse.trackLegacyClickUIElement?null===(n=(e=this.pulse).trackLegacyClickUIElement)||void 0===n||n.call(e,s):this.pulse.trackClickUIElement?null===(i=(r=this.pulse).trackClickUIElement)||void 0===i||i.call(r,s):null===(a=(o=this.pulse).trackElementClick)||void 0===a||a.call(o,s)})}}class Xr extends Qr{constructor(e,t,n){super(e,t),this.pulse=e,this.newsroomStrategy=t,this.pageType=n}getEventBaseData(e){var t,n,r,i,o,a;const{clientName:s,creativeId:d,itemId:l,placement:c}=this.parseKilkayaData(e),u=this.mapPageType(this.pageType),v=null===(t=this.newsroomStrategy)||void 0===t?void 0:t.getPulsePageId(this.pageType||"front",this.getArticleId());return{"@id":null!==(i=null===(r=null===(n=this.newsroomStrategy)||void 0===n?void 0:n.getPulseObjectId)||void 0===r?void 0:r.call(n))&&void 0!==i?i:c,"@type":"UIElement",position:c,elementType:"Article",custom:{customer:s,creativeId:null!=d?d:l},page:{"@id":null!=v?v:c,"@type":u,url:location.origin},tags:null===(a=null===(o=this.newsroomStrategy)||void 0===o?void 0:o.getTags)||void 0===a?void 0:a.call(o,e)}}getEventTarget(e){const{link:t,itemId:n,title:r}=this.parseKilkayaData(e);return{id:n,name:this.normalizePlacementTitle(null!=r?r:""),type:"Page",url:t}}getEventInput(e,t){return{object:this.getEventBaseData(e),partnerstudio:this.getEventPartnerstudioData(e,t),target:this.getEventTarget(e),provider:this.getProviderData()}}getEventPartnerstudioData(e,t){const n=this.parseKilkayaData(e);return Object.assign(Object.assign({},n),{type:t,tracking_type:"ad",xandrAdLoaded:!1})}getProviderData(){return{productTag:"partnerstudio"}}}const Zr="[data-k5a-teaser-analytics]",ei=(e,t,n)=>{const r=document.querySelectorAll("k5a-stream");if(!r.length)return;const i=new Xr(e,t,n),o=new WeakMap,a=e=>{const t=o.get(e);t&&(t.disconnect(),o.delete(e))},s=new IntersectionObserver((e,t)=>{e.forEach(e=>{if(!e.isIntersecting)return;const n=e.target,r=n.querySelector(Zr);Boolean(null==r?void 0:r.dataset.k5aTeaserAnalytics)?(i.trackContentView(n),t.unobserve(e.target),a(n)):((e,t)=>{if(o.has(e))return;const n=new MutationObserver(()=>{const n=e.querySelector(Zr);Boolean(null==n?void 0:n.dataset.k5aTeaserAnalytics)&&(i.trackContentView(e),t.unobserve(e),a(e))});n.observe(e,{attributes:!0,childList:!0,subtree:!0,attributeFilter:["data-k5a-teaser-analytics"]}),o.set(e,n)})(n,t)})},{threshold:.5});r.forEach(e=>{s.observe(e),e.addEventListener("click",()=>i.trackContentClick(e))})};class ti{handleKilkayaStreamTracking({pulse:e,pageType:t,publisher:n}){if(!(null==e?void 0:e.instance))return;const r={[Oe]:new Gr}[n]||new Yr;ei(e.instance,r,t)}injectKilkayaMeta(e){const t=document.createElement("script");t.textContent=`var k5aMeta = { consent: ${e} };`,document.head.appendChild(t)}observeForKilkayaBackfills(){document.addEventListener("K5A:EmptyStreamSlot",e=>{var t;const n=null===(t=null==e?void 0:e.detail)||void 0===t?void 0:t.streamSlot;if(!n)return;const r=n.parentElement;r&&(u(`Kilkaya placement ${n.getAttribute("name")} has not been loaded, loading Xandr backfill`),this.showBackfill(r))})}showBackfill(e){var t;const n=e.querySelector(".fallback");if(!n)return;n.style.display="block";const r=null!==(t=n.dataset.fallbackTargetId)&&void 0!==t?t:"";At(r)}loadKilkayaScript(t){return e(this,void 0,void 0,function*(){yield Be(t)})}run(t){return e(this,void 0,void 0,function*(){const{tcf:e,isMobileApp:n,country:r,kilkaya:i}=t;if(!(null==i?void 0:i.enabled))return;const o=yield A(e,n,r,"kilkaya");o&&(this.observeForKilkayaBackfills(),this.injectKilkayaMeta(o),yield this.loadKilkayaScript(i.url),this.handleKilkayaStreamTracking(t))})}}const ni=e=>{var t,n,r,i,o,a;const{adScaleConfig:s,deviceType:d}=l.get();if(!(null==s?void 0:s.enabled))return;if(Ce(e,re))return;const c=null!==(t=s.adsToBeScaled[d])&&void 0!==t?t:[],u=Pt(e.targetId.split("-")[0]);if(!c.includes(u))return;const v=null!==(r=null===(n=s.offset)||void 0===n?void 0:n[u])&&void 0!==r?r:0,p=document.getElementById(e.targetId),g=null!==(i=null==p?void 0:p.offsetWidth)&&void 0!==i?i:window.screen.width,h=null!==(a=null===(o=null==p?void 0:p.parentElement)||void 0===o?void 0:o.offsetWidth)&&void 0!==a?a:window.screen.width;((e,t=window.screen.width)=>{const n=Cr(e,t),r=document.querySelector(`iframe[id^="utif_${e.targetId}"]`);r&&(r.style.transform=`scale(${n})`,r.style.transformOrigin="left top")})(e,(g<h?g:h)-v)},ri=1e4,ii=e=>e.some(e=>e.some(e=>!!e&&jn(e,0))),oi=()=>{const{widescreenSwitching:e}=l.get(),{enabled:t,rotationInterval:n=ri,widescreenIdPrefix:r}=null!=e?e:{};if(!t)return;const i=((e="widescreen")=>{const{pageSectionsSelectors:{right:t}={}}=l.get();return t?Array.from(document.querySelectorAll(t)).map(t=>Array.from(t.querySelectorAll(`div[id^="${e}"]`))):[]})(r);let o=0,a=Date.now(),s=ii(i);if(!i.length)return;const d=(e,t,n)=>{e.forEach(e=>{e&&e.style.setProperty(t,n)})},c=e=>1===e?0:1;(e=>{e.forEach(e=>{e[0]&&(e[0].style.display="block"),e[1]&&(e[1].style.display="none")})})(i);const u=((e,t)=>{let n=null;return(...r)=>{null===n&&(e(...r),n=setTimeout(()=>{n=null},t))}})(()=>{s||(s=ii(i)||s,a=Date.now());Date.now()-a>=n&&((()=>{const e=c(o),t=i.map(e=>e[o]),n=i.map(t=>t[e]);d(t,"opacity","0"),setTimeout(()=>{d(t,"display","none"),d(n,"opacity","0"),d(n,"display","block"),setTimeout(()=>{d(n,"opacity","1")},450)},450)})(),o=c(o),a=Date.now())},1e3);window.addEventListener("scroll",u)};et('.advertory-finn-blink-wrapper{height:100%;display:flex !important;align-items:center;justify-content:center}.advertory-finn-blink-wrapper:not(.brandboard-container){width:100%;margin-inline:auto}.advertory-finn-blink{width:100%;height:500px;max-width:580px;display:flex !important;align-items:center;justify-content:center}.advertory-finn-blink::before{content:"" !important}.advertory-finn-blink iframe{max-width:100%}');const ai=e=>document.querySelector(`#${e}`);let si,di=[];const li=["takeover","wallpaper"],ci=e=>{const t=(e=>{const t=qe.getData("alertoryConfigKeywords"),{queryConfig:n,placements:r,tcf:i,glimr:o,appearanceConfig:a,requestSize:d=s,publisher:l,country:c,pageType:u,deviceType:v,isMobileApp:p=!1,pageOptions:{member:g},takeover:h,fullscreenScroll:m,useAppTabletInvCode:y}=e;return{xandr:{member:g,keywords:t,tags:[]},advertory:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({publisher:l,country:c,pageType:u,deviceType:v,placements:r,tcf:i,requestSize:d,isMobileApp:p,useAppTabletInvCode:y},o&&{glimr:o}),n&&{queryConfig:n}),a&&{appearanceConfig:a}),h&&{takeover:h}),m&&{fullscreenScroll:m})}})(e);window.advertory={initialized:!0,siteConfig:e,alertoryConfig:t}},ui=()=>e(void 0,void 0,void 0,function*(){const{pageOptions:t}=l.get(),{preparePageOptions:n}=l.getHandlers(),r=(()=>{const{sandboxAdIframeEnabled:e=!0}=l.get();return{sandboxAdIframe:e,sandboxAttributes:["allow-same-origin","allow-scripts","allow-top-navigation-by-user-activation","allow-popups","allow-popups-to-escape-sandbox","allow-forms"]}})(),i=yield e(void 0,void 0,void 0,function*(){const{tcf:e,isMobileApp:t,country:n}=l.get();return(yield A(e,t,n,"page-options"))?{}:{userSync:{disabled:!0}}}),o=yield n(Object.assign(Object.assign(Object.assign({disablePsa:!0,enableSafeFrame:!0},t),{renderingManagement:Object.assign({},r)}),i));(e=>{const t=qe.getData("alertoryConfigKeywords");if(Object.keys(t).length)return;const n=qr(e);qe.setData("alertoryConfigKeywords",n)})(o.keywords),pt(()=>si.setPageOpts(o))}),vi=t=>e(void 0,void 0,void 0,function*(){const{prebid:e,tcf:n,isMobileApp:r,country:i}=l.get();pi(t);const o=yield A(n,r,i,"prebid");(null==e?void 0:e.enabled)&&o?(u("core loadPlacements prebid enabled"),yield dt()):(u("core load tags invoked without prebid enabled"),gi(t))}),pi=e=>{const{prepareTag:t}=l.getHandlers(),n=[];(e=>{const t=["skyscraperright_1","topboard","wallpaper","skyscraperleft_1"];return e.sort((e,n)=>{const r=t.findIndex(t=>e.id.includes(t)),i=t.findIndex(e=>n.id.includes(e));return-1!==r&&-1===i?-1:-1===r&&-1!==i?1:r-i})})(e).forEach(e=>{u("core defineTags",{placement:e});const r=Lr(e);if(jr(e.id)){const i=t(r),o=(e=>{const{allowedFormats:t,invCode:n,keywords:r,sizes:i}=e;return{adTypes:t,invCode:n,keywords:Nr(r),sizes:i}})(i);n.push(o),pt(()=>(u("core defineTag - add to the queue",{placement:e,preparedTag:i}),si.defineTag(i)))}}),(e=>{var t,n,r;(null===(r=null===(n=null===(t=window.advertory)||void 0===t?void 0:t.alertoryConfig)||void 0===n?void 0:n.xandr)||void 0===r?void 0:r.tags)&&e.length&&window.advertory.alertoryConfig.xandr.tags.push(e)})(n)},gi=e=>{const t=e.filter(({id:e})=>jr(e)).map(({id:e})=>e);t.length&&pt(()=>(u("core loadTags",{placementsIdsToLoad:t}),si.loadTags([...t])))},hi=(t,n)=>e(void 0,void 0,void 0,function*(){const{appearanceConfig:e,deviceType:r}=l.get(),{threshold:i,refresh:o}=t,a=(e=>{const t=document.querySelector(`[data-show-tag-subscribe-id=${e.targetId}]`),n=document.querySelector(`#${e.targetId}`);return t||n})(n),s=null==e?void 0:e.defaultThreshold[r];a&&(u("core showAd - subscribe for show tag with thresholds",{placement:t,adObj:n,threshold:i,deviceDefaultThreshold:s}),yield bn(a,null!=i?i:s)),a&&o&&(u("core showAd - setup refreshing",{placement:t,adObj:n}),a.dataset.refresh=o.toString())}),mi=e=>e.some(({id:e})=>li.some(t=>e.includes(t))),yi=t=>e(void 0,void 0,void 0,function*(){var n;if(!(null===(n=null===window||void 0===window?void 0:window.advertory)||void 0===n?void 0:n.initialized))return;const[r,i]=(e=>e.reduce(([e,t],n)=>{var r;return(null===(r=null==n?void 0:n.finnBlink)||void 0===r?void 0:r.loadOnlyFinnBlink)?[[...e,n],t]:[e,[...t,n]]},[[],[]]))(t),o=(e=>{const{requestSize:t=s,queryConfig:{placementBatches:n}={},deviceType:r}=l.get(),i=jt(e),o=Object.keys((null==n?void 0:n[r])||{}).map(e=>i[e]||[]).filter(e=>e.length>0),a=new Set(o.flat().map(({id:e})=>e)),d=e.filter(({id:e})=>!a.has(e));return[...o,...xn(d,t)]})(i);for(const e of o)mi(e)?(u("core loadAds without lazy loading",{placementsToLoad:e}),yield vi(e)):e.length&&(u("core loadAds with lazy loading",{placementsToLoad:e}),yield fi(e));yield(t=>e(void 0,void 0,void 0,function*(){if(!t.length)return;const{appearanceConfig:e,deviceType:n}=l.get(),r=null==e?void 0:e.defaultThreshold[n];for(const e of t){const{threshold:t,id:n}=e,i=ai(n);i&&(yield bn(i,null!=t?t:r))}}))(r)}),fi=t=>e(void 0,void 0,void 0,function*(){const{queryConfig:{lazyLoadingV3:{enabled:e=!1,rootMargin:n="200% 0px"}={}}={}}=l.get(),r=[];if(!e)return u("lazy load is not enabled",{placements:t}),void(yield vi(t));const i=new IntersectionObserver((e,n)=>{e.filter(({isIntersecting:e,target:{id:t}})=>e&&!t.includes("wallpaper")).forEach(e=>{u("lazy load is enabled - handler start",{loadedPlacementIds:r,placements:t});const i=t.every(e=>r.includes(e.id)),o=t.map(e=>e.id);!i&&r.push(...o),!i&&vi(t),u("lazy load is enabled - handler stop",{loadedPlacementIds:r,placements:t,arePlacementsLoaded:i,placementIds:o}),n.disconnect()})},{rootMargin:n});t.forEach(e=>{const t=document.getElementById(e.id);t&&(u("lazy loading - observe element",{placementId:e.id,element:t}),i.observe(t))})}),wi=()=>e(void 0,void 0,void 0,function*(){const{siteEvents:t,initNativeAd:n,wallpaperHandlers:{initWallpaperAd:r,adjustAdToHorseshoe:i}}=l.getHandlers(),{wallpaper:o,fullscreenScroll:a}=l.get(),s=[];pt(()=>{si.onEvent("adRequested",()=>{t.adRequested()}),si.onEvent("adAvailable",i=>e(void 0,void 0,void 0,function*(){var e,s,d,c,v,p;u("core adAvailable start",{placementsAvailable:di,adObj:i,isFullscreenScrollAd:ve(i),isFinnBlink:be(i.targetId),isNativeAd:pe(i),isMediation:$r(i),isTakeoverAd:he(i),isCollapseAd:fe(i),isWallpaperAd:ye(i)});const g=null===(d=null===(s=null===(e=null===window||void 0===window?void 0:window.apntag)||void 0===e?void 0:e.requests)||void 0===s?void 0:s.tags[i.targetId])||void 0===d?void 0:d.adResponse.ads;$r(i)&&g&&(null===(c=g[1])||void 0===c?void 0:c.rtb)&&(i.banner=null===(p=null===(v=g[1])||void 0===v?void 0:v.rtb)||void 0===p?void 0:p.banner),ve(i)&&st(i),Ae(i)&&oi(),ve(i)&&!be(i.targetId)&&at(i,a),!pe(i)||$r(i)||be(i.targetId)||n(i,l.get()),he(i)&&!fe(i)&&(wr(i.targetId),yield br(i)),ye(i)&&(r(()=>pt(()=>window.apntag.showTag(i.targetId)),o),qe.setData("wallpaper",{isAvailable:!0})),(e=>e.targetId.includes("skyscraperleft")&&!!e.banner)(i)&&qe.setData("horseshoe",{isAvailable:!0}),kr({adObj:i}),(e=>{var t;const n=null==e?void 0:e.targetId;if(!n)return;const r=null===(t=document.querySelector(`#${n}`))||void 0===t?void 0:t.parentElement;r&&((e,t)=>{const{height:n,width:r,native:i}=e;i?t.dataset.adSizes="[1,1]":n&&r&&(t.dataset.adSizes=`[${r},${n}]`)})(e,r)})(i),t.adAvailable(i);const h=di.find(({id:e})=>e===i.targetId);h&&(yield hi(h,i),di=di.filter(e=>e.id!==h.id)),u("core adAvailable stop",{placementsAvailable:di,adObj:i,isFullscreenScrollAd:ve(i),isFinnBlink:be(i.targetId),isNativeAd:pe(i),isMediation:$r(i),isTakeoverAd:he(i),isCollapseAd:fe(i),isWallpaperAd:ye(i)})})),si.onEvent("adLoaded",e=>{const{refreshConfig:r,appearanceConfig:o}=l.get(),a=document.getElementById(e.targetId);be(e.targetId)&&(e=>{const{fullscreenScroll:t}=l.get(),{initNativeAd:n}=l.getHandlers();ve(e)&&at(e,t),pe(e)&&n(e,l.get())})(e);s.includes(e.targetId)&&pe(e)&&(n(e,l.get()),kr({adObj:e})),!s.includes(e.targetId)&&$r(e)&&s.push(e.targetId),fe(e)&&It(e.targetId),he(e)&&((e,t)=>{var n;const r="100%",i="100%";e.resizeAd(t,[r,i]);const o=null===(n=document.querySelector(`#div_utif_${t}`))||void 0===n?void 0:n.querySelector("iframe");if(!o)return;new MutationObserver(e=>{for(const t of e)if("attributes"===t.type&&"style"===t.attributeName){const e=window.getComputedStyle(o),t=e.width,n=e.height;t===r&&n===i||(o.style.width=r,o.style.height=i)}}).observe(o,{attributes:!0,attributeFilter:["style"]})})(si,e.targetId),ge(e)&&(e=>{const t=document.querySelector(`#${e.targetId}`),{siteSpecificConfig:{publisherClassName:n,fullWidthFormatClassName:r}={}}=l.get();if(!t||!n||!r)return;const i=t.parentElement;i&&(t.classList.add(`advertory-${n}-${r}__full-width-ad`),i.classList.add(`advertory-${n}-${r}-wrapper__full-width-ad`))})(e),(e=>Ce(e,ie))(e)&&(e=>{const t=document.querySelector(`#${e.targetId}`),n=null==t?void 0:t.querySelector("iframe"),r=null==n?void 0:n.parentElement,{siteSpecificConfig:{publisherClassName:i,fullWidthFormatClassName:o}={}}=l.get();if(!t||!n||!r)return;const a=window.innerWidth,s=Math.round(a/1080*1920);t.style.width="100%",t.style.height=`${s}px`,t.classList.add(`advertory-${i}-${o}__vertical-full-width-ad`);const d=Cr(e,t.offsetWidth);r.style.transform=`scale(${d})`,r.style.transformOrigin="left top"})(e),((e,t)=>{if(!(null==t?void 0:t.scrollRefreshEnabled))return;const{targetId:n}=e,r=document.querySelector(`#${n}`),i=null==r?void 0:r.parentElement;if(!i||!r)return;Sn({adWrapper:i,placementContainer:r});const{delayTime:o=1e3}=t,a=(new Date).getTime();r&&"true"!==r.dataset.subscribedForRefresh&&(r.dataset.subscribedForRefresh="true",r.dataset.refresh&&On(r,a,o))})(e,r),(null==o?void 0:o.clearProbableDimensionsEnabled)&&(e=>{const t=document.querySelector(`#${e}`);t&&(t.style.minWidth="",t.style.minHeight="")})(e.targetId);var d,c;qe.getData("horseshoe").isAvailable&&i(e.targetId),ni(e),t.adLoaded(e),d=e.targetId,!document.querySelector(`#gdprAdTransparencyCogWheelButton-${d}`)&&(null===(c=window.gdpr)||void 0===c?void 0:c.setupButton)&&window.gdpr.setupButton(d),a&&(a.classList.add("ad-loaded"),(e=>{var t;const{siteSpecificConfig:n}=l.get(),r=null!==(t=null==n?void 0:n.mainColumnWidth)&&void 0!==t?t:1/0;e.clientWidth>r&&e.setAttribute("data-two-column-ad-layout","true")})(a)),Pr(e),window.dispatchEvent(new CustomEvent("advertory:adLoaded",{detail:{targetId:e.targetId,adFormat:Tr(e)}}))}),si.onEvent("adNoBid",n=>e(void 0,void 0,void 0,function*(){It(n.targetId),yield on(l.get(),n),er(n)&&(yield Zn()),t.adNoBid(n)})),si.onEvent("adError",(n,r)=>e(void 0,void 0,void 0,function*(){er(r)&&(yield Zn()),t.adError(n,r)})),si.onEvent("adCollapse",()=>{t.adCollapse()}),si.onEvent("adRequestFailure",e=>{It(e.targetId),t.adRequestFailure(e)}),si.onEvent("adBadRequest",e=>{It(e.targetId),t.adBadRequest(e)}),si.onEvent("adLoadedMediated",e=>t.adLoadedMediated(e)),si.onEvent("adNoBidMediated",e=>t.adNoBidMediated(e))})}),bi=(t,n)=>e(void 0,void 0,void 0,function*(){var r;l.set(t),l.setHandlers(n),qe.initialize(),window.addEventListener("message",mn,!1),si=window.apntag||{anq:[],defineTag:e=>({targetId:""}),showTag:e=>{},onEvent:(e,t,n)=>{},offEvent:(e,t)=>{},refresh:e=>{},modifyTag:(e,t)=>{},loadTags:e=>{},emitEvent:(e,t)=>{},setPageOpts:e=>{},resizeAd:(e,t,n)=>{},getAstVersion:()=>"",setEndpoint:(e,t)=>{},fireImpressionTrackers:e=>{},setKeywords:()=>{},clearRequest:()=>{}},window.apntag=si,u("Apn tag is set up on window"),yield Promise.allSettled([e(void 0,void 0,void 0,function*(){const{tcf:e,isMobileApp:t,country:n}=l.get();(yield A(e,t,n,"xandr-endpoint"))||si.setEndpoint("ib.adnxs-simple.com",!0)}),e(void 0,void 0,void 0,function*(){const{prebid:e,tcf:t,isMobileApp:n,country:r}=l.get(),i=yield A(t,n,r,"prebid");(null==e?void 0:e.enabled)&&i&&(yield Be(null==e?void 0:e.url))}),W(t),e(void 0,void 0,void 0,function*(){const{astUrl:e}=l.get();yield Be(null!=e?e:"https://adsdk.microsoft.com/ast/ast.js")}),e(void 0,void 0,void 0,function*(){const{gptUrl:e}=l.get();yield Be(null!=e?e:"https://securepubads.g.doubleclick.net/tag/js/gpt.js")}),e(void 0,void 0,void 0,function*(){const{brandmetrics:{enabled:e,url:t}={},tcf:n,isMobileApp:r,country:i}=l.get(),{getConsentAsync:o}=I(n,r,i),a=yield o();if(e&&t&&a){if(yield Be(t),document.querySelector(`.${Er}`))return window._brandmetrics=window._brandmetrics||[],void window._brandmetrics.push({cmd:"_loadsurvey"});new MutationObserver((e,t)=>{for(const n of e){if("childList"!==n.type)return;Array.from(n.addedNodes).some(e=>{var t;return null===(t=e.outerHTML)||void 0===t?void 0:t.includes(Er)})&&(t.disconnect(),window._brandmetrics=window._brandmetrics||[],window._brandmetrics.push({cmd:"_loadsurvey"}))}}).observe(document,{childList:!0,subtree:!0,attributes:!0})}}),T(),e(void 0,void 0,void 0,function*(){const{gdpr:{url:e,allowHidingAds:t=!0}={}}=l.get();t&&(window.gdpr=window.gdpr||{},window.gdpr.allowHidingAds=!0),yield Be(null!=e?e:"https://cogwheel.inventory.schibsted.io/prod/latest/gdpr-bundle.js")})]),yield Ir(),u("Libraries have been loaded and trackers have been set"),yield(r=n.librariesToLoad,e(void 0,void 0,void 0,function*(){const e=r.map(e=>Be(e));yield Promise.all(e)})),yield wi(),yield ui(),u("Page options have been set"),ci(t),u("Advertory is setup on window"),di=xt(),$n(di),qn(di),yield yi(di),u("Ads has been loaded",di),_r(di),yield n.replaceAdsWithFinnBlink(t.finnBlink),yield(t=>e(void 0,void 0,void 0,function*(){var e;if(!t.drEdition)return;if(!(yield A(t.tcf,t.isMobileApp,t.country,"handleDrEdition")))return;const n=yield en(),r=new tn(n);nn({publisher:t.publisher,drEditionConfig:t.drEdition,device:t.deviceType,pageType:t.pageType,country:t.country},r,null===(e=t.pulse)||void 0===e?void 0:e.instance)}))(t),(e=>{if(!(null==e?void 0:e.enabled)||Jr)return;const{splitPointIDs:t,adSelector:n,trackSelector:r=Rr}=e,i=document.querySelector(r);if(!i)return;Jr=!0;const o=()=>{Kr(i,n,t)};o(),window.addEventListener("resize",o),window.addEventListener("orientationchange",o),window.addEventListener("load",o),window.addEventListener("advertory:adLoaded",()=>{requestAnimationFrame(o)}),new ResizeObserver(o).observe(i)})(t.rightColumnSplit),yield(t=>e(void 0,void 0,void 0,function*(){const e=new ti;yield e.run(t)}))(t)}),Ei=(t,n)=>e(void 0,void 0,void 0,function*(){yield((t,n)=>e(void 0,void 0,void 0,function*(){const{initConsentManager:e,getConsentAsync:r}=I(t.tcf,t.isMobileApp,t.country),i=yield Fr(t);yield Mr(),yield Dr(e),yield Dr(r),u("TCF resolved successfully"),yield bi(i,n),u("Run function resolved successfully")}))(t,n)}),Ii=()=>{if(!window.location.search.includes("kv_"))return{};const e={},t=(()=>{const e=new URLSearchParams(window.location.search);return Object.fromEntries(e)})();return Object.keys(t).forEach(n=>{n.startsWith("kv_")&&(e[n.slice(3)]=t[n])}),e},Ai={[Oe]:["board","netboard","backfill","outstream"],[Le]:["panorama","outstream"],[xe]:["panorama","outstream"],[Pe]:["wph-article-panorama","wph-front-panorama"]},ki=e=>{var t;const{publisher:n}=l.get();return!!Ai[n]&&!!(null===(t=Ai[n])||void 0===t?void 0:t.some(t=>e.includes(t)))},Ti=((e,t)=>n=>Ei(Object.assign(Object.assign({},n),{siteSpecificConfig:t}),e))({initNativeAd:vt,wallpaperHandlers:{initWallpaperAd:vt,adjustAdToHorseshoe:vt},loadFinnBlinkAd:ut,replaceAdsWithFinnBlink:ut,preparePageOptions:te,prepareTag:e=>{const{keywords:t,targetId:n,invCode:r}=e,{useAppTabletInvCode:i=!0}=l.get(),o=((e,t)=>{const{isMobileApp:n}=l.get();return n?((e,t)=>e.replace(/wtb|wde|wph/g,e=>"wph"===e?"aph":t?"atb":e))(e,t):e})(r,i),a=(e=>{const{keywords:t,dynamicSizeWidthCheck:n}=e,r=`${C()}-adformat`,i=t?t[r]:[];if(!i)return{};const o=(Array.isArray(i)?i:[i]).filter(e=>!(e in ue)||window.innerWidth>=ue[e]);return{[r]:n?o:i}})(e),s=(e=>{const t=`${C()}-targetid`;return e?{[t]:[e]}:{}})(n),d=Ii(),c=(e=>ki(e)?{"aa-sch-dynamic-outstream":["true"]}:{})(r),u=((e,t)=>ki(e)?Object.assign(Object.assign({},t),{playerSkin:{videoBackgroundColor:"#e6e7e8"}}):{})(r);return Object.assign(Object.assign({},e),{invCode:o,keywords:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},t),a),s),c),d),rendererOptions:u})},siteEvents:Se,librariesToLoad:[]},$e),Ci=et("[id^=integration_godt-menu]>article .jw-controls>.jw-controlbar .jw-slider-time{display:none}[id^=integration_godt-menu]>article .jw-controls>.jw-controlbar .jw-button-container{padding:0 6px;height:36px}[id^=integration_godt-menu]>article .jw-controls>.jw-controlbar .jw-button-container .jw-icon{margin-right:3px;height:unset;width:unset;bottom:0}[id^=integration_godt-menu]>article .jw-controls>.jw-controlbar .jw-button-container .jw-icon-volume,[id^=integration_godt-menu]>article .jw-controls>.jw-controlbar .jw-button-container .jw-icon-playback{display:flex}");var Si=Object.freeze({__proto__:null,default:Ci});exports.initAdvertoryPackage=Ti,exports.updateAdvertory=(t,n)=>e(void 0,void 0,void 0,function*(){var e;if(!(null===(e=null===window||void 0===window?void 0:window.advertory)||void 0===e?void 0:e.initialized))return[];const{clearAds:r,reloadExistingAds:i,renderFinnBlinkPlacements:o,contextSelector:a}=null!=n?n:{};if(r)return Ct(),[];i&&(Ct(),document.querySelectorAll('[data-advertory-ad-rendered="true"]').forEach(e=>{At(e.id)})),c(null!=t?t:{}),yield ui();let s=xt(a);return o&&(s=s.filter(e=>be(e.id))),s.length>0&&(di=[...di,...s.map(e=>Object.assign({},e))],$n(s),qn(s),yield yi(s)),di});
1
+ "use strict";function e(e,t,n,r){return new(n||(n=Promise))(function(i,o){function a(e){try{d(r.next(e))}catch(e){o(e)}}function s(e){try{d(r.throw(e))}catch(e){o(e)}}function d(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)}d((r=r.apply(e,t||[])).next())})}function t(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var n,r;require("react/jsx-runtime"),"function"==typeof SuppressedError&&SuppressedError;var i=t(function(){if(r)return n;r=1;var e=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var n=Object.prototype.toString.call(e);return"[object RegExp]"===n||"[object Date]"===n||function(e){return e.$$typeof===t}(e)}(e)},t="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function i(e,t){return!1!==t.clone&&t.isMergeableObject(e)?l((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function o(e,t,n){return e.concat(t).map(function(e){return i(e,n)})}function a(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}(e))}function s(e,t){try{return t in e}catch(e){return!1}}function d(e,t,n){var r={};return n.isMergeableObject(e)&&a(e).forEach(function(t){r[t]=i(e[t],n)}),a(t).forEach(function(o){(function(e,t){return s(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,o)||(s(e,o)&&n.isMergeableObject(t[o])?r[o]=function(e,t){if(!t.customMerge)return l;var n=t.customMerge(e);return"function"==typeof n?n:l}(o,n)(e[o],t[o],n):r[o]=i(t[o],n))}),r}function l(t,n,r){(r=r||{}).arrayMerge=r.arrayMerge||o,r.isMergeableObject=r.isMergeableObject||e,r.cloneUnlessOtherwiseSpecified=i;var a=Array.isArray(n);return a===Array.isArray(t)?a?r.arrayMerge(t,n,r):d(t,n,r):i(n,r)}return l.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(e,n){return l(e,n,t)},{})},n=l}());const o=["deviceType","pageType","placements","takeover","refreshConfig","editableConfiguration"],a={adRequested:()=>{},adAvailable:e=>{},adLoaded:e=>{},adNoBid:e=>{},adError:(e,t)=>{},adCollapse:()=>{},adRequestFailure:e=>{},adBadRequest:e=>{},adLoadedMediated:e=>{},adNoBidMediated:e=>{}},s=6;class d{set(e){this.config=e}modifyConfigProperties(e){if(!this.config)throw new Error("Config was accessed before it had been initialized.");const t={};for(const n of o){const r=e[n];void 0!==r&&(t[n]=r)}Object.assign(this.config,t),Object.prototype.hasOwnProperty.call(e,"pageOptions")&&void 0!==e.pageOptions&&(this.config.pageOptions=Object.assign(Object.assign({},this.config.pageOptions),e.pageOptions)),Object.prototype.hasOwnProperty.call(e,"tcf")&&void 0!==e.tcf&&(this.config.tcf=Object.assign(Object.assign({},this.config.tcf),e.tcf))}get(){if(!this.config)throw new Error("Config was accessed before it had been initialized.");return this.config}getHandlers(){if(!this.siteHandlers)throw new Error("Handlers were accessed before it had been initialized.");return this.siteHandlers}setHandlers(e){this.siteHandlers=i(d.DEFAULT_SITE_HANDLERS,e)}}d.DEFAULT_SITE_HANDLERS={siteEvents:a,initNativeAd:function(){}};const l=new d,c=l.modifyConfigProperties.bind(l),u=(e,t)=>{const n="[Advertory LOG]: ";location.search.includes("ast_debug=true")&&(t?console.log(n,e,t):console.log(n,e))},v=864e5,p=(()=>{const e=e=>{const t=window.localStorage.getItem(e);if(!t)return null;try{return JSON.parse(t)}catch(e){return u("Error with parsing localStorage data"),null}},t=(e,t)=>{window.localStorage.setItem(e,JSON.stringify(t))};return{get:e,set:t,setWithTimestamp:(e,n,r=v)=>{const i={data:n,expirationTime:(new Date).getTime()+r};t(e,JSON.stringify(i))},getByTimestamp:(t,n=v)=>{const r=e(t);if(!r)return null;if(!n)return r;try{const{expirationTime:e,data:t}=JSON.parse(r);return(new Date).getTime()<=e?t:null}catch(e){return u("Error with parsing localStorage data"),null}}}})(),g="glimrTags",h=["glwe_","glwet_"],m={geofenceTags:[],geoTags:[],weatherTags:[]},y=e=>new Promise(t=>{if(!window._tcf_||!(null==e?void 0:e.enabled))return void t(!1);const n=(()=>{if(!window._tcf_)return null;const e=window._tcf_.getPermissionSync("CMP:advertising");if(null===e)return null;const t=Number(e);return u("Advertising permission value obtained synchronously: ",e),Boolean(t)})();if(null!==n)return void t(n);let r=!1;const i=e=>{r||(u("Resolving advertising permission value obtained"),r=!0,t(e))},o=setTimeout(()=>{u("Advertising permission timed out, resolving with false"),i(!1)},3e3);window._tcf_.onTcfReady(()=>{u("On Tcf Ready called, waiting for permission"),clearTimeout(o)}),window._tcf_.getPermission("CMP:advertising",e=>{clearTimeout(o);const t=Number(e);u("Advertising permission value obtained asynchronously: ",e),i(Boolean(t))})}),f={NO:"no",SE:"se"},w="cmp:loaded";let b,E=!1;const I=(t,n,r)=>{const i=!!(null==t?void 0:t.enabled),o=(null==t?void 0:t.timeout)||3e3,a=(s="bypass_tcf",new URLSearchParams(window.location.search).get(s));var s;const d=()=>{if(!(null==t?void 0:t.enabled))return!0;if(((e,t)=>e?!!t&&(u("TCF bypass param detected, returning consent: true"),!0):(u("TCF is not enabled, returning consent: true"),!0))(i,a))return!0;if(E)return null;if(!b)throw new Error("[Advertory]: getConsentSync method was called before the tcfManager was available.");const e=b.getConsentedToAllSync();return u(`TCF consented to all is: ${e}`),b.getConsentedToAllSync()};return{initConsentManager:()=>(null==t?void 0:t.enabled)?new Promise((e,t)=>{if(u("Getting TCF consent manager..."),window._tcf_)return u("TCF consent manager is already available"),b=window._tcf_,void e(b);u("TCF consent manager is not available");const n=()=>{u("CMP loaded, resolving consent manager..."),r&&clearTimeout(r),window._tcf_?(b=window._tcf_,e(b)):t(new Error("CMP loaded but window._tcf_ is not defined"))},r=setTimeout(()=>{document.removeEventListener(w,n),E=!0,t(new Error("Timeout waiting for CMP to load"))},o);u("Listening for CMP loaded event..."),document.addEventListener(w,n,{once:!0})}):Promise.resolve(null),getConsentSync:d,getConsentAsync:()=>e(void 0,void 0,void 0,function*(){if(null==t?void 0:t.schibstedAdChoicesOverrideValue)return u(`Schibsted Ad Choices override value is set, returning override value: ${t.schibstedAdChoicesOverrideValue}`),Boolean(Number(t.schibstedAdChoicesOverrideValue));const e=(null==t?void 0:t.schibstedAdChoicesEnabled)&&r===f.SE,i=(null==t?void 0:t.schibstedAdChoicesEnabled)&&!n&&r===f.NO;if(e||i)return u("Schibsted Ad Choices is enabled, getting advertising permissions..."),yield y(t);if(!(null==t?void 0:t.enabled))return!0;const a=d();return null!==a?a:yield new Promise((e,t)=>{try{if(!b)throw new Error("[Advertory]: getConsentAsync method was called before the tcfManager was available.");let t=!1;const n=n=>{t||(t=!0,e(n))},r=setTimeout(()=>{u("TCF isConsentedToAll timed out, resolving with false"),n(!1)},o);b.onTcfReady(()=>{u("On Tcf Ready called, waiting for consent"),clearTimeout(r)}),b.isConsentedToAll(t=>{clearTimeout(r),e(t)})}catch(e){t(e)}})})}},A=(t,n,r,...i)=>e(void 0,[t,n,r,...i],void 0,function*(e,t,n,r="NOT SPECIFIED FEATURE"){if(!(null==e?void 0:e.schibstedConsentToPayEnabled))return u(`Schibsted Consent to Pay is not enabled, returning true for ${r}`),!0;if(null==e?void 0:e.schibstedAdChoicesOverrideValue)return u(`Schibsted Ad Choices override value is set, returning override value: ${null==e?void 0:e.schibstedAdChoicesOverrideValue} for ${r}`),Boolean(Number(null==e?void 0:e.schibstedAdChoicesOverrideValue));const{getConsentAsync:i}=I(e,t,n);return(yield i())?(u(`Schibsted Ad Choices consent given according to TCF consent manager for ${r}`),!0):(u(`Schibsted Ad Choices consent not given according to TCF consent manager for ${r}`),!1)}),k=()=>e(void 0,void 0,void 0,function*(){const{tcf:e,isMobileApp:t,country:n}=l.get();if(null==e?void 0:e.schibstedConsentToPayEnabled){return yield A(e,t,n,"glimr")}const{getConsentAsync:r}=I(e,t,n);return yield r()}),T=()=>e(void 0,void 0,void 0,function*(){const{glimr:t}=l.get();if(!(yield k())||!(null==t?void 0:t.enabled))return void u("No consent for glimr data fetching.");const n=yield(r=500,e(void 0,void 0,void 0,function*(){return yield Promise.race([e(void 0,void 0,void 0,function*(){const e=yield import("glimr-sdk");return e.default||e}),new Promise(e=>setTimeout(()=>e(!1),r))])}));var r;if(n)try{n.setTagCacheTimeInSeconds(300),yield new Promise(e=>{n.getTags(t.clientId,(t,n)=>{p.setWithTimestamp(g,{tags:t,tagMappings:n}),e(!0)})})}catch(e){u(`Error during getting glimr data: ${e}`)}else u("Timeout (500ms) while loading glimr package. Skipping glimr data fetching.",{glimr:n})}),C=()=>{const{country:e}=l.get();return e===f.NO?"no-sno":"se-generic"},S=()=>{const{country:e,publisher:t}=l.get();return`${e}-${t}`},P={svd:"svd",vg:"vg",godare:"godare",aftenposten:"no-aftenposten",sa:"no-stavangeraftenblad",bt:"no-bergenstidende",aftonbladet:"aftonbladet",e24:"e24",minmote:"minmote",pent:"pent",godt:"godt",tek:"no-tek"},O=e=>h.some(t=>e.startsWith(t)),x=e=>e.startsWith("glgc_"),L=e=>!O(e)&&!x(e),j=e=>{const t=$();if(!t)return m;const n=((e=[])=>e.filter(O))(t),r=((e=[])=>e.filter(x))(t),i=((e=[],t)=>{const n=e.filter(L);if(t){const{publisher:e}=l.get(),t=P[e]||e;n.push(t)}return n})(t,e);return{geoTags:i,geofenceTags:r,weatherTags:n}},$=()=>{const e=p.getByTimestamp(g);return e&&"string"!=typeof e?null==e?void 0:e.tags:null},N={get:(t,n)=>e(void 0,void 0,void 0,function*(){const e=yield fetch(t,n);if(!e.ok)throw new Error(e.statusText);return yield e.json()}),post:(t,n,r)=>e(void 0,void 0,void 0,function*(){const e=JSON.stringify(r),i=yield fetch(t,{method:"POST",headers:n,body:e});if(!i.ok)throw new Error(i.statusText);return yield i.json()})},q="advertory:ppids-cache",_={[f.SE]:`SCH${f.SE.toUpperCase()}-EnvHash`,[f.NO]:`SCH${f.NO.toUpperCase()}-EnvHash`},D={[f.SE]:`SCH${f.SE.toUpperCase()}-UserHash`,[f.NO]:`SCH${f.NO.toUpperCase()}-UserHash`},M={[f.SE]:`sch${f.SE}-envhash-v3`,[f.NO]:`sch${f.NO}-envhash-v3`},B={[f.SE]:`sch${f.SE}-userhash-v3`,[f.NO]:`sch${f.NO}-userhash-v3`},F={[f.SE]:`'sch${f.SE}-iosid-v3'`,[f.NO]:`'sch${f.NO}-iosid-v3'`},R={[f.SE]:`sch${f.SE}-androidid-v3`,[f.NO]:`sch${f.NO}-androidid-v3`},V={[f.SE]:"sdrn:schibsted.com:user",[f.NO]:"sdrn:spid.no:user"};class U{constructor(){this.eids=[]}add(e,t){return e&&this.eids.push({id:e,source:t}),this}buildRyEids(){return this.eids.map(({id:e,source:t})=>({source:t,uids:[{id:e,atype:1,ext:{stype:"ppuid"}}]}))}buildEids(){return[...this.eids]}buildVideoEids(){return this.eids.map(({id:e,source:t})=>`${t},${e}`).join("|")}buildNorstatPath(){const e=this.eids[0];return e?`${e.source}-${e.id}`:""}buildNorstatQuery(e){const t=new URLSearchParams;return this.eids.slice(1).forEach(({id:n,source:r})=>{t.append(e,`${r}-${n}`)}),t}}const H=new class{constructor(){this.ppid1=null,this.ppid2=null}processPPIDs(t){return e(this,arguments,void 0,function*(e,t=1e4){var n,r;const i=yield Promise.race([new Promise(e=>{setTimeout(()=>e({xandr:{ppId1:"",ppId2:""}}),t)}),e.instance.getAdvertisingIdentifiers()]);this.setPPIDs(null===(n=i.xandr)||void 0===n?void 0:n.ppId1,null===(r=i.xandr)||void 0===r?void 0:r.ppId2)})}getPPIDs(){var e,t;return null!==this.ppid1&&null!==this.ppid2||u("PPIDv2s accessed before they have been initialized"),{ppid1:null!==(e=this.ppid1)&&void 0!==e?e:"",ppid2:null!==(t=this.ppid2)&&void 0!==t?t:""}}setPPIDs(e,t){this.ppid1=null!=e?e:"",this.ppid2=null!=t?t:""}},z=new class{constructor(){this.ppid1=null,this.ppid2=null,this.idfv=null,this.anId=null}processPPIDs(t,n){return e(this,void 0,void 0,function*(){var e,r,i,o,a,s,d,l,c,u,v;const g=p.get(q),h=yield this.getNewPPIDs(t,n);if(this.shouldHash(g,h)){const n=null!==(e=t.hasherUrl)&&void 0!==e?e:"https://hasher.schibsted.com/api/v1/hash",l=this.createHasherPayload(h),c=yield this.hashPPIDs(l,n);return c?(this.cachePPIDs(l,c,null===(r=h.idfv)||void 0===r?void 0:r.plain,null===(i=h.anId)||void 0===i?void 0:i.plain),void this.setPPIDs(null!==(o=c.userId)&&void 0!==o?o:"",null!==(a=c.environmentId)&&void 0!==a?a:"",null===(s=h.idfv)||void 0===s?void 0:s.plain,null===(d=h.anId)||void 0===d?void 0:d.plain)):void this.setPPIDs("","")}this.setPPIDs(null!==(l=null==g?void 0:g.userId.hashed)&&void 0!==l?l:"",null!==(c=null==g?void 0:g.environmentId.hashed)&&void 0!==c?c:"",null===(u=null==h?void 0:h.idfv)||void 0===u?void 0:u.plain,null===(v=null==h?void 0:h.anId)||void 0===v?void 0:v.plain)})}getPPIDs(){var e,t;return null!==this.ppid1&&null!==this.ppid2||u("PPIDv3s accessed before they have been initialized"),{ppid1:null!==(e=this.ppid1)&&void 0!==e?e:"",ppid2:null!==(t=this.ppid2)&&void 0!==t?t:"",idfv:this.idfv,anId:this.anId}}setPPIDs(e,t,n,r){this.ppid1=null!=e?e:"",this.ppid2=null!=t?t:"",this.idfv=null!=n?n:null,this.anId=null!=r?r:null}shouldHash(e,t){var n,r;if(!e)return!0;for(const i in e){if((null===(n=e[i])||void 0===n?void 0:n.plain)!==(null===(r=t[i])||void 0===r?void 0:r.plain))return!0}return!1}cachePPIDs(e,t,n,r){const i=Object.assign(Object.assign({clientId:{plain:e.clientId},userId:{plain:e.userId,hashed:t.userId},environmentId:{plain:e.environmentId,hashed:t.environmentId},trackerType:{plain:e.trackerType},trackerVersion:{plain:e.trackerVersion}},n?{idfv:{plain:n}}:{}),r?{anId:{plain:r}}:{});p.set(q,i)}hashPPIDs(t,n){return e(this,void 0,void 0,function*(){try{const e=new Headers({"Content-Type":"application/json"});return yield N.post(n,e,t)}catch(e){return u("Error with hashing PPIDs",e),null}})}getNewPPIDs(t,n){return e(this,arguments,void 0,function*({clientId:t,instance:n},r){const i=yield((t,n)=>e(void 0,void 0,void 0,function*(){const e=yield t.getUserId();return e?`${V[n]}:${e}`:null}))(n,r),o=yield(t=>e(void 0,void 0,void 0,function*(){const e=yield t.getEnvironmentId();return e?`sdrn:schibsted:environment:${e}`:null}))(n),a=window.advertory_idfv,s=window.advertory_anId;return Object.assign(Object.assign({clientId:{plain:t},userId:{plain:i},environmentId:{plain:o},trackerType:{plain:"Advertory"},trackerVersion:{plain:"1.0.0"}},a?{idfv:{plain:a}}:{}),s?{anId:{plain:s}}:{})})}createHasherPayload({clientId:e,trackerType:t,trackerVersion:n,userId:r,environmentId:i}){return{clientId:e.plain,trackerType:t.plain,trackerVersion:n.plain,userId:r.plain,environmentId:i.plain}}},W=t=>e(void 0,void 0,void 0,function*(){const{tracker:e,tcf:n,country:r,isMobileApp:i}=t;if(!(yield A(n,i,r,"setXandrPPIDs")))return;if(!e)return;(yield Promise.allSettled([H.processPPIDs(e,null==n?void 0:n.timeout),z.processPPIDs(e,r)])).forEach((e,t)=>{if("rejected"===e.status){u(`Cannot fetch PPIDs v${t+2}`,e.reason)}})}),K=e=>{const{ppid1:t,ppid2:n}=H.getPPIDs(),{ppid1:r,ppid2:i,idfv:o,anId:a}=z.getPPIDs();return{userIds:[{type:"extendedIDs",eids:(new U).add(n,_[e]).add(t,D[e]).add(i,M[e]).add(r,B[e]).add(o,F[e]).add(a,R[e]).buildEids()}]}},J=e=>{const{ppid1:t,ppid2:n}=H.getPPIDs(),{ppid1:r,ppid2:i,idfv:o,anId:a}=z.getPPIDs();if(!n)return{};return{userSync:{userIds:[{name:"pubProvidedId",params:{eids:(new U).add(n,_[e]).add(t,D[e]).add(i,M[e]).add(r,B[e]).add(o,F[e]).add(a,R[e]).buildRyEids()}}]}}},G=e=>{const t=encodeURIComponent(e).replace(/[-.+*]/g,"\\$&"),n=new RegExp(`(?:(?:^|.*;)\\s*${t}\\s*\\=\\s*([^;]*).*$)|^.*$`);return decodeURIComponent(document.cookie.replace(n,"$1"))||null},Y={MOBILE:"mobile",TABLET:"tablet",DESKTOP:"desktop"},Q=9826;class X{constructor(){this.getSupplyTypeKeywords=()=>{const{deviceType:e=Y.DESKTOP,isMobileApp:t}=l.get();if(t){return{"aa-sch-supply_type":`app_${e===Y.MOBILE?"phone":Y.TABLET}`}}return{"aa-sch-supply_type":`web_${this.getPageOptionsFormatDevice(e)}`}}}prepare(t){return e(this,void 0,void 0,function*(){return Object.assign(Object.assign({},t),{keywords:Object.assign(Object.assign(Object.assign(Object.assign({},t.keywords),this.getSupplyTypeKeywords()),yield this.getFormattedExternalIdKeywords()),this.getHasContextKeywords(t.keywords)),user:{externalUid:yield this.getExternalUid(),dnt:yield this.isTrackingForbidden()}})})}getFormattedExternalIdKeywords(){return e(this,void 0,void 0,function*(){const e=yield this.getExternalUid(),t=this.getUserId();return{"aa-sch-externalid_src":Number(!!e)+Number(!!t)}})}getUserId(){return(()=>{const e=G("_pulse2data");return e?e.split(",")[2]:void 0})()}getExternalUid(){return e(this,void 0,void 0,function*(){return yield e(void 0,void 0,void 0,function*(){const{tcf:e,isMobileApp:t,country:n}=l.get(),{getConsentAsync:r}=I(e,t,n);if(!(yield r()))return;const i=G("_pulse2data");return i?i.split(",")[9]:void 0})})}isTrackingForbidden(){return e(this,void 0,void 0,function*(){return(null===navigator||void 0===navigator?void 0:navigator.globalPrivacyControl)||"1"===(null===navigator||void 0===navigator?void 0:navigator.doNotTrack)||"DO_NOT_TRACK"===(yield this.getExternalUid())})}getMember(){const{pageOptions:{member:e},testMember:t=Q}=l.get();return window.location.search.includes("inventory_test=true")?t:e}getCMPValue(e){return localStorage.getItem(`CMP:${e}`)?"0"===localStorage.getItem(`CMP:${e}`)?"0":"1":"0"}getPublisherKeywords(){const{publisher:e}=l.get();return{"aa-sch-publisher":`${e}`}}getAnalyticsConsentKeywords(){return{"aa-sch-cmp_analytics":this.getCMPValue("analytics")}}getAdvertisingConsentKeywords(){return e(this,void 0,void 0,function*(){const{tcf:e,isMobileApp:t,country:n}=l.get(),{getConsentAsync:r}=I(e,t,n);return{"aa-sch-cmp_advertising":(yield r())?"1":"0"}})}getPageTypeKeywords(){const{pageType:e}=l.get();return{"aa-sch-page_type":e}}getCountryCodeKeywords(e){return{"aa-sch-country_code":e}}getInventoryTypeKeywords(){return{"aa-sch-inventory_type":"editorial"}}getHasContextKeywords(e){const t=e["aa-sch-context_keyword"];return{"aa-sch-has_context_keyword":Array.isArray(t)&&t.length?1:0}}getPageOptionsFormatDevice(e="desktop"){return"mobile"===e?"phone":e}getSponsorsKeywords(){var e;const{publisher:t,keywordsConfig:n}=l.get(),r=null===(e=null==n?void 0:n.sponsors)||void 0===e?void 0:e.split(":").map(e=>`${t}_${e}`);return r?{"no-sno-news-sponsors":r}:{}}}const Z=new X;Z.prepare.bind(Z);const ee=new class extends X{prepare(t){return e(this,void 0,void 0,function*(){const n=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({"aa-sch-country_code":f.SE},this.getPublisherKeywords()),this.getPageTypeKeywords()),yield this.getFormattedExternalIdKeywords()),this.getSupplyTypeKeywords()),yield this.getAdvertisingConsentKeywords()),this.getAnalyticsConsentKeywords()),yield e(void 0,void 0,void 0,function*(){const{glimr:e}=l.get(),{addPublisherToGeo:t}={},n=yield k();if(!(null==e?void 0:e.enabled)||!n)return u("No consent for getting glimr tags."),{};const r=C(),i=j(t);return{[`${r}-geo`]:i.geoTags,[`${r}-weather`]:i.weatherTags,[`${r}-geofence`]:i.geofenceTags}})),(()=>{const{ppid1:e,ppid2:t}=H.getPPIDs();return{"aa-sch-schuserhash":e?"1":"0","aa-sch-schenvhash":t?"1":"0"}})()),this.getHasContextKeywords(t.keywords)),t.keywords);return Object.assign(Object.assign({},t),{keywords:n,user:Object.assign(Object.assign({},K(f.SE)),{externalUid:yield this.getExternalUid()}),member:this.getMember()})})}};var te=ee.prepare.bind(ee);const ne="ABSOLUTE_FULLSCREEN",re="ANY_FULLSCREEN",ie="VERTICAL_FULLWIDTH",oe="FULLWIDTH",ae="TAKEOVER",se="VELVET_TAKEOVER",de="WALLPAPER",le="COLLAPSE",ce={ANY_FULLSCREEN:[{width:6,height:6},{width:1920,height:1080},{width:3,height:3}],ABSOLUTE_FULLSCREEN:[{width:6,height:6}],VERTICAL_FULLWIDTH:[{width:1080,height:1920}],FIXED_FULLSCREEN:[{width:1920,height:1080},{width:3,height:3}],FULLWIDTH:[{width:5},{width:400,height:400}],NATIVE_AD:[{width:1,height:1}],TAKEOVER:[{width:4,height:4}],VELVET_TAKEOVER:[{width:7,height:7}],WALLPAPER:[{width:2,height:2}],COLLAPSE:[{width:2,height:1}]},ue={wallpaper:1600,"l-format":1600},ve=e=>{const{banner:t,targetId:n}=e;return!(!t||(null==n?void 0:n.includes("takeover")))&&Ce(e,re)},pe=e=>{const{native:t}=e;return!!t},ge=e=>Ce(e,oe),he=e=>{const{targetId:t}=e;return t.includes("takeover")||Ce(e,ae)},me=e=>Ce(e,ae),ye=e=>Ce(e,de),fe=e=>Ce(e,le),we=e=>e.targetId.includes("sponsorstripe"),be=e=>{const t=document.querySelector(`#${e}`);return!!t&&"true"===t.dataset.isFinnBlinkPlacement},Ee=e=>e.targetId.startsWith("panorama")||e.targetId.startsWith("modul"),Ie=e=>e.targetId.startsWith("midboard"),Ae=e=>e.targetId.startsWith("widescreen"),ke=e=>e.width>=1260&&e.width<=1280,Te=e=>e.width>=1600&&e.width<=1620,Ce=(e,t)=>{const n=ce[t];if(!n)return!1;return!!n.find(t=>{var n,r;const i=(null===(n=e.banner)||void 0===n?void 0:n.width)||e.width,o=(null===(r=e.banner)||void 0===r?void 0:r.height)||e.height,a=t.width===i,s=!t.height||t.height===o;return a&&s})},Se={adRequested:()=>{},adAvailable:e=>{},adLoaded:e=>{const t=document.querySelector(`#${e.targetId}`),n=null==t?void 0:t.parentElement;var r,i;t&&n&&(Te(e)&&(r=n,t.classList.add("advertory-tvnu-hformat__ad"),r.classList.add("advertory-tvnu-hformat-wrapper__ad"),null===(i=document.getElementById("layout-wrapper"))||void 0===i||i.classList.add("layout-hformat-adjustment"),window.dispatchEvent(new CustomEvent("advertory:hFormatLoaded",{detail:{data:{loaded:!0}},bubbles:!0,cancelable:!0}))),Ae(e)&&(e=>{const t=!!document.querySelector(".advertory-tvnu-hformat-wrapper__ad"),n=e.parentElement;t&&n&&n.classList.add("with-h-format")})(n),(e=>5===e.width&&65===e.height)(e)&&((e,t)=>{e.classList.add("advertory-tvnu-calendar-format__ad"),t.classList.add("advertory-tvnu-calendar-format-wrapper__ad")})(t,n))},adNoBid:e=>{},adError:(e,t)=>{},adCollapse:()=>{},adRequestFailure:e=>{},adBadRequest:e=>{},adLoadedMediated:e=>{},adNoBidMediated:e=>{}},Pe="svd",Oe="vg",xe="godare",Le="aftonbladet",je="e24",$e={publisherClassName:"tvnu",fullWidthFormatClassName:"panorama"};class Ne{initialize(){this.DATA=Object.assign({},Ne.INITIAL_DATA)}getData(e){if(!this.DATA)throw new Error("Storage was accessed with invalid data.");return this.DATA[e]}setData(e,t){if(!this.DATA)throw new Error("Storage was accessed before it had been initialized.");this.DATA[e]=Object.assign(Object.assign({},this.DATA[e]),t)}}Ne.INITIAL_DATA={wallpaper:{isAvailable:!1},horseshoe:{isAvailable:!1},initialClassNames:{},alertoryConfigKeywords:{}};const qe=new Ne,_e=()=>(window.apntag||(window.apntag={anq:[],defineTag:e=>({targetId:""}),showTag:e=>{},onEvent:(e,t,n)=>{},offEvent:(e,t)=>{},refresh:e=>{},modifyTag:(e,t)=>{},loadTags:e=>{},emitEvent:(e,t)=>{},setPageOpts:e=>{},resizeAd:(e,t,n)=>{},getAstVersion:()=>"",setEndpoint:(e,t)=>{},fireImpressionTrackers:e=>{},setKeywords:()=>{},clearRequest:()=>{}}),window.apntag),De=()=>(window.relevantDigital||(window.relevantDigital={cmd:[]}),window.relevantDigital),Me=(e={},t)=>{const{prebid:{externalUidInAuctionEnabled:n,forwardGlimrTags:r=!1}={}}=l.get(),i=[`${C()}-geo`],o=["aa-sch-context_keyword","aa-sch-publisher","se-aftonbladet-section","se-svd-section","se-generic-section","no-sno-news-section","no-sno-news-subsection",...r?i:[]],a=Object.fromEntries(Object.entries(e).filter(([e])=>o.includes(e))),s=t&&n?{id:t}:{};return{ortb2:Object.assign({site:{ext:{data:a}}},s)}},Be=(t,...n)=>e(void 0,[t,...n],void 0,function*(e,{timeout:t}={timeout:1e3}){document.querySelector(`script[src="${e}"]:not([type="module"])`)||(yield new Promise((n,r)=>{const i=document.createElement("script");i.async=!0,i.src=e;const o=()=>{s(),n()},a=()=>{s(),r(new Error(`Failed to load ${e}`))},s=()=>{i.removeEventListener("load",o),i.removeEventListener("error",a),clearTimeout(d)};i.addEventListener("load",o),i.addEventListener("error",a);const d=setTimeout(()=>{s(),r(new Error(`Loading script timed out: ${e}`))},t);document.head.appendChild(i)}).catch(e=>{console.error(e)}))}),Fe=e=>e.includes("snoap.no"),Re=e=>{var t,n,r,i,o;return!!(null===(o=null===(i=null===(r=null===(n=null===(t=window.apntag)||void 0===t?void 0:t.requests)||void 0===n?void 0:n.tags[e])||void 0===r?void 0:r.adResponse)||void 0===i?void 0:i.ads[1])||void 0===o?void 0:o.rtb)},Ve=(e,t=(...e)=>{})=>{const n=t.toString();if(0===e.length)return n;const r=n.substring(0,n.indexOf("=>")).replace("(","").replace(")","").split(",").map(e=>e.trim()),i=n.substring(n.indexOf("{")+1,n.lastIndexOf("}")),o=r.map((t,n)=>`${t} = "${e[n]}"`);return new Function(...o,i).toString()},Ue=Ve([],()=>{const e=({width:e,height:t})=>{var n;const r=null===(n=document.querySelector("#sf_align"))||void 0===n?void 0:n.querySelector("div");if(!r)return;const{clientWidth:i,clientHeight:o}=r,a=e/i,s=t/o;r.style.transform=`scale(${a},${s})`,r.style.transformOrigin="left top"},t=()=>{const{innerWidth:t,innerHeight:n}=window;e({width:t,height:n})};window.addEventListener("resize",t=>{if(!t.currentTarget)return;const n={width:innerWidth,height:innerHeight};e(n)});const n=window.frameElement;(null==n?void 0:n.contentWindow)?n.contentWindow.document.body.onload=t:document.body.onload=t}),He=e=>{const t=Ve([],()=>{new MutationObserver((e,t)=>{document.querySelector("iframe")&&((()=>{const e=document.querySelector("iframe");e&&(e.onload=()=>{if(!e.contentDocument)return;document.body.style.height="100%",document.documentElement.style.height="100%",e.height="100%",e.width="100%";const t=e.contentDocument.createElement("style");t.textContent="\n adfm-ad {\n height: 100% !important;\n width: 100% !important;\n }\n ",e.contentDocument.head.appendChild(t);const n=e.contentDocument.querySelector("iframe");if(!(null==n?void 0:n.contentDocument))return;const r=n.contentDocument.createElement("style");r.textContent="\n #image {\n background-size: cover !important;\n }\n ",new MutationObserver((e,t)=>{n.contentDocument&&(n.contentDocument.head.appendChild(r),t.disconnect())}).observe(e.contentDocument,{childList:!0,subtree:!0})})})(),t.disconnect())}).observe(document.body,{childList:!0,subtree:!0})}),n=document.createElement("script");n.textContent=`(${t})()`;return e+n.outerHTML},ze=[],We={},Ke=(e,t)=>{e.forEach(({target:e,isIntersecting:n})=>{const r=Ge(e);n?(Je(r,n),Ye(e,r,t)):(Je(r,n),Qe(e,r,t))})},Je=(e,t)=>{var n,r;const i=null===(n=document.getElementById(e))||void 0===n?void 0:n.querySelector("iframe");if(!i)return;const o=t?"showFullscreen":"hideFullscreen";null===(r=i.contentWindow)||void 0===r||r.postMessage(`advertory:${o}-${e}`,"*")},Ge=e=>{var t;return null===(t=e.children[0])||void 0===t?void 0:t.id},Ye=(e,t,n)=>{e.classList.add("in-screen"),document.body.classList.add("fullscreen-scroll-in-screen"),window.dispatchEvent(new CustomEvent("advertory:fullscreenScrollInView")),ze.includes(t)||ze.push(t),n&&window.addEventListener("scroll",We[t],{passive:!0})},Qe=(e,t,n)=>{ze.includes(t)&&(n&&window.removeEventListener("scroll",We[t]),document.body.classList.remove("fullscreen-scroll-in-screen"),e.classList.remove("in-screen"),window.dispatchEvent(new CustomEvent("advertory:fullscreenScrollNotInView")))},Xe=(e,t={fadingHeaderEnabled:!1,headerSelectors:[".js-masthead"],skyscraperSelectors:[".skyscraper_r"],headerZIndex:3})=>{const{headerSelectors:n=[".js-masthead"],skyscraperSelectors:r=[".skyscraper_r"],headerZIndex:i=3}=t,o=[],a=[];return n.forEach(e=>{var t;const n=null!==(t=document.querySelector(e))&&void 0!==t?t:document.querySelector("header");n&&o.push(n)}),r.forEach(e=>{const t=document.querySelector(e);t&&a.push(t)}),()=>{o.length&&Ze(e,o,i,0),a.length&&Ze(e,a,i,40)}},Ze=(e,t,n,r)=>{const i=e.offsetHeight,o=window.scrollY,a=e.getBoundingClientRect().top+o;t.forEach(e=>{const t=e.offsetHeight;let s;s=a>o?(a-o)/t-r:(o+t-(a+i))/t;const d=s<=0;e.style.visibility=d?"hidden":"",e.style.zIndex=d?"":n.toString(),e.style.pointerEvents=d?"none":"all",e.style.opacity=s.toString()})};function et(e){if(!e||"undefined"==typeof window)return;const t=document.createElement("style");return t.setAttribute("type","text/css"),t.innerHTML=e,document.head.appendChild(t),e}et('body.fullscreen-scroll-in-screen{overflow-x:hidden}.advertory-fullscreen-scroll-wrapper{visibility:hidden;overflow:visible;width:100% !important;height:var(--advertory-fullscreen-scroll-vh, 100vh) !important;position:relative;margin:var(--advertory-fullscreen-scroll-wrapper-margin);z-index:1;display:block !important;min-height:250px;padding:0 !important;clip-path:polygon(0 0, 100vw 0, 100vw 100dvh, 0 100dvh);-webkit-clip-path:polygon(0 0, 100vw 0, 100vw 100dvh, 0 100dvh)}.advertory-fullscreen-scroll-wrapper>div{position:fixed;top:0;left:0;height:var(--advertory-fullscreen-scroll-vh, 100vh) !important;width:100vw !important;overflow:hidden}html[data-app-platform=iOS] .advertory-fullscreen-scroll-wrapper>div{height:calc(var(--advertory-fullscreen-scroll-vh, 100vh) - env(safe-area-inset-top) + var(--advertory-ios-safe-area-top-fix, 0px) - env(safe-area-inset-bottom)) !important;top:unset !important;bottom:env(safe-area-inset-bottom) !important}.advertory-fullscreen-scroll-wrapper>div>iframe{height:inherit !important;width:inherit !important;display:none !important}.advertory-fullscreen-scroll-wrapper.in-screen{visibility:visible;overflow:visible;width:100vw !important}.advertory-fullscreen-scroll-wrapper.in-screen>div>iframe{display:block !important}.advertory-fullscreen-scroll-wrapper.in-screen:before{content:"";width:100vw;height:150dvh;position:relative !important;display:block;transform:translateX(-50%);overflow:visible;z-index:1;left:50%;top:-150dvh;padding:0 !important}.advertory-fullscreen-scroll-wrapper.in-screen:after{content:"";width:100vw;height:150dvh;position:relative !important;display:block;transform:translateX(-50%);overflow:visible;z-index:1;left:50%;top:-50dvh}.advertory-fullscreen-scroll{position:fixed;top:var(--advertory-fullscreen-scroll-top, 0px);left:var(--advertory-fullscreen-scroll-left, 0px);width:var(--advertory-fullscreen-scroll-vw, 100vw);height:var(--advertory-fullscreen-scroll-vh, 100vh);overflow:hidden}.advertory-fullscreen-scroll::before{content:attr(data-ad-label);box-sizing:border-box;position:fixed;top:0}html[data-app-platform=iOS] .advertory-fullscreen-scroll::before{top:calc(env(safe-area-inset-top) - var(--advertory-ios-safe-area-top-fix, 0px)) !important}.advertory-fullscreen-scroll::before{left:calc(50vw - 628px);width:calc(100% - 36px);max-width:1250px;text-align:left;background-color:hsla(0,0%,100%,.6);color:#212121;font-family:Ester Blenda,Arial,sans-serif;font-size:11px;font-weight:400;font-style:normal;text-transform:lowercase;line-height:1;margin:16px 2px;padding:10px;z-index:1;visibility:inherit !important}@media screen and (max-width: 1290px){.advertory-fullscreen-scroll::before{left:16px}}.advertory-fullscreen-scroll[data-move-cogwheel-to-the-left=true]>div[role=button]{left:calc(50vw - 623px);right:unset}@media screen and (max-width: 1290px){.advertory-fullscreen-scroll[data-move-cogwheel-to-the-left=true]>div[role=button]{left:22px;right:unset}}.advertory-fullscreen-scroll[data-move-cogwheel-to-the-left=true]::before{padding-left:32px}.advertory-fullscreen-scroll>div[id*=utif]{display:block;width:var(--advertory-fullscreen-scroll-vw, 100vw) !important;height:var(--advertory-fullscreen-scroll-vh, 100vh) !important}html[data-app-platform=iOS] .advertory-fullscreen-scroll>div[id*=utif]{height:calc(var(--advertory-fullscreen-scroll-vh, 100vh) - env(safe-area-inset-top) + var(--advertory-ios-safe-area-top-fix, 0px) - env(safe-area-inset-bottom)) !important}.advertory-fullscreen-scroll>div[id*=utif]{overflow:hidden}.advertory-fullscreen-scroll>div[id*=utif]>iframe{display:block;height:inherit !important;width:inherit !important}.advertory-fullscreen-scroll>div[role=button]{z-index:1;opacity:1;background:rgba(0,0,0,0) !important;left:unset;position:fixed !important;right:calc(50vw - 623px);top:19px !important;width:26px !important;height:26px !important}html[data-app-platform=iOS] .advertory-fullscreen-scroll>div[role=button]{top:calc(env(safe-area-inset-top) - var(--advertory-ios-safe-area-top-fix) + 19px) !important}@media screen and (max-width: 1290px){.advertory-fullscreen-scroll>div[role=button]{right:22px}}');const tt={no:{adText:"ANNONSE",adFrom:"ANNONSE FRA",adContent:"ANNONSØRINNHOLD",adContentFrom:"ANNONSØRINNHOLD FRA"},se:{adText:"ANNONS",adFrom:"ANNONS FRÅN",adContent:"EXTERN LÄNK",adContentFrom:"EXTERN LÄNK FRÅN"}};let nt=null;const rt=(e,t)=>{let n=e;return n=(e=>{const t=document.createElement("script");return t.textContent="\n {\n const frame = window.frameElement;\n \n if (frame) {\n frame.contentWindow.document.body.onload = onLoad;\n } else {\n document.body.onload = onLoad;\n }\n \n function onLoad() {\n window.addEventListener('message', function(event) {\n if (event.data === 'advertory:showFullscreen-'+document.body.id) {\n document.body.style.display= \"block\";\n } else if (event.data === 'advertory:hideFullscreen-'+document.body.id) {\n document.body.style.display= \"none\";\n }\n });\n }\n }\n ",e+t.outerHTML})(e),n=(e=>{const t=document.createElement("script");return t.textContent=`(${Ue})()`,e+t.outerHTML})(n),n=(e=>{if((e=>e.includes("google"))(e))return e;const t=document.createElement("div");t.innerHTML=e;const n=t.querySelector("img");return n?(n.style.width="100%",n.style.height="100%",n.style.objectFit="cover",n.style.position="fixed",t.innerHTML):e})(n),n=(e=>{if(Fe(e))return e;const t=document.createElement("style");return t.textContent="\n .GoogleActiveViewClass, .GoogleActiveViewElement {\n transform: translate(calc(-50% + 50vw), 0);\n width: 100vw !important;\n height: 100vh !important;\n }\n .GoogleActiveViewClass img, .GoogleActiveViewElement img {\n width: 100vw;\n height: 100vh;\n object-fit: cover;\n }\n .GoogleActiveViewClass iframe {\n width: 100vw !important;\n height: 100vh !important;\n }\n ",e+t.outerHTML})(n),(e=>e.includes("adform"))(n)&&(n=(e=>{const t=document.createElement("script");t.textContent='\n var frame = window.frameElement;\n if (frame) {\n frame.style.removeProperty("width");\n frame.style.removeProperty("height");\n frame.contentWindow.document.body.onload = onLoad;\n } else {\n document.body.onload = onLoad;\n }\n \n function onLoad() {\n var iframe = document.querySelector("adfm-ad iframe");\n if (iframe) {\n var image = iframe.contentWindow.document.getElementById("image");\n if (!image) return;\n image.style.backgroundSize = "cover";\n } else {\n var iframe = document.querySelector(".adform-adbox iframe");\n if (iframe) {\n var style = document.createElement("style");\n style.textContent = "#banner {width: 100% !important; height: 100% !important;} #banner img {object-fit: cover;}";\n iframe.contentDocument.body.append(style);\n iframe.style = "width: 100vw; height: 100vh;";\n } else {\n var observer = new MutationObserver(function(mutations, obs) {\n for (var mutation of mutations) {\n var iframe = mutation.addedNodes[0];\n if (iframe && iframe.nodeName === "IFRAME") {\n iframe.style = "width: 100vw; height: 100vh;";\n iframe.dataset.contents += "<style>#banner {width: 100% !important; height: 100% !important;} #banner img {object-fit: cover;}</style>";\n obs.disconnect();\n }\n }\n });\n observer.observe(document.body, { childList: true, subtree: true });\n }\n }\n }\n ';const n=document.createElement("style");return n.textContent="\n html, body, adfm-ad, #sf_align, .adform-adbox, .adform-adbox img {\n width: 100% !important;\n height: 100% !important;\n object-fit: cover;\n max-width: 100vw;\n }\n ",e+n.outerHTML+t.outerHTML})(n)),(e=>e.includes("529299503"))(n)&&(n=He(n)),(e=>e.includes("de17a"))(n)&&(n=(e=>Fe(e)?e:e.replace("<iframe ","<iframe onload=\"\n var f = document.querySelector('iframe');\n if (!f) return;\n var s = f.style;\n s.transform = 'scale(' + (window.innerHeight / Number(f.height)).toFixed(2) + ')';\n s.right = parseInt((Number(f.width) - window.innerWidth) / 2) + 'px';\n s.bottom = parseInt((Number(f.height) - window.innerHeight) / 2) + 'px';\n s.position = 'relative';\n \" "))(n)),Fe(n)&&(n=(e=>{let t=e.replace("<html>",'<html style="height: 100%;">');return t=t.replace("</iframe>","</iframe><style>#sf_align {height: 100%;} #sf_align iframe {height: 100vh;}</style>"),t=t.replace('<body style="','<body style="height: 100%; '),t})(n)),(e=>e.includes("kreateam.io"))(n)&&(n=(e=>{let t=e.replace("<html>",'<html style="height: 100%;">');return t=t.replace("</div>","</div><style>#sf_align {height: 100%;} #sf_align iframe {height: 100vh;}</style>"),t=t.replace('<body style="','<body style="height: 100%; '),t})(n)),Re(t)&&(n=(e=>{const t=document.createElement("script");t.textContent='var frame = window.frameElement;\n if (frame) {\n frame.style.width = "100vw";\n frame.style.height = "100vh";\n }';const n=document.createElement("div");return n.innerHTML=e,n.appendChild(t),n.innerHTML})(n)),n},it=()=>{nt=null;const e=window.visualViewport,t=e?e.height:window.innerHeight,n=e?e.width:window.innerWidth,r=e?e.offsetLeft:0,i=document.documentElement;i.style.setProperty("--advertory-fullscreen-scroll-vh",`${t}px`),i.style.setProperty("--advertory-fullscreen-scroll-vw",`${n}px`),i.style.setProperty("--advertory-fullscreen-scroll-left",`${r}px`)},ot=()=>{nt||(nt=window.requestAnimationFrame(it))},at=(e,t)=>{var n,r,i,o;const{country:a}=l.get(),{targetId:s}=e;document.documentElement.style.setProperty("--advertory-ios-safe-area-top-fix",null!==(n=null==t?void 0:t.iosSafeAreaTopFix)&&void 0!==n?n:"0px"),(e=>{const{articlesContainerWidth:t=1302,backgroundColor:n="#fff",foregroundColor:r="#fff",margin:i="16px 0",beforeContentValue:o=""}=e,a=t/2,s=document.createElement("style");s.innerHTML=`\n :root {\n --background: linear-gradient(\n to right,\n ${n} 0px,\n ${n} calc(50% - ${a}px),\n ${r} calc(50% - ${a}px),\n ${r} calc(50% + ${a}px),\n ${n} calc(50% + ${a}px),\n ${n} 100%\n ) !important;\n \n --advertory-fullscreen-scroll-wrapper-margin: ${i};\n }\n \n .advertory-fullscreen-scroll-wrapper {\n ${o&&"clip-path: polygon(0 -16px, 100vw -16px, 100vw 100dvh, 0 100dvh);\n -webkit-clip-path: polygon(0 -16px, 100vw -16px, 100vw 100dvh, 0 100dvh);"}\n }\n\n .advertory-fullscreen-scroll-wrapper:before, .advertory-fullscreen-scroll-wrapper:after {\n background: var(--background);\n content: '${o}' !important;\n }`,s.id="ad-fullscreen-scroll-wrapper-style",document.head.appendChild(s)})(null!==(r=null==t?void 0:t.overlayStyles)&&void 0!==r?r:{});const d=document.getElementById(s),c=null==d?void 0:d.parentElement;if(!d||!c)return;((e,t)=>{const n=(null==t?void 0:t.fadingHeaderEnabled)||!1,r=new IntersectionObserver(e=>Ke(e,n),{}),i=Ge(e);r.observe(e),n&&(We[i]=Xe(e,t))})(c,t),d.className="advertory-fullscreen-scroll";const u=Ce(e,ne)?"absolute":"fixed";d.style.position=u,c.className="advertory-fullscreen-scroll-wrapper",c.dataset.showTagSubscribeId=s,d.setAttribute("data-ad-label",tt[a].adText),(null==t?void 0:t.moveCogwheelToTheLeft)&&(d.dataset.moveCogwheelToTheLeft="true"),ot(),window.addEventListener("resize",ot),null===(i=window.visualViewport)||void 0===i||i.addEventListener("resize",ot),null===(o=window.visualViewport)||void 0===o||o.addEventListener("scroll",ot)},st=({targetId:e})=>{const t=(e=>{const{requests:t}=window.apntag,n=Re(e)?1:0;return null==t?void 0:t.tags[e].adResponse.ads[n].rtb.banner.content})(e);if(!t)return;((e,t)=>{const{requests:n}=window.apntag,r=Re(e)?1:0;n&&(n.tags[e].adResponse.ads[r].rtb.banner.content=t)})(e,rt(t,e))},dt=()=>e(void 0,void 0,void 0,function*(){const{prebid:e,tcf:t,country:n,isMobileApp:r,fullscreenScroll:i}=l.get();if(!(null==e?void 0:e.enabled))return;const{initNativeAd:o}=l.getHandlers(),{getConsentAsync:a}=I(t,r,n),s=yield a(),d=(()=>{let e=!1,t=[];const n={relevantCb:{timeout:1e3},auctionCb:{timeout:2e3}};return{getCancel:()=>e,setCancel:t=>{e=t},events:n,failsafeOnTimeout:r=>{const i=_e(),{prebid:{relevantCbTimeout:o}={}}=l.get(),a="relevantCb"===r&&o?o:n[r].timeout,s=setTimeout(()=>{!n[r].done&&!e&&(console.warn(`Doing failsafe loadTags() call after waiting too long for '${r}'`),e=!0,i.loadTags&&i.loadTags())},a);t.push(s)},cleanup:()=>{t.forEach(e=>clearTimeout(e)),t=[],e=!1,n.relevantCb.done=!1,n.auctionCb.done=!1}}})(),c=_e(),v=(()=>{const{requests:{user:e={userIds:[]},keywords:t={}}={}}=_e();return{user:e,keywords:t}})();d.failsafeOnTimeout("relevantCb");const{user:{externalUid:p=""}={},keywords:g}=v;(()=>{const e=De();return e.cmd||(e.cmd=[]),e.cmd})().push(()=>{if(d.getCancel()||!c.loadTags)return u("core loadTags() call was cancelled",{cancel:d.getCancel(),apnTagLoadTags:!c.loadTags,condition:"or"}),void d.cleanup();const t=De();d.events.relevantCb.done=!0,d.failsafeOnTimeout("auctionCb");const r=s?{gdpr:{cmpApi:"iab",timeout:8e3}}:{cmpApi:"none"};u("prebid consentManagement",r),t.addPrebidConfig(Object.assign(Object.assign({consentManagement:r,enableSendAllBids:!1},J(n)),Me(g,p))),u("core add prebid config",Object.assign(Object.assign({consentManagement:r,enableSendAllBids:!1},J(n)),Me(g,p))),t.loadPrebid({configId:e.id,manageAdserver:!1,collapseEmptyDivs:!1,collapseBeforeAdFetch:!1,noGpt:!0,noSlotReload:!0,loadUnknownSlots:!0,apntagCalls:{showTag:()=>{},loadTags:e=>{d.getCancel()||(d.events.auctionCb.done=!0,c.loadTags(e)),d.cleanup()}},customNativeRender:e=>{lt(e,o)},directRenderFn:e=>{const{settings:t,renderFn:n}=e,{bid:r,adDiv:o}=t||{};if(!o)return;const a=n(t),s=Object.assign(Object.assign({},r),{targetId:o.id,banner:!0});ve(s)&&(at(s,i),(e=>{const t=()=>{const t=e.contentDocument;if(!(null==t?void 0:t.body))return;const n=()=>{const e=t.querySelector("iframe");if(!e)return!1;const n=()=>{var t;const n=null===(t=e.contentDocument)||void 0===t?void 0:t.querySelector(".adn-ttpa-container");n&&(n.style.setProperty("bottom","10px","important"),n.style.setProperty("top","unset","important"))};return e.addEventListener("load",n),n(),!0};if(n())return;const r=new MutationObserver(()=>{n()&&r.disconnect()});r.observe(t.body,{childList:!0,subtree:!0})};e.addEventListener("load",t),t()})(a))}}),u("core load prebid",{configId:e.id,manageAdserver:!1,collapseEmptyDivs:!1,collapseBeforeAdFetch:!1,noGpt:!0,noSlotReload:!0,loadUnknownSlots:!0,apntagCalls:{showTag:()=>{},loadTags:e=>{d.getCancel()||(d.events.auctionCb.done=!0,c.loadTags(e))}},customNativeRender:e=>{lt(e,o)},directRenderFn:()=>{}})})}),lt=(e,t)=>{var n;const{divId:r,native:i,bid:o}=e,a=document.querySelectorAll(`[id^=${r}]`)[0],s=`RY-${a.id}`;((e,t)=>{e.childNodes.forEach(e=>e.style.cssText="position: absolute; z-index: -1;");const n=document.createElement("div");n.setAttribute("id",t),e.appendChild(n)})(a,s);const d=null===(n=a.getElementsByTagName("iframe")[0])||void 0===n?void 0:n.contentWindow;t({native:i,targetId:s},l.get()),null==d||d.postMessage(JSON.stringify({message:"Prebid Response",ad:"\x3c!-- nothing --\x3e",adId:o.adId}),"*")},ct="0123456789abcdefghijklmnopqrstuvwxyz",ut=()=>Promise.resolve(),vt=()=>{},pt=e=>{window.apntag.anq.push(e)},gt=new Promise(e=>{"undefined"!=typeof document&&document.prerendering?document.addEventListener("prerenderingchange",()=>e()):e()}),ht=new Promise(e=>{if("undefined"==typeof document||!document.hidden)return void e();const t=()=>{document.hidden||(document.removeEventListener("visibilitychange",t),e())};document.addEventListener("visibilitychange",t,{once:!0})}),mt=e=>{const t=e.split("-"),n=t[t.length-1];return 6===n.length&&n.match(/^[a-zA-Z0-9]+$/)?t.slice(0,-1).join("-"):e};let yt="";const ft=new Map,wt="advertory-wallpaper-background",bt=()=>{const e=document.querySelector(`.${wt}`);e&&e.remove()},Et=/^wallpaper:url:(http[s]?:\/\/)?[^\s(["<,>]*\.[^\s[",><]*/,It=e=>{if(window.location.href.includes("collapse_ad=0"))return;const t=document.querySelector(`div[id^="${e}"]`);if(!t)return;const n=t.parentElement;n&&(t.style.setProperty("width","0","important"),t.style.setProperty("height","0","important"),t.style.setProperty("display","none","important"),n.style.setProperty("display","none","important"),e.includes("wallpaper")&&bt())},At=e=>{const t=document.querySelector(`div[id^="${e}"]`);if(!t)return;const n=t.parentElement;n&&(t.style.removeProperty("width"),t.style.removeProperty("height"),t.style.removeProperty("display"),n.style.removeProperty("display"))},kt=e=>{var t;const n=null===(t=document.querySelector(`#${e}`))||void 0===t?void 0:t.parentElement,r=(null==n?void 0:n.offsetHeight)||0;n&&(n.style.minHeight=`${r}px`)},Tt=e=>{const t=e.parentElement;if(!e||!t)return;const{container:n,wrapper:r}=(e=>{const t=qe.getData("initialClassNames")[e.id];return{wrapper:(null==t?void 0:t.wrapper)?t.wrapper.join(" "):"",container:(null==t?void 0:t.container)?t.container.join(" "):""}})(e);e.className=n,t.className=r},Ct=()=>{bt();document.querySelectorAll('[data-advertory-ad-rendered="true"]').forEach(e=>{It(e.id),Tt(e),(e=>{const t=document.querySelector(`#${e}`),n=null==t?void 0:t.getAttribute("data-probable-height"),r=null==t?void 0:t.getAttribute("data-probable-width");n&&r&&(null==t||t.style.setProperty("min-height",n+"px"),null==t||t.style.setProperty("min-probable-width",r+"px"))})(e.id),e.innerHTML="",e.id=mt(e.id)}),pt(()=>window.apntag.clearRequest())},St="noGroupedPlacements",Pt=e=>{const t=e.replace(/[0-9]/g,"");return"_"===t.slice(-1)?t.substring(0,t.length-1):t},Ot=e=>{if(!(null==e?void 0:e.minViewWidth))return!0;return window.innerWidth>=e.minViewWidth},xt=e=>{var t;if(!(null===(t=null===window||void 0===window?void 0:window.advertory)||void 0===t?void 0:t.initialized))return[];const{placements:n,queryConfig:r,deviceType:i}=l.get(),o=n[i].filter(Ot)||[],a=e?document.querySelector(e):document;if(!a)return[];const s=o.reduce((e,t)=>{const n=Pt(t.id);return!n||e.includes(n)||e.push(n),e},[]).flatMap(e=>{const t=new RegExp(`^${e}(_(\\d+))?$`),n=o.filter(({id:e})=>e.match(t)),s=(null==r?void 0:r.queryByDataDevice)?`div[id^="${e}"][data-device=${i}], div[id^="${e}"][data-device=all]`:`div[id^="${e}"]:not([data-disabled="true"])`,d=a.querySelectorAll(s),c=Array.from(d).filter(({id:e})=>e.match(t)).map((e,t)=>{var r;const i=Lt(e,t,n),o=i.finnBlink&&!i.finnBlink.renderOnlyWithAdBlock,a=o&&(null===(r=i.finnBlink)||void 0===r?void 0:r.loadOnlyFinnBlink),s=`${e.id}-${((e=6)=>{if(e<=0)return"";let t="";for(let n=0;n<e;n++)t+=ct[Math.floor(36*Math.random())];return t})(6)}`;return e.id=s,e.setAttribute("data-advertory-ad-rendered","true"),o&&e.setAttribute("data-is-finn-blink-placement","true"),a&&e.setAttribute("data-is-finn-blink-only-placement","true"),(e=>{var t;const n=e.id;n&&qe.setData("initialClassNames",{[n]:{wrapper:null===(t=e.parentElement)||void 0===t?void 0:t.className.split(" "),container:e.className.split(" ")}})})(e),Object.assign(Object.assign({},i),{id:s})});return(e=>{const{keywordsConfig:t}=l.get();return(null==t?void 0:t.includeCountingKeywordInTags)?(yt!==window.location.pathname&&(ft.clear(),yt=window.location.pathname),e.map(e=>{var t;const n=e.invCode.replace(/_\d+$/,""),r=null!==(t=ft.get(n))&&void 0!==t?t:0;return e.keywords=Object.assign({},e.keywords),e.keywords[`${S()}-count`]=r,ft.set(n,r+1),e})):e})(c)});return(e=>{const t=Array.from(document.querySelectorAll('div[class^="advertory"]'));return e.sort((e,n)=>t.findIndex(t=>t.id===e.id)-t.findIndex(e=>e.id===n.id))})(s)},Lt=(e,t,n)=>{const r=n[t],i=n[n.length-1],o=n.filter(({id:t})=>t===e.id)[0];return(null==e?void 0:e.id)===(null==r?void 0:r.id)?r:(null==e?void 0:e.id)===(null==i?void 0:i.id)?i:o||i},jt=e=>{const{queryConfig:{placementBatches:t}={},deviceType:n}=l.get(),r=(null==t?void 0:t[n])||{},i=Object.values(r).flat(),o=(e=>{const t={};return e.forEach(e=>{const n=mt(e.id);e.isBackfill&&(t[n]=[e])}),t})(e),a=((e,t)=>{const n={};for(const[r,i]of Object.entries(t))n[r]=e.filter(e=>i.includes(mt(e.id)));return n})(e,r),s=Object.keys(o),d=((e,t)=>e.filter(e=>!t.has(mt(e.id))))(e,new Set([...s,...i]));return Object.assign(Object.assign(Object.assign({},a),o),{[St]:d})},$t=(e,t,n)=>{const r=document.getElementById(`div_utif_${e}`);if(!r)return;const{apntag:i}=window,[o,a]=t;if(!r.dataset.lockedsize&&a&&o)r.style.width=`${o}px`,r.style.height=`${a}px`,n&&(i.resizeAd(r.id,[o,a]),r.dataset.lockedsize="true",r.dataset.lockedwidth=o.toString(),r.dataset.lockedheight=a.toString());else if(null==r?void 0:r.dataset.lockedsize){const{lockedwidth:e,lockedheight:t}=r.dataset;e&&t&&i.resizeAd(r.id,[e,t])}},Nt=["netboard","board"];class qt{constructor(e,t){this.identityFacade=e,this.tracker=t}buildUrl(e,t){var n,r;const{editionName:i}=e,o=(()=>{const e=window.location.href;return new URL(e).searchParams.get("dre_override_inv_code")||""})(),a=JSON.stringify(null!==(r=null===(n=window.advertory)||void 0===n?void 0:n.renderedDrEditionAds)&&void 0!==r?r:[]),s=new URL("https://dr-edition-teaser-server.inventory.schibsted.io/editions"),{envId:d,spid:l}=t;return s.searchParams.append("editionName",i),o&&s.searchParams.append("urlData",o),a&&s.searchParams.append("excludedItems",a),l&&s.searchParams.append("spid",l),d&&s.searchParams.append("envid",d),s.toString()}fetchData(t){return e(this,void 0,void 0,function*(){var e,n,r;const i=yield this.identityFacade.getIdentityUser(),o=null!==(r=yield null===(n=null===(e=this.tracker)||void 0===e?void 0:e.getEnvironmentId)||void 0===n?void 0:n.call(e))&&void 0!==r?r:"",a=(null==i?void 0:i.userId)?String(i.userId):"",s=this.buildUrl(t,{envId:o,spid:a});try{u("Starting fetching DrEdition ad from URL:",s);const e={method:"GET"},t=yield N.get(s,e);return u("Fetch operation completed successfully."),t}catch(e){u("Error during fetch operation:",e)}return null})}}let _t=class{getDrEditionUTMParams(e,t){var n;const{title:r="",clientName:i,creativeId:o}=null!==(n=null==e?void 0:e.pulseData)&&void 0!==n?n:{},{editionName:a}=t,s=r.replace(/<[^>]*>/g,"");return Object.assign({utm_source:"vgfront",utm_content:a,utm_campaign:i,utm_medium:s},o&&{utm_id:`df-${o}`})}getUrlSearchParams(e,t,n){if(!e)return"";const r=this.getDrEditionUTMParams(t,n),i=new URLSearchParams(decodeURIComponent(e.search)),o=new URLSearchParams(e.search);return Object.entries(r).forEach(([e,t])=>{i.has(e)||o.set(e,null!=t?t:"")}),o.toString().replace(/\+/g,"%20")}getUrlWithParams(e,t){var n;const r=null===(n=null==e?void 0:e.pulseData)||void 0===n?void 0:n.url;if(!r)return"";const i=this.getDrEditionUTMParams(e,t),o=new URL(r);return Object.entries(i).forEach(([e,t])=>{o.searchParams.has(e)||o.searchParams.set(e,null!=t?t:"")}),o.toString()}handleVideo(t,n){return e(this,void 0,void 0,function*(){const{id:e,autoplay:r,mute:i,videoLoop:o,vendor:a}=n.videoConfiguration;t.classList.add("vgtv-video-container"),Object.assign(t.dataset,{vgtvVideoId:e,vgtvVendor:a,vgtvAutoplay:r,vgtvMuted:i,vgtvLoop:!!o,vgtvNa:!0,vgtvRecommended:!1,vgtvPulseProvider:"vg",vgtvPulseProductTag:"partnerstudio"})})}getPulseObjectId(){return"sdrn:vg:content:partnerstudio:element:partnerstudio:stats"}getPulsePageId(){return"sdrn:vg:frontpage:front"}getTags(e){var t;let n;if(n=e instanceof HTMLAnchorElement?e.href:null===(t=null==e?void 0:e.querySelector("a"))||void 0===t?void 0:t.href,!n)return[];const{host:r,pathname:i}=new URL(n);if(!r.includes("www.vg.no")&&!i.includes("annonsorinnhold"))return[n];const o=i.split("/");return o.length?[...o.filter(Boolean).slice(1).map(e=>e),n]:[n]}};const Dt=e=>{const t=e.parentElement;t?t.classList.remove("dr-edition-lock-height"):u("Dr. Edition container does not have a parent element, cannot remove height lock.")};class Mt{constructor(e,t,n,r){this.drEditionService=e,this.rendererManager=t,this.videoManager=n,this.pulseManager=r,this.drEditionAds=[]}fetchAndRenderAd(t,n){return e(this,void 0,void 0,function*(){var e,r;const{drEditionConfig:{containerSelector:i},renderAsBackfill:o=!1}=n,a=t.querySelector(i);if(!a)return void u(`Container with selector "${i}" not found.`);const s=yield this.drEditionService.fetchData(n);return(null==s?void 0:s.itemId)||o?!(null==s?void 0:s.itemId)&&o?(u("No Dr. Edition ads available to render. Collapsing whole placement."),It(t.id),void Dt(a)):((null==s?void 0:s.itemId)&&o&&(u("Dr. Edition ad available to render as a Xandr backfill."),At(t.id)),void(s?(s.css&&((e,t)=>{const n=document.createElement("link");n.rel="preload",n.href=e,n.as=t,document.head.appendChild(n)})(s.css,"style"),yield this.rendererManager.render(a,s,n),yield null===(e=this.videoManager)||void 0===e?void 0:e.handle(s,n),Dt(a),this.drEditionAds.push(s),window.advertory=window.advertory||{},window.advertory.renderedDrEditionAds=window.advertory.renderedDrEditionAds||[],window.advertory.renderedDrEditionAds.push(s.itemId),this.observeAdView(t,s,n),null===(r=t.querySelector("a"))||void 0===r||r.addEventListener("pointerup",()=>null)):Dt(a))):(u("No Dr. Edition ads available to render. Hiding Dr. Edition and rendering Xandr backfill."),this.hideDrEdition(a),this.showBackfill(t),void Dt(a))})}observeAdView(e,t,n){this.observeCarousel(e,t,n)||((e,t,n={threshold:.5})=>{new IntersectionObserver(([e],n)=>{e.isIntersecting&&(t(),n.disconnect())},n).observe(e)})(e,()=>this.pulseManager.trackContentView(e,t,n),{threshold:.5})}showBackfill(e){var t;const n=e.querySelector(".fallback");if(!n)return;n.style.display="block";const r=null!==(t=n.dataset.fallbackTargetId)&&void 0!==t?t:"";At(r)}hideDrEdition(e){e.style.display="none"}observeCarousel(e,t,n){const r=e.querySelector(".dr-edition-slider");if(!r)return!1;let i=null;const o=new IntersectionObserver(e=>{e.forEach(e=>{e.isIntersecting&&e.intersectionRatio>=.9&&(i&&clearTimeout(i),i=setTimeout(()=>{e.target.onclick=()=>this.pulseManager.trackContentClick(e.target,t,n),this.pulseManager.trackContentView(e.target,t,n)},500)),[...r.children].forEach(e=>{o.observe(e)})})},{threshold:[.9]});return[...r.children].forEach(e=>{o.observe(e)}),!0}}class Bt{constructor(e,t){this.newsroomStrategy=e,this.pulseManager=t}render(t,n,r){return e(this,void 0,void 0,function*(){if(!(null==n?void 0:n.itemId))return;const{getConsentAsync:e}=I(r.tcf,r.isMobileApp,r.country),i=yield e(),o=r.device===Y.MOBILE?n.mobileHTML:n.desktopHTML;const a=i?o:o.replace(/<img [^>]*class="tracking-pixel"[^>]*>/g,"");t.innerHTML=a,t.querySelectorAll("a").forEach(e=>{var t,i,o;e.search=null!==(o=null===(i=(t=this.newsroomStrategy).getUrlSearchParams)||void 0===i?void 0:i.call(t,e,n,r))&&void 0!==o?o:"",e.onclick=()=>this.pulseManager.trackContentClick(e,n,r)})})}}class Ft{constructor(e){this.strategy=e}handle(t,n){return e(this,void 0,void 0,function*(){const{videoConfiguration:{id:e,preview:r}={}}=t;(e||r)&&(yield this.importScript(n),yield this.createVideoElement(t,n))})}importScript(t){return e(this,void 0,void 0,function*(){const e=t.drEditionConfig.videoScriptUrl,n=document.querySelector(`script[src="${e}"]`);if(e&&!window.autoplayQueue&&!n)try{yield Be(e)}catch(e){u("Error! Failed to prepare SVP player script for Dr. Edition!",e)}})}createVideoElement(t,n){return e(this,void 0,void 0,function*(){const e=document.createElement("div"),{node:r}=t.videoConfiguration,i=[...document.querySelectorAll(`#${r}`)||[]].find(e=>0===e.children.length);if(this.handlePreviewVideo(t,n))return;this.strategy.handleVideo(e,t),null==i||i.appendChild(e),window.autoplayQueue=window.autoplayQueue||[],window.autoplayQueue.push(e=>{e.parse()});const o=null==i?void 0:i.parentNode;if(!o)return;const a=o.closest("a");o.addEventListener("click",e=>{const t=e.target.closest("a");a!==t&&t||(e.stopPropagation(),e.preventDefault())})})}handlePreviewVideo(e,t){var n,r,i;const{preview:{url:o,thumbnail:a}}=null!==(n=e.videoConfiguration)&&void 0!==n?n:{};if(!o)return!1;const s=document.querySelector(".dr-edition-preview .preview-video");return!!s&&(s.setAttribute("src",o),s.setAttribute("playsinline",""),!(!s||!a)&&(null===(i=(r=t.drEditionConfig).addPreviewVideo)||void 0===i||i.call(r,s),!0))}}let Rt=class{constructor(e,t){this.pulse=e,this.newsroomStrategy=t}getEventInput(e,t,n,r){return{}}mapPageType(e){return{front:"Frontpage",article:"Article",section:"Article",collection:"Article",other:"Article"}[e||"front"]||"Frontpage"}getArticleId(){return location.pathname.split("/").slice(-2,-1).pop()||""}getTeaserElementText(e,t){if(!e)return"";const n=e.querySelector({title:".dr-edition-title",subtitle:".dr-edition-subtitle",image:"img.teaser-main-image"}[t]);if(!n)return"";if("image"===t)return n.src||"";const r=null==n?void 0:n.textContent;return r?r.trim():""}getEventTarget(e,t){const{itemId:n,pulseData:{url:r}={}}=t,i=this.getTeaserElementText(e,"title");return{id:n,name:this.normalizePlacementTitle(null!=i?i:""),type:"Page",url:r}}normalizePlacementTitle(e){return e.replace(/<[^>]+>/gi,"").replace(/[^a-z0-9æøå\s_-]/gi,"")}trackContentView(t,n,r){return e(this,void 0,void 0,function*(){var e,i,o,a,s,d,l,c;if(!this.pulse)return;const u=this.getEventInput(t,n,r,"view");(null===(e=this.pulse)||void 0===e?void 0:e.trackLegacyViewUIElement)?null===(o=null===(i=this.pulse)||void 0===i?void 0:i.trackLegacyViewUIElement)||void 0===o||o.call(i,u):(null===(a=this.pulse)||void 0===a?void 0:a.trackViewUIElement)?null===(d=null===(s=this.pulse)||void 0===s?void 0:s.trackViewUIElement)||void 0===d||d.call(s,u):null===(c=null===(l=this.pulse)||void 0===l?void 0:l.trackElementView)||void 0===c||c.call(l,u)})}trackContentClick(t,n,r){return e(this,void 0,void 0,function*(){var e,i,o,a,s,d;if(!this.pulse)return;const l=this.getEventInput(t,n,r,"click");this.pulse.trackLegacyClickUIElement?null===(i=(e=this.pulse).trackLegacyClickUIElement)||void 0===i||i.call(e,l):this.pulse.trackClickUIElement?null===(a=(o=this.pulse).trackClickUIElement)||void 0===a||a.call(o,l):null===(d=(s=this.pulse).trackElementClick)||void 0===d||d.call(s,l)})}};class Vt extends Rt{constructor(e,t,n){super(e,t),this.pulse=e,this.newsroomStrategy=t,this.pageType=n}getEventBaseData(e,t,n){const{pulseData:{title:r,clientName:i="",creativeId:o}={}}=t,{columnName:a,primaryPosition:s}=n;return{"@type":"UIElement",elementType:"Teaser",layout:{elementSize:"large",imageUrl:"",name:"large"},name:r,placement:{columnName:a,primaryPosition:s},"spt:custom":{is_sponsored:!0,sponsor:i,"spt:creativeId":o},url:location.origin}}getEventInput(e,t,n){return{object:this.getEventBaseData(e,t,n),target:this.getEventTarget(e,t)}}}let Ut=class extends Rt{constructor(e,t,n){super(e,t),this.pulse=e,this.newsroomStrategy=t,this.pageType=n}getEventBaseData(e,t,n){var r,i,o,a,s,d;const{itemId:l,pulseData:{clientName:c,creativeId:u}={}}=t,v=n.editionName,p=this.mapPageType(this.pageType),g=null===(r=this.newsroomStrategy)||void 0===r?void 0:r.getPulsePageId(this.pageType||"front",this.getArticleId());return{"@id":null!==(a=null===(o=null===(i=this.newsroomStrategy)||void 0===i?void 0:i.getPulseObjectId)||void 0===o?void 0:o.call(i))&&void 0!==a?a:v,"@type":"UIElement",position:v,elementType:"Article",custom:{customer:c,creativeId:null!=u?u:l},page:{"@id":null!=g?g:v,"@type":p,url:location.origin},tags:null===(d=null===(s=this.newsroomStrategy)||void 0===s?void 0:s.getTags)||void 0===d?void 0:d.call(s,e)}}getEventInput(e,t,n,r){return{object:this.getEventBaseData(e,t,n),partnerstudio:this.getEventPartnerstudioData(e,t,n,r),target:this.getEventTarget(e,t),provider:this.getProviderData()}}getEventPartnerstudioData(e,t,n,r){var i,o,a,s;const{pulseData:{algorithm:d="sov",clientName:l,creativeId:c,editionId:u,itemId:v,url:p,probability:g}={}}=t,h=Math.floor(Date.now()/1e3),m=this.getTeaserElementText(e,"title"),y=this.getTeaserElementText(e,"subtitle"),f=this.getTeaserElementText(e,"image"),w=null!==(s=null!==(a=null===(o=null===(i=this.newsroomStrategy)||void 0===i?void 0:i.getUrlWithParams)||void 0===o?void 0:o.call(i,t,n))&&void 0!==a?a:p)&&void 0!==s?s:"";return{algorithm:d,clientName:l,probability:g,creativeId:c,device:n.device,editionId:u,itemId:v,link:w,placement:n.editionName,subtitle:y,time:h,title:m,type:r,imageUrl:f,frontId:86,tracking_type:"ad",xandrAdLoaded:!1}}getProviderData(){return{productTag:"partnerstudio"}}};const Ht="front",zt=t=>e(void 0,void 0,void 0,function*(){var e,n;return(null===(e=null===window||void 0===window?void 0:window.SVP)||void 0===e?void 0:e.Player)?new window.SVP.Player(t):((()=>{const e="svp-player-sdk",t=document.querySelector(e),n=Array.from(document.querySelectorAll('script[src^="https://cdn.stream.schibsted.media/player"]'));if(t||n.length>0)return;const r=document.createElement("script");r.id=e,r.src="https://cdn.stream.schibsted.media/player/3.78.1/player.min.js",r.async=!0;try{r.src=r.src.replace("player.min","player.next.min")}catch(e){console.error("Failed to set player.next.min source:",e)}document.head.insertBefore(r,document.head.firstChild)})(),(null===(n=window.SVP)||void 0===n?void 0:n.isLoaded)?new window.SVP.Player(t):yield new Promise(e=>{window.addEventListener("onSvpPlayerReady",()=>e(new window.SVP.Player(t)))}))}),Wt={ContentMutePlugin:e=>{window.SVP.Player.Plugins.register({getName:()=>"ContentMutePlugin",initialize(){},setup(){const t=this.player.config.get("mute");this.container=e||this.player.getContainer(),this.muted=t,t&&this.listenToOnce(this.player,"ready",this.renderButtonElement,this)},getButtonElement(){const e=document.createElement("button");e.className="player-plugin-content-mute";const t=document.createElement("span");return t.className="volume-button-icon",e.appendChild(t),e},renderButtonElement(){this.buttonElement=this.getButtonElement(),this.buttonElement.addEventListener("click",this.onButtonClick.bind(this)),this.container.appendChild(this.buttonElement),this.isVideo()||(this.buttonElement.style.display="none"),this.getJWPlayer()&&this.getJWPlayer().on("mute",this.onMuteChange,this)},onButtonClick(){this.getJWPlayer()&&(this.container.classList.add("has-interacted"),this.muted=!this.muted,this.getJWPlayer().setMute(this.muted))},onMuteChange(e){this.muted=e.mute,this.muted?this.buttonElement.classList.remove("content-video-volume-on"):this.buttonElement.classList.add("content-video-volume-on")},isVideo(){return"video"===this.player.getRawAsset().assetType},getJWPlayer(){return this.player.model.player}})},IntegrationMenu:()=>{window.SVP.Player.Plugins.register({getName:()=>"IntegrationMenu",setup(){return e(this,void 0,void 0,function*(){yield Promise.resolve().then(function(){return Si})})}})}};class Kt{handleVideo(t,n){return e(this,arguments,void 0,function*(t,{videoConfiguration:{id:n,node:r,autoplay:i,mute:o,vendor:a}}){yield e(void 0,void 0,void 0,function*(){return yield new Promise(e=>{var t;Boolean(null===(t=window.SVP)||void 0===t?void 0:t.Player)?e(!0):window.addEventListener("onSvpPlayerReady",()=>e(!0))})});const s=["ContentMutePlugin"],d=this.createPlayerOverlay(t);var l,c;c=d,null==(l=s)||l.forEach(e=>{Wt[e](c)});const u={id:n,node:r,autoplay:i,mute:o,vendor:a,autopause:"viewable",maxBitrate:600,pulse:{provider:"e24"},recommended:{autoplay:!1,next:{countdown:10}},skin:{name:"e24-default",url:""}},v=yield zt(u);v.once("assetReady",()=>{((e,t)=>{null==t||t.forEach(t=>{const n=window.SVP.Player.Plugins.get(t);e.addPlugin(new n)})})(v,s)}),v.once("ready",()=>{const e=t;new MutationObserver(t=>{t.forEach(({type:t,attributeName:n})=>{"attributes"===t&&"class"===n&&(e.classList.contains("jw-state-playing")?d.classList.add("is-playing"):d.classList.remove("is-playing"),e.classList.contains("jw-flag-user-inactive")?d.classList.add("is-inactive"):d.classList.remove("is-inactive"))})}).observe(e,{attributes:!0,attributeFilter:["class"]})}),v.once("PulseStats:ready",()=>e(this,void 0,void 0,function*(){const e=yield v.getPlugin("PulseStats").getTracker();null==e||e.update({provider:{id:"e24",productTag:"partnerstudio"}})}))})}getPulseObjectId(){return"sdrn:e24:content:partnerstudio:element:partnerstudio:stats"}getPulsePageId(e,t){return e===Ht?"sdrn:e24:frontpage:front":`sdrn:e24:article:${t}`}getTags(e){var t;let n;if(n=e instanceof HTMLAnchorElement?e.href:null===(t=null==e?void 0:e.querySelector("a"))||void 0===t?void 0:t.href,!n)return[];if(!n.includes("https://e24.no/annonsorinnhold/"))return[n];const{pathname:r}=new URL(n),i=r.split("/").filter(Boolean);return i.length?[...i.slice(1),n]:[n]}createPlayerOverlay(e){const t=document.createElement("div");t.classList.add("cm-custom-video-overlay"),e.parentElement&&(t.innerHTML=e.parentElement.innerHTML,e.parentElement.replaceChild(t,e));return t.addEventListener("click",e=>{e.stopPropagation(),e.preventDefault(),t.classList.add("has-interacted")}),t}}const Jt="https://www.aftonbladet.se/video-player-extras/latest/";class Gt{handleVideo(t,n){return e(this,arguments,void 0,function*(e,{videoConfiguration:{id:t,node:n,autoplay:r,mute:i,vendor:o}}){const a={id:t,node:n,autoplay:r,mute:i,vendor:o,autopause:"viewable",maxBitrate:600,pulse:{provider:"aftonbladet"},recommended:{autoplay:!1,next:{countdown:10}},skin:{name:"",url:""},plugins:{[`${Jt}cta-button.js`]:{name:"CtaButton",options:{type:"unmute"}},[`${Jt}external-link.js`]:{name:"ExternalLink"}}};yield zt(a),this.addEditionVideoClass(e)})}addEditionVideoClass(e){var t;(null===(t=null==e?void 0:e.parentElement)||void 0===t?void 0:t.parentElement)&&e.parentElement.parentElement.classList.add("dr-edition-video-player")}getPulseObjectId(){return""}getPulsePageId(){return""}}const Yt=e=>null!==e&&"object"==typeof e&&!Array.isArray(e);class Qt{handleVideo(t,n){return e(this,arguments,void 0,function*(t,{videoConfiguration:{id:n,node:r,autoplay:i,mute:o,vendor:a}}){const s={id:n,node:r,autoplay:i,mute:o,vendor:a,locale:"se",autopause:"viewable",maxBitrate:600,sharing:!1,recommended:!1,pulse:{provider:"svdse",decorator:(e,t)=>Object.assign(Object.assign({},Yt(e)?e:{}),{provider:Object.assign(Object.assign({},Yt(null==e?void 0:e.provider)?e.provider:{}),{productTag:"partnerstudio"})})},skin:{name:"svd-player",url:""},settings:{pulse:{host:"se-aftonbladet.videoplaza.tv",contentMetadata:{category:"SvD",tags:["standard-linears","pause",`video-${n}`]},requestSettings:{}}}},d=yield zt(s);d.once("PulseStats:ready",()=>e(this,void 0,void 0,function*(){const e=yield d.getPlugin("PulseStats").getTracker();null==e||e.update({provider:{id:"svdse",productTag:"partnerstudio"}})}))})}getPulseObjectId(){return"sdrn:svdse:content:partnerstudio:element:partnerstudio:stats"}getPulsePageId(e,t){return e===Ht?"sdrn:svdse:frontpage:front":`sdrn:svdse:article:${t}`}}let Xt=class{handleVideo(e,t){}getPulseObjectId(){return""}getPulsePageId(e,t){return""}};const Zt=(e,t,n)=>{var r;const{publisher:i,pageType:o,country:a}=e,s={[Oe]:new _t,[je]:new Kt,[Le]:new Gt,[Pe]:new Qt}[i]||new Xt,d=new(a===f.SE?Vt:Ut)(n,s,o),l=new qt(t,null!==(r=null==n?void 0:n.pulseTracker)&&void 0!==r?r:n),c=new Bt(s,d),u=new Ft(s);return new Mt(l,c,u,d)},en=()=>e(void 0,void 0,void 0,function*(){return yield new Promise(e=>{if("undefined"!=typeof window)if(window.Identity)e(window.Identity);else{const t=()=>{e(window.Identity)};window.addEventListener("identity-initialized",t,{once:!0})}else e(void 0)})});class tn{constructor(e){this.identity=e,this.getIdentityUser=this.getIdentityUser.bind(this),this.isUserLoggedIn=this.isUserLoggedIn.bind(this),this.onIdentityLogout=this.onIdentityLogout.bind(this)}getIdentityUser(){return e(this,void 0,void 0,function*(){var e;try{const t=yield null===(e=this.identity)||void 0===e?void 0:e.getUser();return null!=t?t:null}catch(e){return u("[Privacy Broker] User is not logged in."),null}})}isUserLoggedIn(){return e(this,void 0,void 0,function*(){var e,t;return null!==(t=yield null===(e=this.identity)||void 0===e?void 0:e.isLoggedIn())&&void 0!==t&&t})}onIdentityLogout(e){var t;null===(t=this.identity)||void 0===t||t.on("logout",e)}}const nn=(e,t,n)=>{const{wrapperSelector:r}=null==e?void 0:e.drEditionConfig,i=document.querySelectorAll(r),o=new IntersectionObserver((r,i)=>((e,t,n,r,i)=>{const o=Zt(n,r,i);e.forEach(e=>{var r,i,a;if(!e.isIntersecting)return;const s=e.target,d=null!==(r=s.dataset.editionName)&&void 0!==r?r:"",l=null!==(i=s.dataset.pulseColumnname)&&void 0!==i?i:"",c=null!==(a=s.dataset.pulsePrimaryposition)&&void 0!==a?a:"";o.fetchAndRenderAd(s,Object.assign(Object.assign({},n),{editionName:d,columnName:l,primaryPosition:c})),t.unobserve(s)})})(r,i,e,t,n),{rootMargin:"400% 0px"});i.forEach(e=>o.observe(e))},rn=[],on=(t,n)=>e(void 0,void 0,void 0,function*(){var e;const{pulse:r,tcf:i,deviceType:o,drEdition:a,publisher:s,pageType:d,country:l,isMobileApp:c}=t;if(!(yield A(i,c,l,"handleDrEditionBackfill")))return;const v=((e,t)=>{var n;const{deviceType:r,placements:i,drEdition:{fallbackGlobalEditionName:o}={}}=e,a=i[r]||i.desktop,s=mt(t.targetId),d=a.find(e=>e.id===s),l=Nt.some(e=>s.startsWith(e)),c=rn.includes(s),u=(null===(n=null==d?void 0:d.drEdition)||void 0===n?void 0:n.editionName)||o;return d&&l&&!c&&u?(rn.push(s),Object.assign(Object.assign({},d),{drEdition:Object.assign(Object.assign({},d.drEdition),{editionName:u})})):null})(t,n);if(!v)return;if(!(null==r?void 0:r.instance))return void u("Pulse has not been passed as a prop, aborting");const p=yield en(),g=new tn(p),h=Zt({publisher:s,pageType:d,country:l},g,null==r?void 0:r.instance),m=document.getElementById(n.targetId);if(!m||!a)return;m.classList.value="";const y=document.createElement("div");y.className=a.containerSelector.replace(/^[.#:[\]]+/,""),m.innerHTML=y.outerHTML;const f={editionName:(null===(e=null==v?void 0:v.drEdition)||void 0===e?void 0:e.editionName)||"",drEditionConfig:a,device:o,tcf:i,isMobileApp:c,country:l,renderAsBackfill:!0};yield h.fetchAndRenderAd(m,f)}),an="collapseAd",sn="hideAd",dn="resizeAd",ln="renderDrEditionFallback",cn="wallpaperImageUrl",un="wallpaperColor",vn="velvet",pn=[dn,cn,un,an,sn,ln,vn];let gn;const hn=e=>{if("object"==typeof e)return e;if(t=e,Et.test(t)){const t=e.replace(/^wallpaper:url:/,"");return{name:cn,wallpaperImageUrl:t}}var t;if((e=>e.startsWith("wallpaper:color:"))(e)){const t=e.replace(/^wallpaper:color:/,"");return{name:un,wallpaperColor:t}}if(e.startsWith(ln)){const t=e.split(":")[1];return{name:ln,targetId:t}}if(e.startsWith(an)||e.startsWith(sn)){const t=e.split(":")[1];return{name:an,targetId:t}}if(e.includes("name")&&pn.some(t=>e.includes(t)))try{return JSON.parse(e)}catch(e){}},mn=e=>{if(!["http://acdn.adnxs-simple.com","https://acdn.adnxs-simple.com","https://crcdn01.adnxs-simple.com","http://crcdn01.adnxs-simple.com","https://acdn.adnxs.com","http://acdn.adnxs.com","https://adsdk.microsoft.com","https://adsdk.bing.net","https://adsdkprod.azureedge.net"].includes(e.origin.trim()))return;const{data:t}=e;if(!t)return;const n=hn(t);if(!n)return;if(!n.name||!pn.some(e=>n.name===e))return;const{name:r,targetId:i,wallpaperImageUrl:o,wallpaperColor:a,cmd:s,size:d}=n;r===vn&&s&&(s.includes("noScroll")&&(gn=(e=>{if(!e)return()=>{};const t=e.style.overflow;return e.style.setProperty("overflow","hidden"),()=>{e.style.setProperty("overflow",t)}})(document.querySelector("body"))),(s.includes("close")||s.includes("ended"))&&(null==gn||gn(),dispatchEvent(new CustomEvent("advertory:closeTakeover",{})))),r!==an&&r!==sn||!i||It(i),r===dn&&i&&s&&$t(i,s),r===ln&&i&&(It(i),on(l.get(),{targetId:i})),"resizeMediationAd"===r&&i&&d&&$t(i,d,!0),r===cn&&o&&(e=>{const t=document.querySelector(`.${wt}`);t&&(t.style.backgroundImage=`url(${e})`)})(o),r===un&&a&&(e=>{const t=document.querySelector(`.${wt}`);t&&(t.style.backgroundColor=e)})(a)},yn=e=>({rootMargin:`${e}px 0px ${e}px 0px`}),fn=()=>{const{publisher:t,country:n,finnBlink:r}=l.get(),{loadFinnBlinkAd:i,wallpaperHandlers:{adjustAdToHorseshoe:o}}=l.getHandlers(),a=window.apntag,s={publisher:t,country:n,finnBlink:r},d=e=>{At(e),pt(()=>a.showTag(e))};return{withXandrAd:d,withFinnBlinkAd:t=>e(void 0,void 0,void 0,function*(){yield i(t,s,null)}),withFullAdsChain:t=>e(void 0,void 0,void 0,function*(){yield i(t,s,d,()=>{qe.getData("horseshoe").isAvailable&&o(t)})})}},wn=(e,t,n)=>{const r="true"===n.dataset.isFinnBlinkOnlyPlacement;return be(t)&&r?(u(`loading finn blink ad for blink only placement for ${t}`),void fn().withFinnBlinkAd(t)):be(t)?(u(`loading finn blink ad with full ads chain for ${t}`),void fn().withFullAdsChain(t)):void pt(()=>(u("core showTag",{id:t}),e.showTag(t)))},bn=(t,n)=>e(void 0,void 0,void 0,function*(){yield gt,yield ht;const e=new IntersectionObserver((e,n)=>((e,t,n,r)=>{e.filter(({isIntersecting:e,target:{id:t}})=>e&&!t.includes("wallpaper")).forEach(e=>{const{target:i}=e,o=(e=>{const t=e.dataset.showTagSubscribeId;return!e.id.length&&t?t:e.id})(i),a=document.getElementById(o);u("core log from intersection observer handler",{targetId:o,element:a}),n(window.apntag,o,r),a&&(t.unobserve(a),t.disconnect())})})(e,n,wn,t),yn(n));e.observe(t)}),En=new Map,In=["no-stavangeraftenblad","sa","no-aftenposten","aftenposten","no-bergenstidende","bt"],An=".brandstudio-premium-content-widget",kn=({adWrapper:e,placementContainer:t})=>t.offsetHeight+(({adWrapper:e})=>{const{paddingTop:t,paddingBottom:n}=getComputedStyle(e);return parseFloat(t)+parseFloat(n)})({adWrapper:e}),Tn=({adWrapper:e,placementContainer:t})=>{const n=kn({adWrapper:e,placementContainer:t});var r;null==e||e.style.setProperty("height",`${n}px`),Tt(r=t),r.innerHTML=""},Cn=e=>{e&&e.style.getPropertyValue("height")&&e.style.removeProperty("height")},Sn=({adWrapper:e,placementContainer:t})=>{const{publisher:n}=l.get(),r=In.includes(n)&&Boolean(t.closest(An));const i=r?t.closest(An):null,o=new MutationObserver(t=>{t.forEach(({addedNodes:t})=>{t.forEach(t=>{const n=t instanceof HTMLElement,a=n&&t.matches("iframe, article")&&e;if(!n||!r&&!a||r&&!i)return;if(a)return Cn(e),void o.disconnect();const s=t.closest('[style*="height"]'),d=i;s&&d.contains(s)?Cn(s):d.hasAttribute("style")&&Cn(d),o.disconnect()})})});try{o.observe(t,{childList:!0,subtree:!0})}catch(e){o.disconnect()}},Pn=(e,t,n,r,i,o)=>{var a;const s=performance.now(),d=null!==(a=En.get(t))&&void 0!==a?a:0,l=((e,t)=>!!t&&e+t<(new Date).getTime())(r,i)&&n<0;s-d>=i&&l&&(En.set(t,s),((e,t,n)=>{const r=null==n?void 0:n.parentElement;r&&n&&Tn({adWrapper:r,placementContainer:n}),pt(()=>{e.setKeywords([t],{[`${C()}-adreload`]:"1"},{overrideKeyValue:!0}),e.refresh([t])})})(e,t,o))},On=(e,t,n)=>{const r=new IntersectionObserver((e,r)=>((e,t,n,r)=>{e.filter(({isIntersecting:e})=>e).forEach(e=>{const{target:i,boundingClientRect:o}=e;t(window.apntag,i.id,o.y,n,r,i)})})(e,Pn,t,n),yn(300));r.observe(e)},xn=(e,t=6)=>{const n=[];for(let r=0;r<e.length;r+=t){const i=e.slice(r,r+t);n.push(i)}return n},Ln=()=>navigator&&navigator.userAgent.match(/chrome/i)?null:navigator&&navigator.userAgent.match(/apple/i),jn=(e,t=0)=>{const n=e.getBoundingClientRect(),r=window.innerHeight;return n.bottom>-t&&n.top<r+t},$n=e=>{const{refreshConfig:{visibilityStateRefreshEnabled:t=!1}={}}=l.get();if(!t)return;const n=()=>{"visible"===document.visibilityState&&document.removeEventListener("visibilitychange",n),Mn(e)};"visible"!==document.visibilityState&&document.addEventListener("visibilitychange",n)},Nn=(e,t,n)=>{const r=document.querySelectorAll('[data-bf-cache-refresh="true"]');for(const i of r){const r=e.find(e=>{var t;return e.id===(null===(t=i.firstElementChild)||void 0===t?void 0:t.id)&&e.bfCacheRefresh}),o=null==r?void 0:r.threshold;jn(i,o)&&r&&(kt(r.id),n.length&&i.classList.remove(...n),Mn([r],t))}},qn=e=>{const{refreshConfig:{backForwardNavigationRefreshEnabled:t=!1}={},siteSpecificConfig:{classesToRemoveOnRefresh:n=[]}={},isMobileApp:r}=l.get();t&&(e.forEach(({id:e})=>{const t=_n(e);t&&(t.dataset.bfCacheRefresh="true")}),r?((e,t)=>{document.addEventListener("visibilitychange",()=>{Nn(e,!0,t)})})(e,n):((e,t)=>{window.addEventListener("pageshow",n=>{const r=()=>{window.scrollY>0&&(window.removeEventListener("scroll",r),Nn(e,!1,t))};n.persisted&&(Ln()?window.addEventListener("scroll",r,{passive:!0}):Nn(e,!1,t))})})(e,n))},_n=e=>{var t,n;return null!==(n=null===(t=document.querySelector(`#${e}`))||void 0===t?void 0:t.parentElement)&&void 0!==n?n:null},Dn=e=>{const{id:t,allowedFormats:n}=e,r=(e=>{if(!e)return[];try{return JSON.parse(e.dataset.adSizes||"[]")}catch(e){return[]}})(_n(t)),i=(e=>1===e[0]&&1===e[1])(r),o={sizes:[r],allowedFormats:i?n:n.filter(e=>"native"!==e),allowSmallerSizes:!1};return i||(o.native=void 0),o},Mn=(e,t=!1)=>{const{requestSize:n=s}=l.get(),r=e.map(({id:e})=>e),i=xn(r,n);if(t)for(const t of e){const e=Dn(t);window.apntag.modifyTag(t.id,e)}for(const e of i)pt(()=>window.apntag.refresh(e))};const Bn="#fff",Fn="#0098da",Rn="splash",Vn="welcomePage",Un="topscroller",Hn="velvet",zn="takeover-displayed",Wn="takeover-visit-count",Kn=14400,Jn=()=>{const e=G(Wn);return e?parseInt(e):0},Gn=()=>{const{takeover:{enabled:e=!1,secondVisitEnabled:t=!1}={}}=l.get();return!window.location.href.includes("takeover=0")&&(!!window.location.href.includes("takeover=1")||!(!e||(()=>{var e;const t=(null===(e=l.get().takeover)||void 0===e?void 0:e.cookieCapName)||zn;return"true"===G(t)})())&&(!t||Yn()))},Yn=()=>{const e=Jn();return 0===e?((()=>{const e=Jn(),{takeover:{cookieCapTime:t=Kn}={}}=l.get(),n=document.location.hostname;window.document.cookie=`${Wn}=${e+1}; max-age=${t}; domain=${n}; path=/`})(),!1):1===e},Qn=(e,t)=>[[1,1],[1920,1080]].some(([n,r])=>n===e&&r===t),Xn=()=>{const{takeover:e}=l.get();return Boolean(null==e?void 0:e.topscroller)},Zn=()=>e(void 0,void 0,void 0,function*(){const e=document.location.hostname,{takeover:{cookieCapName:t=zn,cookieCapTime:n=Kn}={},isMobileApp:r,tcf:i,country:o}=l.get(),a=yield A(i,r,o,"ad-takeover-cookiecap");n&&a&&(window.document.cookie=`${t}=true; max-age=${n}; domain=${e}; path=/`)}),er=e=>{var t;const n=!!(null===(t=l.get().takeover)||void 0===t?void 0:t.setCookieCapForNotShownAd);return he(e)&&n},tr=(e,t)=>{var n;if(t===Un){const{topscroller:t}=e;return null!=t?t:{}}if(t===Rn){const{splash:t}=e;return null!=t?t:{}}return null!==(n=e.welcomePage)&&void 0!==n?n:{}},nr=(e,t)=>{t!==Rn?(e=>{var t,n,r;const i=null===(n=null===(t=l.get().takeover)||void 0===t?void 0:t.welcomePage)||void 0===n?void 0:n.headerElementSelector,o=null===(r=l.get().takeover)||void 0===r?void 0:r.topscroller;if(!i||o)return;const a=document.querySelector(i),s=document.querySelector(".welcome-page-wrapper"),d=document.querySelector(`#${e.targetId}`),c=document.querySelector(".advertory-welcome-page-scroll");if(!(a&&s&&c&&d))return;const u=null==a?void 0:a.offsetHeight,v=me(e)?"60svh":`calc(100svh - ${u}px)`,p=me(e)?"calc(40svh + 30px)":`calc(${u}px + 30px)`;s.style.setProperty("height",v,"important"),d.style.setProperty("height",v,"important"),c.style.setProperty("bottom",p,"important")})(e):(e=>{var t;if(!(null===(t=l.get().takeover)||void 0===t?void 0:t.splash))return;const n=document.querySelector(".advertory-splash-navbar-wrapper"),r=document.querySelector(`#${e.targetId}`);if(!n||!r)return;const i=`calc(100svh - ${n.offsetHeight}px)`;r.style.setProperty("height",i,"important")})(e)},rr=Ve([],()=>{new MutationObserver((e,t)=>{document.querySelector("iframe")&&((()=>{const e=document.querySelector("iframe");e&&(e.onload=()=>{if(!e.contentDocument)return;document.body.style.height="100%",document.documentElement.style.height="100%",e.height="100%",e.width="100%";const t=e.contentDocument.createElement("style");t.textContent="\n .adform-adbox {\n height: 100% !important;\n width: 100% !important;\n }\n img {\n height: 100% !important;\n width: 100% !important;\n object-fit: cover !important;\n object-position: top !important;\n }\n ",e.contentDocument.head.appendChild(t)})})(),t.disconnect())}).observe(document.body,{childList:!0,subtree:!0})}),ir=(e,t=!0)=>{(e===Vn||e===Un)&&(e=>{e?setTimeout(()=>window.scrollTo(0,0),100):window.scrollTo(0,10)})(t)},or=()=>{const e=parseInt(document.body.dataset.scrollY||"0",10);document.body.style.top="",window.scrollTo(0,e),document.body.classList.remove("page-locked")},ar=e=>{document.body.style.overflow=e?"initial":"hidden"},sr=e=>{const t=lr(e),n=dr(e);(e=>{e.classList.toggle("takeover-ad-hidden",!0)})(e),ar(!0),e.style.display="none",window.removeEventListener("keydown",t),window.removeEventListener("advertory:closeTakeover",n)},dr=e=>{const t=()=>sr(e);return window.addEventListener("advertory:closeTakeover",t),or(),t},lr=e=>{const t=t=>{["Enter","Escape"].includes(t.key)&&sr(e)};return or(),window.addEventListener("keydown",t),t},cr=e=>{const t=e.querySelector(".advertory-splash-navbar-wrapper");t&&(lr(e),dr(e),or(),t.addEventListener("click",()=>{sr(e)}),ar(!1))},ur=e=>{(e=>{window.addEventListener("scroll",()=>{e.getBoundingClientRect().bottom,(e=>{const t=e.getBoundingClientRect().bottom;e.style.opacity=""+t/e.offsetHeight})(e)},{passive:!0})})(e),dr(e);const t=document.querySelector("header");document.querySelectorAll(".smooth-close-takeover").forEach(e=>e.addEventListener("click",()=>null==t?void 0:t.scrollIntoView({behavior:"smooth"})))},vr=e=>{(e=>{window.addEventListener("advertory:closeTakeover",()=>sr(e))})(e)},pr=e=>{const{takeover:{splash:{showAnnonsLabel:t=!1}={}}={}}=l.get(),n=e.querySelectorAll(".advertory-splash-navbar-wrapper"),r=document.querySelector(".advertory-takeover-label");Array.from(n).forEach(e=>e.style.display="flex"),t&&r&&(r.style.display="flex",r.innerText=tt.se.adText),e.classList.toggle("advertory-splash-wrapper",!0)},gr=e=>{const t=document.querySelectorAll(".advertory-topscroller-elements");Array.from(t).forEach(e=>e.style.display="flex");const n=document.querySelector(".advertory-takeover-label");n&&(n.style.display="flex",n.innerText=tt.no.adText,n.classList.add("takeover-topscroller-label"),e.classList.toggle("topscroller-wrapper",!0))},hr=e=>{const t=document.querySelectorAll(".advertory-welcome-page-elements");Array.from(t).forEach(e=>{e.style.display="flex",e.style.animation="elementsAnimation 1.5s ease-out forwards"});const n=document.querySelector(".advertory-takeover-label");n&&(n.style.display="flex",n.innerText=tt.se.adText,e.classList.toggle("welcome-page-wrapper",!0))},mr=e=>{const t=document.querySelector(".advertory-takeover-label");t&&(t.style.display="flex",t.innerText=tt.se.adText,e.classList.toggle("advertory-impact-wrapper",!0))},yr=()=>{const e=document.querySelector(".welcome-page-wrapper, .topscroller-wrapper, .advertory-splash-wrapper");if(!e)return;let t=0;new IntersectionObserver(e=>{e.forEach(e=>{var n;if(e.isIntersecting){window.dispatchEvent(new CustomEvent("advertory:takeoverInView"));(null!==(n=Array.from(e.target.classList))&&void 0!==n?n:[]).includes("advertory-splash-wrapper")&&(()=>{const e=window.scrollY||0;document.body.dataset.scrollY=e.toString(),document.body.style.top="0",document.body.classList.add("page-locked"),document.documentElement.scrollTop=0})(),t++}else t>0&&window.dispatchEvent(new CustomEvent("advertory:takeoverNotInView"))})},{root:null,rootMargin:"0px",threshold:0}).observe(e)},fr=(e,t)=>{let n=e;return e.includes("529299503")&&(n=(e=>{const t=document.createElement("script");return t.textContent=`(${rr})()`,e+t.outerHTML})(e)),n},wr=e=>{const t=(e=>{const{requests:t}=window.apntag,n=Re(e)?1:0;return null==t?void 0:t.tags[e].adResponse.ads[n].rtb.banner.content})(e);if(!t)return;((e,t)=>{const{requests:n}=window.apntag,r=Re(e)?1:0;n&&(n.tags[e].adResponse.ads[r].rtb.banner.content=t)})(e,fr(t))},br=t=>e(void 0,void 0,void 0,function*(){const{takeover:e}=l.get(),{targetId:n}=t,r=document.querySelector(`#${n}`),i=document.querySelector(".advertory-takeover-wrapper");if(!r||!i||!e)return;const o=(e=>{const{width:t,height:n}=e;return Qn(t,n)?Rn:Ce(e,se)?Hn:Xn()?Un:Vn})(t),a=i.offsetHeight,s=window.scrollY>a;i.style.display="block",!s&&ir(o,!1),((e,t)=>{({[Vn]:hr,[Rn]:pr,[Un]:gr,[Hn]:mr})[t](e)})(i,o),yr(),((e,t)=>{({[Vn]:ur,[Un]:ur,[Rn]:cr,[Hn]:vr})[t](e)})(i,o),((e,t,n)=>{if(!n)return;({[Vn]:()=>{const{buttonLabel:r}=tr(n,t);["#advertory-welcome-page-scroll-label","#advertory-welcome-page-scroll-image"].forEach(t=>{const n=e.querySelector(`${t}`);n&&(n.innerText=null!=r?r:"")})},[Rn]:()=>{const{themeColors:r,logotype:i,buttonLabel:o,showArrowIcon:a}=tr(n,t);["#advertory-splash-close-label",".advertory-splash-close","#advertory-splash-logotype",".advertory-splash-navbar-wrapper"].forEach(t=>{const n=e.querySelector(`${t}`);if(n){if("#advertory-splash-close-label"===t&&(n.innerText=null!=o?o:""),".advertory-splash-close"===t&&a){const e=document.createElement("img");e.setAttribute("src","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAAfQAAAH0Bx0gPAAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAABzSURBVDiNtdPJCYBADEDRzzRmE3ZgEV6tRHHpzELiIQrBZRajA7lk4EE2RIQjgApYgdbmY8EJaADZo3sDBKAvQa4JRYZc5D6pyJiDPMuKTCkkXp8icwxJd1mRxSC1/Q94328luJroGqNrkdyrzAfHVHzOG+8CKlLk+LO+AAAAAElFTkSuQmCC"),e.setAttribute("alt","close ad"),n.appendChild(e)}if("#advertory-splash-logotype"===t&&i&&(n.setAttribute("src",i.url),n.setAttribute("alt",i.alt)),".advertory-splash-navbar-wrapper"===t&&r){const{backgroundColor:e,color:t}=r;n.style.setProperty("background-color",null!=e?e:Bn,"important"),n.style.color=null!=t?t:Fn}}})},[Un]:()=>{const{buttonLabel:r,showArrowIcon:i,showCloseButton:o=!0}=tr(n,t);["#advertory-topscroller-scroll-label","#advertory-topscroller-scroll-image",".advertory-topscroller-close"].forEach(t=>{const n=e.querySelector(`${t}`);n&&(".advertory-topscroller-close"!==t||o||(n.style.display="none"),"#advertory-topscroller-scroll-image"!==t||i||(n.style.display="none"),"#advertory-topscroller-scroll-label"===t&&(n.innerText=null!=r?r:""))})},[Hn]:()=>{}})[t]()})(i,o,e),yield Zn(),!s&&ir(o,!0),nr(t,o)});et(".advertory-brandmetrics-survey{width:100%}");const Er="advertory-brandmetrics-survey",Ir=()=>e(void 0,void 0,void 0,function*(){const{norstat:{enabled:t}={},country:n,isMobileApp:r,tcf:i}=l.get(),o=yield A(i,r,n,"norstat");if(!t||r||!o)return;const a=(e=>{const{ppid1:t,ppid2:n}=H.getPPIDs(),{ppid1:r,ppid2:i}=z.getPPIDs(),o=(new U).add(n,_[e]).add(t,D[e]).add(i,M[e]).add(r,B[e]);return`${o.buildNorstatPath()}?${o.buildNorstatQuery("alias").toString()}`})(n);((t,n,...r)=>{e(void 0,[t,n,...r],void 0,function*(e,t,n=!0){if(document.getElementById(t))return;const r=document.createElement("img");r.src=e,r.id=null!=t?t:"",n&&(r.style.display="none"),document.body.appendChild(r)})})(`https://sch-map.norstatsurveys.com/api/nids/${n===f.NO?"schibsted":"schibstedse"}/map/${a}`,"norstat")}),Ar={nativeAd:e=>pe(e)&&!we(e),buyrecipe:e=>e.targetId.startsWith("buyrecipe"),fullwidthAd:ge,fullscreenScroll:ve,topscroller:e=>he(e)&&Xn(),splash:e=>he(e)&&Qn(e.width,e.height),welcomePage:he,wallpaper:ye,skyscraper:e=>e.targetId.includes("skyscraper")&&!!e.banner,lFormat:ke,hFormat:Te,toppanorama:e=>e.targetId.startsWith("toppanorama")&&!Te(e)&&!ke(e),topboard:e=>e.targetId.startsWith("topboard")&&!he(e),widescreen:Ae,insider:e=>e.targetId.startsWith("insider"),sponsorstripe:we,brandboard:e=>(e=>(980===e.width||1920===e.width&&e.targetId.includes("brandboard"))&&!e.targetId.includes("topboard")&&!e.targetId.includes("companion")&&!Ee(e))(e)&&!(e=>e.targetId.includes("backfill"))(e)&&!Ie(e),outstream:e=>"https://acdn.adnxs.com/video/outstream/ANOutstreamVideo.js"===e.renderer_url,netboard:e=>(e=>e.targetId.startsWith("netboard"))(e)||(e=>e.targetId.startsWith("board"))(e),panorama:Ee,midboard:Ie},kr=({adObj:e,preferredTestIdData:t})=>{var n,r;const i=null!==(n=null==t?void 0:t.targetId)&&void 0!==n?n:null==e?void 0:e.targetId;if(!i)return;const o=null===(r=document.querySelector(`#${i}`))||void 0===r?void 0:r.parentElement;if(!o)return;if(((e,t)=>{var n,r,i,o;const a=null===(o=null===(i=null===(r=null===(n=window.apntag)||void 0===n?void 0:n.requests)||void 0===r?void 0:r.tags)||void 0===i?void 0:i[e])||void 0===o?void 0:o.invCode;a&&(t.dataset.invCode=a)})(i,o),null==t?void 0:t.testId)return void(o.dataset.testid=t.testId);const a="DIV"===(null==o?void 0:o.tagName);e&&a&&((e,t)=>{var n,r;for(const[i,o]of Object.entries(Ar))if(o(e)){if("nativeAd"===i){const o="default";t.dataset.testid=`${i}-${null!==(r=null===(n=null==e?void 0:e.native)||void 0===n?void 0:n.desc2)&&void 0!==r?r:o}`;break}t.dataset.testid=i;break}})(e,o)},Tr=e=>{var t;return(null===(t=Object.entries(Ar).find(([,t])=>t(e)))||void 0===t?void 0:t[0])||""},Cr=(e,t)=>{const n=e.width,r=(null!=t?t:window.screen.width)/n;return r<1?r:1},Sr=new Map;Sr.set("insider",{scale:.82,transformOrigin:"left center",cogwheelAdjust:!0}),Sr.set("panorama",{scale:.79,transformOrigin:"center center"}),Sr.set("outstream",{scale:.79,transformOrigin:"center center"}),Sr.set("integration",{scale:.79,transformOrigin:"center center"}),Sr.set("toppanorama",{scale:.8,transformOrigin:"left center"});const Pr=e=>{if(!((null===(t=null===document||void 0===document?void 0:document.body)||void 0===t?void 0:t.clientWidth)>767&&(null===(n=null===document||void 0===document?void 0:document.body)||void 0===n?void 0:n.clientWidth)<=853))return;var t,n;const r=Tr(e),i=Sr.get(r),o=document.querySelector(`#${e.targetId}`);if(!o||!i)return;if(o.style.transformOrigin=i.transformOrigin,o.style.transform=`scale(${i.scale})`,!(null==i?void 0:i.cogwheelAdjust))return;const a=document.querySelector(`div[class*="gdpr-cogwheel-button"][id$="${e.targetId}"]`),s=null==o?void 0:o.offsetWidth;a&&"number"==typeof s&&!isNaN(s)&&a.style.setProperty("right",String(-1*s*.2)+"px")},Or=e=>{var t,n,r,i,o,a;const{adScaleConfig:s,deviceType:d}=l.get();if(!(null==s?void 0:s.enabled))return;if(Ce(e,re))return;const c=null!==(t=s.adsToBeScaled[d])&&void 0!==t?t:[],u=Pt(e.targetId.split("-")[0]);if(!c.includes(u))return;const v=null!==(r=null===(n=s.offset)||void 0===n?void 0:n[u])&&void 0!==r?r:0,p=document.getElementById(e.targetId),g=null!==(i=null==p?void 0:p.offsetWidth)&&void 0!==i?i:window.screen.width,h=null!==(a=null===(o=null==p?void 0:p.parentElement)||void 0===o?void 0:o.offsetWidth)&&void 0!==a?a:window.screen.width;((e,t=window.screen.width)=>{const n=Cr(e,t),r=document.querySelector(`iframe[id^="utif_${e.targetId}"]`);r&&(r.style.transform=`scale(${n})`,r.style.transformOrigin="left top")})(e,(g<h?g:h)-v)},xr=(e,t)=>t?Object.assign(Object.assign({},e),{"aa-sch-ssa-native-ad":"true","aa-sch-ssa-format":"NATIVE_CONTENT","aa-sch-ssa-market":"XNO","aa-sch-ssa-cat":["ssa_1","ssa_2","ssa_3","ssa_4","ssa_5","ssa_6","ssa_7","ssa_8","ssa_9","ssa_10","ssa_11","ssa_12","ssa_13","ssa_14","ssa_15","ssa_16","ssa_17","ssa_18","ssa_19","ssa_20","ssa_21","ssa_22","ssa_23","ssa_24","ssa_25","ssa_26","ssa_27","ssa_28","ssa_29","ssa_30"]}):e,Lr=e=>`externalImpId:'${e}'`,jr=e=>{var t;const{forwardExternalImpId:n=!1,tracker:r}=l.get(),i=(e=>{var t;if(!e.positionConfig)return e;const n=e.keywords[`${S()}-count`],r=e.positionConfig.find(e=>e.adPositionIndex===n);if(!r)return e;const i=r.keywords?Object.assign(Object.assign({},e.keywords),r.keywords):e.keywords;return Object.assign(Object.assign({},e),{sizes:null!==(t=null==r?void 0:r.sizes)&&void 0!==t?t:e.sizes,keywords:i})})(e),{id:o,sizes:a,keywords:s,allowedFormats:d,invCode:c,ssa:v=!1,nativeCustomProperties:p,safeframeConfig:g,dynamicSizeWidthCheck:h=!1}=(e=>{var t;if(!e.takeoverCookieCapForSharedPlacement||Gn())return e;const n=null===(t=e.keywords)||void 0===t?void 0:t["no-sno-adformat"],r=null==n?void 0:n.filter(e=>e!==Un),i=Object.assign(Object.assign({},e.keywords),n&&{"no-sno-adformat":r}),o=e.sizes.filter(([e,t])=>4!==e||4!==t);return Object.assign(Object.assign({},e),{sizes:o,keywords:i})})(i),m=Object.assign({invCode:c,sizes:a,targetId:o,keywords:xr(s,v),allowedFormats:d,dynamicSizeWidthCheck:h},g&&{safeframeConfig:g}),y=(e=>{var t,n,r,i,o,a,s;return e?(null===(t=null==e?void 0:e.instance)||void 0===t?void 0:t.state)?(null===(r=null===(n=null==e?void 0:e.instance)||void 0===n?void 0:n.state)||void 0===r?void 0:r.pageViewId)?(u("Tracker state pageViewId is:",null===(o=null===(i=null==e?void 0:e.instance)||void 0===i?void 0:i.state)||void 0===o?void 0:o.pageViewId),null===(s=null===(a=null==e?void 0:e.instance)||void 0===a?void 0:a.state)||void 0===s?void 0:s.pageViewId):(u("Tracker state does not contain field pageViewId or it is empty"),""):(u("Tracker state is empty"),""):(u("Tracker is not configured in initAdvertory function"),"")})(r);n&&y&&(u("External Impression ID assigned to defineTag:",Lr(y)),m.externalImpId=Lr(y));const f=(e=>Object.entries({video:{required:!1},address:{required:!1},saleprice:{required:!1},rating:{required:!1},price:{required:!1},phone:{required:!1},likes:{required:!1},downloads:{required:!1},customIcon2:{required:!1}}).reduce((t,[n,r])=>((null==e?void 0:e.includes(n))&&(t[n]=r),t),{customTitle1:{required:!1},customTitle2:{required:!1},customTitle3:{required:!1},customTitle4:{required:!1},title:{required:!1},body:{required:!1},image:{required:!1},icon:{required:!1},sponsoredBy:{required:!1},cta:{required:!1},clickUrl:{required:!1},desc2:{required:!1},displayUrl:{required:!1},description:{required:!1}}))(p);return(null===(t=e.allowedFormats)||void 0===t?void 0:t.includes("native"))&&(m.native=f),m},$r=e=>!e.includes("takeover")||Gn(),Nr=e=>{const{source:t}=e;return"csm"===t},qr=e=>{if(!e)return e;const t=e[`${C()}-targetid`],n=t?mt(t[0]):"";return Object.assign(Object.assign({},e),t&&{[`${C()}-targetid`]:[n]})},_r=e=>Object.assign(Object.assign(Object.assign(Object.assign({},e),e[`${C()}-geo`]&&{[`${C()}-geo`]:["geo-test-value"]}),e[`${C()}-geofence`]&&{[`${C()}-geofence`]:["geofence-test-value"]}),e[`${C()}-weather`]&&{[`${C()}-weather`]:["weather-test-value"]}),Dr=e=>{(e=>{const t=new URLSearchParams(window.location.search);if("true"!==t.get("scrollToFirstInvCode"))return;const n=t.get("ast_override_inv_code");if(!n)return;const r=n.split(",")[0].split(":")[0],i=e.find(e=>e.invCode===r),o=document.querySelector(`[id^=${null==i?void 0:i.id}]`);o&&o.scrollIntoView({behavior:"smooth",block:"start"})})(e),(()=>{var e;const t=new URLSearchParams(window.location.search).get("scrollToDrEditionPlacement");if(!t)return;const n=null!==(e=document.querySelector(`[id*="${t}}"]`))&&void 0!==e?e:document.querySelector(`a[aria-label*="${t}"]`);n&&n.scrollIntoView({behavior:"smooth",block:"start"})})()},Mr=(t,n)=>e(void 0,void 0,void 0,function*(){return yield new Promise(e=>{t().then(t=>{e(null!=t?t:null)}).catch(t=>{e(null)})})}),Br=()=>e(void 0,void 0,void 0,function*(){try{(()=>{const e=document.createElement("script");e.setAttribute("src","https://ads.inventory.schibsted.io/ad-service/ad-banner-sponsor-advertisement/ad.js"),e.setAttribute("type","text/javascript"),e.setAttribute("async","true"),document.head.appendChild(e)})(),(()=>{const e=document.createElement("div");e.setAttribute("id","ads-advertory-anchor"),e.classList.add("subscribe_box"),e.classList.add("ad-box"),e.classList.add("leftAd"),e.classList.add("netboard"),e.classList.add("advert"),e.classList.add("module"),e.classList.add("banner"),e.classList.add("leaderboard"),e.classList.add("adsbygoogle"),e.classList.add("ad-banner"),e.classList.add("ad-container"),e.classList.add("adsbox"),e.classList.add("sidebar-ads"),e.classList.add("banner-ads"),e.style.opacity="0",e.style.width="1px",e.style.height="1px",e.style.minWidth="0px",e.style.minHeight="0px",e.style.maxWidth="1px",e.style.maxHeight="1px",e.style.position="absolute",e.style.top="0",e.style.boxSizing="border-box",e.style.margin="0",e.style.padding="0",document.body.appendChild(e)})()}catch(e){console.error("Error running adblock scripts:",e)}}),Fr={arrayMerge:(e,t)=>t},Rr=t=>e(void 0,void 0,void 0,function*(){if(!(e=>{const{editableConfiguration:{useS3Config:t=!1,pageTypeToFetch:n}={},siteSpecificConfig:r}=e;return Boolean(t&&n&&(null==r?void 0:r.publisherClassName))})(t))return t;try{const n=yield(t=>e(void 0,void 0,void 0,function*(){const e=(e=>{const{siteSpecificConfig:t,editableConfiguration:{pageTypeToFetch:n}={}}=e;return(null==t?void 0:t.publisherClassName)&&n?`https://alertory-cdn.staging.inventory.schibsted.io/editable-configurations/${t.publisherClassName}/${n.toUpperCase()}.json`:null})(t);if(!e)return null;const n=new AbortController,r=setTimeout(()=>n.abort(),5e3);try{return yield N.get(e,{method:"GET",signal:n.signal})}catch(t){throw u("Failed to fetch S3 config",{error:t,url:e}),t}finally{clearTimeout(r)}}))(t);return n?(({siteConfig:e,configOverrides:t})=>{var n;const{keywords:r,refresh:o,placements:a,threshold:s,batchSize:d}=t,l=i.all([e.placements,a],Fr),c=i(e.pageOptions,{keywords:r},Fr),u=i(e.appearanceConfig,{defaultThreshold:s},Fr),v=i(null!==(n=e.refreshConfig)&&void 0!==n?n:{},{scrollRefreshEnabled:o},Fr);return Object.assign(Object.assign({},e),{placements:l,requestSize:null!=d?d:e.requestSize,pageOptions:c,appearanceConfig:u,refreshConfig:v})})({siteConfig:t,configOverrides:n}):t}catch(e){return u("Error fetching S3 config, using site config",{error:e}),t}}),Vr=".advertory-right-column-track",Ur="--advertory-right-column-track-height",Hr=e=>e.getBoundingClientRect().top+window.scrollY,zr=e=>{const{marginTop:t,marginBottom:n}=getComputedStyle(e);return e.getBoundingClientRect().height+parseFloat(t||"0")+parseFloat(n||"0")},Wr=(e,t)=>{const n=(r=t,`${Math.max(0,Math.round(r))}px`);var r;document.body.style.setProperty(e,n)},Kr=(e,t)=>`${e}-${t}`,Jr=(e,t,n)=>{var r;const i=Array.from(null!==(r=e.querySelectorAll(t))&&void 0!==r?r:[]),o=(e=>e.map(e=>{var t;return null===(t=document.querySelector(`[id^="${e}"]`))||void 0===t?void 0:t.parentElement}).map((e,t)=>({point:e,originalIndex:t})).filter(e=>Boolean(e.point)))(n);if(0===o.length)return;const a=Hr(e);(()=>{const e=document.querySelector("header");if(!e)return;const t=zr(e);Wr("--advertory-newsroom-header-height",t)})(),o.forEach(({point:e,originalIndex:t})=>{((e,t,n)=>{const r=Hr(e),i=Kr(Ur,t),o=r-n,a=Kr("--advertory-right-column-split-point-height",t),s=zr(e);Wr(i,o),Wr(a,s)})(e,t+1,a),(e=>{const t=null==e?void 0:e.id;if(!t)return;const n=Kr("--advertory-right-column-ad-height",t),r=zr(e);Wr(n,r)})(i[t])});((e,t)=>{const n=Hr(e);Wr(Ur,n-t)})(o[Math.min(i.length,o.length-1)].point,a)};let Gr=!1;class Yr{getPulseObjectId(){return"sdrn:vg:content:partnerstudio:element:partnerstudio:stats"}getPulsePageId(){return"sdrn:vg:frontpage:front"}getTags(e){var t;let n;if(n=e instanceof HTMLAnchorElement?e.href:null===(t=null==e?void 0:e.querySelector("a"))||void 0===t?void 0:t.href,!n)return[];const{host:r,pathname:i}=new URL(n);if(!r.includes("www.vg.no")&&!i.includes("annonsorinnhold"))return[n];const o=i.split("/");return o.length?[...o.filter(Boolean).slice(1).map(e=>e),n]:[n]}}class Qr{getPulseObjectId(){return""}getPulsePageId(e,t){return""}}class Xr{constructor(e,t){this.pulse=e,this.newsroomStrategy=t}getEventInput(e,t){return{}}parseKilkayaData(e){const t=e.querySelector("article");if(!t)return{};const n=t.dataset.k5aTeaserAnalytics;try{return n?JSON.parse(n):{}}catch(e){return{}}}mapPageType(e){return{front:"Frontpage",article:"Article",section:"Article",collection:"Article",other:"Article"}[e||"front"]||"Frontpage"}getArticleId(){return location.pathname.split("/").slice(-2,-1).pop()||""}getEventTarget(e){const{url:t,title:n,itemId:r}=this.parseKilkayaData(e);return{id:r,name:this.normalizePlacementTitle(null!=n?n:""),type:"Page",url:t}}normalizePlacementTitle(e){return e.replace(/<[^>]+>/gi,"").replace(/[^a-z0-9æøå\s_-]/gi,"")}trackContentView(t){return e(this,void 0,void 0,function*(){var e,n,r,i,o,a,s,d;if(!this.pulse)return;const l=this.getEventInput(t,"view");(null===(e=this.pulse)||void 0===e?void 0:e.trackLegacyViewUIElement)?null===(r=null===(n=this.pulse)||void 0===n?void 0:n.trackLegacyViewUIElement)||void 0===r||r.call(n,l):(null===(i=this.pulse)||void 0===i?void 0:i.trackViewUIElement)?null===(a=null===(o=this.pulse)||void 0===o?void 0:o.trackViewUIElement)||void 0===a||a.call(o,l):null===(d=null===(s=this.pulse)||void 0===s?void 0:s.trackElementView)||void 0===d||d.call(s,l)})}trackContentClick(t){return e(this,void 0,void 0,function*(){var e,n,r,i,o,a;if(!this.pulse)return;const s=this.getEventInput(t,"click");this.pulse.trackLegacyClickUIElement?null===(n=(e=this.pulse).trackLegacyClickUIElement)||void 0===n||n.call(e,s):this.pulse.trackClickUIElement?null===(i=(r=this.pulse).trackClickUIElement)||void 0===i||i.call(r,s):null===(a=(o=this.pulse).trackElementClick)||void 0===a||a.call(o,s)})}}class Zr extends Xr{constructor(e,t,n){super(e,t),this.pulse=e,this.newsroomStrategy=t,this.pageType=n}getEventBaseData(e){var t,n,r,i,o,a;const{clientName:s,creativeId:d,itemId:l,placement:c}=this.parseKilkayaData(e),u=this.mapPageType(this.pageType),v=null===(t=this.newsroomStrategy)||void 0===t?void 0:t.getPulsePageId(this.pageType||"front",this.getArticleId());return{"@id":null!==(i=null===(r=null===(n=this.newsroomStrategy)||void 0===n?void 0:n.getPulseObjectId)||void 0===r?void 0:r.call(n))&&void 0!==i?i:c,"@type":"UIElement",position:c,elementType:"Article",custom:{customer:s,creativeId:null!=d?d:l},page:{"@id":null!=v?v:c,"@type":u,url:location.origin},tags:null===(a=null===(o=this.newsroomStrategy)||void 0===o?void 0:o.getTags)||void 0===a?void 0:a.call(o,e)}}getEventTarget(e){const{link:t,itemId:n,title:r}=this.parseKilkayaData(e);return{id:n,name:this.normalizePlacementTitle(null!=r?r:""),type:"Page",url:t}}getEventInput(e,t){return{object:this.getEventBaseData(e),partnerstudio:this.getEventPartnerstudioData(e,t),target:this.getEventTarget(e),provider:this.getProviderData()}}getEventPartnerstudioData(e,t){const n=this.parseKilkayaData(e);return Object.assign(Object.assign({},n),{type:t,tracking_type:"ad",xandrAdLoaded:!1})}getProviderData(){return{productTag:"partnerstudio"}}}const ei="[data-k5a-teaser-analytics]",ti=(e,t,n)=>{const r=document.querySelectorAll("k5a-stream");if(!r.length)return;const i=new Zr(e,t,n),o=new WeakMap,a=e=>{const t=o.get(e);t&&(t.disconnect(),o.delete(e))},s=new IntersectionObserver((e,t)=>{e.forEach(e=>{if(!e.isIntersecting)return;const n=e.target,r=n.querySelector(ei);Boolean(null==r?void 0:r.dataset.k5aTeaserAnalytics)?(i.trackContentView(n),t.unobserve(e.target),a(n)):((e,t)=>{if(o.has(e))return;const n=new MutationObserver(()=>{const n=e.querySelector(ei);Boolean(null==n?void 0:n.dataset.k5aTeaserAnalytics)&&(i.trackContentView(e),t.unobserve(e),a(e))});n.observe(e,{attributes:!0,childList:!0,subtree:!0,attributeFilter:["data-k5a-teaser-analytics"]}),o.set(e,n)})(n,t)})},{threshold:.5});r.forEach(e=>{s.observe(e),e.addEventListener("click",()=>i.trackContentClick(e))})};class ni{handleKilkayaStreamTracking({pulse:e,pageType:t,publisher:n}){if(!(null==e?void 0:e.instance))return;const r={[Oe]:new Yr}[n]||new Qr;ti(e.instance,r,t)}injectKilkayaMeta(e){const t=document.createElement("script");t.textContent=`var k5aMeta = { consent: ${e} };`,document.head.appendChild(t)}observeForKilkayaBackfills(){document.addEventListener("K5A:EmptyStreamSlot",e=>{var t;const n=null===(t=null==e?void 0:e.detail)||void 0===t?void 0:t.streamSlot;if(!n)return;const r=n.parentElement;r&&(u(`Kilkaya placement ${n.getAttribute("name")} has not been loaded, loading Xandr backfill`),this.showBackfill(r))})}showBackfill(e){var t;const n=e.querySelector(".fallback");if(!n)return;n.style.display="block";const r=null!==(t=n.dataset.fallbackTargetId)&&void 0!==t?t:"";At(r)}loadKilkayaScript(t){return e(this,void 0,void 0,function*(){yield Be(t)})}run(t){return e(this,void 0,void 0,function*(){const{tcf:e,isMobileApp:n,country:r,kilkaya:i}=t;if(!(null==i?void 0:i.enabled))return;const o=yield A(e,n,r,"kilkaya");o&&(this.observeForKilkayaBackfills(),this.injectKilkayaMeta(o),yield this.loadKilkayaScript(i.url),this.handleKilkayaStreamTracking(t))})}}const ri=1e4,ii=e=>e.some(e=>e.some(e=>!!e&&jn(e,0))),oi=()=>{const{widescreenSwitching:e}=l.get(),{enabled:t,rotationInterval:n=ri,widescreenIdPrefix:r}=null!=e?e:{};if(!t)return;const i=((e="widescreen")=>{const{pageSectionsSelectors:{right:t}={}}=l.get();return t?Array.from(document.querySelectorAll(t)).map(t=>Array.from(t.querySelectorAll(`div[id^="${e}"]`))):[]})(r);let o=0,a=Date.now(),s=ii(i);if(!i.length)return;const d=(e,t,n)=>{e.forEach(e=>{e&&e.style.setProperty(t,n)})},c=e=>1===e?0:1;(e=>{e.forEach(e=>{e[0]&&(e[0].style.display="block"),e[1]&&(e[1].style.display="none")})})(i);const u=((e,t)=>{let n=null;return(...r)=>{null===n&&(e(...r),n=setTimeout(()=>{n=null},t))}})(()=>{s||(s=ii(i)||s,a=Date.now());Date.now()-a>=n&&((()=>{const e=c(o),t=i.map(e=>e[o]),n=i.map(t=>t[e]);d(t,"opacity","0"),setTimeout(()=>{d(t,"display","none"),d(n,"opacity","0"),d(n,"display","block"),setTimeout(()=>{d(n,"opacity","1")},450)},450)})(),o=c(o),a=Date.now())},1e3);window.addEventListener("scroll",u)};et('.advertory-finn-blink-wrapper{height:100%;display:flex !important;align-items:center;justify-content:center}.advertory-finn-blink-wrapper:not(.brandboard-container){width:100%;margin-inline:auto}.advertory-finn-blink{width:100%;height:500px;max-width:580px;display:flex !important;align-items:center;justify-content:center}.advertory-finn-blink::before{content:"" !important}.advertory-finn-blink iframe{max-width:100%}');const ai=e=>document.querySelector(`#${e}`);let si,di=[];const li=["takeover","wallpaper"],ci=e=>{const t=(e=>{const t=qe.getData("alertoryConfigKeywords"),{queryConfig:n,placements:r,tcf:i,glimr:o,appearanceConfig:a,requestSize:d=s,publisher:l,country:c,pageType:u,deviceType:v,isMobileApp:p=!1,pageOptions:{member:g},takeover:h,fullscreenScroll:m,useAppTabletInvCode:y}=e;return{xandr:{member:g,keywords:t,tags:[]},advertory:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({publisher:l,country:c,pageType:u,deviceType:v,placements:r,tcf:i,requestSize:d,isMobileApp:p,useAppTabletInvCode:y},o&&{glimr:o}),n&&{queryConfig:n}),a&&{appearanceConfig:a}),h&&{takeover:h}),m&&{fullscreenScroll:m})}})(e);window.advertory={initialized:!0,siteConfig:e,alertoryConfig:t}},ui=()=>e(void 0,void 0,void 0,function*(){const{pageOptions:t}=l.get(),{preparePageOptions:n}=l.getHandlers(),r=(()=>{const{sandboxAdIframeEnabled:e=!0}=l.get();return{sandboxAdIframe:e,sandboxAttributes:["allow-same-origin","allow-scripts","allow-top-navigation-by-user-activation","allow-popups","allow-popups-to-escape-sandbox","allow-forms"]}})(),i=yield e(void 0,void 0,void 0,function*(){const{tcf:e,isMobileApp:t,country:n}=l.get();return(yield A(e,t,n,"page-options"))?{}:{userSync:{disabled:!0}}}),o=yield n(Object.assign(Object.assign(Object.assign({disablePsa:!0,enableSafeFrame:!0},t),{renderingManagement:Object.assign({},r)}),i));(e=>{const t=qe.getData("alertoryConfigKeywords");if(Object.keys(t).length)return;const n=_r(e);qe.setData("alertoryConfigKeywords",n)})(o.keywords),pt(()=>si.setPageOpts(o))}),vi=t=>e(void 0,void 0,void 0,function*(){const{prebid:e,tcf:n,isMobileApp:r,country:i}=l.get();pi(t);const o=yield A(n,r,i,"prebid");(null==e?void 0:e.enabled)&&o?(u("core loadPlacements prebid enabled"),yield dt()):(u("core load tags invoked without prebid enabled"),gi(t))}),pi=e=>{const{prepareTag:t}=l.getHandlers(),n=[];(e=>{const t=["skyscraperright_1","topboard","wallpaper","skyscraperleft_1"];return e.sort((e,n)=>{const r=t.findIndex(t=>e.id.includes(t)),i=t.findIndex(e=>n.id.includes(e));return-1!==r&&-1===i?-1:-1===r&&-1!==i?1:r-i})})(e).forEach(e=>{u("core defineTags",{placement:e});const r=jr(e);if($r(e.id)){const i=t(r),o=(e=>{const{allowedFormats:t,invCode:n,keywords:r,sizes:i}=e;return{adTypes:t,invCode:n,keywords:qr(r),sizes:i}})(i);n.push(o),pt(()=>(u("core defineTag - add to the queue",{placement:e,preparedTag:i}),si.defineTag(i)))}}),(e=>{var t,n,r;(null===(r=null===(n=null===(t=window.advertory)||void 0===t?void 0:t.alertoryConfig)||void 0===n?void 0:n.xandr)||void 0===r?void 0:r.tags)&&e.length&&window.advertory.alertoryConfig.xandr.tags.push(e)})(n)},gi=e=>{const t=e.filter(({id:e})=>$r(e)).map(({id:e})=>e);t.length&&pt(()=>(u("core loadTags",{placementsIdsToLoad:t}),si.loadTags([...t])))},hi=(t,n)=>e(void 0,void 0,void 0,function*(){const{appearanceConfig:e,deviceType:r}=l.get(),{threshold:i,refresh:o}=t,a=(e=>{const t=document.querySelector(`[data-show-tag-subscribe-id=${e.targetId}]`),n=document.querySelector(`#${e.targetId}`);return t||n})(n),s=null==e?void 0:e.defaultThreshold[r];a&&(u("core showAd - subscribe for show tag with thresholds",{placement:t,adObj:n,threshold:i,deviceDefaultThreshold:s}),yield bn(a,null!=i?i:s)),a&&o&&(u("core showAd - setup refreshing",{placement:t,adObj:n}),a.dataset.refresh=o.toString())}),mi=e=>e.some(({id:e})=>li.some(t=>e.includes(t))),yi=t=>e(void 0,void 0,void 0,function*(){var n;if(!(null===(n=null===window||void 0===window?void 0:window.advertory)||void 0===n?void 0:n.initialized))return;const[r,i]=(e=>e.reduce(([e,t],n)=>{var r;return(null===(r=null==n?void 0:n.finnBlink)||void 0===r?void 0:r.loadOnlyFinnBlink)?[[...e,n],t]:[e,[...t,n]]},[[],[]]))(t),o=(e=>{const{requestSize:t=s,queryConfig:{placementBatches:n}={},deviceType:r}=l.get(),i=jt(e),o=Object.keys((null==n?void 0:n[r])||{}).map(e=>i[e]||[]).filter(e=>e.length>0),a=new Set(o.flat().map(({id:e})=>e)),d=e.filter(({id:e})=>!a.has(e));return[...o,...xn(d,t)]})(i);for(const e of o)mi(e)?(u("core loadAds without lazy loading",{placementsToLoad:e}),yield vi(e)):e.length&&(u("core loadAds with lazy loading",{placementsToLoad:e}),yield fi(e));yield(t=>e(void 0,void 0,void 0,function*(){if(!t.length)return;const{appearanceConfig:e,deviceType:n}=l.get(),r=null==e?void 0:e.defaultThreshold[n];for(const e of t){const{threshold:t,id:n}=e,i=ai(n);i&&(yield bn(i,null!=t?t:r))}}))(r)}),fi=t=>e(void 0,void 0,void 0,function*(){const{queryConfig:{lazyLoadingV3:{enabled:e=!1,rootMargin:n="200% 0px"}={}}={}}=l.get(),r=[];if(!e)return u("lazy load is not enabled",{placements:t}),void(yield vi(t));const i=new IntersectionObserver((e,n)=>{e.filter(({isIntersecting:e,target:{id:t}})=>e&&!t.includes("wallpaper")).forEach(e=>{u("lazy load is enabled - handler start",{loadedPlacementIds:r,placements:t});const i=t.every(e=>r.includes(e.id)),o=t.map(e=>e.id);!i&&r.push(...o),!i&&vi(t),u("lazy load is enabled - handler stop",{loadedPlacementIds:r,placements:t,arePlacementsLoaded:i,placementIds:o}),n.disconnect()})},{rootMargin:n});t.forEach(e=>{const t=document.getElementById(e.id);t&&(u("lazy loading - observe element",{placementId:e.id,element:t}),i.observe(t))})}),wi=()=>e(void 0,void 0,void 0,function*(){const{siteEvents:t,initNativeAd:n,wallpaperHandlers:{initWallpaperAd:r,adjustAdToHorseshoe:i}}=l.getHandlers(),{wallpaper:o,fullscreenScroll:a}=l.get(),s=[];pt(()=>{si.onEvent("adRequested",()=>{t.adRequested()}),si.onEvent("adAvailable",i=>e(void 0,void 0,void 0,function*(){var e,s,d,c,v,p;u("core adAvailable start",{placementsAvailable:di,adObj:i,isFullscreenScrollAd:ve(i),isFinnBlink:be(i.targetId),isNativeAd:pe(i),isMediation:Nr(i),isTakeoverAd:he(i),isCollapseAd:fe(i),isWallpaperAd:ye(i)});const g=null===(d=null===(s=null===(e=null===window||void 0===window?void 0:window.apntag)||void 0===e?void 0:e.requests)||void 0===s?void 0:s.tags[i.targetId])||void 0===d?void 0:d.adResponse.ads;Nr(i)&&g&&(null===(c=g[1])||void 0===c?void 0:c.rtb)&&(i.banner=null===(p=null===(v=g[1])||void 0===v?void 0:v.rtb)||void 0===p?void 0:p.banner),ve(i)&&st(i),Ae(i)&&oi(),ve(i)&&!be(i.targetId)&&at(i,a),!pe(i)||Nr(i)||be(i.targetId)||n(i,l.get()),he(i)&&!fe(i)&&(wr(i.targetId),yield br(i)),ye(i)&&(r(()=>pt(()=>window.apntag.showTag(i.targetId)),o),qe.setData("wallpaper",{isAvailable:!0})),(e=>e.targetId.includes("skyscraperleft")&&!!e.banner)(i)&&qe.setData("horseshoe",{isAvailable:!0}),kr({adObj:i}),(e=>{var t;const n=null==e?void 0:e.targetId;if(!n)return;const r=null===(t=document.querySelector(`#${n}`))||void 0===t?void 0:t.parentElement;r&&((e,t)=>{const{height:n,width:r,native:i}=e;i?t.dataset.adSizes="[1,1]":n&&r&&(t.dataset.adSizes=`[${r},${n}]`)})(e,r)})(i),t.adAvailable(i);const h=di.find(({id:e})=>e===i.targetId);h&&(yield hi(h,i),di=di.filter(e=>e.id!==h.id)),u("core adAvailable stop",{placementsAvailable:di,adObj:i,isFullscreenScrollAd:ve(i),isFinnBlink:be(i.targetId),isNativeAd:pe(i),isMediation:Nr(i),isTakeoverAd:he(i),isCollapseAd:fe(i),isWallpaperAd:ye(i)})})),si.onEvent("adLoaded",e=>{const{refreshConfig:r,appearanceConfig:o}=l.get(),a=document.getElementById(e.targetId);be(e.targetId)&&(e=>{const{fullscreenScroll:t}=l.get(),{initNativeAd:n}=l.getHandlers();ve(e)&&at(e,t),pe(e)&&n(e,l.get())})(e);s.includes(e.targetId)&&pe(e)&&(n(e,l.get()),kr({adObj:e})),!s.includes(e.targetId)&&Nr(e)&&s.push(e.targetId),fe(e)&&It(e.targetId),he(e)&&((e,t)=>{var n;const r="100%",i="100%";e.resizeAd(t,[r,i]);const o=null===(n=document.querySelector(`#div_utif_${t}`))||void 0===n?void 0:n.querySelector("iframe");if(!o)return;new MutationObserver(e=>{for(const t of e)if("attributes"===t.type&&"style"===t.attributeName){const e=window.getComputedStyle(o),t=e.width,n=e.height;t===r&&n===i||(o.style.width=r,o.style.height=i)}}).observe(o,{attributes:!0,attributeFilter:["style"]})})(si,e.targetId),ge(e)&&(e=>{const t=document.querySelector(`#${e.targetId}`),{siteSpecificConfig:{publisherClassName:n,fullWidthFormatClassName:r}={}}=l.get();if(!t||!n||!r)return;const i=t.parentElement;i&&(t.classList.add(`advertory-${n}-${r}__full-width-ad`),i.classList.add(`advertory-${n}-${r}-wrapper__full-width-ad`))})(e),(e=>Ce(e,ie))(e)&&(e=>{const t=document.querySelector(`#${e.targetId}`),n=null==t?void 0:t.querySelector("iframe"),r=null==n?void 0:n.parentElement,{siteSpecificConfig:{publisherClassName:i,fullWidthFormatClassName:o}={}}=l.get();if(!t||!n||!r)return;const a=window.innerWidth,s=Math.round(a/1080*1920);t.style.width="100%",t.style.height=`${s}px`,t.classList.add(`advertory-${i}-${o}__vertical-full-width-ad`);const d=Cr(e,t.offsetWidth);r.style.transform=`scale(${d})`,r.style.transformOrigin="left top"})(e),((e,t)=>{if(!(null==t?void 0:t.scrollRefreshEnabled))return;const{targetId:n}=e,r=document.querySelector(`#${n}`),i=null==r?void 0:r.parentElement;if(!i||!r)return;Sn({adWrapper:i,placementContainer:r});const{delayTime:o=1e3}=t,a=(new Date).getTime();r&&"true"!==r.dataset.subscribedForRefresh&&(r.dataset.subscribedForRefresh="true",r.dataset.refresh&&On(r,a,o))})(e,r),(null==o?void 0:o.clearProbableDimensionsEnabled)&&(e=>{const t=document.querySelector(`#${e}`);t&&(t.style.minWidth="",t.style.minHeight="")})(e.targetId);var d,c;qe.getData("horseshoe").isAvailable&&i(e.targetId),Or(e),t.adLoaded(e),d=e.targetId,!document.querySelector(`#gdprAdTransparencyCogWheelButton-${d}`)&&(null===(c=window.gdpr)||void 0===c?void 0:c.setupButton)&&window.gdpr.setupButton(d),a&&(a.classList.add("ad-loaded"),(e=>{var t;const{siteSpecificConfig:n}=l.get(),r=null!==(t=null==n?void 0:n.mainColumnWidth)&&void 0!==t?t:1/0;e.clientWidth>r&&e.setAttribute("data-two-column-ad-layout","true")})(a)),Pr(e),window.dispatchEvent(new CustomEvent("advertory:adLoaded",{detail:{targetId:e.targetId,adFormat:Tr(e)}}))}),si.onEvent("adNoBid",n=>e(void 0,void 0,void 0,function*(){It(n.targetId),yield on(l.get(),n),er(n)&&(yield Zn()),t.adNoBid(n)})),si.onEvent("adError",(n,r)=>e(void 0,void 0,void 0,function*(){er(r)&&(yield Zn()),t.adError(n,r)})),si.onEvent("adCollapse",()=>{t.adCollapse()}),si.onEvent("adRequestFailure",e=>{It(e.targetId),t.adRequestFailure(e)}),si.onEvent("adBadRequest",e=>{It(e.targetId),t.adBadRequest(e)}),si.onEvent("adLoadedMediated",e=>t.adLoadedMediated(e)),si.onEvent("adNoBidMediated",e=>t.adNoBidMediated(e))})}),bi=(t,n)=>e(void 0,void 0,void 0,function*(){var r;l.set(t),l.setHandlers(n),qe.initialize(),window.addEventListener("message",mn,!1),si=window.apntag||{anq:[],defineTag:e=>({targetId:""}),showTag:e=>{},onEvent:(e,t,n)=>{},offEvent:(e,t)=>{},refresh:e=>{},modifyTag:(e,t)=>{},loadTags:e=>{},emitEvent:(e,t)=>{},setPageOpts:e=>{},resizeAd:(e,t,n)=>{},getAstVersion:()=>"",setEndpoint:(e,t)=>{},fireImpressionTrackers:e=>{},setKeywords:()=>{},clearRequest:()=>{}},window.apntag=si,u("Apn tag is set up on window"),yield Promise.allSettled([e(void 0,void 0,void 0,function*(){const{tcf:e,isMobileApp:t,country:n}=l.get();(yield A(e,t,n,"xandr-endpoint"))||si.setEndpoint("ib.adnxs-simple.com",!0)}),e(void 0,void 0,void 0,function*(){const{prebid:e,tcf:t,isMobileApp:n,country:r}=l.get(),i=yield A(t,n,r,"prebid");(null==e?void 0:e.enabled)&&i&&(yield Be(null==e?void 0:e.url))}),W(t),e(void 0,void 0,void 0,function*(){const{astUrl:e}=l.get();yield Be(null!=e?e:"https://adsdk.microsoft.com/ast/ast.js")}),e(void 0,void 0,void 0,function*(){const{gptUrl:e}=l.get();yield Be(null!=e?e:"https://securepubads.g.doubleclick.net/tag/js/gpt.js")}),e(void 0,void 0,void 0,function*(){const{brandmetrics:{enabled:e,url:t}={},tcf:n,isMobileApp:r,country:i}=l.get(),{getConsentAsync:o}=I(n,r,i),a=yield o();if(e&&t&&a){if(yield Be(t),document.querySelector(`.${Er}`))return window._brandmetrics=window._brandmetrics||[],void window._brandmetrics.push({cmd:"_loadsurvey"});new MutationObserver((e,t)=>{for(const n of e){if("childList"!==n.type)return;Array.from(n.addedNodes).some(e=>{var t;return null===(t=e.outerHTML)||void 0===t?void 0:t.includes(Er)})&&(t.disconnect(),window._brandmetrics=window._brandmetrics||[],window._brandmetrics.push({cmd:"_loadsurvey"}))}}).observe(document,{childList:!0,subtree:!0,attributes:!0})}}),T(),e(void 0,void 0,void 0,function*(){const{gdpr:{url:e,allowHidingAds:t=!0}={}}=l.get();t&&(window.gdpr=window.gdpr||{},window.gdpr.allowHidingAds=!0),yield Be(null!=e?e:"https://cogwheel.inventory.schibsted.io/prod/latest/gdpr-bundle.js")})]),yield Ir(),u("Libraries have been loaded and trackers have been set"),yield(r=n.librariesToLoad,e(void 0,void 0,void 0,function*(){const e=r.map(e=>Be(e));yield Promise.all(e)})),yield wi(),yield ui(),u("Page options have been set"),ci(t),u("Advertory is setup on window"),di=xt(),$n(di),qn(di),yield yi(di),u("Ads has been loaded",di),Dr(di),yield n.replaceAdsWithFinnBlink(t.finnBlink),yield(t=>e(void 0,void 0,void 0,function*(){var e;if(!t.drEdition)return;if(!(yield A(t.tcf,t.isMobileApp,t.country,"handleDrEdition")))return;const n=yield en(),r=new tn(n);nn({publisher:t.publisher,drEditionConfig:t.drEdition,device:t.deviceType,pageType:t.pageType,country:t.country},r,null===(e=t.pulse)||void 0===e?void 0:e.instance)}))(t),(e=>{if(!(null==e?void 0:e.enabled)||Gr)return;const{splitPointIDs:t,adSelector:n,trackSelector:r=Vr}=e,i=document.querySelector(r);if(!i)return;Gr=!0;const o=()=>{Jr(i,n,t)};o(),window.addEventListener("resize",o),window.addEventListener("orientationchange",o),window.addEventListener("load",o),window.addEventListener("advertory:adLoaded",()=>{requestAnimationFrame(o)}),new ResizeObserver(o).observe(i)})(t.rightColumnSplit),yield(t=>e(void 0,void 0,void 0,function*(){const e=new ni;yield e.run(t)}))(t)}),Ei=(t,n)=>e(void 0,void 0,void 0,function*(){yield((t,n)=>e(void 0,void 0,void 0,function*(){const{initConsentManager:e,getConsentAsync:r}=I(t.tcf,t.isMobileApp,t.country),i=yield Rr(t);yield Br(),yield Mr(e),yield Mr(r),u("TCF resolved successfully"),yield bi(i,n),u("Run function resolved successfully")}))(t,n)}),Ii=()=>{if(!window.location.search.includes("kv_"))return{};const e={},t=(()=>{const e=new URLSearchParams(window.location.search);return Object.fromEntries(e)})();return Object.keys(t).forEach(n=>{n.startsWith("kv_")&&(e[n.slice(3)]=t[n])}),e},Ai={[Oe]:["board","netboard","backfill","outstream"],[Le]:["panorama","outstream"],[xe]:["panorama","outstream"],[Pe]:["wph-article-panorama","wph-front-panorama"]},ki=e=>{var t;const{publisher:n}=l.get();return!!Ai[n]&&!!(null===(t=Ai[n])||void 0===t?void 0:t.some(t=>e.includes(t)))},Ti=((e,t)=>n=>Ei(Object.assign(Object.assign({},n),{siteSpecificConfig:t}),e))({initNativeAd:vt,wallpaperHandlers:{initWallpaperAd:vt,adjustAdToHorseshoe:vt},loadFinnBlinkAd:ut,replaceAdsWithFinnBlink:ut,preparePageOptions:te,prepareTag:e=>{const{keywords:t,targetId:n,invCode:r}=e,{useAppTabletInvCode:i=!0}=l.get(),o=((e,t)=>{const{isMobileApp:n}=l.get();return n?((e,t)=>e.replace(/wtb|wde|wph/g,e=>"wph"===e?"aph":t?"atb":e))(e,t):e})(r,i),a=(e=>{const{keywords:t,dynamicSizeWidthCheck:n}=e,r=`${C()}-adformat`,i=t?t[r]:[];if(!i)return{};const o=(Array.isArray(i)?i:[i]).filter(e=>!(e in ue)||window.innerWidth>=ue[e]);return{[r]:n?o:i}})(e),s=(e=>{const t=`${C()}-targetid`;return e?{[t]:[e]}:{}})(n),d=Ii(),c=(e=>ki(e)?{"aa-sch-dynamic-outstream":["true"]}:{})(r),u=((e,t)=>ki(e)?Object.assign(Object.assign({},t),{playerSkin:{videoBackgroundColor:"#e6e7e8"}}):{})(r);return Object.assign(Object.assign({},e),{invCode:o,keywords:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},t),a),s),c),d),rendererOptions:u})},siteEvents:Se,librariesToLoad:[]},$e),Ci=et("[id^=integration_godt-menu]>article .jw-controls>.jw-controlbar .jw-slider-time{display:none}[id^=integration_godt-menu]>article .jw-controls>.jw-controlbar .jw-button-container{padding:0 6px;height:36px}[id^=integration_godt-menu]>article .jw-controls>.jw-controlbar .jw-button-container .jw-icon{margin-right:3px;height:unset;width:unset;bottom:0}[id^=integration_godt-menu]>article .jw-controls>.jw-controlbar .jw-button-container .jw-icon-volume,[id^=integration_godt-menu]>article .jw-controls>.jw-controlbar .jw-button-container .jw-icon-playback{display:flex}");var Si=Object.freeze({__proto__:null,default:Ci});exports.initAdvertoryPackage=Ti,exports.updateAdvertory=(t,n)=>e(void 0,void 0,void 0,function*(){var e;if(!(null===(e=null===window||void 0===window?void 0:window.advertory)||void 0===e?void 0:e.initialized))return[];const{clearAds:r,reloadExistingAds:i,renderFinnBlinkPlacements:o,contextSelector:a}=null!=n?n:{};if(r)return Ct(),[];i&&(Ct(),document.querySelectorAll('[data-advertory-ad-rendered="true"]').forEach(e=>{At(e.id)})),c(null!=t?t:{}),yield ui();let s=xt(a);return o&&(s=s.filter(e=>be(e.id))),s.length>0&&(di=[...di,...s.map(e=>Object.assign({},e))],$n(s),qn(s),yield yi(s)),di});