@schibsted/advertory 3.4.13 → 3.4.14-inv-2675.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.
Files changed (378) hide show
  1. package/ad-native/cjs/index.d.ts +6 -27
  2. package/ad-native/es/index.d.ts +6 -27
  3. package/aftenposten/cjs/index.d.ts +6 -27
  4. package/aftenposten/cjs/index.js +1 -1
  5. package/aftenposten/es/_auto-entry_aftenposten-DuZ2R6ZV.js +1 -0
  6. package/aftenposten/es/{events-DKEPGfkM.js → events-klv_sqJ8.js} +1 -1
  7. package/aftenposten/es/{index-DWEtV0NR.js → index-3VbfeT1t.js} +1 -1
  8. package/aftenposten/es/{index-BNB3C6E-.js → index-C1d8G-jR.js} +1 -1
  9. package/aftenposten/es/{index-CCE-C1HN.js → index-D-b1az0h.js} +1 -1
  10. package/aftenposten/es/{index-BhbxE_25.js → index-DK8g_wXr.js} +1 -1
  11. package/aftenposten/es/{index-C9D1A7fz.js → index-D_3BGLoO.js} +1 -1
  12. package/aftenposten/es/{index-JUbNdRuz.js → index-DpAWPFjj.js} +1 -1
  13. package/aftenposten/es/{index-CHRLj_VV.js → index-DxbMTSa6.js} +1 -1
  14. package/aftenposten/es/{index-B9jM8uJp.js → index-S_lHH7sP.js} +1 -1
  15. package/aftenposten/es/index.d.ts +6 -27
  16. package/aftenposten/es/index.js +1 -1
  17. package/aftenposten/es/{styles-Cdv34tFr.js → styles-Br-BnZ09.js} +1 -1
  18. package/aftenposten/es/{styles-DPLTaMqa.js → styles-C-cqp70Q.js} +1 -1
  19. package/aftenposten/es/{styles-DRo2gfi-.js → styles-C6-krtlR.js} +1 -1
  20. package/aftenposten/es/{styles-2jZnGzOL.js → styles-C9xjLFRm.js} +1 -1
  21. package/aftenposten/es/{styles-CkK0N-wj.js → styles-CUKzkjG7.js} +1 -1
  22. package/aftenposten/es/{styles-BSf3bvgL.js → styles-D6qs1vF4.js} +1 -1
  23. package/aftenposten/es/{styles-DhO41e2R.js → styles-DzB4gu9n.js} +1 -1
  24. package/aftenposten/es/{styles-CVdL3mGq.js → styles-RWxAxb9h.js} +1 -1
  25. package/aftenposten/es/{styles-Drrmd6ic.js → styles-UxvyGS2D.js} +1 -1
  26. package/aftenposten/es/{styles-CbWNyowJ.js → styles-XlMPH-76.js} +1 -1
  27. package/aftenpostenv2/es/_auto-entry_aftenpostenv2-C6d-yyE-.js +1 -0
  28. package/aftenpostenv2/es/{events-cGs04mSN.js → events-DZXDCDoz.js} +1 -1
  29. package/aftenpostenv2/es/{index-aNIUHXze.js → index-BkX4kxMU.js} +1 -1
  30. package/aftenpostenv2/es/{index-DWvJchU6.js → index-C3ZOJmMT.js} +1 -1
  31. package/aftenpostenv2/es/{index-BDTGsSwd.js → index-CMYm3oM9.js} +1 -1
  32. package/aftenpostenv2/es/{index-CLljdOgE.js → index-CNWPYqjq.js} +1 -1
  33. package/aftenpostenv2/es/{index-D7ptGGO-.js → index-CNbl2bvN.js} +1 -1
  34. package/aftenpostenv2/es/{index-BhSR3kGL.js → index-CYREmyXw.js} +1 -1
  35. package/aftenpostenv2/es/{index-kaOiEg3O.js → index-Cm_d0knF.js} +1 -1
  36. package/aftenpostenv2/es/{index-Dxxj-XUF.js → index-tRHGunv4.js} +1 -1
  37. package/aftenpostenv2/es/index.d.ts +6 -27
  38. package/aftenpostenv2/es/index.js +1 -1
  39. package/aftenpostenv2/es/{styles-Jd_XZ1sX.js → styles-BLOOOS8-.js} +1 -1
  40. package/aftenpostenv2/es/{styles-Cf3flzw_.js → styles-Bgk1Pq4s.js} +1 -1
  41. package/aftenpostenv2/es/{styles-D4CN1Pbp.js → styles-BpDsvS5q.js} +1 -1
  42. package/aftenpostenv2/es/{styles-BQRJOeWA.js → styles-CIRgrjDD.js} +1 -1
  43. package/aftenpostenv2/es/{styles-CWIHh5ES.js → styles-DH6bbrL1.js} +1 -1
  44. package/aftenpostenv2/es/{styles-Dqbg_h90.js → styles-Dgrxzv-R.js} +1 -1
  45. package/aftenpostenv2/es/{styles-DcbX8XpP.js → styles-DgsrLl9M.js} +1 -1
  46. package/aftenpostenv2/es/{styles-Bb8KCS67.js → styles-DyzfMPwo.js} +1 -1
  47. package/aftenpostenv2/es/{styles-CjWMsJWa.js → styles-DzIO4y8G.js} +1 -1
  48. package/aftenpostenv2/es/{styles-BUi1KOiu.js → styles-ZbJL0y6g.js} +1 -1
  49. package/aftonbladet/cjs/index.d.ts +6 -27
  50. package/aftonbladet/cjs/index.js +1 -1
  51. package/aftonbladet/es/_auto-entry_aftonbladet-B4kfeeay.js +1 -0
  52. package/aftonbladet/es/{events-CqHPJ25E.js → events-D8dercD3.js} +1 -1
  53. package/aftonbladet/es/{index-DbLqYJQ1.js → index-8gjdjqr0.js} +1 -1
  54. package/aftonbladet/es/{index-DRC_jUIR.js → index-BNZxUvQ5.js} +1 -1
  55. package/aftonbladet/es/{index-BfYyv1Y3.js → index-BUuVhUHr.js} +1 -1
  56. package/aftonbladet/es/{index-DPBovzTm.js → index-BY6H8RWH.js} +1 -1
  57. package/aftonbladet/es/{index-DMXydSy1.js → index-C7URi_rg.js} +1 -1
  58. package/aftonbladet/es/{index-C-aG3CSr.js → index-CFqbgbis.js} +1 -1
  59. package/aftonbladet/es/{index-DD-wmA3b.js → index-ffRDgOt8.js} +1 -1
  60. package/aftonbladet/es/{index-wu_uZJ3I.js → index-h6Hxbb6e.js} +1 -1
  61. package/aftonbladet/es/index.d.ts +6 -27
  62. package/aftonbladet/es/index.js +1 -1
  63. package/aftonbladet/es/{styles-CrqmyCRC.js → styles-8ujEJD1J.js} +1 -1
  64. package/aftonbladet/es/{styles-B2yIShmI.js → styles-CwO7gDWt.js} +1 -1
  65. package/aftonbladet/es/{styles-CRybZj4C.js → styles-Cy1oJ6nH.js} +1 -1
  66. package/aftonbladet/es/{styles-7WtKxzhO.js → styles-DMV1q7sG.js} +1 -1
  67. package/aftonbladet/es/{styles-BvQVtKqM.js → styles-DadFushW.js} +1 -1
  68. package/aftonbladet/es/{styles-B7F00SJC.js → styles-LGqDNwDt.js} +1 -1
  69. package/aftonbladetv2/es/_auto-entry_aftonbladetv2-CXni7Y8e.js +1 -0
  70. package/aftonbladetv2/es/{events-F2MAm7hP.js → events-jzBe4O9k.js} +1 -1
  71. package/aftonbladetv2/es/{index-DK6d1n72.js → index-C0agCt_D.js} +1 -1
  72. package/aftonbladetv2/es/{index-3t-TtZA7.js → index-C74KeUrl.js} +1 -1
  73. package/aftonbladetv2/es/{index-DSy4XN0k.js → index-CHgGiMoZ.js} +1 -1
  74. package/aftonbladetv2/es/{index-Bmq3vLe7.js → index-CoquvRVh.js} +1 -1
  75. package/aftonbladetv2/es/{index-vrLkrA5Q.js → index-DgSLCMKG.js} +1 -1
  76. package/aftonbladetv2/es/{index-CH80zQJg.js → index-ErlU_AWB.js} +1 -1
  77. package/aftonbladetv2/es/{index-mZot56VG.js → index-bx4msqNn.js} +1 -1
  78. package/aftonbladetv2/es/{index-BxhMMu8S.js → index-w51AgsDE.js} +1 -1
  79. package/aftonbladetv2/es/index.d.ts +6 -27
  80. package/aftonbladetv2/es/index.js +1 -1
  81. package/aftonbladetv2/es/{styles-Bf-nc3ar.js → styles-BU4A5XwI.js} +1 -1
  82. package/aftonbladetv2/es/{styles-BDXIY7L6.js → styles-BposrOK8.js} +1 -1
  83. package/aftonbladetv2/es/{styles-tb8NbiL9.js → styles-Bzlov_9z.js} +1 -1
  84. package/aftonbladetv2/es/{styles-BnM-vUtg.js → styles-CelZRDgV.js} +1 -1
  85. package/aftonbladetv2/es/{styles-B_SLUOOm.js → styles-D2SWD-NT.js} +1 -1
  86. package/aftonbladetv2/es/{styles-D9MbCPbR.js → styles-DH3VdIXo.js} +1 -1
  87. package/bt/cjs/index.d.ts +6 -27
  88. package/bt/cjs/index.js +1 -1
  89. package/bt/es/_auto-entry_bt-IZ3zzqhM.js +1 -0
  90. package/bt/es/{events-BiZTUccz.js → events-CQXl03Tu.js} +1 -1
  91. package/bt/es/{index-CCWVerJg.js → index-6THw9zmd.js} +1 -1
  92. package/bt/es/{index-47maYTIw.js → index-BYFp_8uw.js} +1 -1
  93. package/bt/es/{index-C0SDG27K.js → index-BkpeyVDy.js} +1 -1
  94. package/bt/es/{index-WW1ggdD2.js → index-BmTSnWbR.js} +1 -1
  95. package/bt/es/{index-Ctn9l5sF.js → index-CV4ADMBE.js} +1 -1
  96. package/bt/es/{index-D4CTTpHq.js → index-CYZFbpHN.js} +1 -1
  97. package/{sa/es/index-CVo2bvHa.js → bt/es/index-CjNxaT7G.js} +1 -1
  98. package/bt/es/{index-PBYkoefE.js → index-puFdNhWA.js} +1 -1
  99. package/bt/es/index.d.ts +6 -27
  100. package/bt/es/index.js +1 -1
  101. package/{sa/es/styles-Cn4mlkwu.js → bt/es/styles-6eYlwVom.js} +1 -1
  102. package/bt/es/{styles-K196H2g8.js → styles-B47NSseg.js} +1 -1
  103. package/bt/es/{styles-Cj7qoYzk.js → styles-B9Yg1bMU.js} +1 -1
  104. package/bt/es/{styles-D-Vefwdc.js → styles-CIjPiz-7.js} +1 -1
  105. package/{sa/es/styles-B0fUHg6e.js → bt/es/styles-D0foZe1-.js} +1 -1
  106. package/bt/es/{styles-D3b_zDLG.js → styles-DEMp8e3E.js} +1 -1
  107. package/bt/es/{styles-DzpOal2h.js → styles-DPhx-0hG.js} +1 -1
  108. package/bt/es/{styles-BvtgJJvA.js → styles-qQ5ygvkL.js} +1 -1
  109. package/bt/es/{styles-vp9TKNef.js → styles-qS0KYnpc.js} +1 -1
  110. package/btv2/es/_auto-entry_btv2-BBF3K8TB.js +1 -0
  111. package/btv2/es/{events-BzjCXDmD.js → events-CJRisxxP.js} +1 -1
  112. package/btv2/es/{index-ypDJbRmv.js → index-BWTCDo9D.js} +1 -1
  113. package/btv2/es/{index-CH4xAaPD.js → index-CDcezIvH.js} +1 -1
  114. package/btv2/es/{index-D2xGJKyH.js → index-CmzziY7Z.js} +1 -1
  115. package/btv2/es/{index-DSSpySZH.js → index-CxEyXAMi.js} +1 -1
  116. package/btv2/es/{index-DXx3mLih.js → index-Cy2JRpgZ.js} +1 -1
  117. package/btv2/es/{index-i76Dw8aX.js → index-D0hGEFoi.js} +1 -1
  118. package/btv2/es/{index-CrEzAmOq.js → index-DP1WtGJa.js} +1 -1
  119. package/{sav2/es/index-DK1oTN1u.js → btv2/es/index-DiQcLyEw.js} +1 -1
  120. package/btv2/es/index.d.ts +6 -27
  121. package/btv2/es/index.js +1 -1
  122. package/{vgv2/es/styles-BBZMSzoF.js → btv2/es/styles-B-UZvrtN.js} +1 -1
  123. package/{vgv2/es/styles-BPT-qUNq.js → btv2/es/styles-Be5pGrEi.js} +1 -1
  124. package/{sav2/es/styles-Cbs2drMD.js → btv2/es/styles-CFwhAOay.js} +1 -1
  125. package/{sav2/es/styles-B6yetf03.js → btv2/es/styles-CNJOP5eq.js} +1 -1
  126. package/btv2/es/{styles-Cex1nobv.js → styles-DFs0Zm4b.js} +1 -1
  127. package/{sav2/es/styles-DJw6pIzH.js → btv2/es/styles-KlE0k6wn.js} +1 -1
  128. package/btv2/es/{styles-DQuTQjle.js → styles-S40OMycj.js} +1 -1
  129. package/{sav2/es/styles-BlHvtXYb.js → btv2/es/styles-z3Dga7zL.js} +1 -1
  130. package/dr-edition/cjs/index.d.ts +6 -13
  131. package/dr-edition/cjs/index.js +1 -1
  132. package/dr-edition/es/index.d.ts +6 -13
  133. package/dr-edition/es/index.js +1 -1
  134. package/e24/es/_auto-entry_e24-DwH7UbDx.js +1 -0
  135. package/e24/es/{events-Bn2T7T9a.js → events-BSGbPBA9.js} +1 -1
  136. package/{tv4/es/index-BRrn8QKt.js → e24/es/index-8gb5T-xE.js} +1 -1
  137. package/e24/es/{index-dWe5Rx5B.js → index-CQ83Vrt0.js} +1 -1
  138. package/e24/es/{index-BQv3Sxf9.js → index-CxFkN_C2.js} +1 -1
  139. package/e24/es/{index-ByW4jH_X.js → index-D2jApR7I.js} +1 -1
  140. package/e24/es/{index-BZcVv812.js → index-SfqJgrrv.js} +1 -1
  141. package/e24/es/{index-CduaDIrS.js → index-l3e6JVMS.js} +1 -1
  142. package/e24/es/{index-CF9p3gqF.js → index-xyPq5joO.js} +1 -1
  143. package/e24/es/{index-W3BxJEHG.js → index-zyemhpF4.js} +1 -1
  144. package/e24/es/index.d.ts +6 -27
  145. package/e24/es/index.js +1 -1
  146. package/e24/es/{styles-BpT05fHe.js → styles-5PZdUVM_.js} +1 -1
  147. package/e24/es/{styles-0iI9RREc.js → styles-B67i0Ycz.js} +1 -1
  148. package/e24/es/{styles-Ce1bu28P.js → styles-BF6t3KZE.js} +1 -1
  149. package/{tv4/es/styles-CWeSNH-n.js → e24/es/styles-BfhohSX5.js} +1 -1
  150. package/e24/es/{styles-BiDCLCW7.js → styles-Bj6UupBW.js} +1 -1
  151. package/e24/es/{styles-pdDQ694q.js → styles-BtAD8Siq.js} +1 -1
  152. package/e24/es/{styles-f5hwcx2V.js → styles-CEXNyOcu.js} +1 -1
  153. package/e24/es/{styles-CrOq1uSB.js → styles-DFV-fOTl.js} +1 -1
  154. package/e24/es/{styles-CdBHjteb.js → styles-DRJqo5gY.js} +1 -1
  155. package/e24/es/{styles-Cf4ypcKM.js → styles-Dk-rXaO1.js} +1 -1
  156. package/e24/es/{styles-BZ62iRdG.js → styles-DuA4Bavg.js} +1 -1
  157. package/fotbollskanalen/cjs/index.d.ts +6 -27
  158. package/fotbollskanalen/cjs/index.js +1 -1
  159. package/fotbollskanalen/es/_auto-entry_fotbollskanalen-DRZg_gJT.js +1 -0
  160. package/fotbollskanalen/es/{events-szJnDbry.js → events-MxOWff6Y.js} +1 -1
  161. package/fotbollskanalen/es/{index-qdqyfUtE.js → index-8oy-q4p7.js} +1 -1
  162. package/fotbollskanalen/es/{index-BQHqJCPe.js → index-BzepXHsE.js} +1 -1
  163. package/fotbollskanalen/es/{index-ZvfM5Yz1.js → index-C9W7XTIl.js} +1 -1
  164. package/fotbollskanalen/es/{index-CrDNIO4l.js → index-CBL9IjvS.js} +1 -1
  165. package/fotbollskanalen/es/{index-CNnVOwXm.js → index-CW6x9lZU.js} +1 -1
  166. package/fotbollskanalen/es/{index-DvCXcWg2.js → index-Ci7R1RTK.js} +1 -1
  167. package/fotbollskanalen/es/{index-CjLD1zkx.js → index-D0Nbz3hL.js} +1 -1
  168. package/fotbollskanalen/es/{index-D7CjRRto.js → index-DZGQUWj9.js} +1 -1
  169. package/fotbollskanalen/es/index.d.ts +6 -27
  170. package/fotbollskanalen/es/index.js +1 -1
  171. package/fotbollskanalen/es/{styles-RQCqAO4d.js → styles-BetCQoPj.js} +1 -1
  172. package/godt/cjs/index.d.ts +6 -27
  173. package/godt/cjs/index.js +1 -1
  174. package/kilkaya/cjs/index.d.ts +5 -27
  175. package/kilkaya/cjs/index.js +1 -1
  176. package/kilkaya/es/index.d.ts +5 -27
  177. package/kilkaya/es/index.js +1 -1
  178. package/klart/cjs/index.d.ts +6 -27
  179. package/klart/cjs/index.js +1 -1
  180. package/koket/cjs/index.d.ts +6 -27
  181. package/koket/cjs/index.js +1 -1
  182. package/koket/es/_auto-entry_koket-CVjegpiF.js +1 -0
  183. package/koket/es/{events-BdWyZJzS.js → events-BgUwFadx.js} +1 -1
  184. package/koket/es/{index-0VMjhDYm.js → index-AynmqJO3.js} +1 -1
  185. package/koket/es/{index-D3ygEfot.js → index-BCLR-S2_.js} +1 -1
  186. package/koket/es/{index-BpEUYR1h.js → index-Cgw9fn7R.js} +1 -1
  187. package/{svdv2/es/index-BFuceDfK.js → koket/es/index-DUC-9pBx.js} +1 -1
  188. package/koket/es/{index-DkSEuan0.js → index-Db-q1hdx.js} +1 -1
  189. package/{svdv2/es/index-C4pN98HM.js → koket/es/index-DzQ9bquE.js} +1 -1
  190. package/koket/es/{index-CQRM1_9Z.js → index-DzTedObl.js} +1 -1
  191. package/koket/es/{index-DKcphVAX.js → index-o3ka4jBF.js} +1 -1
  192. package/koket/es/index.d.ts +6 -27
  193. package/koket/es/index.js +1 -1
  194. package/{svdv2/es/styles-CsRH7OwY.js → koket/es/styles-CuEH92T3.js} +1 -1
  195. package/minmote/cjs/index.d.ts +6 -27
  196. package/minmote/cjs/index.js +1 -1
  197. package/package.json +1 -1
  198. package/pent/cjs/index.d.ts +6 -27
  199. package/pent/cjs/index.js +1 -1
  200. package/sa/cjs/index.d.ts +6 -27
  201. package/sa/cjs/index.js +1 -1
  202. package/sa/es/_auto-entry_sa-sHn4kql2.js +1 -0
  203. package/sa/es/{events-CpHcIBzh.js → events-BNtwHfQ4.js} +1 -1
  204. package/sa/es/{index-tLG8ciGB.js → index-BnuB7KJd.js} +1 -1
  205. package/sa/es/{index-Dd1Y97lw.js → index-DEn1qASH.js} +1 -1
  206. package/{bt/es/index-BgBCbmKK.js → sa/es/index-DIW6auI0.js} +1 -1
  207. package/sa/es/{index-Dff3FrSE.js → index-DdrsEfVG.js} +1 -1
  208. package/sa/es/{index-Bl-YU1dP.js → index-DgZBz3Uf.js} +1 -1
  209. package/sa/es/{index-Dm912f7j.js → index-DwCows_K.js} +1 -1
  210. package/sa/es/{index-BGQPYUjf.js → index-L5EHyBZi.js} +1 -1
  211. package/sa/es/{index-CwCnQRNv.js → index-N-T6qVK2.js} +1 -1
  212. package/sa/es/index.d.ts +6 -27
  213. package/sa/es/index.js +1 -1
  214. package/{vg/es/styles-BS_Oh73M.js → sa/es/styles-BuT032cq.js} +1 -1
  215. package/{vg/es/styles-C7LhgQkX.js → sa/es/styles-CIH-AgDI.js} +1 -1
  216. package/sa/es/{styles-DwXHz4p-.js → styles-CKEBnEH2.js} +1 -1
  217. package/sa/es/{styles-CViyCPXH.js → styles-CLa0JPYq.js} +1 -1
  218. package/{bt/es/styles-Dxz3L0fX.js → sa/es/styles-D9GxBQtt.js} +1 -1
  219. package/sa/es/{styles-6eCduJjk.js → styles-DGyO_to4.js} +1 -1
  220. package/sa/es/{styles-CFJdZolS.js → styles-DIib0UT-.js} +1 -1
  221. package/sa/es/{styles-BzaRI9FD.js → styles-MYor7S5O.js} +1 -1
  222. package/sa/es/{styles-BgvUhWZT.js → styles-RAwCt6EC.js} +1 -1
  223. package/sav2/es/_auto-entry_sav2-Dw50QvDu.js +1 -0
  224. package/sav2/es/{events-Dog8n166.js → events-DSh6UZin.js} +1 -1
  225. package/sav2/es/{index-CqRijYqt.js → index-0KUvCpv6.js} +1 -1
  226. package/sav2/es/{index-CFrKD4N4.js → index-CJHnCXvi.js} +1 -1
  227. package/sav2/es/{index-C2vTQtRr.js → index-CPjOKbAu.js} +1 -1
  228. package/sav2/es/{index-IfeBZfAv.js → index-Cd-yKGWJ.js} +1 -1
  229. package/{btv2/es/index-DCAju2n6.js → sav2/es/index-DZ17umNE.js} +1 -1
  230. package/sav2/es/{index-BVyGMuqV.js → index-M7zN8nkh.js} +1 -1
  231. package/sav2/es/{index-8h2QQSc2.js → index-q2K24hAf.js} +1 -1
  232. package/sav2/es/{index-DlVGuIRO.js → index-vyDaw9G6.js} +1 -1
  233. package/sav2/es/index.d.ts +6 -27
  234. package/sav2/es/index.js +1 -1
  235. package/{vgv2/es/styles-ByxjhGhY.js → sav2/es/styles-Bfohitvh.js} +1 -1
  236. package/{btv2/es/styles-D_OVqIdW.js → sav2/es/styles-Bh-2pbfL.js} +1 -1
  237. package/{btv2/es/styles--cN6_CNi.js → sav2/es/styles-CukSY_7e.js} +1 -1
  238. package/sav2/es/{styles-3YwI1h2-.js → styles-DGd9V3yE.js} +1 -1
  239. package/sav2/es/{styles-B3oMClUn.js → styles-DkIwYGAh.js} +1 -1
  240. package/sav2/es/{styles-B3vIzWMl.js → styles-DwNgYGDs.js} +1 -1
  241. package/{btv2/es/styles-wXMjHens.js → sav2/es/styles-jwgJY5_i.js} +1 -1
  242. package/sav2/es/{styles-RC2bhv68.js → styles-l1YADz9J.js} +1 -1
  243. package/svd/cjs/index.d.ts +6 -27
  244. package/svd/cjs/index.js +1 -1
  245. package/svd/es/_auto-entry_svd-CUsvbG8c.js +1 -0
  246. package/svd/es/{events-CzwVC4qY.js → events-HDdXSGro.js} +1 -1
  247. package/svd/es/{index-Dv1udWqy.js → index-C0E22D2m.js} +1 -1
  248. package/svd/es/{index-D07O6Cdm.js → index-CXxR25A6.js} +1 -1
  249. package/{e24/es/index-C5JK4Qx4.js → svd/es/index-CYHCQ1O2.js} +1 -1
  250. package/svd/es/{index-ClvSP2ZW.js → index-CfGP5SUU.js} +1 -1
  251. package/svd/es/{index-5ln_jpoV.js → index-DLcRy5Qk.js} +1 -1
  252. package/svd/es/{index-COmMOm0t.js → index-RU9D6lHG.js} +1 -1
  253. package/svd/es/{index-AxMmynyO.js → index-n8gd9ijz.js} +1 -1
  254. package/svd/es/{index-Z_kOo7dB.js → index-r8JZbQo7.js} +1 -1
  255. package/svd/es/index.d.ts +6 -27
  256. package/svd/es/index.js +1 -1
  257. package/svd/es/{styles-DPnCh2t5.js → styles-5bQ-VJBX.js} +1 -1
  258. package/svd/es/{styles-Dn6Zt-RJ.js → styles-CG752RlT.js} +1 -1
  259. package/svd/es/{styles-BWFlVQnU.js → styles-DtFDqLZZ.js} +1 -1
  260. package/svd/es/{styles-T716n3-R.js → styles-Dz_SMwfc.js} +1 -1
  261. package/svd/es/{styles-DxYChK1b.js → styles-Gv3Xl2Fq.js} +1 -1
  262. package/svd/es/{styles--z8Dgl02.js → styles-uDPbmFbo.js} +1 -1
  263. package/svdv2/es/_auto-entry_svdv2-CmXKM5R8.js +1 -0
  264. package/svdv2/es/{events-DcyH6O_V.js → events-CWnKzDsn.js} +1 -1
  265. package/svdv2/es/{index-Ba6e0PrX.js → index-BC-RAIHg.js} +1 -1
  266. package/{koket/es/index-BMfC4ihY.js → svdv2/es/index-BlAEV6_h.js} +1 -1
  267. package/svdv2/es/{index-hQ40Xo1i.js → index-C-X9vVJ_.js} +1 -1
  268. package/svdv2/es/{index-BxwG5_mt.js → index-ClkA7ew-.js} +1 -1
  269. package/svdv2/es/{index-S3a66jhs.js → index-CtJ_mZmt.js} +1 -1
  270. package/svdv2/es/{index-D3YfK_Rr.js → index-DUlJCHET.js} +1 -1
  271. package/{koket/es/index-B4RxuN92.js → svdv2/es/index-ZwgfN5Ys.js} +1 -1
  272. package/svdv2/es/{index-DfLPDKWG.js → index-sczy6qFW.js} +1 -1
  273. package/svdv2/es/index.d.ts +6 -27
  274. package/svdv2/es/index.js +1 -1
  275. package/svdv2/es/{styles-ygGFK_Nz.js → styles-7vNc-2un.js} +1 -1
  276. package/svdv2/es/{styles-B2ke3usj.js → styles-BpAiQyh0.js} +1 -1
  277. package/svdv2/es/{styles-DoZ4OR3i.js → styles-CQcDCdQy.js} +1 -1
  278. package/svdv2/es/{styles-CrLSHnyW.js → styles-Citcmx1-.js} +1 -1
  279. package/{koket/es/styles-CDfsgc7e.js → svdv2/es/styles-D3H6NPnK.js} +1 -1
  280. package/svdv2/es/{styles-Cpk3jqGg.js → styles-_zpVWaMm.js} +1 -1
  281. package/tek/cjs/index.d.ts +6 -27
  282. package/tek/cjs/index.js +1 -1
  283. package/tracker/cjs/index.d.ts +6 -27
  284. package/tracker/cjs/index.js +1 -1
  285. package/tracker/es/index.d.ts +6 -27
  286. package/tracker/es/index.js +1 -1
  287. package/tv4/cjs/index.d.ts +6 -27
  288. package/tv4/cjs/index.js +1 -1
  289. package/tv4/es/_auto-entry_tv4-C2tSzRur.js +1 -0
  290. package/tv4/es/{events-wcexbD6c.js → events-2YzZnQLw.js} +1 -1
  291. package/tv4/es/{index-DOPye16D.js → index-BGZvfF9Y.js} +1 -1
  292. package/tv4/es/{index-CJLyjRUy.js → index-BdnPPynq.js} +1 -1
  293. package/tv4/es/{index-CojPSAod.js → index-COqpRbCY.js} +1 -1
  294. package/tv4/es/{index-C27mV0sI.js → index-D5eyMcDN.js} +1 -1
  295. package/tv4/es/{index-CJrmaByc.js → index-DbOni98-.js} +1 -1
  296. package/tv4/es/{index-DwwSIWUX.js → index-Z0jDa2hs.js} +1 -1
  297. package/tv4/es/{index-zUieoZtt.js → index-cq-91Ybj.js} +1 -1
  298. package/{svd/es/index-CtQAlx1i.js → tv4/es/index-gPCQX9mt.js} +1 -1
  299. package/tv4/es/index.d.ts +6 -27
  300. package/tv4/es/index.js +1 -1
  301. package/{e24/es/styles-DbPaaQhx.js → tv4/es/styles-CjSvGIaa.js} +1 -1
  302. package/tvnu/cjs/index.d.ts +6 -27
  303. package/tvnu/cjs/index.js +1 -1
  304. package/types/index.d.ts +6 -27
  305. package/vg/cjs/index.d.ts +6 -27
  306. package/vg/cjs/index.js +1 -1
  307. package/vg/es/_auto-entry_vg-5OLK1PaL.js +1 -0
  308. package/vg/es/{events-Ca8PEFxH.js → events-DT2plgiZ.js} +1 -1
  309. package/vg/es/{index-lAaEINKY.js → index-BAvo-YI1.js} +1 -1
  310. package/vg/es/{index-CY5_yPNz.js → index-Bjz9t3_b.js} +1 -1
  311. package/vg/es/{index-iwIx2csi.js → index-BtunkKzR.js} +1 -1
  312. package/vg/es/{index-2ViM6Z_E.js → index-CJ3-QGcp.js} +1 -1
  313. package/vg/es/{index-Dw4tkJm9.js → index-CKKIrm06.js} +1 -1
  314. package/vg/es/{index-BhoMjnwi.js → index-CYXjOfxz.js} +1 -1
  315. package/vg/es/{index-2HBwWrDZ.js → index-ClwbnLdv.js} +1 -1
  316. package/vg/es/{index-gh-qdWl3.js → index-qXahbyn0.js} +1 -1
  317. package/vg/es/index.d.ts +6 -27
  318. package/vg/es/index.js +1 -1
  319. package/vg/es/{styles-KWo4tdyB.js → styles-3_fhCooD.js} +1 -1
  320. package/vg/es/{styles-DyU85Yem.js → styles-BBETR16i.js} +1 -1
  321. package/vg/es/{styles-CxEdAEsm.js → styles-BdkLriyK.js} +1 -1
  322. package/vg/es/{styles-CcSukju-.js → styles-C_GkKCGG.js} +1 -1
  323. package/{sa/es/styles-Bzr7re6i.js → vg/es/styles-CfWx8XLc.js} +1 -1
  324. package/vg/es/{styles-CfChsdxf.js → styles-ChRVQ7gD.js} +1 -1
  325. package/vg/es/{styles-BoAqtXI-.js → styles-Chqxs34X.js} +1 -1
  326. package/vg/es/{styles-h_Sz1ik5.js → styles-Cne6G_JT.js} +1 -1
  327. package/vg/es/{styles-DeJdP1N1.js → styles-DJTfgRnh.js} +1 -1
  328. package/vg/es/{styles-DGCn2CYN.js → styles-DU12P5SB.js} +1 -1
  329. package/vg/es/{styles-B7mPwht_.js → styles-Dc4oKzhM.js} +1 -1
  330. package/{bt/es/styles-B1VaBJsk.js → vg/es/styles-LTs9Y7O2.js} +1 -1
  331. package/vg/es/{styles-COAPuyTC.js → styles-LoNd54MB.js} +1 -1
  332. package/vg/es/{styles-CEOa8SJF.js → styles-YZYyF6yL.js} +1 -1
  333. package/vg/es/{styles-Cq8gyMtO.js → styles-s9m6EdRR.js} +1 -1
  334. package/vgv2/es/_auto-entry_vgv2-DjAcHCff.js +1 -0
  335. package/vgv2/es/{events-DNkN18vT.js → events-CdCPzm4B.js} +1 -1
  336. package/vgv2/es/{index-DK-aVwq5.js → index-B8_gSYpA.js} +1 -1
  337. package/vgv2/es/{index-StiNpJYN.js → index-BzgSnVa9.js} +1 -1
  338. package/vgv2/es/{index-Bg9q612m.js → index-C2EhjMUF.js} +1 -1
  339. package/vgv2/es/{index-C1ElJMPL.js → index-CVjJ4Gf3.js} +1 -1
  340. package/vgv2/es/{index-CFfew_Hr.js → index-CiCXPuCl.js} +1 -1
  341. package/vgv2/es/{index-BAOSiCkF.js → index-CwPvxIc6.js} +1 -1
  342. package/vgv2/es/{index-DNScSEfq.js → index-DMsXgnOF.js} +1 -1
  343. package/vgv2/es/{index-C9W2H7yU.js → index-DUfgQLoG.js} +1 -1
  344. package/vgv2/es/index.d.ts +6 -27
  345. package/vgv2/es/index.js +1 -1
  346. package/vgv2/es/{styles-BEfPRcna.js → styles-0RlDabJb.js} +1 -1
  347. package/vgv2/es/{styles-C1D_9t7l.js → styles-AKNODZi0.js} +1 -1
  348. package/vgv2/es/{styles-QY_ZMd8I.js → styles-BCa_rKUY.js} +1 -1
  349. package/vgv2/es/{styles-D6HQ6xcn.js → styles-BOlo8I8_.js} +1 -1
  350. package/vgv2/es/{styles-BeBDnUVA.js → styles-BjE495Bp.js} +1 -1
  351. package/vgv2/es/{styles-BcpiLYlT.js → styles-Bw0cwTZy.js} +1 -1
  352. package/vgv2/es/{styles-Dbde7ciA.js → styles-C1niuRIR.js} +1 -1
  353. package/{btv2/es/styles-DEI95laR.js → vgv2/es/styles-CjwrIlHa.js} +1 -1
  354. package/vgv2/es/{styles-C3B5JUB_.js → styles-D1zJKlJ_.js} +1 -1
  355. package/vgv2/es/{styles-CC39I9et.js → styles-DKpsaAl9.js} +1 -1
  356. package/vgv2/es/{styles-CGoOi8H3.js → styles-DqmQTogg.js} +1 -1
  357. package/vgv2/es/{styles-CYFBwqUu.js → styles-J3niUfzt.js} +1 -1
  358. package/{btv2/es/styles-BlLbcdMF.js → vgv2/es/styles-N4yg2ZRS.js} +1 -1
  359. package/{btv2/es/styles-rgnDm1KE.js → vgv2/es/styles-RN5Jfk16.js} +1 -1
  360. package/vgv2/es/{styles-BPnYKeGp.js → styles-danoFIP3.js} +1 -1
  361. package/video/cjs/index.js +1 -1
  362. package/video/es/index.js +1 -1
  363. package/aftenposten/es/_auto-entry_aftenposten-Cl0fdATI.js +0 -1
  364. package/aftenpostenv2/es/_auto-entry_aftenpostenv2-DmzCVOLI.js +0 -1
  365. package/aftonbladet/es/_auto-entry_aftonbladet-C8UPlgHW.js +0 -1
  366. package/aftonbladetv2/es/_auto-entry_aftonbladetv2-BRG4vCT_.js +0 -1
  367. package/bt/es/_auto-entry_bt-Bk5yuKAV.js +0 -1
  368. package/btv2/es/_auto-entry_btv2-yQhIazsa.js +0 -1
  369. package/e24/es/_auto-entry_e24-B8BbWljb.js +0 -1
  370. package/fotbollskanalen/es/_auto-entry_fotbollskanalen-awwUwT11.js +0 -1
  371. package/koket/es/_auto-entry_koket-B5W_TYr9.js +0 -1
  372. package/sa/es/_auto-entry_sa-Bb5FVWBc.js +0 -1
  373. package/sav2/es/_auto-entry_sav2-AZVx6DD8.js +0 -1
  374. package/svd/es/_auto-entry_svd-CENb3dWh.js +0 -1
  375. package/svdv2/es/_auto-entry_svdv2-B2oqDqqQ.js +0 -1
  376. package/tv4/es/_auto-entry_tv4-B41KwUm2.js +0 -1
  377. package/vg/es/_auto-entry_vg-DKyKS-W5.js +0 -1
  378. package/vgv2/es/_auto-entry_vgv2-BOwVYPRZ.js +0 -1
@@ -1,3 +1,4 @@
1
+ import Tracker from '@schibsted/pulse-sdk';
1
2
  import { ReactNode } from 'react';
2
3
 
3
4
  type AstAdType = 'banner' | 'video' | 'native' | 'outstream';
@@ -151,39 +152,17 @@ declare const PageTypes: {
151
152
  };
152
153
  type PageType = (typeof PageTypes)[keyof typeof PageTypes];
153
154
 
154
- interface AdvertisingIdentifiers {
155
- xandr?: {
156
- ppId1?: string;
157
- ppId2?: string;
158
- };
159
- }
160
- interface TrackerInstance {
161
- getAdvertisingIdentifiers: () => Promise<AdvertisingIdentifiers>;
162
- getUserId: () => Promise<undefined | string | number>;
163
- getEnvironmentId: () => Promise<undefined | string>;
164
- getActor: () => Promise<undefined | unknown>;
165
- state?: {
166
- pageViewId?: string;
167
- };
168
- }
169
- interface PulseInstance extends TrackerInstance {
170
- pulseTracker?: TrackerInstance;
155
+ interface PulseLegacyExtras {
171
156
  trackElementView?: (eventInput: unknown) => Promise<void>;
172
157
  trackElementClick?: (eventInput: unknown) => Promise<void>;
173
158
  trackClickUIElement?: (eventInput: unknown) => Promise<void>;
174
159
  trackViewUIElement?: (eventInput: unknown) => Promise<void>;
175
- trackLegacyClickUIElement?: (eventInput: unknown) => Promise<void>;
176
- trackLegacyViewUIElement?: (eventInput: unknown) => Promise<void>;
177
160
  }
178
- interface Tracker {
161
+ interface PulseConfig {
179
162
  clientId: string;
180
- instance: TrackerInstance;
163
+ instance: Tracker & PulseLegacyExtras;
181
164
  hasherUrl?: string;
182
165
  }
183
- interface Pulse {
184
- clientId: string;
185
- instance: PulseInstance;
186
- }
187
166
 
188
167
  declare const Newsrooms: {
189
168
  readonly SVD: "svd";
@@ -230,8 +209,7 @@ interface SiteConfig {
230
209
  glimr?: GlimrConfig;
231
210
  tcf?: TCFConfig;
232
211
  prebid?: PrebidConfig;
233
- tracker?: Tracker;
234
- pulse?: Pulse;
212
+ pulse?: PulseConfig;
235
213
  finnBlink?: FinnBlinkConfig;
236
214
  wallpaper?: WallpaperConfig;
237
215
  fullscreenScroll?: FullscreenScrollConfig;
@@ -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="vg",r="aftenposten",i="sa",o="bt",a="e24";class s{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 l{getPulseObjectId(){return""}getPulsePageId(e,t){return""}}class d{constructor(e,t){this.pulse=e,this.newsroomStrategy=t}getEventInput(e,t){return{}}parseKilkayaData(e){const t=e.querySelector("article");if(!t)return{};const n=t.dataset.k5aTeaserAnalytics;try{return n?JSON.parse(n):{}}catch(e){return{}}}mapPageType(e){return{front:"Frontpage",article:"Article",section:"Article",collection:"Article",other:"Article"}[e||"front"]||"Frontpage"}getArticleId(){return location.pathname.split("/").slice(-2,-1).pop()||""}getEventTarget(e){const{url:t,title:n,itemId:r}=this.parseKilkayaData(e);return{id:r,name:this.normalizePlacementTitle(null!=n?n:""),type:"Page",url:t}}normalizePlacementTitle(e){return e.replace(/<[^>]+>/gi,"").replace(/[^a-z0-9æøå\s_-]/gi,"")}trackContentView(e){return t(this,void 0,void 0,function*(){var t,n,r,i,o,a,s,l,d;const c=new CustomEvent("advertory:partnerstudioAdImpression",{detail:{ad:null===(t=this.parseKilkayaData(e))||void 0===t?void 0:t.placement}});if(window.dispatchEvent(c),!this.pulse)return;const u=this.getEventInput(e,"view");(null===(n=this.pulse)||void 0===n?void 0:n.trackLegacyViewUIElement)?null===(i=null===(r=this.pulse)||void 0===r?void 0:r.trackLegacyViewUIElement)||void 0===i||i.call(r,u):(null===(o=this.pulse)||void 0===o?void 0:o.trackViewUIElement)?null===(s=null===(a=this.pulse)||void 0===a?void 0:a.trackViewUIElement)||void 0===s||s.call(a,u):null===(d=null===(l=this.pulse)||void 0===l?void 0:l.trackElementView)||void 0===d||d.call(l,u)})}trackContentClick(e){return t(this,void 0,void 0,function*(){var t,n,r,i,o,a;if(!this.pulse)return;const s=this.getEventInput(e,"click");this.pulse.trackLegacyClickUIElement?null===(n=(t=this.pulse).trackLegacyClickUIElement)||void 0===n||n.call(t,s):this.pulse.trackClickUIElement?null===(i=(r=this.pulse).trackClickUIElement)||void 0===i||i.call(r,s):null===(a=(o=this.pulse).trackElementClick)||void 0===a||a.call(o,s)})}}class c extends d{constructor(e,t,n){super(e,t),this.pulse=e,this.newsroomStrategy=t,this.pageType=n}getEventBaseData(e){var t,n,r,i,o,a;const{clientName:s,creativeId:l,itemId:d,placement:c}=this.parseKilkayaData(e),u=this.mapPageType(this.pageType),g=null===(t=this.newsroomStrategy)||void 0===t?void 0:t.getPulsePageId(this.pageType||"front",this.getArticleId());return{"@id":null!==(i=null===(r=null===(n=this.newsroomStrategy)||void 0===n?void 0:n.getPulseObjectId)||void 0===r?void 0:r.call(n))&&void 0!==i?i:c,"@type":"UIElement",position:c,elementType:"Article",custom:{customer:s,creativeId:null!=l?l:d},page:{"@id":null!=g?g:c,"@type":u,url:location.origin},tags:null===(a=null===(o=this.newsroomStrategy)||void 0===o?void 0:o.getTags)||void 0===a?void 0:a.call(o,e)}}getEventTarget(e){const{link:t,itemId:n,title:r}=this.parseKilkayaData(e);return{id:n,name:this.normalizePlacementTitle(null!=r?r:""),type:"Page",url:t}}getEventInput(e,t){return{object:this.getEventBaseData(e),partnerstudio:this.getEventPartnerstudioData(e,t),target:this.getEventTarget(e),provider:this.getProviderData()}}getEventPartnerstudioData(e,t){const n=this.parseKilkayaData(e);return Object.assign(Object.assign({},n),{type:t,tracking_type:"ad",xandrAdLoaded:!1})}getProviderData(){return{productTag:"partnerstudio"}}}const u="[data-k5a-teaser-analytics]",g=(e,t,n)=>{const r=document.querySelectorAll("k5a-stream");if(!r.length)return;const i=new c(e,t,n),o=new WeakMap,a=e=>{const t=o.get(e);t&&(t.disconnect(),o.delete(e))},s=new IntersectionObserver((e,t)=>{e.forEach(e=>{if(!e.isIntersecting)return;const n=e.target,r=n.querySelector(u);Boolean(null==r?void 0:r.dataset.k5aTeaserAnalytics)?(i.trackContentView(n),t.unobserve(e.target),a(n)):((e,t)=>{if(o.has(e))return;const n=new MutationObserver(()=>{const n=e.querySelector(u);Boolean(null==n?void 0:n.dataset.k5aTeaserAnalytics)&&(i.trackContentView(e),t.unobserve(e),a(e))});n.observe(e,{attributes:!0,childList:!0,subtree:!0,attributeFilter:["data-k5a-teaser-analytics"]}),o.set(e,n)})(n,t)})},{threshold:.5});r.forEach(e=>{s.observe(e),e.addEventListener("click",()=>i.trackContentClick(e))})},v=(e,t)=>{const n="[Advertory LOG]: ";location.search.includes("ast_debug=true")&&(t?console.log(n,e,t):console.log(n,e))},p=(e,t)=>{console.warn("[Advertory WARN]: ",e)},f=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 v("Advertising permission value obtained synchronously: ",e),Boolean(t)})();if(null!==n)return void t(n);let r=!1;const i=e=>{r||(v("Resolving advertising permission value obtained"),r=!0,t(e))},o=setTimeout(()=>{v("Advertising permission timed out, resolving with false"),i(!1)},3e3);window._tcf_.onTcfReady(()=>{v("On Tcf Ready called, waiting for permission"),clearTimeout(o)}),window._tcf_.getPermission("CMP:advertising",e=>{clearTimeout(o);const t=Number(e);v("Advertising permission value obtained asynchronously: ",e),i(Boolean(t))})}),h="no",y="se",m="cmp:loaded";let b="undefined"!=typeof window?window._tcf_:void 0,w=!1;const k=(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&&(v("TCF bypass param detected, returning consent: true"),!0):(v("TCF is not enabled, returning consent: true"),!0))(i,a))return!0;if(w)return null;if(!b)throw new Error("[Advertory]: getConsentSync method was called before the tcfManager was available.");const t=b.getConsentedToAllSync();return v(`TCF consented to all is: ${t}`),b.getConsentedToAllSync()};return{initConsentManager:()=>(null==e?void 0:e.enabled)?new Promise((e,t)=>{if(v("Getting TCF consent manager..."),window._tcf_)return v("TCF consent manager is already available"),b=window._tcf_,void e(b);v("TCF consent manager is not available");const n=()=>{v("CMP loaded, resolving consent manager..."),r&&clearTimeout(r),window._tcf_?(b=window._tcf_,e(b)):t(new Error("CMP loaded but window._tcf_ is not defined"))},r=setTimeout(()=>{document.removeEventListener(m,n),w=!0,t(new Error("Timeout waiting for CMP to load"))},o);v("Listening for CMP loaded event..."),document.addEventListener(m,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 v(`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===h;if(t||n)return v("Schibsted Ad Choices is enabled, getting advertising permissions..."),yield f(e);if(!(null==e?void 0:e.enabled))return!0;const i=l();return null!==i?i:yield new Promise((e,t)=>{try{if(!b)throw new Error("[Advertory]: getConsentAsync method was called before the tcfManager was available.");let t=!1;const n=n=>{t||(t=!0,e(n))},r=setTimeout(()=>{v("TCF isConsentedToAll timed out, resolving with false"),n(!1)},o);b.onTcfReady(()=>{v("On Tcf Ready called, waiting for consent"),clearTimeout(r)}),b.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 v("[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 T(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var E,O;var S=T(function(){if(O)return E;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)},{})},E=s}());const P=["placements","takeover","refreshConfig","editory"],A={adRequested:()=>{},adAvailable:e=>{},adLoaded:e=>{},adNoBid:e=>{},adError:(e,t)=>{},adCollapse:()=>{},adRequestFailure:e=>{},adBadRequest:e=>{},adLoadedMediated:e=>{},adNoBidMediated:e=>{}},I=e=>{(e=>{const{pageContext:t,pageOptions:n,placements:r,appearanceConfig:i}=null!=e?e:{};(null==t?void 0:t.publisher)||p("pageContext.publisher is required."),(null==t?void 0:t.countryCode)||p("pageContext.countryCode is required."),(null==t?void 0:t.pageType)||p("pageContext.pageType is required."),(null==t?void 0:t.deviceType)||p("pageContext.deviceType is required."),n||p("pageOptions is required."),r||p("placements is required."),(null==i?void 0:i.defaultThreshold)||p("appearanceConfig.defaultThreshold is required.")})(e),(e=>{var t,n,r;const i=e.pageSectionsSelectors,o=[{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"}];for(const{flag:e,property:t,featureName:n}of o)e&&!(null==i?void 0:i[t])&&p(`pageSectionsSelectors.${t} is required when ${n} is enabled.`)})(e)};class j{set(e){I(e),this.config=e}modifyConfigProperties(e){if(!this.config)throw new Error("Config was accessed before it had been initialized.");const t={};for(const n of P){const r=e[n];void 0!==r&&(t[n]=r)}Object.assign(this.config,t),Object.hasOwn(e,"pageContext")&&void 0!==e.pageContext&&(this.config.pageContext=Object.assign(Object.assign({},this.config.pageContext),e.pageContext)),Object.hasOwn(e,"pageOptions")&&void 0!==e.pageOptions&&(this.config.pageOptions=Object.assign(Object.assign({},this.config.pageOptions),e.pageOptions)),Object.hasOwn(e,"tcf")&&void 0!==e.tcf&&(this.config.tcf=Object.assign(Object.assign({},this.config.tcf),e.tcf))}get(){if(!this.config)throw new Error("Config was accessed before it had been initialized.");return this.config}getHandlers(){if(!this.siteHandlers)throw new Error("Handlers were accessed before it had been initialized.");return this.siteHandlers}setHandlers(e){this.siteHandlers=S(j.DEFAULT_SITE_HANDLERS,e)}}j.DEFAULT_SITE_HANDLERS={siteEvents:A,initNativeAd:()=>{}};const L=new j;L.modifyConfigProperties.bind(L);const _=864e5,M=(()=>{const e=e=>{const t=window.localStorage.getItem(e);if(!t)return null;try{return JSON.parse(t)}catch(e){return v("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=_)=>{const i={data:n,expirationTime:(new Date).getTime()+r};t(e,JSON.stringify(i))},getByTimestamp:(t,n=_)=>{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 v("Error with parsing localStorage data"),null}}}})(),x=e=>e.startsWith("glci_"),N=()=>{var e;return((e=[])=>e.filter(x))(null!==(e=(()=>{const e=M.getByTimestamp("glimrTags");return e&&"string"!=typeof e?null==e?void 0:e.tags:null})())&&void 0!==e?e:[])},U=/^glci_/,$="gender_",F="geo_",q="male",D="female",K=()=>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===q||o===D?`${$}${o}`:void 0}catch(e){return}var e}),B=()=>t(void 0,void 0,void 0,function*(){const e=[],t=yield K(),n=(()=>{const e=N().map(e=>`${F}${e.replace(U,"")}`);return Array.from(new Set(e))})();return t&&e.push(t),n&&e.push(...n),e}),R="front";class V{getPulseObjectId(){return"sdrn:e24:content:partnerstudio:element:partnerstudio:stats"}getPulsePageId(e,t){return e===R?"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 H{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 J{getPulseObjectId(){return"sdrn:stavangeraftenblad:content:partnerstudio:element:partnerstudio:stats"}getPulsePageId(){return"sdrn:stavangeraftenblad:frontpage:Frontpage"}}class W{handleKilkayaStreamTracking({pulse:e,pageContext:{pageType:t,publisher:d}}){if(!(null==e?void 0:e.instance))return;const c={[n]:new s,[a]:new V,[r]:new H,[o]:new z,[i]:new J}[d]||new l;g(e.instance,c,t)}injectKilkayaMeta(e){return t(this,void 0,void 0,function*(){const t=document.createElement("script"),n=yield B();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(v(`Kilkaya event for slot: ${n}`),!n)return void v("Kilkaya slot empty, Xandr backfill won't be loaded");const r=n.parentElement;r?(v(`Kilkaya placement ${n.getAttribute("name")} has not been loaded, loading Xandr backfill`),this.showBackfill(r)):v("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="block";(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 v(`Schibsted Consent to Pay is not enabled, returning true for ${r}`),!0;if(null==e?void 0:e.schibstedAdChoicesOverrideValue)return v(`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}=k(e,0,n);return(yield i())?(v(`Schibsted Ad Choices consent given according to TCF consent manager for ${r}`),!0):(v(`Schibsted Ad Choices consent not given according to TCF consent manager for ${r}`),!1)}))(i,o,a,"kilkaya");l&&(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%"}},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 W;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="vg",r="sa",i="bt",o="e24";class a{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 s{getPulseObjectId(){return""}getPulsePageId(e,t){return""}}class l{constructor(e,t){this.pulse=e,this.newsroomStrategy=t}getEventInput(e,t){return{}}parseKilkayaData(e){const t=e.querySelector("article");if(!t)return{};const n=t.dataset.k5aTeaserAnalytics;try{return n?JSON.parse(n):{}}catch(e){return{}}}mapPageType(e){return{front:"Frontpage",article:"Article",section:"Article",collection:"Article",other:"Article"}[e||"front"]||"Frontpage"}getArticleId(){return location.pathname.split("/").slice(-2,-1).pop()||""}getEventTarget(e){const{url:t,title:n,itemId:r}=this.parseKilkayaData(e);return{id:r,name:this.normalizePlacementTitle(null!=n?n:""),type:"Page",url:t}}normalizePlacementTitle(e){return e.replace(/<[^>]+>/gi,"").replace(/[^a-z0-9æøå\s_-]/gi,"")}trackContentView(e){return t(this,void 0,void 0,function*(){var t,n,r,i,o,a,s,l,d;const c=new CustomEvent("advertory:partnerstudioAdImpression",{detail:{ad:null===(t=this.parseKilkayaData(e))||void 0===t?void 0:t.placement}});if(window.dispatchEvent(c),!this.pulse)return;const u=this.getEventInput(e,"view");(null===(n=this.pulse)||void 0===n?void 0:n.trackLegacyViewUIElement)?null===(i=null===(r=this.pulse)||void 0===r?void 0:r.trackLegacyViewUIElement)||void 0===i||i.call(r,u):(null===(o=this.pulse)||void 0===o?void 0:o.trackViewUIElement)?null===(s=null===(a=this.pulse)||void 0===a?void 0:a.trackViewUIElement)||void 0===s||s.call(a,u):null===(d=null===(l=this.pulse)||void 0===l?void 0:l.trackElementView)||void 0===d||d.call(l,u)})}trackContentClick(e){return t(this,void 0,void 0,function*(){var t,n,r,i,o,a;if(!this.pulse)return;const s=this.getEventInput(e,"click");this.pulse.trackLegacyClickUIElement?null===(n=(t=this.pulse).trackLegacyClickUIElement)||void 0===n||n.call(t,s):this.pulse.trackClickUIElement?null===(i=(r=this.pulse).trackClickUIElement)||void 0===i||i.call(r,s):null===(a=(o=this.pulse).trackElementClick)||void 0===a||a.call(o,s)})}}class d extends l{constructor(e,t,n){super(e,t),this.pulse=e,this.newsroomStrategy=t,this.pageType=n}getEventBaseData(e){var t,n,r,i,o,a;const{clientName:s,creativeId:l,itemId:d,placement:c}=this.parseKilkayaData(e),u=this.mapPageType(this.pageType),g=null===(t=this.newsroomStrategy)||void 0===t?void 0:t.getPulsePageId(this.pageType||"front",this.getArticleId());return{"@id":null!==(i=null===(r=null===(n=this.newsroomStrategy)||void 0===n?void 0:n.getPulseObjectId)||void 0===r?void 0:r.call(n))&&void 0!==i?i:c,"@type":"UIElement",position:c,elementType:"Article",custom:{customer:s,creativeId:null!=l?l:d},page:{"@id":null!=g?g:c,"@type":u,url:location.origin},tags:null===(a=null===(o=this.newsroomStrategy)||void 0===o?void 0:o.getTags)||void 0===a?void 0:a.call(o,e)}}getEventTarget(e){const{link:t,itemId:n,title:r}=this.parseKilkayaData(e);return{id:n,name:this.normalizePlacementTitle(null!=r?r:""),type:"Page",url:t}}getEventInput(e,t){return{object:this.getEventBaseData(e),partnerstudio:this.getEventPartnerstudioData(e,t),target:this.getEventTarget(e),provider:this.getProviderData()}}getEventPartnerstudioData(e,t){const n=this.parseKilkayaData(e);return Object.assign(Object.assign({},n),{type:t,tracking_type:"ad",xandrAdLoaded:!1})}getProviderData(){return{productTag:"partnerstudio"}}}const c="[data-k5a-teaser-analytics]",u=(e,t,n)=>{const r=document.querySelectorAll("k5a-stream");if(!r.length)return;const i=new d(e,t,n),o=new WeakMap,a=e=>{const t=o.get(e);t&&(t.disconnect(),o.delete(e))},s=new IntersectionObserver((e,t)=>{e.forEach(e=>{if(!e.isIntersecting)return;const n=e.target,r=n.querySelector(c);Boolean(null==r?void 0:r.dataset.k5aTeaserAnalytics)?(i.trackContentView(n),t.unobserve(e.target),a(n)):((e,t)=>{if(o.has(e))return;const n=new MutationObserver(()=>{const n=e.querySelector(c);Boolean(null==n?void 0:n.dataset.k5aTeaserAnalytics)&&(i.trackContentView(e),t.unobserve(e),a(e))});n.observe(e,{attributes:!0,childList:!0,subtree:!0,attributeFilter:["data-k5a-teaser-analytics"]}),o.set(e,n)})(n,t)})},{threshold:.5});r.forEach(e=>{s.observe(e),e.addEventListener("click",()=>i.trackContentClick(e))})},g=(e,t)=>{const n="[Advertory LOG]: ";location.search.includes("ast_debug=true")&&(t?console.log(n,e,t):console.log(n,e))},v=(e,t)=>{console.warn("[Advertory WARN]: ",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 g("Advertising permission value obtained synchronously: ",e),Boolean(t)})();if(null!==n)return void t(n);let r=!1;const i=e=>{r||(g("Resolving advertising permission value obtained"),r=!0,t(e))},o=setTimeout(()=>{g("Advertising permission timed out, resolving with false"),i(!1)},3e3);window._tcf_.onTcfReady(()=>{g("On Tcf Ready called, waiting for permission"),clearTimeout(o)}),window._tcf_.getPermission("CMP:advertising",e=>{clearTimeout(o);const t=Number(e);g("Advertising permission value obtained asynchronously: ",e),i(Boolean(t))})}),f="no",h="se",y="cmp:loaded";let m="undefined"!=typeof window?window._tcf_:void 0,b=!1;const w=(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&&(g("TCF bypass param detected, returning consent: true"),!0):(g("TCF is not enabled, returning consent: true"),!0))(i,a))return!0;if(b)return null;if(!m)throw new Error("[Advertory]: getConsentSync method was called before the tcfManager was available.");const t=m.getConsentedToAllSync();return g(`TCF consented to all is: ${t}`),m.getConsentedToAllSync()};return{initConsentManager:()=>(null==e?void 0:e.enabled)?new Promise((e,t)=>{if(g("Getting TCF consent manager..."),window._tcf_)return g("TCF consent manager is already available"),m=window._tcf_,void e(m);g("TCF consent manager is not available");const n=()=>{g("CMP loaded, resolving consent manager..."),r&&clearTimeout(r),window._tcf_?(m=window._tcf_,e(m)):t(new Error("CMP loaded but window._tcf_ is not defined"))},r=setTimeout(()=>{document.removeEventListener(y,n),b=!0,t(new Error("Timeout waiting for CMP to load"))},o);g("Listening for CMP loaded event..."),document.addEventListener(y,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 g(`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===h,n=(null==e?void 0:e.advertisingCMPSignalEnabled)&&r===f;if(t||n)return g("Schibsted Ad Choices is enabled, getting advertising permissions..."),yield p(e);if(!(null==e?void 0:e.enabled))return!0;const i=l();return null!==i?i:yield new Promise((e,t)=>{try{if(!m)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(()=>{g("TCF isConsentedToAll timed out, resolving with false"),n(!1)},o);m.onTcfReady(()=>{g("On Tcf Ready called, waiting for consent"),clearTimeout(r)}),m.isConsentedToAll(t=>{clearTimeout(r),e(t)})}catch(e){t(e)}})})}};class k{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 g("[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 T,E;var O=C(function(){if(E)return T;E=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)},{})},T=s}());const S=["placements","takeover","refreshConfig","editory"],P={adRequested:()=>{},adAvailable:e=>{},adLoaded:e=>{},adNoBid:e=>{},adError:(e,t)=>{},adCollapse:()=>{},adRequestFailure:e=>{},adBadRequest:e=>{},adLoadedMediated:e=>{},adNoBidMediated:e=>{}},A=e=>{(e=>{const{pageContext:t,pageOptions:n,placements:r,appearanceConfig:i}=null!=e?e:{};(null==t?void 0:t.publisher)||v("pageContext.publisher is required."),(null==t?void 0:t.countryCode)||v("pageContext.countryCode is required."),(null==t?void 0:t.pageType)||v("pageContext.pageType is required."),(null==t?void 0:t.deviceType)||v("pageContext.deviceType is required."),n||v("pageOptions is required."),r||v("placements is required."),(null==i?void 0:i.defaultThreshold)||v("appearanceConfig.defaultThreshold is required.")})(e),(e=>{var t,n,r;const i=e.pageSectionsSelectors,o=[{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"}];for(const{flag:e,property:t,featureName:n}of o)e&&!(null==i?void 0:i[t])&&v(`pageSectionsSelectors.${t} is required when ${n} is enabled.`)})(e)};class I{set(e){A(e),this.config=e}modifyConfigProperties(e){if(!this.config)throw new Error("Config was accessed before it had been initialized.");const t={};for(const n of S){const r=e[n];void 0!==r&&(t[n]=r)}Object.assign(this.config,t),Object.hasOwn(e,"pageContext")&&void 0!==e.pageContext&&(this.config.pageContext=Object.assign(Object.assign({},this.config.pageContext),e.pageContext)),Object.hasOwn(e,"pageOptions")&&void 0!==e.pageOptions&&(this.config.pageOptions=Object.assign(Object.assign({},this.config.pageOptions),e.pageOptions)),Object.hasOwn(e,"tcf")&&void 0!==e.tcf&&(this.config.tcf=Object.assign(Object.assign({},this.config.tcf),e.tcf))}get(){if(!this.config)throw new Error("Config was accessed before it had been initialized.");return this.config}getHandlers(){if(!this.siteHandlers)throw new Error("Handlers were accessed before it had been initialized.");return this.siteHandlers}setHandlers(e){this.siteHandlers=O(I.DEFAULT_SITE_HANDLERS,e)}}I.DEFAULT_SITE_HANDLERS={siteEvents:P,initNativeAd:()=>{}};const j=new I;j.modifyConfigProperties.bind(j);const L=864e5,_=(()=>{const e=e=>{const t=window.localStorage.getItem(e);if(!t)return null;try{return JSON.parse(t)}catch(e){return g("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=L)=>{const i={data:n,expirationTime:(new Date).getTime()+r};t(e,JSON.stringify(i))},getByTimestamp:(t,n=L)=>{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 g("Error with parsing localStorage data"),null}}}})(),M=e=>e.startsWith("glci_"),x=()=>{var e;return((e=[])=>e.filter(M))(null!==(e=(()=>{const e=_.getByTimestamp("glimrTags");return e&&"string"!=typeof e?null==e?void 0:e.tags:null})())&&void 0!==e?e:[])},N=/^glci_/,U="gender_",$="geo_",F="male",q="female",D=()=>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 k(n),i=yield r.getIdentityUser(),{gender:o}=null!=i?i:{};return o===F||o===q?`${U}${o}`:void 0}catch(e){return}var e}),K=()=>t(void 0,void 0,void 0,function*(){const e=[],t=yield D(),n=(()=>{const e=x().map(e=>`${$}${e.replace(N,"")}`);return Array.from(new Set(e))})();return t&&e.push(t),n&&e.push(...n),e}),B="front";class R{getPulseObjectId(){return"sdrn:e24:content:partnerstudio:element:partnerstudio:stats"}getPulsePageId(e,t){return e===B?"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 V{getPulseObjectId(){return"sdrn:aftenposten:content:partnerstudio:element:partnerstudio:stats"}getPulsePageId(){return"sdrn:aftenposten:frontpage:Frontpage"}}class H{getPulseObjectId(){return"sdrn:bt:content:partnerstudio:element:partnerstudio:stats"}getPulsePageId(){return"sdrn:bt:frontpage:Frontpage"}}class z{getPulseObjectId(){return"sdrn:stavangeraftenblad:content:partnerstudio:element:partnerstudio:stats"}getPulsePageId(){return"sdrn:stavangeraftenblad:frontpage:Frontpage"}}class J{handleKilkayaStreamTracking({pulse:e,pageContext:{pageType:t,publisher:l}}){if(!(null==e?void 0:e.instance))return;const d={[n]:new a,[o]:new R,"no-aftenposten":new V,[i]:new H,"no-bergenstidende":new H,[r]:new z,"no-stavangeraftenblad":new z}[l]||new s;u(e.instance,d,t)}injectKilkayaMeta(e){return t(this,void 0,void 0,function*(){const t=document.createElement("script"),n=yield K();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(g(`Kilkaya event for slot: ${n}`),!n)return void g("Kilkaya slot empty, Xandr backfill won't be loaded");const r=n.parentElement;r?(g(`Kilkaya placement ${n.getAttribute("name")} has not been loaded, loading Xandr backfill`),this.showBackfill(r)):g("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="block";(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 g(`Schibsted Consent to Pay is not enabled, returning true for ${r}`),!0;if(null==e?void 0:e.schibstedAdChoicesOverrideValue)return g(`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}=w(e,0,n);return(yield i())?(g(`Schibsted Ad Choices consent given according to TCF consent manager for ${r}`),!0):(g(`Schibsted Ad Choices consent not given according to TCF consent manager for ${r}`),!1)}))(i,o,a,"kilkaya");l&&(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%"}},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 J;yield t.run(e)});
@@ -1,3 +1,4 @@
1
+ import Tracker from '@schibsted/pulse-sdk';
1
2
  import { ReactNode } from 'react';
2
3
 
3
4
  type AstAdType = 'banner' | 'video' | 'native' | 'outstream';
@@ -151,39 +152,17 @@ declare const PageTypes: {
151
152
  };
152
153
  type PageType = (typeof PageTypes)[keyof typeof PageTypes];
153
154
 
154
- interface AdvertisingIdentifiers {
155
- xandr?: {
156
- ppId1?: string;
157
- ppId2?: string;
158
- };
159
- }
160
- interface TrackerInstance {
161
- getAdvertisingIdentifiers: () => Promise<AdvertisingIdentifiers>;
162
- getUserId: () => Promise<undefined | string | number>;
163
- getEnvironmentId: () => Promise<undefined | string>;
164
- getActor: () => Promise<undefined | unknown>;
165
- state?: {
166
- pageViewId?: string;
167
- };
168
- }
169
- interface PulseInstance extends TrackerInstance {
170
- pulseTracker?: TrackerInstance;
155
+ interface PulseLegacyExtras {
171
156
  trackElementView?: (eventInput: unknown) => Promise<void>;
172
157
  trackElementClick?: (eventInput: unknown) => Promise<void>;
173
158
  trackClickUIElement?: (eventInput: unknown) => Promise<void>;
174
159
  trackViewUIElement?: (eventInput: unknown) => Promise<void>;
175
- trackLegacyClickUIElement?: (eventInput: unknown) => Promise<void>;
176
- trackLegacyViewUIElement?: (eventInput: unknown) => Promise<void>;
177
160
  }
178
- interface Tracker {
161
+ interface PulseConfig {
179
162
  clientId: string;
180
- instance: TrackerInstance;
163
+ instance: Tracker & PulseLegacyExtras;
181
164
  hasherUrl?: string;
182
165
  }
183
- interface Pulse {
184
- clientId: string;
185
- instance: PulseInstance;
186
- }
187
166
 
188
167
  declare const Newsrooms: {
189
168
  readonly SVD: "svd";
@@ -230,8 +209,7 @@ interface SiteConfig {
230
209
  glimr?: GlimrConfig;
231
210
  tcf?: TCFConfig;
232
211
  prebid?: PrebidConfig;
233
- tracker?: Tracker;
234
- pulse?: Pulse;
212
+ pulse?: PulseConfig;
235
213
  finnBlink?: FinnBlinkConfig;
236
214
  wallpaper?: WallpaperConfig;
237
215
  fullscreenScroll?: FullscreenScrollConfig;
@@ -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="vg",i="aftenposten",o="sa",a="bt",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""}}class c{constructor(e,t){this.pulse=e,this.newsroomStrategy=t}getEventInput(e,t){return{}}parseKilkayaData(e){const t=e.querySelector("article");if(!t)return{};const n=t.dataset.k5aTeaserAnalytics;try{return n?JSON.parse(n):{}}catch(e){return{}}}mapPageType(e){return{front:"Frontpage",article:"Article",section:"Article",collection:"Article",other:"Article"}[e||"front"]||"Frontpage"}getArticleId(){return location.pathname.split("/").slice(-2,-1).pop()||""}getEventTarget(e){const{url:t,title:n,itemId:r}=this.parseKilkayaData(e);return{id:r,name:this.normalizePlacementTitle(null!=n?n:""),type:"Page",url:t}}normalizePlacementTitle(e){return e.replace(/<[^>]+>/gi,"").replace(/[^a-z0-9æøå\s_-]/gi,"")}trackContentView(e){return n(this,void 0,void 0,function*(){var t,n,r,i,o,a,s,l,d;const c=new CustomEvent("advertory:partnerstudioAdImpression",{detail:{ad:null===(t=this.parseKilkayaData(e))||void 0===t?void 0:t.placement}});if(window.dispatchEvent(c),!this.pulse)return;const u=this.getEventInput(e,"view");(null===(n=this.pulse)||void 0===n?void 0:n.trackLegacyViewUIElement)?null===(i=null===(r=this.pulse)||void 0===r?void 0:r.trackLegacyViewUIElement)||void 0===i||i.call(r,u):(null===(o=this.pulse)||void 0===o?void 0:o.trackViewUIElement)?null===(s=null===(a=this.pulse)||void 0===a?void 0:a.trackViewUIElement)||void 0===s||s.call(a,u):null===(d=null===(l=this.pulse)||void 0===l?void 0:l.trackElementView)||void 0===d||d.call(l,u)})}trackContentClick(e){return n(this,void 0,void 0,function*(){var t,n,r,i,o,a;if(!this.pulse)return;const s=this.getEventInput(e,"click");this.pulse.trackLegacyClickUIElement?null===(n=(t=this.pulse).trackLegacyClickUIElement)||void 0===n||n.call(t,s):this.pulse.trackClickUIElement?null===(i=(r=this.pulse).trackClickUIElement)||void 0===i||i.call(r,s):null===(a=(o=this.pulse).trackElementClick)||void 0===a||a.call(o,s)})}}class u extends c{constructor(e,t,n){super(e,t),this.pulse=e,this.newsroomStrategy=t,this.pageType=n}getEventBaseData(e){var t,n,r,i,o,a;const{clientName:s,creativeId:l,itemId:d,placement:c}=this.parseKilkayaData(e),u=this.mapPageType(this.pageType),g=null===(t=this.newsroomStrategy)||void 0===t?void 0:t.getPulsePageId(this.pageType||"front",this.getArticleId());return{"@id":null!==(i=null===(r=null===(n=this.newsroomStrategy)||void 0===n?void 0:n.getPulseObjectId)||void 0===r?void 0:r.call(n))&&void 0!==i?i:c,"@type":"UIElement",position:c,elementType:"Article",custom:{customer:s,creativeId:null!=l?l:d},page:{"@id":null!=g?g:c,"@type":u,url:location.origin},tags:null===(a=null===(o=this.newsroomStrategy)||void 0===o?void 0:o.getTags)||void 0===a?void 0:a.call(o,e)}}getEventTarget(e){const{link:t,itemId:n,title:r}=this.parseKilkayaData(e);return{id:n,name:this.normalizePlacementTitle(null!=r?r:""),type:"Page",url:t}}getEventInput(e,t){return{object:this.getEventBaseData(e),partnerstudio:this.getEventPartnerstudioData(e,t),target:this.getEventTarget(e),provider:this.getProviderData()}}getEventPartnerstudioData(e,t){const n=this.parseKilkayaData(e);return Object.assign(Object.assign({},n),{type:t,tracking_type:"ad",xandrAdLoaded:!1})}getProviderData(){return{productTag:"partnerstudio"}}}const g="[data-k5a-teaser-analytics]",v=(e,t,n)=>{const r=document.querySelectorAll("k5a-stream");if(!r.length)return;const i=new u(e,t,n),o=new WeakMap,a=e=>{const t=o.get(e);t&&(t.disconnect(),o.delete(e))},s=new IntersectionObserver((e,t)=>{e.forEach(e=>{if(!e.isIntersecting)return;const n=e.target,r=n.querySelector(g);Boolean(null==r?void 0:r.dataset.k5aTeaserAnalytics)?(i.trackContentView(n),t.unobserve(e.target),a(n)):((e,t)=>{if(o.has(e))return;const n=new MutationObserver(()=>{const n=e.querySelector(g);Boolean(null==n?void 0:n.dataset.k5aTeaserAnalytics)&&(i.trackContentView(e),t.unobserve(e),a(e))});n.observe(e,{attributes:!0,childList:!0,subtree:!0,attributeFilter:["data-k5a-teaser-analytics"]}),o.set(e,n)})(n,t)})},{threshold:.5});r.forEach(e=>{s.observe(e),e.addEventListener("click",()=>i.trackContentClick(e))})},p=(e,t)=>{const n="[Advertory LOG]: ";location.search.includes("ast_debug=true")&&(t?console.log(n,e,t):console.log(n,e))},f=(e,t)=>{console.warn("[Advertory WARN]: ",e)},h=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 p("Advertising permission value obtained synchronously: ",e),Boolean(t)})();if(null!==n)return void t(n);let r=!1;const i=e=>{r||(p("Resolving advertising permission value obtained"),r=!0,t(e))},o=setTimeout(()=>{p("Advertising permission timed out, resolving with false"),i(!1)},3e3);window._tcf_.onTcfReady(()=>{p("On Tcf Ready called, waiting for permission"),clearTimeout(o)}),window._tcf_.getPermission("CMP:advertising",e=>{clearTimeout(o);const t=Number(e);p("Advertising permission value obtained asynchronously: ",e),i(Boolean(t))})}),y="no",m="se",b="cmp:loaded";let w="undefined"!=typeof window?window._tcf_:void 0,k=!1;const C=(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&&(p("TCF bypass param detected, returning consent: true"),!0):(p("TCF is not enabled, returning consent: true"),!0))(i,a))return!0;if(k)return null;if(!w)throw new Error("[Advertory]: getConsentSync method was called before the tcfManager was available.");const t=w.getConsentedToAllSync();return p(`TCF consented to all is: ${t}`),w.getConsentedToAllSync()};return{initConsentManager:()=>(null==e?void 0:e.enabled)?new Promise((e,t)=>{if(p("Getting TCF consent manager..."),window._tcf_)return p("TCF consent manager is already available"),w=window._tcf_,void e(w);p("TCF consent manager is not available");const n=()=>{p("CMP loaded, resolving consent manager..."),r&&clearTimeout(r),window._tcf_?(w=window._tcf_,e(w)):t(new Error("CMP loaded but window._tcf_ is not defined"))},r=setTimeout(()=>{document.removeEventListener(b,n),k=!0,t(new Error("Timeout waiting for CMP to load"))},o);p("Listening for CMP loaded event..."),document.addEventListener(b,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 p(`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===m,n=(null==e?void 0:e.advertisingCMPSignalEnabled)&&r===y;if(t||n)return p("Schibsted Ad Choices is enabled, getting advertising permissions..."),yield h(e);if(!(null==e?void 0:e.enabled))return!0;const i=l();return null!==i?i:yield new Promise((e,t)=>{try{if(!w)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(()=>{p("TCF isConsentedToAll timed out, resolving with false"),n(!1)},o);w.onTcfReady(()=>{p("On Tcf Ready called, waiting for consent"),clearTimeout(r)}),w.isConsentedToAll(t=>{clearTimeout(r),e(t)})}catch(e){t(e)}})})}};class T{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 p("[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 E(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var O,S;var P=E(function(){if(S)return O;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)},{})},O=s}());const A=["placements","takeover","refreshConfig","editory"],I={adRequested:()=>{},adAvailable:e=>{},adLoaded:e=>{},adNoBid:e=>{},adError:(e,t)=>{},adCollapse:()=>{},adRequestFailure:e=>{},adBadRequest:e=>{},adLoadedMediated:e=>{},adNoBidMediated:e=>{}},j=e=>{(e=>{const{pageContext:t,pageOptions:n,placements:r,appearanceConfig:i}=null!=e?e:{};(null==t?void 0:t.publisher)||f("pageContext.publisher is required."),(null==t?void 0:t.countryCode)||f("pageContext.countryCode is required."),(null==t?void 0:t.pageType)||f("pageContext.pageType is required."),(null==t?void 0:t.deviceType)||f("pageContext.deviceType is required."),n||f("pageOptions is required."),r||f("placements is required."),(null==i?void 0:i.defaultThreshold)||f("appearanceConfig.defaultThreshold is required.")})(e),(e=>{var t,n,r;const i=e.pageSectionsSelectors,o=[{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"}];for(const{flag:e,property:t,featureName:n}of o)e&&!(null==i?void 0:i[t])&&f(`pageSectionsSelectors.${t} is required when ${n} is enabled.`)})(e)};class L{set(e){j(e),this.config=e}modifyConfigProperties(e){if(!this.config)throw new Error("Config was accessed before it had been initialized.");const t={};for(const n of A){const r=e[n];void 0!==r&&(t[n]=r)}Object.assign(this.config,t),Object.hasOwn(e,"pageContext")&&void 0!==e.pageContext&&(this.config.pageContext=Object.assign(Object.assign({},this.config.pageContext),e.pageContext)),Object.hasOwn(e,"pageOptions")&&void 0!==e.pageOptions&&(this.config.pageOptions=Object.assign(Object.assign({},this.config.pageOptions),e.pageOptions)),Object.hasOwn(e,"tcf")&&void 0!==e.tcf&&(this.config.tcf=Object.assign(Object.assign({},this.config.tcf),e.tcf))}get(){if(!this.config)throw new Error("Config was accessed before it had been initialized.");return this.config}getHandlers(){if(!this.siteHandlers)throw new Error("Handlers were accessed before it had been initialized.");return this.siteHandlers}setHandlers(e){this.siteHandlers=P(L.DEFAULT_SITE_HANDLERS,e)}}L.DEFAULT_SITE_HANDLERS={siteEvents:I,initNativeAd:()=>{}};const _=new L;_.modifyConfigProperties.bind(_);const M=864e5,N=(()=>{const e=e=>{const t=window.localStorage.getItem(e);if(!t)return null;try{return JSON.parse(t)}catch(e){return p("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=M)=>{const i={data:n,expirationTime:(new Date).getTime()+r};t(e,JSON.stringify(i))},getByTimestamp:(t,n=M)=>{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 p("Error with parsing localStorage data"),null}}}})(),U=e=>e.startsWith("glci_"),$=()=>{var e;return((e=[])=>e.filter(U))(null!==(e=(()=>{const e=N.getByTimestamp("glimrTags");return e&&"string"!=typeof e?null==e?void 0:e.tags:null})())&&void 0!==e?e:[])},F=/^glci_/,x="gender_",D="geo_",q="male",B="female",K=()=>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 T(t),i=yield r.getIdentityUser(),{gender:o}=null!=i?i:{};return o===q||o===B?`${x}${o}`:void 0}catch(e){return}var e}),R=()=>n(void 0,void 0,void 0,function*(){const e=[],t=yield K(),n=(()=>{const e=$().map(e=>`${D}${e.replace(F,"")}`);return Array.from(new Set(e))})();return t&&e.push(t),n&&e.push(...n),e}),V="front";class H{getPulseObjectId(){return"sdrn:e24:content:partnerstudio:element:partnerstudio:stats"}getPulsePageId(e,t){return e===V?"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 J{getPulseObjectId(){return"sdrn:bt:content:partnerstudio:element:partnerstudio:stats"}getPulsePageId(){return"sdrn:bt:frontpage:Frontpage"}}class W{getPulseObjectId(){return"sdrn:stavangeraftenblad:content:partnerstudio:element:partnerstudio:stats"}getPulsePageId(){return"sdrn:stavangeraftenblad:frontpage:Frontpage"}}class X{handleKilkayaStreamTracking({pulse:e,pageContext:{pageType:t,publisher:n}}){if(!(null==e?void 0:e.instance))return;const c={[r]:new l,[s]:new H,[i]:new z,[a]:new J,[o]:new W}[n]||new d;v(e.instance,c,t)}injectKilkayaMeta(e){return n(this,void 0,void 0,function*(){const t=document.createElement("script"),n=yield R();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(p(`Kilkaya event for slot: ${n}`),!n)return void p("Kilkaya slot empty, Xandr backfill won't be loaded");const r=n.parentElement;r?(p(`Kilkaya placement ${n.getAttribute("name")} has not been loaded, loading Xandr backfill`),this.showBackfill(r)):p("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="block";(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 p(`Schibsted Consent to Pay is not enabled, returning true for ${r}`),!0;if(null==e?void 0:e.schibstedAdChoicesOverrideValue)return p(`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())?(p(`Schibsted Ad Choices consent given according to TCF consent manager for ${r}`),!0):(p(`Schibsted Ad Choices consent not given according to TCF consent manager for ${r}`),!1)}))(i,o,a,"kilkaya");l&&(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 G=({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%"}},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})]}))},Q=e=>n(void 0,void 0,void 0,function*(){const t=new X;yield t.run(e)});export{G as Kilkaya,Q 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="vg",i="sa",o="bt",a="e24";class s{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 l{getPulseObjectId(){return""}getPulsePageId(e,t){return""}}class d{constructor(e,t){this.pulse=e,this.newsroomStrategy=t}getEventInput(e,t){return{}}parseKilkayaData(e){const t=e.querySelector("article");if(!t)return{};const n=t.dataset.k5aTeaserAnalytics;try{return n?JSON.parse(n):{}}catch(e){return{}}}mapPageType(e){return{front:"Frontpage",article:"Article",section:"Article",collection:"Article",other:"Article"}[e||"front"]||"Frontpage"}getArticleId(){return location.pathname.split("/").slice(-2,-1).pop()||""}getEventTarget(e){const{url:t,title:n,itemId:r}=this.parseKilkayaData(e);return{id:r,name:this.normalizePlacementTitle(null!=n?n:""),type:"Page",url:t}}normalizePlacementTitle(e){return e.replace(/<[^>]+>/gi,"").replace(/[^a-z0-9æøå\s_-]/gi,"")}trackContentView(e){return n(this,void 0,void 0,function*(){var t,n,r,i,o,a,s,l,d;const c=new CustomEvent("advertory:partnerstudioAdImpression",{detail:{ad:null===(t=this.parseKilkayaData(e))||void 0===t?void 0:t.placement}});if(window.dispatchEvent(c),!this.pulse)return;const u=this.getEventInput(e,"view");(null===(n=this.pulse)||void 0===n?void 0:n.trackLegacyViewUIElement)?null===(i=null===(r=this.pulse)||void 0===r?void 0:r.trackLegacyViewUIElement)||void 0===i||i.call(r,u):(null===(o=this.pulse)||void 0===o?void 0:o.trackViewUIElement)?null===(s=null===(a=this.pulse)||void 0===a?void 0:a.trackViewUIElement)||void 0===s||s.call(a,u):null===(d=null===(l=this.pulse)||void 0===l?void 0:l.trackElementView)||void 0===d||d.call(l,u)})}trackContentClick(e){return n(this,void 0,void 0,function*(){var t,n,r,i,o,a;if(!this.pulse)return;const s=this.getEventInput(e,"click");this.pulse.trackLegacyClickUIElement?null===(n=(t=this.pulse).trackLegacyClickUIElement)||void 0===n||n.call(t,s):this.pulse.trackClickUIElement?null===(i=(r=this.pulse).trackClickUIElement)||void 0===i||i.call(r,s):null===(a=(o=this.pulse).trackElementClick)||void 0===a||a.call(o,s)})}}class c extends d{constructor(e,t,n){super(e,t),this.pulse=e,this.newsroomStrategy=t,this.pageType=n}getEventBaseData(e){var t,n,r,i,o,a;const{clientName:s,creativeId:l,itemId:d,placement:c}=this.parseKilkayaData(e),u=this.mapPageType(this.pageType),g=null===(t=this.newsroomStrategy)||void 0===t?void 0:t.getPulsePageId(this.pageType||"front",this.getArticleId());return{"@id":null!==(i=null===(r=null===(n=this.newsroomStrategy)||void 0===n?void 0:n.getPulseObjectId)||void 0===r?void 0:r.call(n))&&void 0!==i?i:c,"@type":"UIElement",position:c,elementType:"Article",custom:{customer:s,creativeId:null!=l?l:d},page:{"@id":null!=g?g:c,"@type":u,url:location.origin},tags:null===(a=null===(o=this.newsroomStrategy)||void 0===o?void 0:o.getTags)||void 0===a?void 0:a.call(o,e)}}getEventTarget(e){const{link:t,itemId:n,title:r}=this.parseKilkayaData(e);return{id:n,name:this.normalizePlacementTitle(null!=r?r:""),type:"Page",url:t}}getEventInput(e,t){return{object:this.getEventBaseData(e),partnerstudio:this.getEventPartnerstudioData(e,t),target:this.getEventTarget(e),provider:this.getProviderData()}}getEventPartnerstudioData(e,t){const n=this.parseKilkayaData(e);return Object.assign(Object.assign({},n),{type:t,tracking_type:"ad",xandrAdLoaded:!1})}getProviderData(){return{productTag:"partnerstudio"}}}const u="[data-k5a-teaser-analytics]",g=(e,t,n)=>{const r=document.querySelectorAll("k5a-stream");if(!r.length)return;const i=new c(e,t,n),o=new WeakMap,a=e=>{const t=o.get(e);t&&(t.disconnect(),o.delete(e))},s=new IntersectionObserver((e,t)=>{e.forEach(e=>{if(!e.isIntersecting)return;const n=e.target,r=n.querySelector(u);Boolean(null==r?void 0:r.dataset.k5aTeaserAnalytics)?(i.trackContentView(n),t.unobserve(e.target),a(n)):((e,t)=>{if(o.has(e))return;const n=new MutationObserver(()=>{const n=e.querySelector(u);Boolean(null==n?void 0:n.dataset.k5aTeaserAnalytics)&&(i.trackContentView(e),t.unobserve(e),a(e))});n.observe(e,{attributes:!0,childList:!0,subtree:!0,attributeFilter:["data-k5a-teaser-analytics"]}),o.set(e,n)})(n,t)})},{threshold:.5});r.forEach(e=>{s.observe(e),e.addEventListener("click",()=>i.trackContentClick(e))})},v=(e,t)=>{const n="[Advertory LOG]: ";location.search.includes("ast_debug=true")&&(t?console.log(n,e,t):console.log(n,e))},p=(e,t)=>{console.warn("[Advertory WARN]: ",e)},f=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 v("Advertising permission value obtained synchronously: ",e),Boolean(t)})();if(null!==n)return void t(n);let r=!1;const i=e=>{r||(v("Resolving advertising permission value obtained"),r=!0,t(e))},o=setTimeout(()=>{v("Advertising permission timed out, resolving with false"),i(!1)},3e3);window._tcf_.onTcfReady(()=>{v("On Tcf Ready called, waiting for permission"),clearTimeout(o)}),window._tcf_.getPermission("CMP:advertising",e=>{clearTimeout(o);const t=Number(e);v("Advertising permission value obtained asynchronously: ",e),i(Boolean(t))})}),h="no",y="se",m="cmp:loaded";let b="undefined"!=typeof window?window._tcf_:void 0,w=!1;const k=(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&&(v("TCF bypass param detected, returning consent: true"),!0):(v("TCF is not enabled, returning consent: true"),!0))(i,a))return!0;if(w)return null;if(!b)throw new Error("[Advertory]: getConsentSync method was called before the tcfManager was available.");const t=b.getConsentedToAllSync();return v(`TCF consented to all is: ${t}`),b.getConsentedToAllSync()};return{initConsentManager:()=>(null==e?void 0:e.enabled)?new Promise((e,t)=>{if(v("Getting TCF consent manager..."),window._tcf_)return v("TCF consent manager is already available"),b=window._tcf_,void e(b);v("TCF consent manager is not available");const n=()=>{v("CMP loaded, resolving consent manager..."),r&&clearTimeout(r),window._tcf_?(b=window._tcf_,e(b)):t(new Error("CMP loaded but window._tcf_ is not defined"))},r=setTimeout(()=>{document.removeEventListener(m,n),w=!0,t(new Error("Timeout waiting for CMP to load"))},o);v("Listening for CMP loaded event..."),document.addEventListener(m,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 v(`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===h;if(t||n)return v("Schibsted Ad Choices is enabled, getting advertising permissions..."),yield f(e);if(!(null==e?void 0:e.enabled))return!0;const i=l();return null!==i?i:yield new Promise((e,t)=>{try{if(!b)throw new Error("[Advertory]: getConsentAsync method was called before the tcfManager was available.");let t=!1;const n=n=>{t||(t=!0,e(n))},r=setTimeout(()=>{v("TCF isConsentedToAll timed out, resolving with false"),n(!1)},o);b.onTcfReady(()=>{v("On Tcf Ready called, waiting for consent"),clearTimeout(r)}),b.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 v("[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 T(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var E,O;var S=T(function(){if(O)return E;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)},{})},E=s}());const P=["placements","takeover","refreshConfig","editory"],A={adRequested:()=>{},adAvailable:e=>{},adLoaded:e=>{},adNoBid:e=>{},adError:(e,t)=>{},adCollapse:()=>{},adRequestFailure:e=>{},adBadRequest:e=>{},adLoadedMediated:e=>{},adNoBidMediated:e=>{}},I=e=>{(e=>{const{pageContext:t,pageOptions:n,placements:r,appearanceConfig:i}=null!=e?e:{};(null==t?void 0:t.publisher)||p("pageContext.publisher is required."),(null==t?void 0:t.countryCode)||p("pageContext.countryCode is required."),(null==t?void 0:t.pageType)||p("pageContext.pageType is required."),(null==t?void 0:t.deviceType)||p("pageContext.deviceType is required."),n||p("pageOptions is required."),r||p("placements is required."),(null==i?void 0:i.defaultThreshold)||p("appearanceConfig.defaultThreshold is required.")})(e),(e=>{var t,n,r;const i=e.pageSectionsSelectors,o=[{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"}];for(const{flag:e,property:t,featureName:n}of o)e&&!(null==i?void 0:i[t])&&p(`pageSectionsSelectors.${t} is required when ${n} is enabled.`)})(e)};class j{set(e){I(e),this.config=e}modifyConfigProperties(e){if(!this.config)throw new Error("Config was accessed before it had been initialized.");const t={};for(const n of P){const r=e[n];void 0!==r&&(t[n]=r)}Object.assign(this.config,t),Object.hasOwn(e,"pageContext")&&void 0!==e.pageContext&&(this.config.pageContext=Object.assign(Object.assign({},this.config.pageContext),e.pageContext)),Object.hasOwn(e,"pageOptions")&&void 0!==e.pageOptions&&(this.config.pageOptions=Object.assign(Object.assign({},this.config.pageOptions),e.pageOptions)),Object.hasOwn(e,"tcf")&&void 0!==e.tcf&&(this.config.tcf=Object.assign(Object.assign({},this.config.tcf),e.tcf))}get(){if(!this.config)throw new Error("Config was accessed before it had been initialized.");return this.config}getHandlers(){if(!this.siteHandlers)throw new Error("Handlers were accessed before it had been initialized.");return this.siteHandlers}setHandlers(e){this.siteHandlers=S(j.DEFAULT_SITE_HANDLERS,e)}}j.DEFAULT_SITE_HANDLERS={siteEvents:A,initNativeAd:()=>{}};const L=new j;L.modifyConfigProperties.bind(L);const _=864e5,M=(()=>{const e=e=>{const t=window.localStorage.getItem(e);if(!t)return null;try{return JSON.parse(t)}catch(e){return v("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=_)=>{const i={data:n,expirationTime:(new Date).getTime()+r};t(e,JSON.stringify(i))},getByTimestamp:(t,n=_)=>{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 v("Error with parsing localStorage data"),null}}}})(),N=e=>e.startsWith("glci_"),U=()=>{var e;return((e=[])=>e.filter(N))(null!==(e=(()=>{const e=M.getByTimestamp("glimrTags");return e&&"string"!=typeof e?null==e?void 0:e.tags:null})())&&void 0!==e?e:[])},$=/^glci_/,F="gender_",x="geo_",D="male",q="female",B=()=>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===D||o===q?`${F}${o}`:void 0}catch(e){return}var e}),K=()=>n(void 0,void 0,void 0,function*(){const e=[],t=yield B(),n=(()=>{const e=U().map(e=>`${x}${e.replace($,"")}`);return Array.from(new Set(e))})();return t&&e.push(t),n&&e.push(...n),e}),R="front";class V{getPulseObjectId(){return"sdrn:e24:content:partnerstudio:element:partnerstudio:stats"}getPulsePageId(e,t){return e===R?"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 H{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 J{getPulseObjectId(){return"sdrn:stavangeraftenblad:content:partnerstudio:element:partnerstudio:stats"}getPulsePageId(){return"sdrn:stavangeraftenblad:frontpage:Frontpage"}}class W{handleKilkayaStreamTracking({pulse:e,pageContext:{pageType:t,publisher:n}}){if(!(null==e?void 0:e.instance))return;const d={[r]:new s,[a]:new V,"no-aftenposten":new H,[o]:new z,"no-bergenstidende":new z,[i]:new J,"no-stavangeraftenblad":new J}[n]||new l;g(e.instance,d,t)}injectKilkayaMeta(e){return n(this,void 0,void 0,function*(){const t=document.createElement("script"),n=yield K();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(v(`Kilkaya event for slot: ${n}`),!n)return void v("Kilkaya slot empty, Xandr backfill won't be loaded");const r=n.parentElement;r?(v(`Kilkaya placement ${n.getAttribute("name")} has not been loaded, loading Xandr backfill`),this.showBackfill(r)):v("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="block";(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 v(`Schibsted Consent to Pay is not enabled, returning true for ${r}`),!0;if(null==e?void 0:e.schibstedAdChoicesOverrideValue)return v(`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}=k(e,0,n);return(yield i())?(v(`Schibsted Ad Choices consent given according to TCF consent manager for ${r}`),!0):(v(`Schibsted Ad Choices consent not given according to TCF consent manager for ${r}`),!1)}))(i,o,a,"kilkaya");l&&(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 X=({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%"}},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})]}))},G=e=>n(void 0,void 0,void 0,function*(){const t=new W;yield t.run(e)});export{X as Kilkaya,G as runKilkaya};
@@ -1,3 +1,5 @@
1
+ import Tracker from '@schibsted/pulse-sdk';
2
+
1
3
  type AstAdType = 'banner' | 'video' | 'native' | 'outstream';
2
4
  interface AstBanner {
3
5
  content: string;
@@ -296,39 +298,17 @@ declare const PageTypes: {
296
298
  };
297
299
  type PageType = (typeof PageTypes)[keyof typeof PageTypes];
298
300
 
299
- interface AdvertisingIdentifiers {
300
- xandr?: {
301
- ppId1?: string;
302
- ppId2?: string;
303
- };
304
- }
305
- interface TrackerInstance {
306
- getAdvertisingIdentifiers: () => Promise<AdvertisingIdentifiers>;
307
- getUserId: () => Promise<undefined | string | number>;
308
- getEnvironmentId: () => Promise<undefined | string>;
309
- getActor: () => Promise<undefined | unknown>;
310
- state?: {
311
- pageViewId?: string;
312
- };
313
- }
314
- interface PulseInstance extends TrackerInstance {
315
- pulseTracker?: TrackerInstance;
301
+ interface PulseLegacyExtras {
316
302
  trackElementView?: (eventInput: unknown) => Promise<void>;
317
303
  trackElementClick?: (eventInput: unknown) => Promise<void>;
318
304
  trackClickUIElement?: (eventInput: unknown) => Promise<void>;
319
305
  trackViewUIElement?: (eventInput: unknown) => Promise<void>;
320
- trackLegacyClickUIElement?: (eventInput: unknown) => Promise<void>;
321
- trackLegacyViewUIElement?: (eventInput: unknown) => Promise<void>;
322
306
  }
323
- interface Tracker {
307
+ interface PulseConfig {
324
308
  clientId: string;
325
- instance: TrackerInstance;
309
+ instance: Tracker & PulseLegacyExtras;
326
310
  hasherUrl?: string;
327
311
  }
328
- interface Pulse {
329
- clientId: string;
330
- instance: PulseInstance;
331
- }
332
312
 
333
313
  declare const Newsrooms: {
334
314
  readonly SVD: "svd";
@@ -432,8 +412,7 @@ interface SiteConfig {
432
412
  glimr?: GlimrConfig;
433
413
  tcf?: TCFConfig;
434
414
  prebid?: PrebidConfig;
435
- tracker?: Tracker;
436
- pulse?: Pulse;
415
+ pulse?: PulseConfig;
437
416
  finnBlink?: FinnBlinkConfig;
438
417
  wallpaper?: WallpaperConfig;
439
418
  fullscreenScroll?: FullscreenScrollConfig;