@schibsted/advertory 3.17.3-no-issue.0 → 3.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ad-native/cjs/index.d.ts +6 -1
- package/ad-native/cjs/index.js +1 -1
- package/ad-native/es/index.d.ts +6 -1
- package/ad-native/es/index.js +1 -1
- package/aftenposten/cjs/index.d.ts +25 -4
- package/aftenposten/cjs/index.js +1 -1
- package/aftenposten/es/_auto-entry_aftenposten-DNQJWDRJ.js +1 -0
- package/aftenposten/es/{events-DrFV0dBK.js → events-CrUg0OPQ.js} +1 -1
- package/aftenposten/es/{index-DYjuPnFS.js → index-B88se93R.js} +1 -1
- package/aftenposten/es/{index-BpsIVc6W.js → index-B8H4adn8.js} +1 -1
- package/aftenposten/es/{index-CYwX99fH.js → index-Baw9qoIS.js} +1 -1
- package/aftenposten/es/{index-C9XykMHR.js → index-CRmEgEA-.js} +1 -1
- package/aftenposten/es/{index-BBu4Wj-F.js → index-CukHpBrP.js} +1 -1
- package/aftenposten/es/{index-DeHiEx3z.js → index-D32eGxZe.js} +1 -1
- package/{aftonbladet/es/index-C3DQrbS2.js → aftenposten/es/index-DkODCj7Y.js} +1 -1
- package/aftenposten/es/{index-DF10WqY9.js → index-oxCgGc0x.js} +1 -1
- package/aftenposten/es/index.d.ts +25 -4
- package/aftenposten/es/index.js +1 -1
- package/aftenposten/es/{styles-B1AGMY-X.js → styles-B4tTww6V.js} +1 -1
- package/aftenposten/es/{styles-CRv87wHW.js → styles-C2cUV2b9.js} +1 -1
- package/aftenposten/es/{styles-Bi04XSrV.js → styles-CnQw6LZA.js} +1 -1
- package/aftenposten/es/{styles-yvcjbK1D.js → styles-D5ApGFNI.js} +1 -1
- package/aftenposten/es/{styles-BdVi1b2S.js → styles-DHu1uaqZ.js} +1 -1
- package/aftenposten/es/{styles-_OUQX0b3.js → styles-DOKeZ3h-.js} +1 -1
- package/aftenposten/es/{styles-9OmJ8_oN.js → styles-DU53ed9M.js} +1 -1
- package/aftenposten/es/{styles-DbSgl5PZ.js → styles-D_6_RmQo.js} +1 -1
- package/aftenposten/es/{styles-C3JnCvtp.js → styles-De8j1a-R.js} +1 -1
- package/aftenposten/es/{styles-Cks2zrCg.js → styles-oO_QUZ2K.js} +1 -1
- package/aftenposten/es/{styles-CzlcZrYO.js → styles-te1Pc83x.js} +1 -1
- package/aftenpostenv2/es/_auto-entry_aftenpostenv2-BtdjJBRi.js +1 -0
- package/aftenpostenv2/es/{events-Dgo8DjiG.js → events-BrKUU6S-.js} +1 -1
- package/aftenpostenv2/es/{index-D-1y672n.js → index-B3eSx0AF.js} +1 -1
- package/aftenpostenv2/es/{index-__aEkQFk.js → index-Bva5GG_A.js} +1 -1
- package/aftenpostenv2/es/{index-CIrgCgon.js → index-DLyPNdxl.js} +1 -1
- package/{aftonbladetv2/es/index-BhPCsPVo.js → aftenpostenv2/es/index-DSAe15TH.js} +1 -1
- package/aftenpostenv2/es/{index-BDcrgq9l.js → index-DYl7sSG_.js} +1 -1
- package/aftenpostenv2/es/{index-DyB1vUtZ.js → index-Do7nyVpB.js} +1 -1
- package/aftenpostenv2/es/{index-cNznJHO6.js → index-dOfoy9xz.js} +1 -1
- package/aftenpostenv2/es/{index-BoQJmERC.js → index-ynKvMWyD.js} +1 -1
- package/aftenpostenv2/es/index.d.ts +25 -4
- package/aftenpostenv2/es/index.js +1 -1
- package/aftenpostenv2/es/{styles-Cs23-QeP.js → styles-44Ytvc9u.js} +1 -1
- package/aftenpostenv2/es/{styles-PSOvI0L4.js → styles-BJBUx_yM.js} +1 -1
- package/aftenpostenv2/es/{styles-CGeRgRt0.js → styles-Bdvoy-5V.js} +1 -1
- package/aftenpostenv2/es/{styles-qvIxXbLQ.js → styles-BukZbfMI.js} +1 -1
- package/aftenpostenv2/es/{styles-SQec1A8F.js → styles-CArxNqcE.js} +1 -1
- package/aftenpostenv2/es/{styles-DLk5mux5.js → styles-CkIPdN9M.js} +1 -1
- package/aftenpostenv2/es/{styles-C1-hljRj.js → styles-Cp2Dp8Rx.js} +1 -1
- package/aftenpostenv2/es/{styles-ZDNIZnXa.js → styles-DsNPVIp7.js} +1 -1
- package/aftenpostenv2/es/{styles-DFEdRPun.js → styles-DyvLGuPw.js} +1 -1
- package/aftenpostenv2/es/{styles-DXxzhWJu.js → styles-ZLshTJTG.js} +1 -1
- package/aftenpostenv2/es/{styles-Cjp-f91D.js → styles-jtekW9Qf.js} +1 -1
- package/aftonbladet/cjs/index.d.ts +25 -4
- package/aftonbladet/cjs/index.js +1 -1
- package/aftonbladet/es/_auto-entry_aftonbladet-CznwHJ9L.js +1 -0
- package/aftonbladet/es/{events-rJcXVbHP.js → events-DJJwehoG.js} +1 -1
- package/aftonbladet/es/{index-CSSldldx.js → index-BMlpU8aw.js} +1 -1
- package/aftonbladet/es/{index-CTMBtrux.js → index-BTr2EHBG.js} +1 -1
- package/aftonbladet/es/{index-BmOBHZkC.js → index-BfGlK5AK.js} +1 -1
- package/aftonbladet/es/{index-BZlnBBc1.js → index-C7WHdqMB.js} +1 -1
- package/aftonbladet/es/{index-NBlN9Jrg.js → index-CcK3t2zJ.js} +1 -1
- package/aftonbladet/es/{index-CFnAaVoE.js → index-DHQi_Gb5.js} +1 -1
- package/{aftenposten/es/index-BkCQ75ZQ.js → aftonbladet/es/index-DX1V8TfP.js} +1 -1
- package/aftonbladet/es/{index-Rg-TVf1t.js → index-L7Igeo8s.js} +1 -1
- package/aftonbladet/es/index.d.ts +25 -4
- package/aftonbladet/es/index.js +1 -1
- package/aftonbladet/es/{styles-DwDU8W8N.js → styles-B24gjaYN.js} +1 -1
- package/aftonbladet/es/{styles-DK1YWvOj.js → styles-B8-C3HbP.js} +1 -1
- package/aftonbladet/es/{styles-B9jmcT41.js → styles-Bs-L9RIM.js} +1 -1
- package/aftonbladet/es/{styles-DcIeoE8-.js → styles-BwQI8Har.js} +1 -1
- package/aftonbladet/es/{styles-D3apiLDJ.js → styles-C2KNA6_Q.js} +1 -1
- package/aftonbladet/es/{styles-CfvlVErl.js → styles-DpD1yUu5.js} +1 -1
- package/aftonbladet/es/{styles-Dkc8b1El.js → styles-Du4kYdG3.js} +1 -1
- package/aftonbladetv2/es/_auto-entry_aftonbladetv2-Cuo_y3Oe.js +1 -0
- package/aftonbladetv2/es/{events-BxYlZ14G.js → events-pCNuOORU.js} +1 -1
- package/aftonbladetv2/es/{index-Dc3P-Vj6.js → index-BG9zfrXp.js} +1 -1
- package/{aftenpostenv2/es/index-BMAuUe4u.js → aftonbladetv2/es/index-CG-_IAXO.js} +1 -1
- package/aftonbladetv2/es/{index-CEgE18wQ.js → index-ChI1Xtav.js} +1 -1
- package/aftonbladetv2/es/{index-DstH63Eo.js → index-DZF6xWvX.js} +1 -1
- package/aftonbladetv2/es/{index-BZeHNgGY.js → index-Df0qhN5Y.js} +1 -1
- package/aftonbladetv2/es/{index-BSTet1E6.js → index-DmNGezFs.js} +1 -1
- package/aftonbladetv2/es/{index-DYnoler4.js → index-FxbhCpIm.js} +1 -1
- package/aftonbladetv2/es/{index-PvR1BYh3.js → index-nAn7C_ww.js} +1 -1
- package/aftonbladetv2/es/index.d.ts +25 -4
- package/aftonbladetv2/es/index.js +1 -1
- package/aftonbladetv2/es/{styles-DoxsWHNx.js → styles-3aKR0OYZ.js} +1 -1
- package/aftonbladetv2/es/{styles-Cso2SE0o.js → styles-BPm6_Tyf.js} +1 -1
- package/aftonbladetv2/es/{styles-XCvAMXHH.js → styles-Duqf6IZA.js} +1 -1
- package/aftonbladetv2/es/{styles-DG6jT6KH.js → styles-DzMy_ylE.js} +1 -1
- package/aftonbladetv2/es/{styles-2IywgKra.js → styles-WUl2O9SJ.js} +1 -1
- package/aftonbladetv2/es/{styles-01kZc3MH.js → styles-m7_3GfZS.js} +1 -1
- package/aftonbladetv2/es/{styles-CnZuHMAg.js → styles-xrODYqc8.js} +1 -1
- package/brandmetrics/cjs/index.js +1 -1
- package/brandmetrics/es/index.js +1 -1
- package/bt/cjs/index.d.ts +25 -4
- package/bt/cjs/index.js +1 -1
- package/bt/es/_auto-entry_bt-CZB9FTXD.js +1 -0
- package/bt/es/{events-BTTfxZEn.js → events-DE_uZlA1.js} +1 -1
- package/bt/es/{index-DoiSIQUA.js → index-B0a_Oa4i.js} +1 -1
- package/bt/es/{index-c5kc-LLT.js → index-CODK_zJ9.js} +1 -1
- package/bt/es/{index-IhdafbF4.js → index-CSofW9eD.js} +1 -1
- package/bt/es/{index-BybloOV3.js → index-Cd2KH2u-.js} +1 -1
- package/bt/es/{index-CmNAWoja.js → index-Dr3GcIfK.js} +1 -1
- package/{sa/es/index-CSbL3Gqd.js → bt/es/index-Du1q8PZU.js} +1 -1
- package/{sa/es/index-5tnwuNe_.js → bt/es/index-PV9x_biL.js} +1 -1
- package/bt/es/{index-BZhRaIjL.js → index-vemxQymc.js} +1 -1
- package/bt/es/index.d.ts +25 -4
- package/bt/es/index.js +1 -1
- package/bt/es/{styles-5J3v6CaG.js → styles-BM5_s_r7.js} +1 -1
- package/bt/es/{styles-Dge93syQ.js → styles-B_fc-kdO.js} +1 -1
- package/{vg/es/styles-DuxXrYea.js → bt/es/styles-BmrHJiYo.js} +1 -1
- package/bt/es/{styles-CSsKrNX0.js → styles-BscvjspQ.js} +1 -1
- package/bt/es/{styles-Cchr2_Ww.js → styles-Bta58nId.js} +1 -1
- package/bt/es/{styles-CLdus-H8.js → styles-BvkvfBxv.js} +1 -1
- package/{sa/es/styles-CIEP0fIL.js → bt/es/styles-C9A3YE-k.js} +1 -1
- package/bt/es/{styles-DkXuYx14.js → styles-CSxhZElM.js} +1 -1
- package/bt/es/{styles-B6EU0y_N.js → styles-D4NwmlBA.js} +1 -1
- package/bt/es/{styles-BmnSvjox.js → styles-imkAc2uq.js} +1 -1
- package/btv2/es/_auto-entry_btv2-jyP99ykN.js +1 -0
- package/{sav2/es/events-Dp9lnfAs.js → btv2/es/events-BqMvV7di.js} +1 -1
- package/btv2/es/{index-CQF1nZr3.js → index-B5UitQXo.js} +1 -1
- package/btv2/es/{index-BGcafCy2.js → index-C9BTFt3G.js} +1 -1
- package/btv2/es/{index-DoMSlydf.js → index-CBJLiIfz.js} +1 -1
- package/btv2/es/{index-D23w-Btl.js → index-CMZC7H8g.js} +1 -1
- package/{sav2/es/index-DWm-UHqQ.js → btv2/es/index-CNOhmWcU.js} +1 -1
- package/btv2/es/{index-CktvaYLJ.js → index-DV0c6Xrq.js} +1 -1
- package/btv2/es/{index-i_utaDhT.js → index-DpxleBMV.js} +1 -1
- package/btv2/es/{index-CPlese99.js → index-DxvAY5Lc.js} +1 -1
- package/btv2/es/index.d.ts +25 -4
- package/btv2/es/index.js +1 -1
- package/btv2/es/{styles-C-ZtQhan.js → styles-B2feTcg_.js} +1 -1
- package/btv2/es/{styles-CbLeNOrs.js → styles-BInms_h5.js} +1 -1
- package/btv2/es/{styles-B2OJXzrM.js → styles-BSPiAJfQ.js} +1 -1
- package/btv2/es/{styles-dkNCmliT.js → styles-CVY_OoAs.js} +1 -1
- package/{sav2/es/styles-DUem7O9S.js → btv2/es/styles-CaJ8VnX_.js} +1 -1
- package/{sav2/es/styles-Dj_GPfsz.js → btv2/es/styles-CkiWn-pK.js} +1 -1
- package/{sav2/es/styles-CUkEDO5m.js → btv2/es/styles-DTzc8iL0.js} +1 -1
- package/{vgv2/es/styles-BQj7pk_x.js → btv2/es/styles-UQhKSng8.js} +1 -1
- package/btv2/es/{styles-DdRhazKl.js → styles-x4cDdw2y.js} +1 -1
- package/btv2/styles.css +1 -1
- package/common/cjs/index.js +1 -1
- package/common/es/index.js +1 -1
- package/e24/es/_auto-entry_e24-o2zJnnp7.js +1 -0
- package/e24/es/{events-Cd2dTyNn.js → events-DF8f8UTH.js} +1 -1
- package/e24/es/{index-87AuIS7V.js → index-BQJbsM6e.js} +1 -1
- package/e24/es/{index-BEIep0Ze.js → index-BeeAlBuD.js} +1 -1
- package/e24/es/{index-UPwew21d.js → index-BsmbZsXV.js} +1 -1
- package/e24/es/{index-B4PlQ911.js → index-CP6Im7lE.js} +1 -1
- package/e24/es/{index--6UTxLKO.js → index-CYHnZe0J.js} +1 -1
- package/e24/es/{index-BF0fnST5.js → index-Cmwd1gSI.js} +1 -1
- package/e24/es/{index-ClS6qNV0.js → index-Woi0QIyP.js} +1 -1
- package/e24/es/{index-Dzr7VO1y.js → index-v06i8ZMq.js} +1 -1
- package/e24/es/index.d.ts +25 -4
- package/e24/es/index.js +1 -1
- package/{tv4/es/styles-6LXZ5x_a.js → e24/es/styles-BQnfcenF.js} +1 -1
- package/e24/es/{styles-CfM-1QHc.js → styles-Bfd45Pjf.js} +1 -1
- package/e24/es/{styles-CcN9IEsB.js → styles-BhEr5ezW.js} +1 -1
- package/e24/es/{styles-BUFCHi9e.js → styles-Bz0tFWFB.js} +1 -1
- package/e24/es/{styles-DkOQgCFK.js → styles-C4GttOVW.js} +1 -1
- package/e24/es/{styles-B2DEW-hT.js → styles-CElrg8qK.js} +1 -1
- package/e24/es/{styles-DwUZS-bn.js → styles-Cmrihndl.js} +1 -1
- package/e24/es/{styles-Cu0eUKZo.js → styles-D3LLw4RS.js} +1 -1
- package/e24/es/{styles-CfP9Vfv0.js → styles-D3vWLz7X.js} +1 -1
- package/e24/es/{styles-Dc4VhsK-.js → styles-DjdLwJ-N.js} +1 -1
- package/e24/es/{styles-Dvo7zrg1.js → styles-SI2Tr_RP.js} +1 -1
- package/e24/es/{styles-DCAAdGVf.js → styles-jZ8udc-A.js} +1 -1
- package/editory/cjs/index.d.ts +6 -1
- package/editory/es/index.d.ts +6 -1
- package/fotbollskanalen/cjs/index.d.ts +25 -4
- package/fotbollskanalen/cjs/index.js +1 -1
- package/fotbollskanalen/es/_auto-entry_fotbollskanalen-BoGkrwkH.js +1 -0
- package/fotbollskanalen/es/{events-DC2A2YOH.js → events-XgL2a9Ad.js} +1 -1
- package/fotbollskanalen/es/{index-B-DfI9hC.js → index-B4s9_MRH.js} +1 -1
- package/fotbollskanalen/es/{index-MWfCDJyV.js → index-Bb-DsC59.js} +1 -1
- package/fotbollskanalen/es/{index-B451kqAc.js → index-CABM14sH.js} +1 -1
- package/fotbollskanalen/es/{index-B9_Sz-54.js → index-CxQRsQ7s.js} +1 -1
- package/fotbollskanalen/es/{index-DiLmKZt3.js → index-D3_ErBOr.js} +1 -1
- package/fotbollskanalen/es/{index-BKW4bFIJ.js → index-D3vJg6of.js} +1 -1
- package/fotbollskanalen/es/{index-C391nMTK.js → index-D5gs6mRS.js} +1 -1
- package/fotbollskanalen/es/{index-DxBBNuC0.js → index-uHEsJIAw.js} +1 -1
- package/fotbollskanalen/es/index.d.ts +25 -4
- package/fotbollskanalen/es/index.js +1 -1
- package/fotbollskanalen/es/{styles-DixDvPPA.js → styles-5gUPsWW9.js} +1 -1
- package/fotbollskanalen/es/{styles-BGNGAe2-.js → styles-Be0tghxV.js} +1 -1
- package/fotbollskanalen/es/{styles-Cl7zoy5_.js → styles-Bvv8u7Ja.js} +1 -1
- package/fotbollskanalen/es/{styles-GoFDWbbT.js → styles-CoTOpYRX.js} +1 -1
- package/fotbollskanalen/es/{styles-BTpc2HZt.js → styles-hLRHR3gJ.js} +1 -1
- package/glimr/cjs/index.js +1 -1
- package/glimr/es/index.js +1 -1
- package/godt/cjs/index.d.ts +25 -4
- package/godt/cjs/index.js +1 -1
- package/kilkaya/cjs/index.d.ts +6 -1
- package/kilkaya/cjs/index.js +1 -1
- package/kilkaya/es/index.d.ts +6 -1
- package/kilkaya/es/index.js +1 -1
- package/klart/cjs/index.d.ts +25 -4
- package/klart/cjs/index.js +1 -1
- package/koket/cjs/index.d.ts +25 -4
- package/koket/cjs/index.js +1 -1
- package/koket/es/_auto-entry_koket-BITL2_K1.js +1 -0
- package/koket/es/{events-ircrdxrW.js → events-CJe7o002.js} +1 -1
- package/koket/es/{index-DM25lZ1I.js → index-Bj4wpTgt.js} +1 -1
- package/koket/es/{index-Br3mqMs0.js → index-CSA4jvBm.js} +1 -1
- package/koket/es/{index-CvzsGNvf.js → index-D2ikK49F.js} +1 -1
- package/{svdv2/es/index-w3s6a0BM.js → koket/es/index-D76GM_Dq.js} +1 -1
- package/koket/es/{index-BUzc35Jj.js → index-DUMFbWv2.js} +1 -1
- package/{svdv2/es/index-d2-BL9x2.js → koket/es/index-D_t1L0Jw.js} +1 -1
- package/koket/es/{index-D3v2bGK4.js → index-DnTZqSNs.js} +1 -1
- package/koket/es/{index-B8k0GOJ7.js → index-Dxz_IhQv.js} +1 -1
- package/koket/es/index.d.ts +25 -4
- package/koket/es/index.js +1 -1
- package/koket/es/{styles-LduwO43b.js → styles-B5AKPQcZ.js} +1 -1
- package/{svdv2/es/styles-DfXEVHoZ.js → koket/es/styles-CvVaiJbk.js} +1 -1
- package/koket/es/{styles-CVZ8UsRx.js → styles-D7VFY5X2.js} +1 -1
- package/{svdv2/es/styles-CAQMmBBf.js → koket/es/styles-If56BndQ.js} +1 -1
- package/koket/es/{styles-BH1ieOjw.js → styles-_ywNTArC.js} +1 -1
- package/minmote/cjs/index.d.ts +25 -4
- package/minmote/cjs/index.js +1 -1
- package/mtv/es/_auto-entry_mtv-D53dvC1i.js +1 -0
- package/mtv/es/{index-BStz0L62.js → index-BZztN2dU.js} +1 -1
- package/mtv/es/index-DIuXGid2.js +1 -0
- package/mtv/es/index-DT8GWwa8.js +1 -0
- package/mtv/es/{index-BB2_LyL7.js → index-TbvSGRB5.js} +1 -1
- package/mtv/es/index.d.ts +27 -6
- package/mtv/es/index.js +1 -1
- package/{svd/es/styles-D6djW8Eo.js → mtv/es/styles-BpMDR0GA.js} +1 -1
- package/omni/es/_auto-entry_omni-BVChM78_.js +1 -0
- package/omni/es/{events-DMYRUFOA.js → events-Dcpm5emQ.js} +1 -1
- package/omni/es/{index-BGXOEIdC.js → index-B5L9LdZe.js} +1 -1
- package/omni/es/{index-CzNBPlm5.js → index-ChmcSFS1.js} +1 -1
- package/omni/es/{index-vtGWj6Qt.js → index-D8Du6qKy.js} +1 -1
- package/omni/es/{index-D_zHL5xR.js → index-DEd1G3aM.js} +1 -1
- package/omni/es/{index-BJMrrHHN.js → index-DS_3fMAL.js} +1 -1
- package/omni/es/{index-BA8ZSjBF.js → index-DUL7FQvO.js} +1 -1
- package/{sav2/es/index-DbQIUZI_.js → omni/es/index-DoPgNVgH.js} +1 -1
- package/omni/es/{index-CPFSh255.js → index-fF0V2I_V.js} +1 -1
- package/omni/es/index.d.ts +25 -4
- package/omni/es/index.js +1 -1
- package/omni/es/{styles-BOdRjJS0.js → styles-BdEe5Ynl.js} +1 -1
- package/omni/es/{styles-Dn1cDwX6.js → styles-CW92yIpD.js} +1 -1
- package/omni/es/{styles-CYSXAMP-.js → styles-kHuAMSyr.js} +1 -1
- package/package.json +1 -1
- package/pent/cjs/index.d.ts +25 -4
- package/pent/cjs/index.js +1 -1
- package/pulse/cjs/index.d.ts +8 -3
- package/pulse/cjs/index.js +1 -1
- package/pulse/es/index.d.ts +8 -3
- package/pulse/es/index.js +1 -1
- package/sa/cjs/index.d.ts +25 -4
- package/sa/cjs/index.js +1 -1
- package/sa/es/_auto-entry_sa-J8OfTxac.js +1 -0
- package/sa/es/{events-BDTO1uoY.js → events-C3BMo9Uo.js} +1 -1
- package/sa/es/{index-Cq5l3VCX.js → index-CawIeUqK.js} +1 -1
- package/sa/es/{index-CEdPBwwD.js → index-Cto0_xo8.js} +1 -1
- package/sa/es/{index-BN2kqP-Z.js → index-CuD4xNFU.js} +1 -1
- package/sa/es/{index-Bj_NrEkj.js → index-Cx1T5nb9.js} +1 -1
- package/{bt/es/index-Cc1irGR3.js → sa/es/index-DFBOTrjK.js} +1 -1
- package/{bt/es/index-BvNyTMP_.js → sa/es/index-Du-rhVYT.js} +1 -1
- package/sa/es/{index-DFD6AldM.js → index-DxUp0ZXa.js} +1 -1
- package/sa/es/{index-BwkLrqzw.js → index-fKdGZ7GD.js} +1 -1
- package/sa/es/index.d.ts +25 -4
- package/sa/es/index.js +1 -1
- package/sa/es/{styles-mip6kenJ.js → styles-B3bE3oeO.js} +1 -1
- package/sa/es/{styles-Avlvf_an.js → styles-BMtPMhSP.js} +1 -1
- package/sa/es/{styles-CoMPX3Uo.js → styles-BvRBg64g.js} +1 -1
- package/sa/es/{styles-35KFdgRO.js → styles-CL6zmM-h.js} +1 -1
- package/{vg/es/styles-Z0ltuKsj.js → sa/es/styles-CcFDd5SA.js} +1 -1
- package/{vg/es/styles-DRlgmYS6.js → sa/es/styles-CiDiUkgA.js} +1 -1
- package/sa/es/{styles-D7kQN4tJ.js → styles-DjWc-g-U.js} +1 -1
- package/sa/es/{styles-t_EqxDnm.js → styles-DnI_syRT.js} +1 -1
- package/sa/es/{styles-5ZH6mdVq.js → styles-G5IDTsth.js} +1 -1
- package/sa/es/{styles-heBXtksC.js → styles-KY5KJOnA.js} +1 -1
- package/sav2/es/_auto-entry_sav2-nmDgZMyM.js +1 -0
- package/{tvnu/es/events-DG4iAom3.js → sav2/es/events-BM5FbEtd.js} +1 -1
- package/sav2/es/{index-Drq7H5-2.js → index-BMjVrYV7.js} +1 -1
- package/sav2/es/{index-3souzBf0.js → index-BgbkIwOq.js} +1 -1
- package/{tvnu/es/index-bgUvqn5_.js → sav2/es/index-C5WrRc-b.js} +1 -1
- package/sav2/es/{index-DsbYeItT.js → index-CFCEtWva.js} +1 -1
- package/{omni/es/index-BWULYxlB.js → sav2/es/index-CXNd1xW1.js} +1 -1
- package/sav2/es/{index-BAIPDd7_.js → index-CqZ5h5be.js} +1 -1
- package/sav2/es/{index-DEoczlk_.js → index-CwfU7lhW.js} +1 -1
- package/{tvnu/es/index-DvrKJZbP.js → sav2/es/index-Heoe_AIr.js} +1 -1
- package/sav2/es/index.d.ts +25 -4
- package/sav2/es/index.js +1 -1
- package/{btv2/es/styles-DuZfN7De.js → sav2/es/styles-9CZX0c_O.js} +1 -1
- package/sav2/es/{styles-D_EhAHbB.js → styles-B4ork19U.js} +1 -1
- package/sav2/es/{styles-DKlujQs-.js → styles-BKirbOEP.js} +1 -1
- package/{vgv2/es/styles-BH2730_N.js → sav2/es/styles-C30jV7ky.js} +1 -1
- package/{vgv2/es/styles-uw85Axqh.js → sav2/es/styles-CK4Np9Dz.js} +1 -1
- package/sav2/es/{styles-Cc4tdxzT.js → styles-CjU4l-SU.js} +1 -1
- package/sav2/es/{styles-C4mXD_Br.js → styles-DmiRDUDx.js} +1 -1
- package/{btv2/es/styles-CCdvxZkw.js → sav2/es/styles-Jp_tDrzp.js} +1 -1
- package/sav2/es/{styles-Cfond6pZ.js → styles-eYX3EHRu.js} +1 -1
- package/svd/cjs/index.d.ts +25 -4
- package/svd/cjs/index.js +1 -1
- package/svd/es/_auto-entry_svd-BOBXC1NB.js +1 -0
- package/svd/es/{events-8yBFM-g9.js → events-C1VnSaGH.js} +1 -1
- package/svd/es/{index-B2sNqbth.js → index-B0d8xAfM.js} +1 -1
- package/svd/es/{index-DtG-UZOo.js → index-B3Ok5Zxi.js} +1 -1
- package/svd/es/{index-B4JjxZN-.js → index-C0zYrhS8.js} +1 -1
- package/{tv4/es/index-DZzapVv8.js → svd/es/index-CB5fxcjW.js} +1 -1
- package/svd/es/{index-i_xbZf1B.js → index-CPMzs4OC.js} +1 -1
- package/svd/es/{index-CzXdBAfA.js → index-CbwiRx-g.js} +1 -1
- package/svd/es/{index-D-s47e3U.js → index-DkAKiA6e.js} +1 -1
- package/svd/es/{index-DhS4Nx4a.js → index-t-VmRR6x.js} +1 -1
- package/svd/es/index.d.ts +25 -4
- package/svd/es/index.js +1 -1
- package/svd/es/{styles-2Lce7uvt.js → styles-4soJ7u-x.js} +1 -1
- package/{mtv/es/styles-DEY0uCs4.js → svd/es/styles-B62zkTco.js} +1 -1
- package/svd/es/{styles-B2QvCzKq.js → styles-B6yIVgo2.js} +1 -1
- package/svd/es/{styles-CQM4vLOx.js → styles-C3IWf8aj.js} +1 -1
- package/svd/es/{styles-GF_LpFgN.js → styles-CYqkTmPz.js} +1 -1
- package/svd/es/{styles-8PQPeHpF.js → styles-CtcLRY0n.js} +1 -1
- package/svd/es/{styles-BiWx6ZH4.js → styles-Dul2qFeg.js} +1 -1
- package/svdv2/es/_auto-entry_svdv2-C-1qQWmF.js +1 -0
- package/svdv2/es/{events-qLqrGAio.js → events-Dd2yn2PL.js} +1 -1
- package/svdv2/es/{index-Dds7WtOX.js → index-B1Msxa1O.js} +1 -1
- package/svdv2/es/{index-BzGM0CTM.js → index-C_Hy2D6G.js} +1 -1
- package/svdv2/es/{index-DqJR991C.js → index-CgvIVueE.js} +1 -1
- package/{koket/es/index-DeI6vS_G.js → svdv2/es/index-Cm2XNnkR.js} +1 -1
- package/svdv2/es/{index-DMVf3KFx.js → index-D7ABApW9.js} +1 -1
- package/svdv2/es/{index-BVSRed75.js → index-DjDdQPHz.js} +1 -1
- package/svdv2/es/{index-DdcT82wK.js → index-ZVx6osQq.js} +1 -1
- package/{koket/es/index-huZ-_aLo.js → svdv2/es/index-vayJTGli.js} +1 -1
- package/svdv2/es/index.d.ts +25 -4
- package/svdv2/es/index.js +1 -1
- package/svdv2/es/{styles-ByFDL-dP.js → styles-B0JQvBQt.js} +1 -1
- package/svdv2/es/{styles-D1HQ_1IA.js → styles-BGCZCbcv.js} +1 -1
- package/svdv2/es/{styles-Uqa5OW98.js → styles-Bz8f24X2.js} +1 -1
- package/svdv2/es/{styles-bHk0csrV.js → styles-CEborJgX.js} +1 -1
- package/svdv2/es/{styles-Ie7GbPj3.js → styles-CqjB4SkE.js} +1 -1
- package/{koket/es/styles-C_2fBGU2.js → svdv2/es/styles-DQ_w0XU-.js} +1 -1
- package/{koket/es/styles-C7o8yioZ.js → svdv2/es/styles-XF3Es5pU.js} +1 -1
- package/svdv2/es/{styles-BpposcNL.js → styles-Xcws2oR2.js} +1 -1
- package/tek/cjs/index.d.ts +25 -4
- package/tek/cjs/index.js +1 -1
- package/tv4/cjs/index.d.ts +25 -4
- package/tv4/cjs/index.js +1 -1
- package/tv4/es/_auto-entry_tv4-DrT58fo2.js +1 -0
- package/{mtv/es/events-DcYmIufJ.js → tv4/es/events-CA_qpiiH.js} +1 -1
- package/tv4/es/{index-DrkdtvU4.js → index-1faQFOdm.js} +1 -1
- package/tv4/es/{index-NFbvbjjl.js → index-B4Kh7kpG.js} +1 -1
- package/{svd/es/index-DZm2YXsK.js → tv4/es/index-BM8z6Ixi.js} +1 -1
- package/tv4/es/{index-BJJnBqOv.js → index-BsfijWz0.js} +1 -1
- package/tv4/es/{index-YmGI2bVj.js → index-CuR9OppE.js} +1 -1
- package/tv4/es/{index-C3ifCrbG.js → index-DGUaN9RI.js} +1 -1
- package/tv4/es/{index-qDiymVH7.js → index-DJfxqylY.js} +1 -1
- package/tv4/es/{index-CQsI9gjC.js → index-iFXY2RDG.js} +1 -1
- package/tv4/es/index.d.ts +25 -4
- package/tv4/es/index.js +1 -1
- package/{e24/es/styles-fUpBcQWW.js → tv4/es/styles-B-tvI5HI.js} +1 -1
- package/tv4/es/{styles-DYnUm3FY.js → styles-BjfL5pmp.js} +1 -1
- package/tv4/es/{styles-D4Axupga.js → styles-CMOqiTdr.js} +1 -1
- package/tv4/es/{styles-Cu4IjVLi.js → styles-DYdmZGFU.js} +1 -1
- package/tv4/es/{styles-CbPUmvE2.js → styles-DwosxoLg.js} +1 -1
- package/tvnu/cjs/index.d.ts +25 -4
- package/tvnu/cjs/index.js +1 -1
- package/tvnu/es/_auto-entry_tvnu-BN6qNwOY.js +1 -0
- package/{btv2/es/events-CQz2eBDf.js → tvnu/es/events-Dn2KJr0j.js} +1 -1
- package/tvnu/es/{index-CmKqyiye.js → index-BTKg4emk.js} +1 -1
- package/tvnu/es/{index-D7pI0_mw.js → index-BjEOq_zN.js} +1 -1
- package/tvnu/es/{index-BISzrl9Y.js → index-C-17pOoR.js} +1 -1
- package/{btv2/es/index-C4Az6XIC.js → tvnu/es/index-C3LNZYqg.js} +1 -1
- package/tvnu/es/{index-DYjxij7P.js → index-CCfVOFWB.js} +1 -1
- package/tvnu/es/{index-zTrtNvRR.js → index-CR8jWo2c.js} +1 -1
- package/{sav2/es/index-pvZ-dP5X.js → tvnu/es/index-DFmrpUUo.js} +1 -1
- package/tvnu/es/{index-Dm6rvUix.js → index-vd3IGMiX.js} +1 -1
- package/tvnu/es/index.d.ts +25 -4
- package/tvnu/es/index.js +1 -1
- package/{btv2/es/styles-DGnJ2ZHN.js → tvnu/es/styles-D12Q2zLD.js} +1 -1
- package/tvnu/es/{styles-CFcdp1fA.js → styles-D3x4jf-j.js} +1 -1
- package/tvnu/es/{styles-D3ildpSw.js → styles-DQHdlPhl.js} +1 -1
- package/tvnu/es/{styles-B4tuyk2Y.js → styles-DWXHDRlP.js} +1 -1
- package/types/index.d.ts +6 -1
- package/vg/cjs/index.d.ts +25 -4
- package/vg/cjs/index.js +1 -1
- package/vg/es/_auto-entry_vg-Trd8pvQs.js +1 -0
- package/vg/es/{events-CGfaaHdB.js → events-BfqUtz1_.js} +1 -1
- package/vg/es/{index-COQVHzcU.js → index-BJB7jY6x.js} +1 -1
- package/vg/es/{index-Cb_nVuUE.js → index-CDqvLPgT.js} +1 -1
- package/vg/es/{index-BmasLAXQ.js → index-CTaICLSw.js} +1 -1
- package/vg/es/{index-Bei2WE_E.js → index-C_JV8JF_.js} +1 -1
- package/vg/es/{index-BcnX31VT.js → index-CuWR3e5A.js} +1 -1
- package/vg/es/{index-Cly9tLBa.js → index-DeQUkpYq.js} +1 -1
- package/vg/es/{index-BucJ-9XL.js → index-DkPggcF3.js} +1 -1
- package/vg/es/{index-C6kFY3dZ.js → index-x8PwNet6.js} +1 -1
- package/vg/es/index.d.ts +25 -4
- package/vg/es/index.js +1 -1
- package/vg/es/{styles-D0z9s1YH.js → styles--yOXPdjG.js} +1 -1
- package/{bt/es/styles-BCTNj0AI.js → vg/es/styles-1n8j2EjV.js} +1 -1
- package/{sa/es/styles-B58C90tH.js → vg/es/styles-3vc-o84P.js} +1 -1
- package/vg/es/{styles-B_A2_8w8.js → styles-B-9EIsrQ.js} +1 -1
- package/vg/es/{styles-BB3qQZ9l.js → styles-BmpqqoHg.js} +1 -1
- package/vg/es/{styles-ChTpS5EJ.js → styles-BsguFks5.js} +1 -1
- package/vg/es/{styles-Byh-69do.js → styles-CC05R_3-.js} +1 -1
- package/vg/es/{styles-BQA1hCbw.js → styles-CNRmBQ4c.js} +1 -1
- package/vg/es/{styles-CMqiReP_.js → styles-CVbJvaly.js} +1 -1
- package/vg/es/{styles-w8ZeI_ne.js → styles-CgOAOEfA.js} +1 -1
- package/{bt/es/styles-DQVwmpRj.js → vg/es/styles-CzX1ajop.js} +1 -1
- package/vg/es/{styles-C0KjyzTJ.js → styles-DK6OtLji.js} +1 -1
- package/vg/es/{styles-C2dD9HYG.js → styles-Di-6gMqt.js} +1 -1
- package/vg/es/{styles-CSe2imW9.js → styles-L2IpsHbq.js} +1 -1
- package/vg/es/{styles-dmsQx7Im.js → styles-Q9SKc1Hh.js} +1 -1
- package/vg/es/{styles-46BzZ7Zb.js → styles-pTQEVgFw.js} +1 -1
- package/vgv2/es/_auto-entry_vgv2-B3OjjjK2.js +1 -0
- package/vgv2/es/{events-PFdv4TSw.js → events-Bq8LUFIZ.js} +1 -1
- package/vgv2/es/{index-BR8j1wSu.js → index-BWIZzC2g.js} +1 -1
- package/vgv2/es/{index-BeQdxkGt.js → index-BgPYv31C.js} +1 -1
- package/vgv2/es/{index-RdR3Qa3u.js → index-Cqg9XYLx.js} +1 -1
- package/vgv2/es/{index-DzjEt1rM.js → index-D57YFxL2.js} +1 -1
- package/vgv2/es/{index-CkBRixx8.js → index-DG8kZFha.js} +1 -1
- package/vgv2/es/{index-CdS4MYhL.js → index-DVRyKCSg.js} +1 -1
- package/vgv2/es/{index-BIvUYvnr.js → index-DYYNBjmC.js} +1 -1
- package/vgv2/es/{index-Bt0xr2Gw.js → index-MIhy6YLN.js} +1 -1
- package/vgv2/es/index.d.ts +25 -4
- package/vgv2/es/index.js +1 -1
- package/vgv2/es/styles-8OZXx9WD.js +1 -0
- package/vgv2/es/{styles-D0M_Dye0.js → styles-BdY5gfHd.js} +1 -1
- package/vgv2/es/{styles-CQILkwRZ.js → styles-BdeVHtB7.js} +1 -1
- package/vgv2/es/{styles-BZ9dNdDJ.js → styles-Bhz17umu.js} +1 -1
- package/vgv2/es/{styles-qlt-8mNJ.js → styles-C1IfNQfL.js} +1 -1
- package/{tvnu/es/styles-B_07-OHk.js → vgv2/es/styles-CFJwqIst.js} +1 -1
- package/vgv2/es/{styles-DpCexWaH.js → styles-CQVrfUUl.js} +1 -1
- package/vgv2/es/{styles-DAZFpnqm.js → styles-CTcizZ-Q.js} +1 -1
- package/vgv2/es/{styles-_tb1eFvy.js → styles-D6H8kUXu.js} +1 -1
- package/vgv2/es/{styles-fv5mre1M.js → styles-DOULAbPJ.js} +1 -1
- package/vgv2/es/{styles-CQ4nHwXC.js → styles-DPSrcrqr.js} +1 -1
- package/vgv2/es/{styles-hJnDM70W.js → styles-DikRMMY4.js} +1 -1
- package/vgv2/es/{styles-CyZw26mO.js → styles-Dn0aUcYr.js} +1 -1
- package/{btv2/es/styles-BZ9n0Aac.js → vgv2/es/styles-NmqmsWTa.js} +1 -1
- package/{sav2/es/styles-3EsH1hd8.js → vgv2/es/styles-ctQS7q-2.js} +1 -1
- package/vgv2/es/{styles-Di4urdRu.js → styles-ridlIX7w.js} +1 -1
- package/video/cjs/index.js +1 -1
- package/video/es/index.js +1 -1
- package/aftenposten/es/_auto-entry_aftenposten-a_qALgNa.js +0 -1
- package/aftenpostenv2/es/_auto-entry_aftenpostenv2-BqP-f1mQ.js +0 -1
- package/aftonbladet/es/_auto-entry_aftonbladet-yLe8FMqX.js +0 -1
- package/aftonbladetv2/es/_auto-entry_aftonbladetv2-B23Hj9cK.js +0 -1
- package/bt/es/_auto-entry_bt-BcoJlF5F.js +0 -1
- package/btv2/es/_auto-entry_btv2-C-dIxU3h.js +0 -1
- package/e24/es/_auto-entry_e24-Ct_p-SFb.js +0 -1
- package/fotbollskanalen/es/_auto-entry_fotbollskanalen-PzBs8tWv.js +0 -1
- package/koket/es/_auto-entry_koket-BkBa0yO1.js +0 -1
- package/mtv/es/_auto-entry_mtv-C9V2deVl.js +0 -1
- package/mtv/es/index-3jUVCNHV.js +0 -1
- package/mtv/es/index-BEpx8cSh.js +0 -1
- package/mtv/es/index-CfPgdHyv.js +0 -1
- package/mtv/es/index-Cqfo1UGm.js +0 -1
- package/mtv/es/index-DjGbdn2F.js +0 -1
- package/mtv/es/index-SjIyGcTf.js +0 -1
- package/omni/es/_auto-entry_omni-CVCCcxyM.js +0 -1
- package/sa/es/_auto-entry_sa-B8L10P3p.js +0 -1
- package/sav2/es/_auto-entry_sav2-BmnUD43b.js +0 -1
- package/svd/es/_auto-entry_svd-B-mz79jP.js +0 -1
- package/svdv2/es/_auto-entry_svdv2-CjnUPNi-.js +0 -1
- package/tv4/es/_auto-entry_tv4-CsO2kOuH.js +0 -1
- package/tv4/es/events-DPiyDMOB.js +0 -1
- package/tvnu/es/_auto-entry_tvnu-C1Na4FvX.js +0 -1
- package/vg/es/_auto-entry_vg-Btay7qtC.js +0 -1
- package/vgv2/es/_auto-entry_vgv2-RFh5kNdr.js +0 -1
- package/vgv2/es/styles-CKJ38HW5.js +0 -1
package/kilkaya/cjs/index.d.ts
CHANGED
|
@@ -306,7 +306,6 @@ interface PlacementRefreshConfig {
|
|
|
306
306
|
}
|
|
307
307
|
interface Placement {
|
|
308
308
|
targetId: string;
|
|
309
|
-
adUnitId?: string;
|
|
310
309
|
sizes: Array<Array<number>>;
|
|
311
310
|
allowedFormats: Array<AstAdType>;
|
|
312
311
|
invCode: string;
|
|
@@ -393,6 +392,11 @@ interface TCFConfig {
|
|
|
393
392
|
timeout?: number;
|
|
394
393
|
nonRtb?: NonRTBConfig;
|
|
395
394
|
}
|
|
395
|
+
interface ManagedThirdPartyConfig {
|
|
396
|
+
readpeakUrl?: string;
|
|
397
|
+
adnamiUrl?: string;
|
|
398
|
+
adformDmpUrl?: string;
|
|
399
|
+
}
|
|
396
400
|
interface PrebidConfig {
|
|
397
401
|
enabled: boolean;
|
|
398
402
|
prebidUrl: string;
|
|
@@ -403,6 +407,7 @@ interface PrebidConfig {
|
|
|
403
407
|
forwardGlimrTags?: boolean;
|
|
404
408
|
manageAdserver?: boolean;
|
|
405
409
|
adServerUrl?: string;
|
|
410
|
+
thirdParty?: ManagedThirdPartyConfig;
|
|
406
411
|
}
|
|
407
412
|
interface NonRTBConfig {
|
|
408
413
|
invCodeSuffix?: string;
|
package/kilkaya/cjs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("react/jsx-runtime");function t(e,t,n,r){return new(n||(n=Promise))(function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)}l((r=r.apply(e,t||[])).next())})}"function"==typeof SuppressedError&&SuppressedError;const n="svd",r="vg",i="sa",o="bt",a="aftonbladet",s="e24";class l{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 d{getPulseObjectId(){return""}getPulsePageId(e,t){return""}}const c=(e,t)=>{new IntersectionObserver((e,n)=>{for(const r of e)if(r.intersectionRatio>=.5){n.disconnect(),t();break}},{threshold:.5}).observe(e)};class u{constructor(e,t){this.pulse=e,this.publisher=t}static extractAdFormat(e){return e.replace(/_\d.*$/,"")}computeInvCode(){}buildPlacement(e){return{placementId:null!=e?e:""}}trackLoad(){var e,t;null===(t=(e=this.pulse).trackLoadAd)||void 0===t||t.call(e,{object:this.buildAdObject(),placement:this.buildPlacement(this.computeInvCode())})}trackImpression(){const e=document.querySelector(`#${this.getTargetId()}`);e&&c(e,()=>{var e,t;return null===(t=(e=this.pulse).trackImpressionAd)||void 0===t?void 0:t.call(e,{object:this.buildAdObject(),placement:this.buildPlacement(this.computeInvCode())})})}trackEngagement(e){var t,n;null===(n=(t=this.pulse).trackEngagementAd)||void 0===n||n.call(t,{object:this.buildAdObject(),placement:this.buildPlacement(null!=e?e:this.computeInvCode()),engagement:{action:"Click",elementName:this.getTargetId()}})}}const g="[data-k5a-teaser-analytics]";class p extends u{constructor(e,t,n,r){super(e,""),this.root=t,this.newsroomStrategy=n,this.pageType=r}getTargetId(){return this.root.id}buildAdObject(){return this.getEventInput("view")}parseKilkayaData(){const e=this.root.querySelector("article");if(!e)return{};const t=e.dataset.k5aTeaserAnalytics;try{return t?JSON.parse(t):{}}catch(e){return{}}}mapPageType(e){var t;return null!==(t={front:"Frontpage",article:"Article",section:"Article",collection:"Article",other:"Article"}[null!=e?e:"front"])&&void 0!==t?t:"Frontpage"}getArticleId(){var e;return null!==(e=location.pathname.split("/").slice(-2,-1).pop())&&void 0!==e?e:""}getPlacementData(){var e,t;const n=this.root.closest(".kilkaya-wrapper");return{columnName:null!==(e=null==n?void 0:n.dataset.pulseColumnname)&&void 0!==e?e:"",primaryPosition:Number(null==n?void 0:n.dataset.pulsePrimaryposition)||0,secondaryPosition:Number(null==n?void 0:n.dataset.pulseSecondaryposition)||0,slot:null!==(t=null==n?void 0:n.dataset.slotTag)&&void 0!==t?t:""}}getEventTarget(){const{link:e,itemId:t,title:n}=this.parseKilkayaData();return{id:t,name:this.normalizePlacementTitle(null!=n?n:""),type:"Page",url:e}}normalizePlacementTitle(e){return e.replace(/<[^>]+>/gi,"").replace(/[^a-z0-9æøå\s_-]/gi,"")}waitForAnalyticsData(e){const t=this.root.querySelector(g);if(Boolean(null==t?void 0:t.dataset.k5aTeaserAnalytics))return void e();const n=new MutationObserver(()=>{const t=this.root.querySelector(g);Boolean(null==t?void 0:t.dataset.k5aTeaserAnalytics)&&(n.disconnect(),e())});n.observe(this.root,{attributes:!0,childList:!0,subtree:!0,attributeFilter:["data-k5a-teaser-analytics"]})}trackLoad(){}trackImpression(){c(this.root,()=>this.waitForAnalyticsData(()=>{var e,t;const n=new CustomEvent("advertory:partnerstudioAdImpression",{detail:{ad:this.parseKilkayaData().placement}});window.dispatchEvent(n);const r=this.getEventInput("view");this.pulse.trackLegacyViewUIElement?this.pulse.trackLegacyViewUIElement(r):this.pulse.trackViewUIElement?this.pulse.trackViewUIElement(r):null===(t=(e=this.pulse).trackElementView)||void 0===t||t.call(e,r)}))}trackEngagement(e){var t,n;const r=this.getEventInput("click");this.pulse.trackLegacyClickUIElement?this.pulse.trackLegacyClickUIElement(r):this.pulse.trackClickUIElement?this.pulse.trackClickUIElement(r):null===(n=(t=this.pulse).trackElementClick)||void 0===n||n.call(t,r)}}class v extends p{getEventBaseData(){var e,t,n,r;const{clientName:i,creativeId:o,itemId:a,placement:s}=this.parseKilkayaData(),{primaryPosition:l,secondaryPosition:d,slot:c}=this.getPlacementData(),u=this.mapPageType(this.pageType),g=null===(e=this.newsroomStrategy)||void 0===e?void 0:e.getPulsePageId(null!==(t=this.pageType)&&void 0!==t?t:"front",this.getArticleId());return Object.assign(Object.assign({},a&&{"@id":`sdrn:kilkaya:teaser:${a}`}),{"@type":"UIElement",position:s,elementType:"Article",custom:{customer:i,creativeId:null!=o?o:a},page:{"@id":null!=g?g:s,"@type":u,url:location.origin},placement:{primaryPosition:l,secondaryPosition:d,source:c},tags:null===(r=null===(n=this.newsroomStrategy)||void 0===n?void 0:n.getTags)||void 0===r?void 0:r.call(n,this.root)})}getEventInput(e){return{object:this.getEventBaseData(),partnerstudio:this.getEventPartnerstudioData(e),target:this.getEventTarget(),provider:this.getProviderData()}}getEventPartnerstudioData(e){return Object.assign(Object.assign({},this.parseKilkayaData()),{type:e,tracking_type:"ad",xandrAdLoaded:!1})}getProviderData(){return{productTag:"partnerstudio"}}}class m extends p{getEventBaseData(){var e,t;const{title:n="",clientName:r="",creativeId:i="",link:o="",itemId:a=""}=this.parseKilkayaData(),{columnName:s,primaryPosition:l,secondaryPosition:d,slot:c}=this.getPlacementData(),u={publicUrl:o,urlPath:o?new URL(o).pathname:""},{publicUrl:g,urlPath:p}=o&&(null===(t=null===(e=this.newsroomStrategy)||void 0===e?void 0:e.transformUrl)||void 0===t?void 0:t.call(e,o))||u;return Object.assign(Object.assign({},a&&{"@id":`sdrn:kilkaya:teaser:${a}`}),{"@type":"UIElement",elementType:"Teaser",layout:{elementSize:"large",imageUrl:"",name:"large"},name:n,placement:{columnName:s,primaryPosition:l,secondaryPosition:d,source:c},tags:[r,n,g,p].filter(Boolean),"spt:custom":{is_sponsored:!0,sponsor:r,"spt:creativeId":i,pageTitle:n,publicUrl:g,urlPath:p},url:location.origin})}getEventInput(e){return{object:this.getEventBaseData(),target:this.getEventTarget()}}}const h="no",f="se",y=(e,t)=>{const n="[Advertory LOG]: ";location.search.includes("ast_debug=true")&&(t?console.log(n,e,t):console.log(n,e))},b=(e,t)=>{console.warn("[Advertory WARN]: ",e)},w=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 y("Advertising permission value obtained synchronously: ",e),Boolean(t)})();if(null!==n)return void t(n);let r=!1;const i=e=>{r||(y("Resolving advertising permission value obtained"),r=!0,t(e))},o=setTimeout(()=>{y("Advertising permission timed out, resolving with false"),i(!1)},3e3);window._tcf_.onTcfReady(()=>{y("On Tcf Ready called, waiting for permission"),clearTimeout(o)}),window._tcf_.getPermission("CMP:advertising",e=>{clearTimeout(o);const t=Number(e);y("Advertising permission value obtained asynchronously: ",e),i(Boolean(t))})}),k="cmp:loaded";let P="undefined"!=typeof window?window._tcf_:void 0,T=!1;const E=(e,n,r)=>{const i=!!(null==e?void 0:e.enabled),o=(null==e?void 0:e.timeout)||3e3,a=(s="bypass_tcf",new URLSearchParams(window.location.search).get(s));var s;const l=()=>{if(!(null==e?void 0:e.enabled))return!0;if(((e,t)=>e?!!t&&(y("TCF bypass param detected, returning consent: true"),!0):(y("TCF is not enabled, returning consent: true"),!0))(i,a))return!0;if(T)return null;if(!P)throw new Error("[Advertory]: getConsentSync method was called before the tcfManager was available.");const t=P.getConsentedToAllSync();return y(`TCF consented to all is: ${t}`),P.getConsentedToAllSync()};return{initConsentManager:()=>(null==e?void 0:e.enabled)?new Promise((e,t)=>{if(y("Getting TCF consent manager..."),window._tcf_)return y("TCF consent manager is already available"),P=window._tcf_,void e(P);y("TCF consent manager is not available");const n=()=>{y("CMP loaded, resolving consent manager..."),r&&clearTimeout(r),window._tcf_?(P=window._tcf_,e(P)):t(new Error("CMP loaded but window._tcf_ is not defined"))},r=setTimeout(()=>{document.removeEventListener(k,n),T=!0,t(new Error("Timeout waiting for CMP to load"))},o);y("Listening for CMP loaded event..."),document.addEventListener(k,n,{once:!0})}):Promise.resolve(null),getConsentSync:l,getConsentAsync:()=>t(void 0,void 0,void 0,function*(){if(null==e?void 0:e.schibstedAdChoicesOverrideValue)return y(`Schibsted Ad Choices override value is set, returning override value: ${e.schibstedAdChoicesOverrideValue}`),Boolean(Number(e.schibstedAdChoicesOverrideValue));const t=(null==e?void 0:e.advertisingCMPSignalEnabled)&&r===f,n=(null==e?void 0:e.advertisingCMPSignalEnabled)&&r===h;if(t||n)return y("Schibsted Ad Choices is enabled, getting advertising permissions..."),yield w(e);if(!(null==e?void 0:e.enabled))return!0;const i=l();return null!==i?i:yield new Promise((e,t)=>{try{if(!P)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(()=>{y("TCF isConsentedToAll timed out, resolving with false"),n(!1)},o);P.onTcfReady(()=>{y("On Tcf Ready called, waiting for consent"),clearTimeout(r)}),P.isConsentedToAll(t=>{clearTimeout(r),e(t)})}catch(e){t(e)}})})}};class I{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 t(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 y("[Privacy Broker] User is not logged in."),null}})}isUserLoggedIn(){return t(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)}}function C(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var A,S;var O=C(function(){if(S)return A;S=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 n(e,t){return!1!==t.clone&&t.isMergeableObject(e)?s((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function r(e,t,r){return e.concat(t).map(function(e){return n(e,r)})}function i(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 o(e,t){try{return t in e}catch(e){return!1}}function a(e,t,r){var a={};return r.isMergeableObject(e)&&i(e).forEach(function(t){a[t]=n(e[t],r)}),i(t).forEach(function(i){(function(e,t){return o(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,i)||(o(e,i)&&r.isMergeableObject(t[i])?a[i]=function(e,t){if(!t.customMerge)return s;var n=t.customMerge(e);return"function"==typeof n?n:s}(i,r)(e[i],t[i],r):a[i]=n(t[i],r))}),a}function s(t,i,o){(o=o||{}).arrayMerge=o.arrayMerge||r,o.isMergeableObject=o.isMergeableObject||e,o.cloneUnlessOtherwiseSpecified=n;var s=Array.isArray(i);return s===Array.isArray(t)?s?o.arrayMerge(t,i,o):a(t,i,o):n(i,o)}return s.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(e,n){return s(e,n,t)},{})},A=s}());const j={arrayMerge:(e,t)=>t,isMergeableObject:e=>"object"==typeof e&&null!==e&&e.constructor===Object},L=(e,t)=>O(e,t,j),U=(e,t)=>Object.assign(Object.assign({},e),t),_=(e,t)=>{var n;return L(null!==(n=e)&&void 0!==n?n:{},t)},N={adRequested:()=>{},adAvailable:e=>{},adLoaded:e=>{},adNoBid:e=>{},adError:(e,t)=>{},adCollapse:()=>{},adRequestFailure:e=>{},adBadRequest:e=>{},adLoadedMediated:e=>{},adNoBidMediated:e=>{}},$=e=>{(e=>{const{pageContext:t,pageOptions:n,placements:r,appearanceConfig:i}=null!=e?e:{};(null==t?void 0:t.publisher)||b("pageContext.publisher is required."),(null==t?void 0:t.countryCode)||b("pageContext.countryCode is required."),(null==t?void 0:t.pageType)||b("pageContext.pageType is required."),(null==t?void 0:t.deviceType)||b("pageContext.deviceType is required."),n||b("pageOptions is required."),r||b("placements is required."),(null==i?void 0:i.defaultThreshold)||b("appearanceConfig.defaultThreshold is required.")})(e),(e=>{var t,n,r,i;const o=e.pageSectionsSelectors,a=[{flag:!!(null===(t=e.takeover)||void 0===t?void 0:t.enabled),property:"header",featureName:"takeover"},{flag:!!(null===(n=e.sponsorstripe)||void 0===n?void 0:n.enabled),property:"header",featureName:"sponsorstripe"},{flag:!!(null===(r=e.widescreenSwitching)||void 0===r?void 0:r.enabled),property:"right",featureName:"widescreenSwitching"},{flag:!!(null===(i=e.wallpaper)||void 0===i?void 0:i.enabled),property:"header",featureName:"wallpaper"}];for(const{flag:e,property:t,featureName:n}of a)e&&!(null==o?void 0:o[t])&&b(`pageSectionsSelectors.${t} is required when ${n} is enabled.`)})(e)},M={placements:(e,t)=>t,takeover:_,refreshConfig:U,editory:_,appearanceConfig:_,pageContext:U,pageOptions:U,pageSectionsSelectors:U,tcf:U};class x{set(e){$(e),this.config=e}modifyConfigProperties(e){if(!this.config)throw new Error("Config was accessed before it had been initialized.");((e,t)=>{const n=e;for(const e of Object.keys(M)){const r=t[e];void 0!==r&&(n[e]=M[e](n[e],r))}})(this.config,e)}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=L(x.DEFAULT_SITE_HANDLERS,e)}}x.DEFAULT_SITE_HANDLERS={siteEvents:N,initNativeAd:()=>{}};const D=new x;D.modifyConfigProperties.bind(D);const F=864e5,B=(()=>{const e=e=>{const t=window.localStorage.getItem(e);if(!t)return null;try{return JSON.parse(t)}catch(e){return y("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=F)=>{const i={data:n,expirationTime:(new Date).getTime()+r};t(e,JSON.stringify(i))},getByTimestamp:(t,n=F)=>{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 y("Error with parsing localStorage data"),null}}}})(),q=e=>e.startsWith("glci_"),K=()=>{var e;return((e=[])=>e.filter(q))(null!==(e=(()=>{const e=B.getByTimestamp("glimrTags");return e&&"string"!=typeof e?null==e?void 0:e.tags:null})())&&void 0!==e?e:[])},R=/^glci_/,V="gender_",H="geo_",z="male",J="female",W=()=>t(void 0,void 0,void 0,function*(){try{const n=yield(e=500,t(void 0,void 0,void 0,function*(){return Promise.race([t(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)})}),new Promise(t=>setTimeout(()=>t(void 0),e))])})),r=new I(n),i=yield r.getIdentityUser(),{gender:o}=null!=i?i:{};return o===z||o===J?`${V}${o}`:void 0}catch(e){return}var e}),X=()=>t(void 0,void 0,void 0,function*(){const e=[],t=yield W(),n=(()=>{const e=K().map(e=>`${H}${e.replace(R,"")}`);return Array.from(new Set(e))})();return t&&e.push(t),n&&e.push(...n),e}),G="front";class Q{getPulseObjectId(){return"sdrn:e24:content:partnerstudio:element:partnerstudio:stats"}getPulsePageId(e,t){return e===G?"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]}}class Y{getPulseObjectId(){return"sdrn:aftenposten:content:partnerstudio:element:partnerstudio:stats"}getPulsePageId(){return"sdrn:aftenposten:frontpage:Frontpage"}}class Z{getPulseObjectId(){return"sdrn:bt:content:partnerstudio:element:partnerstudio:stats"}getPulsePageId(){return"sdrn:bt:frontpage:Frontpage"}}class ee{getPulseObjectId(){return"sdrn:stavangeraftenblad:content:partnerstudio:element:partnerstudio:stats"}getPulsePageId(){return"sdrn:stavangeraftenblad:frontpage:Frontpage"}}class te{transformUrl(e){const{hostname:t,pathname:n}=new URL(e);return"brand-studio.svd.se"===t?{publicUrl:`https://svd.se/brand-studio${n}`,urlPath:`/brand-studio${n}`}:{publicUrl:e,urlPath:n}}getPulseObjectId(){return"sdrn:svdse:content:partnerstudio:element:partnerstudio:stats"}getPulsePageId(e,t){return e===G?"sdrn:svdse:frontpage:front":`sdrn:svdse:article:${t}`}}class ne{transformUrl(e){const{hostname:t,pathname:n}=new URL(e);return"brand-studio.aftonbladet.se"===t?{publicUrl:`https://aftonbladet.se/brand-studio${n}`,urlPath:`/brand-studio${n}`}:{publicUrl:e,urlPath:n}}getPulseObjectId(){return""}getPulsePageId(){return""}}class re{handleKilkayaStreamTracking({pulse:e,pageContext:{pageType:t,publisher:c,countryCode:u}}){if(!(null==e?void 0:e.instance))return;const g={[r]:new l,[s]:new Q,"no-aftenposten":new Y,[o]:new Z,"no-bergenstidende":new Z,[i]:new ee,"no-stavangeraftenblad":new ee,[n]:new te,[a]:new ne}[c]||new d;((e,t,n,r)=>{const i=document.querySelectorAll("k5a-stream");i.length&&i.forEach(i=>{const o=r===f?new m(e,i,t):new v(e,i,t,n);o.trackImpression(),i.addEventListener("click",()=>o.trackEngagement())})})(e.instance,g,t,u)}injectKilkayaMeta(e){return t(this,void 0,void 0,function*(){const t=document.createElement("script"),n=yield X();t.textContent=`var k5aMeta = { consent: ${e}, cntTag: ${JSON.stringify(n)} };`,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(y(`Kilkaya event for slot: ${n}`),!n)return void y("Kilkaya slot empty, Xandr backfill won't be loaded");const r=n.parentElement;r?(y(`Kilkaya placement ${n.getAttribute("name")} has not been loaded, loading Xandr backfill`),this.showBackfill(r)):y("Kilkaya parent slot empty, Xandr backfill won't be loaded")})}showBackfill(e){var t;const n=e.querySelector(".fallback");if(!n)return;n.style.display="flex";(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"))})(null!==(t=n.dataset.fallbackTargetId)&&void 0!==t?t:"")}loadKilkayaScript(e){return t(this,void 0,void 0,function*(){yield((e,...n)=>t(void 0,[e,...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(l)};i.addEventListener("load",o),i.addEventListener("error",a);const l=setTimeout(()=>{s(),r(new Error(`Loading script timed out: ${e}`))},t);document.head.appendChild(i)}).catch(e=>{console.error(e)}))}))(e)})}run(e){return t(this,void 0,void 0,function*(){var n,r;const{tcf:i,pageContext:{isMobileApp:o,countryCode:a},kilkaya:s}=e;if(!(null==s?void 0:s.enabled))return;const l=yield((e,n,r,...i)=>t(void 0,[e,n,r,...i],void 0,function*(e,t,n,r="NOT SPECIFIED FEATURE"){if(!(null==e?void 0:e.schibstedConsentToPayEnabled))return y(`Schibsted Consent to Pay is not enabled, returning true for ${r}`),!0;if(null==e?void 0:e.schibstedAdChoicesOverrideValue)return y(`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}=E(e,0,n);return(yield i())?(y(`Schibsted Ad Choices consent given according to TCF consent manager for ${r}`),!0):(y(`Schibsted Ad Choices consent not given according to TCF consent manager for ${r}`),!1)}))(i,o,a,"kilkaya");this.observeForKilkayaBackfills(),yield this.injectKilkayaMeta(l),yield this.loadKilkayaScript(null!==(r=null===(n=s.options)||void 0===n?void 0:n.kilkayaUrl)&&void 0!==r?r:""),this.handleKilkayaStreamTracking(e)})}}exports.Kilkaya=({placementName:t,slotTag:n,fallbackTargetId:r,children:i,pulseData:o,htmlAttributes:a})=>{const s=(e,t)=>{const n={};if(!e)return n;for(const[r,i]of Object.entries(e)){n[t?`${t}-${r}`:r]=String(i)}return n},l=s(o,"data-pulse"),d=s(a,"data");return e.jsxs("div",Object.assign({className:"kilkaya-wrapper kilkaya-lock-height",style:{width:"100%"},"data-slot-tag":n},l,d,{children:[e.jsx("div",{className:"inscreen-target"}),e.jsx("k5a-stream",{name:t,"slot-tag":n}),e.jsx("div",{className:"container"}),e.jsx("div",{className:"fallback","data-fallback-target-id":r,style:{display:"none"},children:i})]}))},exports.runKilkaya=e=>t(void 0,void 0,void 0,function*(){const t=new re;yield t.run(e)});
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime");function t(e,t,n,r){return new(n||(n=Promise))(function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)}l((r=r.apply(e,t||[])).next())})}"function"==typeof SuppressedError&&SuppressedError;const n="svd",r="vg",i="sa",o="bt",a="aftonbladet",s="e24";class l{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 d{getPulseObjectId(){return""}getPulsePageId(e,t){return""}}const c=(e,t)=>{new IntersectionObserver((e,n)=>{for(const r of e)if(r.intersectionRatio>=.5){n.disconnect(),t();break}},{threshold:.5}).observe(e)};class u{constructor(e,t){this.pulse=e,this.publisher=t}static extractAdFormat(e){return e.replace(/_\d.*$/,"")}computeInvCode(){}buildPlacement(e){return{placementId:null!=e?e:""}}trackLoad(){var e,t;null===(t=(e=this.pulse).trackLoadAd)||void 0===t||t.call(e,{object:this.buildAdObject(),placement:this.buildPlacement(this.computeInvCode())})}trackImpression(){const e=document.querySelector(`#${this.getTargetId()}`);e&&c(e,()=>{var e,t;return null===(t=(e=this.pulse).trackImpressionAd)||void 0===t?void 0:t.call(e,{object:this.buildAdObject(),placement:this.buildPlacement(this.computeInvCode())})})}trackEngagement(e){var t,n;null===(n=(t=this.pulse).trackEngagementAd)||void 0===n||n.call(t,{object:this.buildAdObject(),placement:this.buildPlacement(null!=e?e:this.computeInvCode()),engagement:{action:"Click",elementName:this.getTargetId()}})}}const g="[data-k5a-teaser-analytics]";class p extends u{constructor(e,t,n,r){super(e,""),this.root=t,this.newsroomStrategy=n,this.pageType=r}getTargetId(){return this.root.id}buildAdObject(){return this.getEventInput("view")}parseKilkayaData(){const e=this.root.querySelector("article");if(!e)return{};const t=e.dataset.k5aTeaserAnalytics;try{return t?JSON.parse(t):{}}catch(e){return{}}}mapPageType(e){var t;return null!==(t={front:"Frontpage",article:"Article",section:"Article",collection:"Article",other:"Article"}[null!=e?e:"front"])&&void 0!==t?t:"Frontpage"}getArticleId(){var e;return null!==(e=location.pathname.split("/").slice(-2,-1).pop())&&void 0!==e?e:""}getPlacementData(){var e,t;const n=this.root.closest(".kilkaya-wrapper");return{columnName:null!==(e=null==n?void 0:n.dataset.pulseColumnname)&&void 0!==e?e:"",primaryPosition:Number(null==n?void 0:n.dataset.pulsePrimaryposition)||0,secondaryPosition:Number(null==n?void 0:n.dataset.pulseSecondaryposition)||0,slot:null!==(t=null==n?void 0:n.dataset.slotTag)&&void 0!==t?t:""}}getEventTarget(){const{link:e,itemId:t,title:n}=this.parseKilkayaData();return{id:t,name:this.normalizePlacementTitle(null!=n?n:""),type:"Page",url:e}}normalizePlacementTitle(e){return e.replace(/<[^>]+>/gi,"").replace(/[^a-z0-9æøå\s_-]/gi,"")}waitForAnalyticsData(e){const t=this.root.querySelector(g);if(Boolean(null==t?void 0:t.dataset.k5aTeaserAnalytics))return void e();const n=new MutationObserver(()=>{const t=this.root.querySelector(g);Boolean(null==t?void 0:t.dataset.k5aTeaserAnalytics)&&(n.disconnect(),e())});n.observe(this.root,{attributes:!0,childList:!0,subtree:!0,attributeFilter:["data-k5a-teaser-analytics"]})}trackLoad(){}trackImpression(){c(this.root,()=>this.waitForAnalyticsData(()=>{var e,t;const n=new CustomEvent("advertory:partnerstudioAdImpression",{detail:{ad:this.parseKilkayaData().placement}});window.dispatchEvent(n);const r=this.getEventInput("view");this.pulse.trackLegacyViewUIElement?this.pulse.trackLegacyViewUIElement(r):this.pulse.trackViewUIElement?this.pulse.trackViewUIElement(r):null===(t=(e=this.pulse).trackElementView)||void 0===t||t.call(e,r)}))}trackEngagement(e){var t,n;const r=this.getEventInput("click");this.pulse.trackLegacyClickUIElement?this.pulse.trackLegacyClickUIElement(r):this.pulse.trackClickUIElement?this.pulse.trackClickUIElement(r):null===(n=(t=this.pulse).trackElementClick)||void 0===n||n.call(t,r)}}class v extends p{getEventBaseData(){var e,t,n,r;const{clientName:i,creativeId:o,itemId:a,placement:s}=this.parseKilkayaData(),{primaryPosition:l,secondaryPosition:d,slot:c}=this.getPlacementData(),u=this.mapPageType(this.pageType),g=null===(e=this.newsroomStrategy)||void 0===e?void 0:e.getPulsePageId(null!==(t=this.pageType)&&void 0!==t?t:"front",this.getArticleId());return Object.assign(Object.assign({},a&&{"@id":`sdrn:kilkaya:teaser:${a}`}),{"@type":"UIElement",position:s,elementType:"Article",custom:{customer:i,creativeId:null!=o?o:a},page:{"@id":null!=g?g:s,"@type":u,url:location.origin},placement:{primaryPosition:l,secondaryPosition:d,source:c},tags:null===(r=null===(n=this.newsroomStrategy)||void 0===n?void 0:n.getTags)||void 0===r?void 0:r.call(n,this.root)})}getEventInput(e){return{object:this.getEventBaseData(),partnerstudio:this.getEventPartnerstudioData(e),target:this.getEventTarget(),provider:this.getProviderData()}}getEventPartnerstudioData(e){return Object.assign(Object.assign({},this.parseKilkayaData()),{type:e,tracking_type:"ad",xandrAdLoaded:!1})}getProviderData(){return{productTag:"partnerstudio"}}}class m extends p{getEventBaseData(){var e,t;const{title:n="",clientName:r="",creativeId:i="",link:o="",itemId:a=""}=this.parseKilkayaData(),{columnName:s,primaryPosition:l,secondaryPosition:d,slot:c}=this.getPlacementData(),u={publicUrl:o,urlPath:o?new URL(o).pathname:""},{publicUrl:g,urlPath:p}=o&&(null===(t=null===(e=this.newsroomStrategy)||void 0===e?void 0:e.transformUrl)||void 0===t?void 0:t.call(e,o))||u;return Object.assign(Object.assign({},a&&{"@id":`sdrn:kilkaya:teaser:${a}`}),{"@type":"UIElement",elementType:"Teaser",layout:{elementSize:"large",imageUrl:"",name:"large"},name:n,placement:{columnName:s,primaryPosition:l,secondaryPosition:d,source:c},tags:[r,n,g,p].filter(Boolean),"spt:custom":{is_sponsored:!0,sponsor:r,"spt:creativeId":i,pageTitle:n,publicUrl:g,urlPath:p},url:location.origin})}getEventInput(e){return{object:this.getEventBaseData(),target:this.getEventTarget()}}}const h="no",f="se",y=(e,t)=>{const n="[Advertory LOG]: ";location.search.includes("ast_debug=true")&&(t?console.log(n,e,t):console.log(n,e))},b=(e,t)=>{console.warn("[Advertory WARN]: ",e)},w=()=>{return e="bypass_tcf",new URLSearchParams(window.location.search).get(e);var e},k=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 y("Advertising permission value obtained synchronously: ",e),Boolean(t)})();if(null!==n)return void t(n);let r=!1;const i=e=>{r||(y("Resolving advertising permission value obtained"),r=!0,t(e))},o=setTimeout(()=>{y("Advertising permission timed out, resolving with false"),i(!1)},3e3);window._tcf_.onTcfReady(()=>{y("On Tcf Ready called, waiting for permission"),clearTimeout(o)}),window._tcf_.getPermission("CMP:advertising",e=>{clearTimeout(o);const t=Number(e);y("Advertising permission value obtained asynchronously: ",e),i(Boolean(t))})}),P="cmp:loaded";let T="undefined"!=typeof window?window._tcf_:void 0,E=!1;const I=(e,n,r)=>{const i=!!(null==e?void 0:e.enabled),o=(null==e?void 0:e.timeout)||3e3,a=w(),s=()=>{if(!(null==e?void 0:e.enabled))return!0;if(((e,t)=>e?!!t&&(y("TCF bypass param detected, returning consent: true"),!0):(y("TCF is not enabled, returning consent: true"),!0))(i,a))return!0;if(E)return null;if(!T)throw new Error("[Advertory]: getConsentSync method was called before the tcfManager was available.");const t=T.getConsentedToAllSync();return y(`TCF consented to all is: ${t}`),T.getConsentedToAllSync()};return{initConsentManager:()=>(null==e?void 0:e.enabled)?new Promise((e,t)=>{if(y("Getting TCF consent manager..."),window._tcf_)return y("TCF consent manager is already available"),T=window._tcf_,void e(T);y("TCF consent manager is not available");const n=()=>{y("CMP loaded, resolving consent manager..."),r&&clearTimeout(r),window._tcf_?(T=window._tcf_,e(T)):t(new Error("CMP loaded but window._tcf_ is not defined"))},r=setTimeout(()=>{document.removeEventListener(P,n),E=!0,t(new Error("Timeout waiting for CMP to load"))},o);y("Listening for CMP loaded event..."),document.addEventListener(P,n,{once:!0})}):Promise.resolve(null),getConsentSync:s,getConsentAsync:()=>t(void 0,void 0,void 0,function*(){if(null==e?void 0:e.schibstedAdChoicesOverrideValue)return y(`Schibsted Ad Choices override value is set, returning override value: ${e.schibstedAdChoicesOverrideValue}`),Boolean(Number(e.schibstedAdChoicesOverrideValue));const t=(null==e?void 0:e.advertisingCMPSignalEnabled)&&r===f,n=(null==e?void 0:e.advertisingCMPSignalEnabled)&&r===h;if(t||n)return y("Schibsted Ad Choices is enabled, getting advertising permissions..."),yield k(e);if(!(null==e?void 0:e.enabled))return!0;const i=s();return null!==i?i:yield new Promise((e,t)=>{try{if(!T)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(()=>{y("TCF isConsentedToAll timed out, resolving with false"),n(!1)},o);T.onTcfReady(()=>{y("On Tcf Ready called, waiting for consent"),clearTimeout(r)}),T.isConsentedToAll(t=>{clearTimeout(r),e(t)})}catch(e){t(e)}})})}};class C{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 t(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 y("[Privacy Broker] User is not logged in."),null}})}isUserLoggedIn(){return t(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)}}function S(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var A,O;var j=S(function(){if(O)return A;O=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 n(e,t){return!1!==t.clone&&t.isMergeableObject(e)?s((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function r(e,t,r){return e.concat(t).map(function(e){return n(e,r)})}function i(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 o(e,t){try{return t in e}catch(e){return!1}}function a(e,t,r){var a={};return r.isMergeableObject(e)&&i(e).forEach(function(t){a[t]=n(e[t],r)}),i(t).forEach(function(i){(function(e,t){return o(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,i)||(o(e,i)&&r.isMergeableObject(t[i])?a[i]=function(e,t){if(!t.customMerge)return s;var n=t.customMerge(e);return"function"==typeof n?n:s}(i,r)(e[i],t[i],r):a[i]=n(t[i],r))}),a}function s(t,i,o){(o=o||{}).arrayMerge=o.arrayMerge||r,o.isMergeableObject=o.isMergeableObject||e,o.cloneUnlessOtherwiseSpecified=n;var s=Array.isArray(i);return s===Array.isArray(t)?s?o.arrayMerge(t,i,o):a(t,i,o):n(i,o)}return s.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(e,n){return s(e,n,t)},{})},A=s}());const U={arrayMerge:(e,t)=>t,isMergeableObject:e=>"object"==typeof e&&null!==e&&e.constructor===Object},L=(e,t)=>j(e,t,U),_=(e,t)=>Object.assign(Object.assign({},e),t),$=(e,t)=>{var n;return L(null!==(n=e)&&void 0!==n?n:{},t)},N=e=>{(e=>{const{pageContext:t,pageOptions:n,placements:r,appearanceConfig:i}=null!=e?e:{};(null==t?void 0:t.publisher)||b("pageContext.publisher is required."),(null==t?void 0:t.countryCode)||b("pageContext.countryCode is required."),(null==t?void 0:t.pageType)||b("pageContext.pageType is required."),(null==t?void 0:t.deviceType)||b("pageContext.deviceType is required."),n||b("pageOptions is required."),r||b("placements is required."),(null==i?void 0:i.defaultThreshold)||b("appearanceConfig.defaultThreshold is required.")})(e),(e=>{var t,n,r,i;const o=e.pageSectionsSelectors,a=[{flag:!!(null===(t=e.takeover)||void 0===t?void 0:t.enabled),property:"header",featureName:"takeover"},{flag:!!(null===(n=e.sponsorstripe)||void 0===n?void 0:n.enabled),property:"header",featureName:"sponsorstripe"},{flag:!!(null===(r=e.widescreenSwitching)||void 0===r?void 0:r.enabled),property:"right",featureName:"widescreenSwitching"},{flag:!!(null===(i=e.wallpaper)||void 0===i?void 0:i.enabled),property:"header",featureName:"wallpaper"}];for(const{flag:e,property:t,featureName:n}of a)e&&!(null==o?void 0:o[t])&&b(`pageSectionsSelectors.${t} is required when ${n} is enabled.`)})(e)},M={placements:(e,t)=>t,takeover:$,refreshConfig:_,editory:$,appearanceConfig:$,pageContext:_,pageOptions:_,pageSectionsSelectors:_,tcf:_};class x{set(e){N(e),this.config=e}modifyConfigProperties(e){if(!this.config)throw new Error("Config was accessed before it had been initialized.");((e,t)=>{const n=e;for(const e of Object.keys(M)){const r=t[e];void 0!==r&&(n[e]=M[e](n[e],r))}})(this.config,e)}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=L(x.DEFAULT_SITE_HANDLERS,e)}}x.DEFAULT_SITE_HANDLERS={initNativeAd:()=>{}};const D=new x;D.modifyConfigProperties.bind(D);const F=864e5,K=(()=>{const e=e=>{const t=window.localStorage.getItem(e);if(!t)return null;try{return JSON.parse(t)}catch(e){return y("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=F)=>{const i={data:n,expirationTime:(new Date).getTime()+r};t(e,JSON.stringify(i))},getByTimestamp:(t,n=F)=>{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 y("Error with parsing localStorage data"),null}}}})(),B=e=>e.startsWith("glci_"),q=()=>{var e;return((e=[])=>e.filter(B))(null!==(e=(()=>{const e=K.getByTimestamp("glimrTags");return e&&"string"!=typeof e?null==e?void 0:e.tags:null})())&&void 0!==e?e:[])},R=/^glci_/,V="gender_",H="geo_",z="male",J="female",W=()=>t(void 0,void 0,void 0,function*(){try{const n=yield(e=500,t(void 0,void 0,void 0,function*(){return Promise.race([t(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)})}),new Promise(t=>setTimeout(()=>t(void 0),e))])})),r=new C(n),i=yield r.getIdentityUser(),{gender:o}=null!=i?i:{};return o===z||o===J?`${V}${o}`:void 0}catch(e){return}var e}),X=()=>t(void 0,void 0,void 0,function*(){const e=[],t=yield W(),n=(()=>{const e=q().map(e=>`${H}${e.replace(R,"")}`);return Array.from(new Set(e))})();return t&&e.push(t),n&&e.push(...n),e}),G="front";class Q{getPulseObjectId(){return"sdrn:e24:content:partnerstudio:element:partnerstudio:stats"}getPulsePageId(e,t){return e===G?"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]}}class Y{getPulseObjectId(){return"sdrn:aftenposten:content:partnerstudio:element:partnerstudio:stats"}getPulsePageId(){return"sdrn:aftenposten:frontpage:Frontpage"}}class Z{getPulseObjectId(){return"sdrn:bt:content:partnerstudio:element:partnerstudio:stats"}getPulsePageId(){return"sdrn:bt:frontpage:Frontpage"}}class ee{getPulseObjectId(){return"sdrn:stavangeraftenblad:content:partnerstudio:element:partnerstudio:stats"}getPulsePageId(){return"sdrn:stavangeraftenblad:frontpage:Frontpage"}}class te{transformUrl(e){const{hostname:t,pathname:n}=new URL(e);return"brand-studio.svd.se"===t?{publicUrl:`https://svd.se/brand-studio${n}`,urlPath:`/brand-studio${n}`}:{publicUrl:e,urlPath:n}}getPulseObjectId(){return"sdrn:svdse:content:partnerstudio:element:partnerstudio:stats"}getPulsePageId(e,t){return e===G?"sdrn:svdse:frontpage:front":`sdrn:svdse:article:${t}`}}class ne{transformUrl(e){const{hostname:t,pathname:n}=new URL(e);return"brand-studio.aftonbladet.se"===t?{publicUrl:`https://aftonbladet.se/brand-studio${n}`,urlPath:`/brand-studio${n}`}:{publicUrl:e,urlPath:n}}getPulseObjectId(){return""}getPulsePageId(){return""}}class re{handleKilkayaStreamTracking({pulse:e,pageContext:{pageType:t,publisher:c,countryCode:u}}){if(!(null==e?void 0:e.instance))return;const g={[r]:new l,[s]:new Q,"no-aftenposten":new Y,[o]:new Z,"no-bergenstidende":new Z,[i]:new ee,"no-stavangeraftenblad":new ee,[n]:new te,[a]:new ne}[c]||new d;((e,t,n,r)=>{const i=document.querySelectorAll("k5a-stream");i.length&&i.forEach(i=>{const o=r===f?new m(e,i,t):new v(e,i,t,n);o.trackImpression(),i.addEventListener("click",()=>o.trackEngagement())})})(e.instance,g,t,u)}injectKilkayaMeta(e){return t(this,void 0,void 0,function*(){const t=document.createElement("script"),n=yield X();t.textContent=`var k5aMeta = { consent: ${e}, cntTag: ${JSON.stringify(n)} };`,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(y(`Kilkaya event for slot: ${n}`),!n)return void y("Kilkaya slot empty, Xandr backfill won't be loaded");const r=n.parentElement;r?(y(`Kilkaya placement ${n.getAttribute("name")} has not been loaded, loading Xandr backfill`),this.showBackfill(r)):y("Kilkaya parent slot empty, Xandr backfill won't be loaded")})}showBackfill(e){var t;const n=e.querySelector(".fallback");if(!n)return;n.style.display="flex";(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"))})(null!==(t=n.dataset.fallbackTargetId)&&void 0!==t?t:"")}loadKilkayaScript(e){return t(this,void 0,void 0,function*(){yield((e,...n)=>t(void 0,[e,...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(l)};i.addEventListener("load",o),i.addEventListener("error",a);const l=setTimeout(()=>{s(),r(new Error(`Loading script timed out: ${e}`))},t);document.head.appendChild(i)}).catch(e=>{console.error(e)}))}))(e)})}run(e){return t(this,void 0,void 0,function*(){var n,r;const{tcf:i,pageContext:{isMobileApp:o,countryCode:a},kilkaya:s}=e;if(!(null==s?void 0:s.enabled))return;const l=yield((e,n,r,...i)=>t(void 0,[e,n,r,...i],void 0,function*(e,t,n,r="NOT SPECIFIED FEATURE"){if(!(null==e?void 0:e.schibstedConsentToPayEnabled))return y(`Schibsted Consent to Pay is not enabled, returning true for ${r}`),!0;if(null==e?void 0:e.schibstedAdChoicesOverrideValue)return y(`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,0,n);return(yield i())?(y(`Schibsted Ad Choices consent given according to TCF consent manager for ${r}`),!0):(y(`Schibsted Ad Choices consent not given according to TCF consent manager for ${r}`),!1)}))(i,o,a,"kilkaya");this.observeForKilkayaBackfills(),yield this.injectKilkayaMeta(l),yield this.loadKilkayaScript(null!==(r=null===(n=s.options)||void 0===n?void 0:n.kilkayaUrl)&&void 0!==r?r:""),this.handleKilkayaStreamTracking(e)})}}exports.Kilkaya=({placementName:t,slotTag:n,fallbackTargetId:r,children:i,pulseData:o,htmlAttributes:a})=>{const s=(e,t)=>{const n={};if(!e)return n;for(const[r,i]of Object.entries(e)){n[t?`${t}-${r}`:r]=String(i)}return n},l=s(o,"data-pulse"),d=s(a,"data");return e.jsxs("div",Object.assign({className:"kilkaya-wrapper kilkaya-lock-height",style:{width:"100%"},"data-slot-tag":n},l,d,{children:[e.jsx("div",{className:"inscreen-target"}),e.jsx("k5a-stream",{name:t,"slot-tag":n}),e.jsx("div",{className:"container"}),e.jsx("div",{className:"fallback","data-fallback-target-id":r,style:{display:"none"},children:i})]}))},exports.runKilkaya=e=>t(void 0,void 0,void 0,function*(){const t=new re;yield t.run(e)});
|
package/kilkaya/es/index.d.ts
CHANGED
|
@@ -306,7 +306,6 @@ interface PlacementRefreshConfig {
|
|
|
306
306
|
}
|
|
307
307
|
interface Placement {
|
|
308
308
|
targetId: string;
|
|
309
|
-
adUnitId?: string;
|
|
310
309
|
sizes: Array<Array<number>>;
|
|
311
310
|
allowedFormats: Array<AstAdType>;
|
|
312
311
|
invCode: string;
|
|
@@ -393,6 +392,11 @@ interface TCFConfig {
|
|
|
393
392
|
timeout?: number;
|
|
394
393
|
nonRtb?: NonRTBConfig;
|
|
395
394
|
}
|
|
395
|
+
interface ManagedThirdPartyConfig {
|
|
396
|
+
readpeakUrl?: string;
|
|
397
|
+
adnamiUrl?: string;
|
|
398
|
+
adformDmpUrl?: string;
|
|
399
|
+
}
|
|
396
400
|
interface PrebidConfig {
|
|
397
401
|
enabled: boolean;
|
|
398
402
|
prebidUrl: string;
|
|
@@ -403,6 +407,7 @@ interface PrebidConfig {
|
|
|
403
407
|
forwardGlimrTags?: boolean;
|
|
404
408
|
manageAdserver?: boolean;
|
|
405
409
|
adServerUrl?: string;
|
|
410
|
+
thirdParty?: ManagedThirdPartyConfig;
|
|
406
411
|
}
|
|
407
412
|
interface NonRTBConfig {
|
|
408
413
|
invCodeSuffix?: string;
|
package/kilkaya/es/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t}from"react/jsx-runtime";function n(e,t,n,r){return new(n||(n=Promise))(function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)}l((r=r.apply(e,t||[])).next())})}"function"==typeof SuppressedError&&SuppressedError;const r="svd",i="vg",o="sa",a="bt",s="aftonbladet",l="e24";class d{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 c{getPulseObjectId(){return""}getPulsePageId(e,t){return""}}const u=(e,t)=>{new IntersectionObserver((e,n)=>{for(const r of e)if(r.intersectionRatio>=.5){n.disconnect(),t();break}},{threshold:.5}).observe(e)};class g{constructor(e,t){this.pulse=e,this.publisher=t}static extractAdFormat(e){return e.replace(/_\d.*$/,"")}computeInvCode(){}buildPlacement(e){return{placementId:null!=e?e:""}}trackLoad(){var e,t;null===(t=(e=this.pulse).trackLoadAd)||void 0===t||t.call(e,{object:this.buildAdObject(),placement:this.buildPlacement(this.computeInvCode())})}trackImpression(){const e=document.querySelector(`#${this.getTargetId()}`);e&&u(e,()=>{var e,t;return null===(t=(e=this.pulse).trackImpressionAd)||void 0===t?void 0:t.call(e,{object:this.buildAdObject(),placement:this.buildPlacement(this.computeInvCode())})})}trackEngagement(e){var t,n;null===(n=(t=this.pulse).trackEngagementAd)||void 0===n||n.call(t,{object:this.buildAdObject(),placement:this.buildPlacement(null!=e?e:this.computeInvCode()),engagement:{action:"Click",elementName:this.getTargetId()}})}}const p="[data-k5a-teaser-analytics]";class v extends g{constructor(e,t,n,r){super(e,""),this.root=t,this.newsroomStrategy=n,this.pageType=r}getTargetId(){return this.root.id}buildAdObject(){return this.getEventInput("view")}parseKilkayaData(){const e=this.root.querySelector("article");if(!e)return{};const t=e.dataset.k5aTeaserAnalytics;try{return t?JSON.parse(t):{}}catch(e){return{}}}mapPageType(e){var t;return null!==(t={front:"Frontpage",article:"Article",section:"Article",collection:"Article",other:"Article"}[null!=e?e:"front"])&&void 0!==t?t:"Frontpage"}getArticleId(){var e;return null!==(e=location.pathname.split("/").slice(-2,-1).pop())&&void 0!==e?e:""}getPlacementData(){var e,t;const n=this.root.closest(".kilkaya-wrapper");return{columnName:null!==(e=null==n?void 0:n.dataset.pulseColumnname)&&void 0!==e?e:"",primaryPosition:Number(null==n?void 0:n.dataset.pulsePrimaryposition)||0,secondaryPosition:Number(null==n?void 0:n.dataset.pulseSecondaryposition)||0,slot:null!==(t=null==n?void 0:n.dataset.slotTag)&&void 0!==t?t:""}}getEventTarget(){const{link:e,itemId:t,title:n}=this.parseKilkayaData();return{id:t,name:this.normalizePlacementTitle(null!=n?n:""),type:"Page",url:e}}normalizePlacementTitle(e){return e.replace(/<[^>]+>/gi,"").replace(/[^a-z0-9æøå\s_-]/gi,"")}waitForAnalyticsData(e){const t=this.root.querySelector(p);if(Boolean(null==t?void 0:t.dataset.k5aTeaserAnalytics))return void e();const n=new MutationObserver(()=>{const t=this.root.querySelector(p);Boolean(null==t?void 0:t.dataset.k5aTeaserAnalytics)&&(n.disconnect(),e())});n.observe(this.root,{attributes:!0,childList:!0,subtree:!0,attributeFilter:["data-k5a-teaser-analytics"]})}trackLoad(){}trackImpression(){u(this.root,()=>this.waitForAnalyticsData(()=>{var e,t;const n=new CustomEvent("advertory:partnerstudioAdImpression",{detail:{ad:this.parseKilkayaData().placement}});window.dispatchEvent(n);const r=this.getEventInput("view");this.pulse.trackLegacyViewUIElement?this.pulse.trackLegacyViewUIElement(r):this.pulse.trackViewUIElement?this.pulse.trackViewUIElement(r):null===(t=(e=this.pulse).trackElementView)||void 0===t||t.call(e,r)}))}trackEngagement(e){var t,n;const r=this.getEventInput("click");this.pulse.trackLegacyClickUIElement?this.pulse.trackLegacyClickUIElement(r):this.pulse.trackClickUIElement?this.pulse.trackClickUIElement(r):null===(n=(t=this.pulse).trackElementClick)||void 0===n||n.call(t,r)}}class m extends v{getEventBaseData(){var e,t,n,r;const{clientName:i,creativeId:o,itemId:a,placement:s}=this.parseKilkayaData(),{primaryPosition:l,secondaryPosition:d,slot:c}=this.getPlacementData(),u=this.mapPageType(this.pageType),g=null===(e=this.newsroomStrategy)||void 0===e?void 0:e.getPulsePageId(null!==(t=this.pageType)&&void 0!==t?t:"front",this.getArticleId());return Object.assign(Object.assign({},a&&{"@id":`sdrn:kilkaya:teaser:${a}`}),{"@type":"UIElement",position:s,elementType:"Article",custom:{customer:i,creativeId:null!=o?o:a},page:{"@id":null!=g?g:s,"@type":u,url:location.origin},placement:{primaryPosition:l,secondaryPosition:d,source:c},tags:null===(r=null===(n=this.newsroomStrategy)||void 0===n?void 0:n.getTags)||void 0===r?void 0:r.call(n,this.root)})}getEventInput(e){return{object:this.getEventBaseData(),partnerstudio:this.getEventPartnerstudioData(e),target:this.getEventTarget(),provider:this.getProviderData()}}getEventPartnerstudioData(e){return Object.assign(Object.assign({},this.parseKilkayaData()),{type:e,tracking_type:"ad",xandrAdLoaded:!1})}getProviderData(){return{productTag:"partnerstudio"}}}class h extends v{getEventBaseData(){var e,t;const{title:n="",clientName:r="",creativeId:i="",link:o="",itemId:a=""}=this.parseKilkayaData(),{columnName:s,primaryPosition:l,secondaryPosition:d,slot:c}=this.getPlacementData(),u={publicUrl:o,urlPath:o?new URL(o).pathname:""},{publicUrl:g,urlPath:p}=o&&(null===(t=null===(e=this.newsroomStrategy)||void 0===e?void 0:e.transformUrl)||void 0===t?void 0:t.call(e,o))||u;return Object.assign(Object.assign({},a&&{"@id":`sdrn:kilkaya:teaser:${a}`}),{"@type":"UIElement",elementType:"Teaser",layout:{elementSize:"large",imageUrl:"",name:"large"},name:n,placement:{columnName:s,primaryPosition:l,secondaryPosition:d,source:c},tags:[r,n,g,p].filter(Boolean),"spt:custom":{is_sponsored:!0,sponsor:r,"spt:creativeId":i,pageTitle:n,publicUrl:g,urlPath:p},url:location.origin})}getEventInput(e){return{object:this.getEventBaseData(),target:this.getEventTarget()}}}const f="no",y="se",b=(e,t)=>{const n="[Advertory LOG]: ";location.search.includes("ast_debug=true")&&(t?console.log(n,e,t):console.log(n,e))},w=(e,t)=>{console.warn("[Advertory WARN]: ",e)},k=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 b("Advertising permission value obtained synchronously: ",e),Boolean(t)})();if(null!==n)return void t(n);let r=!1;const i=e=>{r||(b("Resolving advertising permission value obtained"),r=!0,t(e))},o=setTimeout(()=>{b("Advertising permission timed out, resolving with false"),i(!1)},3e3);window._tcf_.onTcfReady(()=>{b("On Tcf Ready called, waiting for permission"),clearTimeout(o)}),window._tcf_.getPermission("CMP:advertising",e=>{clearTimeout(o);const t=Number(e);b("Advertising permission value obtained asynchronously: ",e),i(Boolean(t))})}),P="cmp:loaded";let T="undefined"!=typeof window?window._tcf_:void 0,E=!1;const I=(e,t,r)=>{const i=!!(null==e?void 0:e.enabled),o=(null==e?void 0:e.timeout)||3e3,a=(s="bypass_tcf",new URLSearchParams(window.location.search).get(s));var s;const l=()=>{if(!(null==e?void 0:e.enabled))return!0;if(((e,t)=>e?!!t&&(b("TCF bypass param detected, returning consent: true"),!0):(b("TCF is not enabled, returning consent: true"),!0))(i,a))return!0;if(E)return null;if(!T)throw new Error("[Advertory]: getConsentSync method was called before the tcfManager was available.");const t=T.getConsentedToAllSync();return b(`TCF consented to all is: ${t}`),T.getConsentedToAllSync()};return{initConsentManager:()=>(null==e?void 0:e.enabled)?new Promise((e,t)=>{if(b("Getting TCF consent manager..."),window._tcf_)return b("TCF consent manager is already available"),T=window._tcf_,void e(T);b("TCF consent manager is not available");const n=()=>{b("CMP loaded, resolving consent manager..."),r&&clearTimeout(r),window._tcf_?(T=window._tcf_,e(T)):t(new Error("CMP loaded but window._tcf_ is not defined"))},r=setTimeout(()=>{document.removeEventListener(P,n),E=!0,t(new Error("Timeout waiting for CMP to load"))},o);b("Listening for CMP loaded event..."),document.addEventListener(P,n,{once:!0})}):Promise.resolve(null),getConsentSync:l,getConsentAsync:()=>n(void 0,void 0,void 0,function*(){if(null==e?void 0:e.schibstedAdChoicesOverrideValue)return b(`Schibsted Ad Choices override value is set, returning override value: ${e.schibstedAdChoicesOverrideValue}`),Boolean(Number(e.schibstedAdChoicesOverrideValue));const t=(null==e?void 0:e.advertisingCMPSignalEnabled)&&r===y,n=(null==e?void 0:e.advertisingCMPSignalEnabled)&&r===f;if(t||n)return b("Schibsted Ad Choices is enabled, getting advertising permissions..."),yield k(e);if(!(null==e?void 0:e.enabled))return!0;const i=l();return null!==i?i:yield new Promise((e,t)=>{try{if(!T)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(()=>{b("TCF isConsentedToAll timed out, resolving with false"),n(!1)},o);T.onTcfReady(()=>{b("On Tcf Ready called, waiting for consent"),clearTimeout(r)}),T.isConsentedToAll(t=>{clearTimeout(r),e(t)})}catch(e){t(e)}})})}};class C{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 n(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 b("[Privacy Broker] User is not logged in."),null}})}isUserLoggedIn(){return n(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)}}function A(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var S,O;var j=A(function(){if(O)return S;O=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 n(e,t){return!1!==t.clone&&t.isMergeableObject(e)?s((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function r(e,t,r){return e.concat(t).map(function(e){return n(e,r)})}function i(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 o(e,t){try{return t in e}catch(e){return!1}}function a(e,t,r){var a={};return r.isMergeableObject(e)&&i(e).forEach(function(t){a[t]=n(e[t],r)}),i(t).forEach(function(i){(function(e,t){return o(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,i)||(o(e,i)&&r.isMergeableObject(t[i])?a[i]=function(e,t){if(!t.customMerge)return s;var n=t.customMerge(e);return"function"==typeof n?n:s}(i,r)(e[i],t[i],r):a[i]=n(t[i],r))}),a}function s(t,i,o){(o=o||{}).arrayMerge=o.arrayMerge||r,o.isMergeableObject=o.isMergeableObject||e,o.cloneUnlessOtherwiseSpecified=n;var s=Array.isArray(i);return s===Array.isArray(t)?s?o.arrayMerge(t,i,o):a(t,i,o):n(i,o)}return s.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(e,n){return s(e,n,t)},{})},S=s}());const L={arrayMerge:(e,t)=>t,isMergeableObject:e=>"object"==typeof e&&null!==e&&e.constructor===Object},U=(e,t)=>j(e,t,L),_=(e,t)=>Object.assign(Object.assign({},e),t),N=(e,t)=>{var n;return U(null!==(n=e)&&void 0!==n?n:{},t)},$={adRequested:()=>{},adAvailable:e=>{},adLoaded:e=>{},adNoBid:e=>{},adError:(e,t)=>{},adCollapse:()=>{},adRequestFailure:e=>{},adBadRequest:e=>{},adLoadedMediated:e=>{},adNoBidMediated:e=>{}},M=e=>{(e=>{const{pageContext:t,pageOptions:n,placements:r,appearanceConfig:i}=null!=e?e:{};(null==t?void 0:t.publisher)||w("pageContext.publisher is required."),(null==t?void 0:t.countryCode)||w("pageContext.countryCode is required."),(null==t?void 0:t.pageType)||w("pageContext.pageType is required."),(null==t?void 0:t.deviceType)||w("pageContext.deviceType is required."),n||w("pageOptions is required."),r||w("placements is required."),(null==i?void 0:i.defaultThreshold)||w("appearanceConfig.defaultThreshold is required.")})(e),(e=>{var t,n,r,i;const o=e.pageSectionsSelectors,a=[{flag:!!(null===(t=e.takeover)||void 0===t?void 0:t.enabled),property:"header",featureName:"takeover"},{flag:!!(null===(n=e.sponsorstripe)||void 0===n?void 0:n.enabled),property:"header",featureName:"sponsorstripe"},{flag:!!(null===(r=e.widescreenSwitching)||void 0===r?void 0:r.enabled),property:"right",featureName:"widescreenSwitching"},{flag:!!(null===(i=e.wallpaper)||void 0===i?void 0:i.enabled),property:"header",featureName:"wallpaper"}];for(const{flag:e,property:t,featureName:n}of a)e&&!(null==o?void 0:o[t])&&w(`pageSectionsSelectors.${t} is required when ${n} is enabled.`)})(e)},D={placements:(e,t)=>t,takeover:N,refreshConfig:_,editory:N,appearanceConfig:N,pageContext:_,pageOptions:_,pageSectionsSelectors:_,tcf:_};class F{set(e){M(e),this.config=e}modifyConfigProperties(e){if(!this.config)throw new Error("Config was accessed before it had been initialized.");((e,t)=>{const n=e;for(const e of Object.keys(D)){const r=t[e];void 0!==r&&(n[e]=D[e](n[e],r))}})(this.config,e)}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=U(F.DEFAULT_SITE_HANDLERS,e)}}F.DEFAULT_SITE_HANDLERS={siteEvents:$,initNativeAd:()=>{}};const B=new F;B.modifyConfigProperties.bind(B);const x=864e5,q=(()=>{const e=e=>{const t=window.localStorage.getItem(e);if(!t)return null;try{return JSON.parse(t)}catch(e){return b("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=x)=>{const i={data:n,expirationTime:(new Date).getTime()+r};t(e,JSON.stringify(i))},getByTimestamp:(t,n=x)=>{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 b("Error with parsing localStorage data"),null}}}})(),R=e=>e.startsWith("glci_"),K=()=>{var e;return((e=[])=>e.filter(R))(null!==(e=(()=>{const e=q.getByTimestamp("glimrTags");return e&&"string"!=typeof e?null==e?void 0:e.tags:null})())&&void 0!==e?e:[])},V=/^glci_/,H="gender_",z="geo_",J="male",W="female",X=()=>n(void 0,void 0,void 0,function*(){try{const t=yield(e=500,n(void 0,void 0,void 0,function*(){return Promise.race([n(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)})}),new Promise(t=>setTimeout(()=>t(void 0),e))])})),r=new C(t),i=yield r.getIdentityUser(),{gender:o}=null!=i?i:{};return o===J||o===W?`${H}${o}`:void 0}catch(e){return}var e}),G=()=>n(void 0,void 0,void 0,function*(){const e=[],t=yield X(),n=(()=>{const e=K().map(e=>`${z}${e.replace(V,"")}`);return Array.from(new Set(e))})();return t&&e.push(t),n&&e.push(...n),e}),Q="front";class Y{getPulseObjectId(){return"sdrn:e24:content:partnerstudio:element:partnerstudio:stats"}getPulsePageId(e,t){return e===Q?"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]}}class Z{getPulseObjectId(){return"sdrn:aftenposten:content:partnerstudio:element:partnerstudio:stats"}getPulsePageId(){return"sdrn:aftenposten:frontpage:Frontpage"}}class ee{getPulseObjectId(){return"sdrn:bt:content:partnerstudio:element:partnerstudio:stats"}getPulsePageId(){return"sdrn:bt:frontpage:Frontpage"}}class te{getPulseObjectId(){return"sdrn:stavangeraftenblad:content:partnerstudio:element:partnerstudio:stats"}getPulsePageId(){return"sdrn:stavangeraftenblad:frontpage:Frontpage"}}class ne{transformUrl(e){const{hostname:t,pathname:n}=new URL(e);return"brand-studio.svd.se"===t?{publicUrl:`https://svd.se/brand-studio${n}`,urlPath:`/brand-studio${n}`}:{publicUrl:e,urlPath:n}}getPulseObjectId(){return"sdrn:svdse:content:partnerstudio:element:partnerstudio:stats"}getPulsePageId(e,t){return e===Q?"sdrn:svdse:frontpage:front":`sdrn:svdse:article:${t}`}}class re{transformUrl(e){const{hostname:t,pathname:n}=new URL(e);return"brand-studio.aftonbladet.se"===t?{publicUrl:`https://aftonbladet.se/brand-studio${n}`,urlPath:`/brand-studio${n}`}:{publicUrl:e,urlPath:n}}getPulseObjectId(){return""}getPulsePageId(){return""}}class ie{handleKilkayaStreamTracking({pulse:e,pageContext:{pageType:t,publisher:n,countryCode:u}}){if(!(null==e?void 0:e.instance))return;const g={[i]:new d,[l]:new Y,"no-aftenposten":new Z,[a]:new ee,"no-bergenstidende":new ee,[o]:new te,"no-stavangeraftenblad":new te,[r]:new ne,[s]:new re}[n]||new c;((e,t,n,r)=>{const i=document.querySelectorAll("k5a-stream");i.length&&i.forEach(i=>{const o=r===y?new h(e,i,t):new m(e,i,t,n);o.trackImpression(),i.addEventListener("click",()=>o.trackEngagement())})})(e.instance,g,t,u)}injectKilkayaMeta(e){return n(this,void 0,void 0,function*(){const t=document.createElement("script"),n=yield G();t.textContent=`var k5aMeta = { consent: ${e}, cntTag: ${JSON.stringify(n)} };`,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(b(`Kilkaya event for slot: ${n}`),!n)return void b("Kilkaya slot empty, Xandr backfill won't be loaded");const r=n.parentElement;r?(b(`Kilkaya placement ${n.getAttribute("name")} has not been loaded, loading Xandr backfill`),this.showBackfill(r)):b("Kilkaya parent slot empty, Xandr backfill won't be loaded")})}showBackfill(e){var t;const n=e.querySelector(".fallback");if(!n)return;n.style.display="flex";(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"))})(null!==(t=n.dataset.fallbackTargetId)&&void 0!==t?t:"")}loadKilkayaScript(e){return n(this,void 0,void 0,function*(){yield((e,...t)=>n(void 0,[e,...t],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(l)};i.addEventListener("load",o),i.addEventListener("error",a);const l=setTimeout(()=>{s(),r(new Error(`Loading script timed out: ${e}`))},t);document.head.appendChild(i)}).catch(e=>{console.error(e)}))}))(e)})}run(e){return n(this,void 0,void 0,function*(){var t,r;const{tcf:i,pageContext:{isMobileApp:o,countryCode:a},kilkaya:s}=e;if(!(null==s?void 0:s.enabled))return;const l=yield((e,t,r,...i)=>n(void 0,[e,t,r,...i],void 0,function*(e,t,n,r="NOT SPECIFIED FEATURE"){if(!(null==e?void 0:e.schibstedConsentToPayEnabled))return b(`Schibsted Consent to Pay is not enabled, returning true for ${r}`),!0;if(null==e?void 0:e.schibstedAdChoicesOverrideValue)return b(`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,0,n);return(yield i())?(b(`Schibsted Ad Choices consent given according to TCF consent manager for ${r}`),!0):(b(`Schibsted Ad Choices consent not given according to TCF consent manager for ${r}`),!1)}))(i,o,a,"kilkaya");this.observeForKilkayaBackfills(),yield this.injectKilkayaMeta(l),yield this.loadKilkayaScript(null!==(r=null===(t=s.options)||void 0===t?void 0:t.kilkayaUrl)&&void 0!==r?r:""),this.handleKilkayaStreamTracking(e)})}}const oe=({placementName:n,slotTag:r,fallbackTargetId:i,children:o,pulseData:a,htmlAttributes:s})=>{const l=(e,t)=>{const n={};if(!e)return n;for(const[r,i]of Object.entries(e)){n[t?`${t}-${r}`:r]=String(i)}return n},d=l(a,"data-pulse"),c=l(s,"data");return e("div",Object.assign({className:"kilkaya-wrapper kilkaya-lock-height",style:{width:"100%"},"data-slot-tag":r},d,c,{children:[t("div",{className:"inscreen-target"}),t("k5a-stream",{name:n,"slot-tag":r}),t("div",{className:"container"}),t("div",{className:"fallback","data-fallback-target-id":i,style:{display:"none"},children:o})]}))},ae=e=>n(void 0,void 0,void 0,function*(){const t=new ie;yield t.run(e)});export{oe as Kilkaya,ae as runKilkaya};
|
|
1
|
+
import{jsxs as e,jsx as t}from"react/jsx-runtime";function n(e,t,n,r){return new(n||(n=Promise))(function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)}l((r=r.apply(e,t||[])).next())})}"function"==typeof SuppressedError&&SuppressedError;const r="svd",i="vg",o="sa",a="bt",s="aftonbladet",l="e24";class d{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 c{getPulseObjectId(){return""}getPulsePageId(e,t){return""}}const u=(e,t)=>{new IntersectionObserver((e,n)=>{for(const r of e)if(r.intersectionRatio>=.5){n.disconnect(),t();break}},{threshold:.5}).observe(e)};class g{constructor(e,t){this.pulse=e,this.publisher=t}static extractAdFormat(e){return e.replace(/_\d.*$/,"")}computeInvCode(){}buildPlacement(e){return{placementId:null!=e?e:""}}trackLoad(){var e,t;null===(t=(e=this.pulse).trackLoadAd)||void 0===t||t.call(e,{object:this.buildAdObject(),placement:this.buildPlacement(this.computeInvCode())})}trackImpression(){const e=document.querySelector(`#${this.getTargetId()}`);e&&u(e,()=>{var e,t;return null===(t=(e=this.pulse).trackImpressionAd)||void 0===t?void 0:t.call(e,{object:this.buildAdObject(),placement:this.buildPlacement(this.computeInvCode())})})}trackEngagement(e){var t,n;null===(n=(t=this.pulse).trackEngagementAd)||void 0===n||n.call(t,{object:this.buildAdObject(),placement:this.buildPlacement(null!=e?e:this.computeInvCode()),engagement:{action:"Click",elementName:this.getTargetId()}})}}const p="[data-k5a-teaser-analytics]";class v extends g{constructor(e,t,n,r){super(e,""),this.root=t,this.newsroomStrategy=n,this.pageType=r}getTargetId(){return this.root.id}buildAdObject(){return this.getEventInput("view")}parseKilkayaData(){const e=this.root.querySelector("article");if(!e)return{};const t=e.dataset.k5aTeaserAnalytics;try{return t?JSON.parse(t):{}}catch(e){return{}}}mapPageType(e){var t;return null!==(t={front:"Frontpage",article:"Article",section:"Article",collection:"Article",other:"Article"}[null!=e?e:"front"])&&void 0!==t?t:"Frontpage"}getArticleId(){var e;return null!==(e=location.pathname.split("/").slice(-2,-1).pop())&&void 0!==e?e:""}getPlacementData(){var e,t;const n=this.root.closest(".kilkaya-wrapper");return{columnName:null!==(e=null==n?void 0:n.dataset.pulseColumnname)&&void 0!==e?e:"",primaryPosition:Number(null==n?void 0:n.dataset.pulsePrimaryposition)||0,secondaryPosition:Number(null==n?void 0:n.dataset.pulseSecondaryposition)||0,slot:null!==(t=null==n?void 0:n.dataset.slotTag)&&void 0!==t?t:""}}getEventTarget(){const{link:e,itemId:t,title:n}=this.parseKilkayaData();return{id:t,name:this.normalizePlacementTitle(null!=n?n:""),type:"Page",url:e}}normalizePlacementTitle(e){return e.replace(/<[^>]+>/gi,"").replace(/[^a-z0-9æøå\s_-]/gi,"")}waitForAnalyticsData(e){const t=this.root.querySelector(p);if(Boolean(null==t?void 0:t.dataset.k5aTeaserAnalytics))return void e();const n=new MutationObserver(()=>{const t=this.root.querySelector(p);Boolean(null==t?void 0:t.dataset.k5aTeaserAnalytics)&&(n.disconnect(),e())});n.observe(this.root,{attributes:!0,childList:!0,subtree:!0,attributeFilter:["data-k5a-teaser-analytics"]})}trackLoad(){}trackImpression(){u(this.root,()=>this.waitForAnalyticsData(()=>{var e,t;const n=new CustomEvent("advertory:partnerstudioAdImpression",{detail:{ad:this.parseKilkayaData().placement}});window.dispatchEvent(n);const r=this.getEventInput("view");this.pulse.trackLegacyViewUIElement?this.pulse.trackLegacyViewUIElement(r):this.pulse.trackViewUIElement?this.pulse.trackViewUIElement(r):null===(t=(e=this.pulse).trackElementView)||void 0===t||t.call(e,r)}))}trackEngagement(e){var t,n;const r=this.getEventInput("click");this.pulse.trackLegacyClickUIElement?this.pulse.trackLegacyClickUIElement(r):this.pulse.trackClickUIElement?this.pulse.trackClickUIElement(r):null===(n=(t=this.pulse).trackElementClick)||void 0===n||n.call(t,r)}}class m extends v{getEventBaseData(){var e,t,n,r;const{clientName:i,creativeId:o,itemId:a,placement:s}=this.parseKilkayaData(),{primaryPosition:l,secondaryPosition:d,slot:c}=this.getPlacementData(),u=this.mapPageType(this.pageType),g=null===(e=this.newsroomStrategy)||void 0===e?void 0:e.getPulsePageId(null!==(t=this.pageType)&&void 0!==t?t:"front",this.getArticleId());return Object.assign(Object.assign({},a&&{"@id":`sdrn:kilkaya:teaser:${a}`}),{"@type":"UIElement",position:s,elementType:"Article",custom:{customer:i,creativeId:null!=o?o:a},page:{"@id":null!=g?g:s,"@type":u,url:location.origin},placement:{primaryPosition:l,secondaryPosition:d,source:c},tags:null===(r=null===(n=this.newsroomStrategy)||void 0===n?void 0:n.getTags)||void 0===r?void 0:r.call(n,this.root)})}getEventInput(e){return{object:this.getEventBaseData(),partnerstudio:this.getEventPartnerstudioData(e),target:this.getEventTarget(),provider:this.getProviderData()}}getEventPartnerstudioData(e){return Object.assign(Object.assign({},this.parseKilkayaData()),{type:e,tracking_type:"ad",xandrAdLoaded:!1})}getProviderData(){return{productTag:"partnerstudio"}}}class h extends v{getEventBaseData(){var e,t;const{title:n="",clientName:r="",creativeId:i="",link:o="",itemId:a=""}=this.parseKilkayaData(),{columnName:s,primaryPosition:l,secondaryPosition:d,slot:c}=this.getPlacementData(),u={publicUrl:o,urlPath:o?new URL(o).pathname:""},{publicUrl:g,urlPath:p}=o&&(null===(t=null===(e=this.newsroomStrategy)||void 0===e?void 0:e.transformUrl)||void 0===t?void 0:t.call(e,o))||u;return Object.assign(Object.assign({},a&&{"@id":`sdrn:kilkaya:teaser:${a}`}),{"@type":"UIElement",elementType:"Teaser",layout:{elementSize:"large",imageUrl:"",name:"large"},name:n,placement:{columnName:s,primaryPosition:l,secondaryPosition:d,source:c},tags:[r,n,g,p].filter(Boolean),"spt:custom":{is_sponsored:!0,sponsor:r,"spt:creativeId":i,pageTitle:n,publicUrl:g,urlPath:p},url:location.origin})}getEventInput(e){return{object:this.getEventBaseData(),target:this.getEventTarget()}}}const f="no",y="se",b=(e,t)=>{const n="[Advertory LOG]: ";location.search.includes("ast_debug=true")&&(t?console.log(n,e,t):console.log(n,e))},w=(e,t)=>{console.warn("[Advertory WARN]: ",e)},k=()=>{return e="bypass_tcf",new URLSearchParams(window.location.search).get(e);var e},P=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 b("Advertising permission value obtained synchronously: ",e),Boolean(t)})();if(null!==n)return void t(n);let r=!1;const i=e=>{r||(b("Resolving advertising permission value obtained"),r=!0,t(e))},o=setTimeout(()=>{b("Advertising permission timed out, resolving with false"),i(!1)},3e3);window._tcf_.onTcfReady(()=>{b("On Tcf Ready called, waiting for permission"),clearTimeout(o)}),window._tcf_.getPermission("CMP:advertising",e=>{clearTimeout(o);const t=Number(e);b("Advertising permission value obtained asynchronously: ",e),i(Boolean(t))})}),T="cmp:loaded";let E="undefined"!=typeof window?window._tcf_:void 0,I=!1;const C=(e,t,r)=>{const i=!!(null==e?void 0:e.enabled),o=(null==e?void 0:e.timeout)||3e3,a=k(),s=()=>{if(!(null==e?void 0:e.enabled))return!0;if(((e,t)=>e?!!t&&(b("TCF bypass param detected, returning consent: true"),!0):(b("TCF is not enabled, returning consent: true"),!0))(i,a))return!0;if(I)return null;if(!E)throw new Error("[Advertory]: getConsentSync method was called before the tcfManager was available.");const t=E.getConsentedToAllSync();return b(`TCF consented to all is: ${t}`),E.getConsentedToAllSync()};return{initConsentManager:()=>(null==e?void 0:e.enabled)?new Promise((e,t)=>{if(b("Getting TCF consent manager..."),window._tcf_)return b("TCF consent manager is already available"),E=window._tcf_,void e(E);b("TCF consent manager is not available");const n=()=>{b("CMP loaded, resolving consent manager..."),r&&clearTimeout(r),window._tcf_?(E=window._tcf_,e(E)):t(new Error("CMP loaded but window._tcf_ is not defined"))},r=setTimeout(()=>{document.removeEventListener(T,n),I=!0,t(new Error("Timeout waiting for CMP to load"))},o);b("Listening for CMP loaded event..."),document.addEventListener(T,n,{once:!0})}):Promise.resolve(null),getConsentSync:s,getConsentAsync:()=>n(void 0,void 0,void 0,function*(){if(null==e?void 0:e.schibstedAdChoicesOverrideValue)return b(`Schibsted Ad Choices override value is set, returning override value: ${e.schibstedAdChoicesOverrideValue}`),Boolean(Number(e.schibstedAdChoicesOverrideValue));const t=(null==e?void 0:e.advertisingCMPSignalEnabled)&&r===y,n=(null==e?void 0:e.advertisingCMPSignalEnabled)&&r===f;if(t||n)return b("Schibsted Ad Choices is enabled, getting advertising permissions..."),yield P(e);if(!(null==e?void 0:e.enabled))return!0;const i=s();return null!==i?i:yield new Promise((e,t)=>{try{if(!E)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(()=>{b("TCF isConsentedToAll timed out, resolving with false"),n(!1)},o);E.onTcfReady(()=>{b("On Tcf Ready called, waiting for consent"),clearTimeout(r)}),E.isConsentedToAll(t=>{clearTimeout(r),e(t)})}catch(e){t(e)}})})}};class S{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 n(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 b("[Privacy Broker] User is not logged in."),null}})}isUserLoggedIn(){return n(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)}}function A(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var O,j;var U=A(function(){if(j)return O;j=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 n(e,t){return!1!==t.clone&&t.isMergeableObject(e)?s((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function r(e,t,r){return e.concat(t).map(function(e){return n(e,r)})}function i(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 o(e,t){try{return t in e}catch(e){return!1}}function a(e,t,r){var a={};return r.isMergeableObject(e)&&i(e).forEach(function(t){a[t]=n(e[t],r)}),i(t).forEach(function(i){(function(e,t){return o(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,i)||(o(e,i)&&r.isMergeableObject(t[i])?a[i]=function(e,t){if(!t.customMerge)return s;var n=t.customMerge(e);return"function"==typeof n?n:s}(i,r)(e[i],t[i],r):a[i]=n(t[i],r))}),a}function s(t,i,o){(o=o||{}).arrayMerge=o.arrayMerge||r,o.isMergeableObject=o.isMergeableObject||e,o.cloneUnlessOtherwiseSpecified=n;var s=Array.isArray(i);return s===Array.isArray(t)?s?o.arrayMerge(t,i,o):a(t,i,o):n(i,o)}return s.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(e,n){return s(e,n,t)},{})},O=s}());const L={arrayMerge:(e,t)=>t,isMergeableObject:e=>"object"==typeof e&&null!==e&&e.constructor===Object},_=(e,t)=>U(e,t,L),$=(e,t)=>Object.assign(Object.assign({},e),t),N=(e,t)=>{var n;return _(null!==(n=e)&&void 0!==n?n:{},t)},M=e=>{(e=>{const{pageContext:t,pageOptions:n,placements:r,appearanceConfig:i}=null!=e?e:{};(null==t?void 0:t.publisher)||w("pageContext.publisher is required."),(null==t?void 0:t.countryCode)||w("pageContext.countryCode is required."),(null==t?void 0:t.pageType)||w("pageContext.pageType is required."),(null==t?void 0:t.deviceType)||w("pageContext.deviceType is required."),n||w("pageOptions is required."),r||w("placements is required."),(null==i?void 0:i.defaultThreshold)||w("appearanceConfig.defaultThreshold is required.")})(e),(e=>{var t,n,r,i;const o=e.pageSectionsSelectors,a=[{flag:!!(null===(t=e.takeover)||void 0===t?void 0:t.enabled),property:"header",featureName:"takeover"},{flag:!!(null===(n=e.sponsorstripe)||void 0===n?void 0:n.enabled),property:"header",featureName:"sponsorstripe"},{flag:!!(null===(r=e.widescreenSwitching)||void 0===r?void 0:r.enabled),property:"right",featureName:"widescreenSwitching"},{flag:!!(null===(i=e.wallpaper)||void 0===i?void 0:i.enabled),property:"header",featureName:"wallpaper"}];for(const{flag:e,property:t,featureName:n}of a)e&&!(null==o?void 0:o[t])&&w(`pageSectionsSelectors.${t} is required when ${n} is enabled.`)})(e)},D={placements:(e,t)=>t,takeover:N,refreshConfig:$,editory:N,appearanceConfig:N,pageContext:$,pageOptions:$,pageSectionsSelectors:$,tcf:$};class F{set(e){M(e),this.config=e}modifyConfigProperties(e){if(!this.config)throw new Error("Config was accessed before it had been initialized.");((e,t)=>{const n=e;for(const e of Object.keys(D)){const r=t[e];void 0!==r&&(n[e]=D[e](n[e],r))}})(this.config,e)}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=_(F.DEFAULT_SITE_HANDLERS,e)}}F.DEFAULT_SITE_HANDLERS={initNativeAd:()=>{}};const x=new F;x.modifyConfigProperties.bind(x);const B=864e5,K=(()=>{const e=e=>{const t=window.localStorage.getItem(e);if(!t)return null;try{return JSON.parse(t)}catch(e){return b("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=B)=>{const i={data:n,expirationTime:(new Date).getTime()+r};t(e,JSON.stringify(i))},getByTimestamp:(t,n=B)=>{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 b("Error with parsing localStorage data"),null}}}})(),q=e=>e.startsWith("glci_"),R=()=>{var e;return((e=[])=>e.filter(q))(null!==(e=(()=>{const e=K.getByTimestamp("glimrTags");return e&&"string"!=typeof e?null==e?void 0:e.tags:null})())&&void 0!==e?e:[])},V=/^glci_/,H="gender_",z="geo_",J="male",W="female",X=()=>n(void 0,void 0,void 0,function*(){try{const t=yield(e=500,n(void 0,void 0,void 0,function*(){return Promise.race([n(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)})}),new Promise(t=>setTimeout(()=>t(void 0),e))])})),r=new S(t),i=yield r.getIdentityUser(),{gender:o}=null!=i?i:{};return o===J||o===W?`${H}${o}`:void 0}catch(e){return}var e}),G=()=>n(void 0,void 0,void 0,function*(){const e=[],t=yield X(),n=(()=>{const e=R().map(e=>`${z}${e.replace(V,"")}`);return Array.from(new Set(e))})();return t&&e.push(t),n&&e.push(...n),e}),Q="front";class Y{getPulseObjectId(){return"sdrn:e24:content:partnerstudio:element:partnerstudio:stats"}getPulsePageId(e,t){return e===Q?"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]}}class Z{getPulseObjectId(){return"sdrn:aftenposten:content:partnerstudio:element:partnerstudio:stats"}getPulsePageId(){return"sdrn:aftenposten:frontpage:Frontpage"}}class ee{getPulseObjectId(){return"sdrn:bt:content:partnerstudio:element:partnerstudio:stats"}getPulsePageId(){return"sdrn:bt:frontpage:Frontpage"}}class te{getPulseObjectId(){return"sdrn:stavangeraftenblad:content:partnerstudio:element:partnerstudio:stats"}getPulsePageId(){return"sdrn:stavangeraftenblad:frontpage:Frontpage"}}class ne{transformUrl(e){const{hostname:t,pathname:n}=new URL(e);return"brand-studio.svd.se"===t?{publicUrl:`https://svd.se/brand-studio${n}`,urlPath:`/brand-studio${n}`}:{publicUrl:e,urlPath:n}}getPulseObjectId(){return"sdrn:svdse:content:partnerstudio:element:partnerstudio:stats"}getPulsePageId(e,t){return e===Q?"sdrn:svdse:frontpage:front":`sdrn:svdse:article:${t}`}}class re{transformUrl(e){const{hostname:t,pathname:n}=new URL(e);return"brand-studio.aftonbladet.se"===t?{publicUrl:`https://aftonbladet.se/brand-studio${n}`,urlPath:`/brand-studio${n}`}:{publicUrl:e,urlPath:n}}getPulseObjectId(){return""}getPulsePageId(){return""}}class ie{handleKilkayaStreamTracking({pulse:e,pageContext:{pageType:t,publisher:n,countryCode:u}}){if(!(null==e?void 0:e.instance))return;const g={[i]:new d,[l]:new Y,"no-aftenposten":new Z,[a]:new ee,"no-bergenstidende":new ee,[o]:new te,"no-stavangeraftenblad":new te,[r]:new ne,[s]:new re}[n]||new c;((e,t,n,r)=>{const i=document.querySelectorAll("k5a-stream");i.length&&i.forEach(i=>{const o=r===y?new h(e,i,t):new m(e,i,t,n);o.trackImpression(),i.addEventListener("click",()=>o.trackEngagement())})})(e.instance,g,t,u)}injectKilkayaMeta(e){return n(this,void 0,void 0,function*(){const t=document.createElement("script"),n=yield G();t.textContent=`var k5aMeta = { consent: ${e}, cntTag: ${JSON.stringify(n)} };`,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(b(`Kilkaya event for slot: ${n}`),!n)return void b("Kilkaya slot empty, Xandr backfill won't be loaded");const r=n.parentElement;r?(b(`Kilkaya placement ${n.getAttribute("name")} has not been loaded, loading Xandr backfill`),this.showBackfill(r)):b("Kilkaya parent slot empty, Xandr backfill won't be loaded")})}showBackfill(e){var t;const n=e.querySelector(".fallback");if(!n)return;n.style.display="flex";(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"))})(null!==(t=n.dataset.fallbackTargetId)&&void 0!==t?t:"")}loadKilkayaScript(e){return n(this,void 0,void 0,function*(){yield((e,...t)=>n(void 0,[e,...t],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(l)};i.addEventListener("load",o),i.addEventListener("error",a);const l=setTimeout(()=>{s(),r(new Error(`Loading script timed out: ${e}`))},t);document.head.appendChild(i)}).catch(e=>{console.error(e)}))}))(e)})}run(e){return n(this,void 0,void 0,function*(){var t,r;const{tcf:i,pageContext:{isMobileApp:o,countryCode:a},kilkaya:s}=e;if(!(null==s?void 0:s.enabled))return;const l=yield((e,t,r,...i)=>n(void 0,[e,t,r,...i],void 0,function*(e,t,n,r="NOT SPECIFIED FEATURE"){if(!(null==e?void 0:e.schibstedConsentToPayEnabled))return b(`Schibsted Consent to Pay is not enabled, returning true for ${r}`),!0;if(null==e?void 0:e.schibstedAdChoicesOverrideValue)return b(`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}=C(e,0,n);return(yield i())?(b(`Schibsted Ad Choices consent given according to TCF consent manager for ${r}`),!0):(b(`Schibsted Ad Choices consent not given according to TCF consent manager for ${r}`),!1)}))(i,o,a,"kilkaya");this.observeForKilkayaBackfills(),yield this.injectKilkayaMeta(l),yield this.loadKilkayaScript(null!==(r=null===(t=s.options)||void 0===t?void 0:t.kilkayaUrl)&&void 0!==r?r:""),this.handleKilkayaStreamTracking(e)})}}const oe=({placementName:n,slotTag:r,fallbackTargetId:i,children:o,pulseData:a,htmlAttributes:s})=>{const l=(e,t)=>{const n={};if(!e)return n;for(const[r,i]of Object.entries(e)){n[t?`${t}-${r}`:r]=String(i)}return n},d=l(a,"data-pulse"),c=l(s,"data");return e("div",Object.assign({className:"kilkaya-wrapper kilkaya-lock-height",style:{width:"100%"},"data-slot-tag":r},d,c,{children:[t("div",{className:"inscreen-target"}),t("k5a-stream",{name:n,"slot-tag":r}),t("div",{className:"container"}),t("div",{className:"fallback","data-fallback-target-id":i,style:{display:"none"},children:o})]}))},ae=e=>n(void 0,void 0,void 0,function*(){const t=new ie;yield t.run(e)});export{oe as Kilkaya,ae as runKilkaya};
|
package/klart/cjs/index.d.ts
CHANGED
|
@@ -520,7 +520,6 @@ interface PlacementRefreshConfig {
|
|
|
520
520
|
}
|
|
521
521
|
interface Placement {
|
|
522
522
|
targetId: string;
|
|
523
|
-
adUnitId?: string;
|
|
524
523
|
sizes: Array<Array<number>>;
|
|
525
524
|
allowedFormats: Array<AstAdType>;
|
|
526
525
|
invCode: string;
|
|
@@ -607,6 +606,11 @@ interface TCFConfig {
|
|
|
607
606
|
timeout?: number;
|
|
608
607
|
nonRtb?: NonRTBConfig;
|
|
609
608
|
}
|
|
609
|
+
interface ManagedThirdPartyConfig {
|
|
610
|
+
readpeakUrl?: string;
|
|
611
|
+
adnamiUrl?: string;
|
|
612
|
+
adformDmpUrl?: string;
|
|
613
|
+
}
|
|
610
614
|
interface PrebidConfig {
|
|
611
615
|
enabled: boolean;
|
|
612
616
|
prebidUrl: string;
|
|
@@ -617,6 +621,7 @@ interface PrebidConfig {
|
|
|
617
621
|
forwardGlimrTags?: boolean;
|
|
618
622
|
manageAdserver?: boolean;
|
|
619
623
|
adServerUrl?: string;
|
|
624
|
+
thirdParty?: ManagedThirdPartyConfig;
|
|
620
625
|
}
|
|
621
626
|
interface NonRTBConfig {
|
|
622
627
|
invCodeSuffix?: string;
|
|
@@ -891,8 +896,13 @@ interface Advertory {
|
|
|
891
896
|
getVideoAdsConfig: (params: VideoAdsConfigParams) => (stream: VideoStream) => Promise<Record<string, unknown>>;
|
|
892
897
|
}
|
|
893
898
|
|
|
899
|
+
declare const TagDefinitions: {
|
|
900
|
+
readonly EXPLICIT: "explicit";
|
|
901
|
+
readonly DOM_DISCOVERED: "dom-discovered";
|
|
902
|
+
};
|
|
903
|
+
type TagDefinition = (typeof TagDefinitions)[keyof typeof TagDefinitions];
|
|
894
904
|
interface AdServerCapabilities {
|
|
895
|
-
tagDefinition:
|
|
905
|
+
tagDefinition: TagDefinition;
|
|
896
906
|
deferredRequest: boolean;
|
|
897
907
|
deferredRender: boolean;
|
|
898
908
|
refresh: boolean;
|
|
@@ -910,18 +920,29 @@ interface AdEventBus {
|
|
|
910
920
|
on: (event: AdEventName, handler: AdEventHandler) => void;
|
|
911
921
|
}
|
|
912
922
|
|
|
923
|
+
interface RefreshOptions {
|
|
924
|
+
keepPreviousSizes?: Array<Placement>;
|
|
925
|
+
applyReloadKeyword?: boolean;
|
|
926
|
+
}
|
|
913
927
|
interface AdServerDriver {
|
|
914
928
|
readonly name: string;
|
|
915
929
|
readonly capabilities: AdServerCapabilities;
|
|
930
|
+
readonly messageOrigins?: ReadonlyArray<string>;
|
|
916
931
|
setup(): Promise<void>;
|
|
917
932
|
setTargeting(): Promise<void>;
|
|
933
|
+
enrichPlacementsAfterDiscovery?(placements: Array<Placement>): Array<Placement>;
|
|
934
|
+
adjustPlacementsBeforeRequest?(placements: Array<Placement>): Promise<Array<Placement>>;
|
|
918
935
|
definePlacements?(placements: Array<Placement>): void;
|
|
919
936
|
requestPlacements?(placements: Array<Placement>): Promise<void>;
|
|
920
937
|
requestPage?(): Promise<void>;
|
|
921
938
|
bindEvents(bus: AdEventBus): Promise<void>;
|
|
939
|
+
clear?(targetIds: Array<string>): void;
|
|
940
|
+
resizeCreative?(targetId: string, size: Array<number>, isMediation?: boolean): void;
|
|
941
|
+
render?(targetId: string): void;
|
|
942
|
+
refresh?(targetIds: Array<string>, options?: RefreshOptions): void;
|
|
922
943
|
}
|
|
923
944
|
|
|
924
|
-
declare const createAdvertory: (handlers: SiteHandlers,
|
|
945
|
+
declare const createAdvertory: (handlers: SiteHandlers, driver: AdServerDriver, siteSpecificConfig?: SiteSpecificConfig) => Advertory;
|
|
925
946
|
|
|
926
947
|
declare const prepareTag: (tag: AstDefineTagParams) => AstDefineTagParams;
|
|
927
948
|
|
|
@@ -962,6 +983,6 @@ const HANDLERS = {
|
|
|
962
983
|
initNativeAd: initAdsOnKlart,
|
|
963
984
|
};
|
|
964
985
|
|
|
965
|
-
const advertory = createAdvertory(HANDLERS,
|
|
986
|
+
const advertory = createAdvertory(HANDLERS, xandrDriver, siteSpecificConfig);
|
|
966
987
|
|
|
967
988
|
export { Integration, Panorama, Takeover, Widescreen, advertory as default };
|