@streamlayer/react 1.22.3 → 1.23.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 (112) hide show
  1. package/lib/cjs/Question.js +1 -1
  2. package/lib/cjs/advertisement.js +44 -40
  3. package/lib/cjs/analytics.js +1 -1
  4. package/lib/cjs/index-eShKGO10.js +5 -0
  5. package/lib/cjs/index.js +1 -1
  6. package/lib/cjs/index10.js +4 -1
  7. package/lib/cjs/index11.js +1 -4
  8. package/lib/cjs/index12.js +1 -1
  9. package/lib/cjs/index13.js +1 -1
  10. package/lib/cjs/index14.js +1 -1
  11. package/lib/cjs/index15.js +5 -1
  12. package/lib/cjs/index2.js +1 -1
  13. package/lib/cjs/index4.js +1 -1
  14. package/lib/cjs/index7.js +1 -5
  15. package/lib/cjs/index8.js +1 -1
  16. package/lib/cjs/index9.js +1 -1
  17. package/lib/cjs/insight.js +1 -1
  18. package/lib/cjs/masters2.js +5 -5
  19. package/lib/cjs/notification.js +1 -1
  20. package/lib/cjs/pause-ad.js +1 -1
  21. package/lib/cjs/points.js +1 -1
  22. package/lib/cjs/storage.js +1 -1
  23. package/lib/cjs/useStreamLayerApp2.js +17 -17
  24. package/lib/classic/cjs/Question.js +1 -1
  25. package/lib/classic/cjs/advertisement.js +44 -40
  26. package/lib/classic/cjs/analytics.js +1 -1
  27. package/lib/classic/cjs/bet-pack.js +1 -1
  28. package/lib/classic/cjs/index-eShKGO10.js +5 -0
  29. package/lib/classic/cjs/index.js +1 -1
  30. package/lib/classic/cjs/index10.js +1 -1
  31. package/lib/classic/cjs/index11.js +1 -1
  32. package/lib/classic/cjs/index12.js +4 -1
  33. package/lib/classic/cjs/index2.js +2 -2
  34. package/lib/classic/cjs/index3.js +1 -1
  35. package/lib/classic/cjs/index4.js +1 -1
  36. package/lib/classic/cjs/index5.js +1 -1
  37. package/lib/classic/cjs/index6.js +1 -5
  38. package/lib/classic/cjs/index7.js +1 -1
  39. package/lib/classic/cjs/index8.js +1 -1
  40. package/lib/classic/cjs/index9.js +1 -1
  41. package/lib/classic/cjs/insight.js +1 -1
  42. package/lib/classic/cjs/notification.js +1 -1
  43. package/lib/classic/cjs/notification2.js +1 -1
  44. package/lib/classic/cjs/pause-ad.js +1 -1
  45. package/lib/classic/cjs/points.js +1 -1
  46. package/lib/classic/cjs/useStreamLayerApp2.js +17 -17
  47. package/lib/classic/es/Question.js +53 -53
  48. package/lib/classic/es/advertisement.js +15547 -10742
  49. package/lib/classic/es/analytics.js +74 -18
  50. package/lib/classic/es/bet-pack.js +4 -4
  51. package/lib/classic/es/index-eShKGO10.js +3757 -0
  52. package/lib/classic/es/index.js +1 -1
  53. package/lib/classic/es/index10.js +2295 -82
  54. package/lib/classic/es/index11.js +179 -2339
  55. package/lib/classic/es/index12.js +822 -170
  56. package/lib/classic/es/index2.js +13 -14
  57. package/lib/classic/es/index3.js +16 -61
  58. package/lib/classic/es/index4.js +282 -16
  59. package/lib/classic/es/index5.js +5 -283
  60. package/lib/classic/es/index6.js +9 -3756
  61. package/lib/classic/es/index7.js +62 -5
  62. package/lib/classic/es/index8.js +315 -7
  63. package/lib/classic/es/index9.js +81 -313
  64. package/lib/classic/es/insight.js +1 -1
  65. package/lib/classic/es/notification.js +1 -1
  66. package/lib/classic/es/notification2.js +476 -452
  67. package/lib/classic/es/pause-ad.js +174 -208
  68. package/lib/classic/es/points.js +4 -4
  69. package/lib/classic/es/useStreamLayerApp2.js +5062 -4028
  70. package/lib/dist/cjs/index-eShKGO10.js +5 -0
  71. package/lib/dist/cjs/masters.js +35 -35
  72. package/lib/dist/es/index-eShKGO10.js +3757 -0
  73. package/lib/dist/es/masters.js +9267 -8240
  74. package/lib/dist/index.d.ts +13 -1
  75. package/lib/dist/style.css +1 -1
  76. package/lib/es/Question.js +4 -4
  77. package/lib/es/advertisement.js +15547 -10742
  78. package/lib/es/analytics.js +74 -18
  79. package/lib/es/index-eShKGO10.js +3757 -0
  80. package/lib/es/index.js +1 -1
  81. package/lib/es/index10.js +804 -236
  82. package/lib/es/index11.js +170 -822
  83. package/lib/es/index12.js +302 -166
  84. package/lib/es/index13.js +81 -313
  85. package/lib/es/index14.js +2350 -82
  86. package/lib/es/index15.js +1229 -2330
  87. package/lib/es/index2.js +10 -11
  88. package/lib/es/index4.js +2 -2
  89. package/lib/es/index7.js +5 -3756
  90. package/lib/es/index8.js +9 -5
  91. package/lib/es/index9.js +263 -7
  92. package/lib/es/insight.js +1 -1
  93. package/lib/es/masters2.js +15 -16
  94. package/lib/es/notification.js +449 -425
  95. package/lib/es/pause-ad.js +174 -208
  96. package/lib/es/points.js +1 -1
  97. package/lib/es/storage.js +2 -2
  98. package/lib/es/useStreamLayerApp2.js +5062 -4028
  99. package/lib/style.css +1 -1
  100. package/package.json +17 -17
  101. package/lib/cjs/index-DSi8Qgfs.js +0 -1
  102. package/lib/cjs/index16.js +0 -5
  103. package/lib/cjs/vast-client.min.js +0 -1
  104. package/lib/classic/cjs/index-DSi8Qgfs.js +0 -1
  105. package/lib/classic/cjs/index13.js +0 -4
  106. package/lib/classic/cjs/vast-client.min.js +0 -1
  107. package/lib/classic/es/index-DSi8Qgfs.js +0 -65
  108. package/lib/classic/es/index13.js +0 -835
  109. package/lib/classic/es/vast-client.min.js +0 -1060
  110. package/lib/es/index-DSi8Qgfs.js +0 -65
  111. package/lib/es/index16.js +0 -1254
  112. package/lib/es/vast-client.min.js +0 -1060
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamlayer/react",
3
- "version": "1.22.3",
3
+ "version": "1.23.0",
4
4
  "author": "StreamLayer, Inc (https://streamlayer.io)",
5
5
  "maintainers": [
6
6
  {
@@ -133,30 +133,30 @@
133
133
  ],
134
134
  "dependencies": {
135
135
  "@bufbuild/protobuf": "^2.2.2",
136
- "@streamlayer/sl-eslib": "^5.225.0",
136
+ "@streamlayer/sl-eslib": "^5.228.0",
137
137
  "@connectrpc/connect": "^2.0.0",
138
138
  "@connectrpc/connect-web": "^2.0.0",
139
- "@streamlayer/feature-gamification": "^1.23.8",
140
- "@streamlayer/react-polyfills": "^0.1.53",
141
- "@streamlayer/sdk-web": "^1.16.8",
142
- "@streamlayer/sdk-web-analytics": "^1.14.3",
143
- "@streamlayer/sdk-web-api": "^1.14.8",
144
- "@streamlayer/sdk-web-features": "^1.0.93",
145
- "@streamlayer/sdk-web-core": "^1.18.3",
146
- "@streamlayer/sdk-web-interfaces": "^1.8.8",
147
- "@streamlayer/sdk-web-logger": "^1.0.93",
148
- "@streamlayer/sdk-web-storage": "^1.0.93",
149
- "@streamlayer/sdk-web-types": "^1.16.8",
150
- "@streamlayer/sdk-web-notifications": "^1.3.55",
151
- "@streamlayer/react-ui": "^1.33.3"
139
+ "@streamlayer/feature-gamification": "^1.24.0",
140
+ "@streamlayer/react-polyfills": "^0.2.0",
141
+ "@streamlayer/sdk-web": "^1.17.0",
142
+ "@streamlayer/sdk-web-analytics": "^1.15.0",
143
+ "@streamlayer/sdk-web-api": "^1.15.0",
144
+ "@streamlayer/sdk-web-core": "^1.19.0",
145
+ "@streamlayer/sdk-web-features": "^1.0.94",
146
+ "@streamlayer/sdk-web-interfaces": "^1.9.0",
147
+ "@streamlayer/sdk-web-logger": "^1.0.94",
148
+ "@streamlayer/sdk-web-notifications": "^1.3.56",
149
+ "@streamlayer/sdk-web-storage": "^1.0.94",
150
+ "@streamlayer/sdk-web-types": "^1.16.9",
151
+ "@streamlayer/react-ui": "^1.34.0"
152
152
  },
153
153
  "peerDependencies": {
154
154
  "@fastify/deepmerge": "^2.0.0",
155
155
  "@lottiefiles/react-lottie-player": "^3.5.4",
156
- "@nanostores/query": "^0.2.10",
156
+ "@nanostores/query": "^0.3.4",
157
157
  "@types/lodash.throttle": "^4.1.9",
158
158
  "lodash.throttle": "^4.1.1",
159
- "nanostores": "^0.11.4",
159
+ "nanostores": "^1.1.0",
160
160
  "pino": "^9.4.0",
161
161
  "react": "18.3.1",
162
162
  "react-auth-code-input": "^3.2.1",
@@ -1 +0,0 @@
1
- "use strict";let n=[],i=0;const r=4;let s=o=>{let l=[],e={get(){return e.lc||e.listen(()=>{})(),e.value},lc:0,listen(t){return e.lc=l.push(t),()=>{for(let f=i+r;f<n.length;)n[f]===t?n.splice(f,r):f+=r;let u=l.indexOf(t);~u&&(l.splice(u,1),--e.lc||e.off())}},notify(t,u){let f=!n.length;for(let v of l)n.push(v,e.value,t,u);if(f){for(i=0;i<n.length;i+=r)n[i](n[i+1],n[i+2],n[i+3]);n.length=0}},off(){},set(t){let u=e.value;u!==t&&(e.value=t,e.notify(u))},subscribe(t){let u=e.listen(t);return t(e.value),u},value:o};return e},a=(o={})=>{let l=s(o);return l.setKey=function(e,t){let u=l.value;typeof t>"u"&&e in l.value?(l.value={...l.value},delete l.value[e],l.notify(u,e)):l.value[e]!==t&&(l.value={...l.value,[e]:t},l.notify(u,e))},l};exports.a=s;exports.i=a;
@@ -1,5 +0,0 @@
1
- "use strict";const g2=require("nanostores"),M=require("./index3.js"),u=require("react"),s=require("./sl-types.js"),e=require("react/jsx-runtime"),T=require("./index9.js"),z=require("./index12.js"),O=require("react-dom"),v2=require("./utils.js"),q=require("./storage.js"),j2=require("./index10.js"),u2=require("./index13.js"),b=require("./useStreamLayerApp2.js"),$=require("./index6.js"),I2=require("./index5.js"),A2=require("./index11.js"),L2=require("./analytics.js"),w2=i=>g2.atom(i),b2=i=>{const t=s.useStore(i.getActiveFeature()),n=s.useStore(i.streamStore()),[l,r]=u.useState(null);return u.useEffect(()=>{const o=i.getFeatures();if(!t)r(null);else for(const[c,d]of o)c===t?(d.status.get()===M.FeatureStatus.Suspended&&d.enable(),r(d)):d.status.get()===M.FeatureStatus.Ready&&d.disable();return()=>{for(const[,c]of o)c.status.get()===M.FeatureStatus.Ready&&c.disable()}},[t,i,n]),[t,l]},$2=s.styled_default("div")({name:"Container",class:"c1zy8a",propsAsIs:!1}),T2=s.styled_default("div")({name:"Title",class:"t1vih9p5",propsAsIs:!1}),H2=s.styled_default("div")({name:"Indicator",class:"i1fbnvpb",propsAsIs:!1}),D=({indicator:i,title:t})=>e.jsxs($2,{children:[e.jsx(T2,{children:t}),e.jsx(H2,{children:i})]}),V2=s.styled_default("div")({name:"Container",class:"ctmhwyc",propsAsIs:!1}),k2=s.styled_default("div")({name:"Indicator",class:"i1jri200",propsAsIs:!1}),z2=s.styled_default("div")({name:"Title",class:"t8s05oq",propsAsIs:!1}),R=({indicator:i,title:t})=>e.jsxs(V2,{children:[e.jsx(k2,{children:i}),e.jsx(z2,{children:t})]}),S2=s.styled_default("div")({name:"Container",class:"c1yrpn9o",propsAsIs:!1}),q2=s.styled_default("div")({name:"TopInfo",class:"t17fwahh",propsAsIs:!1}),R2=s.styled_default("div")({name:"BottomInfo",class:"by6w7e9",propsAsIs:!1}),F2=s.styled_default("div")({name:"User",class:"u1g7arbm",propsAsIs:!1}),E2=s.styled_default("img")({name:"Avatar",class:"a1ldeata",propsAsIs:!1}),B2=s.styled_default("div")({name:"UserInfo",class:"u10d4koz",propsAsIs:!1}),M2=s.styled_default("div")({name:"UserName",class:"u1q6roj0",propsAsIs:!1}),N2=s.styled_default("div")({name:"UserRating",class:"ui0m425",propsAsIs:!1}),Z2=s.styled_default("img")({name:"TrophyIcon",class:"t1el3mrn",propsAsIs:!1}),O2=s.styled_default("div")({name:"RtsContainer",class:"r2vgnxv",propsAsIs:!1}),W2=s.styled_default("div")({name:"RtsDivider",class:"roqn06j",propsAsIs:!1}),G2=s.styled_default("div")({name:"Rts",class:"r15adx7c",propsAsIs:!1}),Q=s.styled_default("div")({name:"RtsIndicator",class:"rv59lta",propsAsIs:!1}),U=s.styled_default("div")({name:"RtsLabel",class:"r55lotb",propsAsIs:!1}),P2=s.styled_default("div")({name:"Divider",class:"d1knfgqt",propsAsIs:!1}),D2=s.styled_default("div")({name:"Ranks",class:"r1mqo824",propsAsIs:!1}),Q2=s.styled_default("div")({name:"Statistics",class:"sxareh6",propsAsIs:!1}),U2=s.styled_default("div")({name:"AvatarPlaceholder",class:"amcu48h",propsAsIs:!1}),Y2=s.styled_default("button")({name:"UserAccountBtn",class:"u32nfkp",propsAsIs:!1}),K2="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Trophy'%3e%3cpath%20id='Combined%20Shape'%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M3.69197%204.66662C3.69197%205.99705%203.92914%207.17787%204.4035%208.20912C3.49966%208.02451%202.74487%207.66486%202.1391%207.13014C1.53333%206.59542%201.23046%206.0798%201.23046%205.58328V4.66662H3.69197ZM14.7686%204.66662V5.58328C14.7686%206.0798%2014.4658%206.59542%2013.86%207.13014C13.2542%207.66486%2012.4994%208.02451%2011.5956%208.20912C12.0699%207.17787%2012.3071%205.99705%2012.3071%204.66662H14.7686ZM15.9998%205.58329V4.36108C15.9998%204.10645%2015.9101%203.89002%2015.7306%203.71178C15.5511%203.53354%2015.3332%203.44442%2015.0768%203.44442H12.3076V2.52776C12.3076%202.10763%2012.1569%201.74797%2011.8556%201.44878C11.5544%201.14959%2011.1922%201%2010.7691%201H5.23072C4.80764%201%204.44547%201.14959%204.14419%201.44878C3.84291%201.74797%203.69227%202.10763%203.69227%202.52776V3.44442H0.923068C0.666659%203.44442%200.448714%203.53354%200.269228%203.71178C0.0897418%203.89002%200%204.10645%200%204.36108V5.58329C0%206.03525%200.13301%206.49039%200.399034%206.94872C0.665059%207.40705%201.02403%207.82082%201.47595%208.19003C1.92787%208.55924%202.48234%208.86957%203.13939%209.12101C3.79644%209.37246%204.48713%209.51409%205.21149%209.54592C5.48071%209.88967%205.7852%2010.192%206.12494%2010.453C6.36853%2010.6695%206.53679%2010.9002%206.62974%2011.1453C6.72269%2011.3904%206.76916%2011.6752%206.76916%2011.9999C6.76916%2012.3436%206.67141%2012.6333%206.4759%2012.8688C6.28038%2013.1043%205.96789%2013.2221%205.53841%2013.2221C5.05764%2013.2221%204.62976%2013.3669%204.25476%2013.6566C3.87977%2013.9462%203.69227%2014.3106%203.69227%2014.7499V15.361C3.69227%2015.4501%203.72112%2015.5233%203.77881%2015.5806C3.8365%2015.6379%203.91022%2015.6665%203.99996%2015.6665H11.9999C12.0896%2015.6665%2012.1633%2015.6379%2012.221%2015.5806C12.2787%2015.5233%2012.3076%2015.4501%2012.3076%2015.361V14.7499C12.3076%2014.3106%2012.1201%2013.9462%2011.7451%2013.6566C11.3701%2013.3669%2010.9422%2013.2221%2010.4614%2013.2221C10.0319%2013.2221%209.71945%2013.1043%209.52394%2012.8688C9.32843%2012.6333%209.23068%2012.3436%209.23068%2011.9999C9.23068%2011.6752%209.27715%2011.3904%209.3701%2011.1453C9.46305%2010.9002%209.63131%2010.6695%209.8749%2010.453C10.2146%2010.192%2010.5191%209.88967%2010.7884%209.54592C11.5127%209.51409%2012.2034%209.37246%2012.8604%209.12101C13.5175%208.86957%2014.072%208.55924%2014.5239%208.19003C14.9758%207.82082%2015.3348%207.40705%2015.6008%206.94872C15.8668%206.49039%2015.9998%206.03525%2015.9998%205.58329ZM6.76047%207.1798L8.05109%206.49997L9.3417%207.1798L9.09521%205.73989L10.1393%204.72015L8.69639%204.51007L8.05109%203.2L7.40578%204.51007L5.96283%204.72015L7.00696%205.73989L6.76047%207.1798Z'%20fill='%23F2C94C'/%3e%3c/g%3e%3c/svg%3e",J2=({loading:i,hideFriendsRank:t,avatar:n,name:l,points:r,friendsRank:o,rank:c,streak:d,correct:h,incorrect:y,inTop:j,successRate:v})=>e.jsxs(S2,{"data-loading":i,children:[e.jsx(q2,{children:e.jsx(T.i,{loading:i,children:e.jsxs(F2,{children:[e.jsxs(Y2,{children:[n&&e.jsx(E2,{alt:"avatar",src:n}),!n&&e.jsx(U2,{children:z.I(l||"")})]}),e.jsxs(B2,{children:[e.jsx(M2,{children:l}),e.jsxs(N2,{children:[e.jsxs(O2,{children:[e.jsxs(G2,{children:[e.jsx(Z2,{alt:"rank-icon",src:K2}),e.jsxs(Q,{children:[z.s(r),e.jsx(U,{children:"PTS"})]})]}),t&&e.jsxs(Q,{children:[e.jsx(W2,{}),c||0,e.jsx(U,{children:"global rank"})]})]}),!t&&e.jsxs(e.Fragment,{children:[e.jsx(P2,{}),e.jsxs("div",{children:["TOP ",j||0,"%"]})]})]})]})]})})}),e.jsxs(R2,{children:[!t&&e.jsxs(D2,{children:[e.jsx(T.i,{loading:i,style:{width:"100%"},children:e.jsx(D,{indicator:o||0,title:"Friends rank"})}),e.jsx(T.i,{loading:i,style:{width:"100%"},children:e.jsx(D,{indicator:c||0,title:"Global rank"})})]}),e.jsx(T.i,{loading:i,children:e.jsxs(Q2,{children:[e.jsx(R,{indicator:d||0,title:"Win streak"}),e.jsx(R,{indicator:h||0,title:"Correct"}),e.jsx(R,{indicator:y||0,title:"Incorrect"}),e.jsx(R,{indicator:`${v||0}%`,title:"Succ. rate"})]})})]})]}),X2=s.styled_default("div")({name:"StaticContainer",class:"svm502q",propsAsIs:!1}),e0=`
2
- .sl-pill-button {
3
- display: none !important;
4
- }
5
- `,h2=()=>window.innerWidth>=s.A.md&&window.innerWidth<s.A.lg?76:53,Y=i=>{var t;const n=h2();return Math.round((((t=i.current)==null?void 0:t.getBoundingClientRect().y)||0)-n)<=0},s0=({children:i,container:t,useContainer:n,staticStyles:l})=>{const[r]=u.useState(()=>Y(t)),[o,c]=u.useState(!1);return u.useEffect(()=>{if(!t.current||!r)return c(!0),()=>{};const d=window.scrollY;return c(!0),()=>{Y(t)&&window.scrollTo({top:d,behavior:"instant"})}},[]),u.useEffect(()=>{if(o&&t.current&&r){const d=h2();window.scrollTo({top:t.current.offsetTop-d,behavior:"instant"})}},[o]),!t.current||!o?null:n?O.createPortal(e.jsxs(X2,{className:"StaticContainer",children:[i,e.jsx("style",{children:v2.u}),e.jsx("style",{children:e0})]}),t.current,"modal-node"):O.createPortal(e.jsxs(e.Fragment,{children:[i,e.jsx("style",{children:l})]}),t.current,"modal-node")},t0=s.styled_default("button")({name:"Container",class:"cpjnajb",propsAsIs:!1}),i0=s.styled_default("div")({name:"Content",class:"c4m6kaz",propsAsIs:!1}),n0=s.styled_default("span")({name:"Title",class:"t1h8t9cc",propsAsIs:!1}),l0=()=>e.jsx(t0,{children:e.jsxs(i0,{children:[e.jsx($.B1,{name:"iconCopySuccess"}),e.jsx(n0,{children:"Link Copied to Clipboard"})]})}),C2=i=>{const t=u.useRef(),[n,l]=u.useState(null),r=u.useCallback(async o=>{var c;if(o&&(c=navigator==null?void 0:navigator.clipboard)!=null&&c.writeText){t.current&&(clearTimeout(t.current),l(null));try{await navigator.clipboard.writeText(o),i.current&&(l(O.createPortal(e.jsx(l0,{}),i.current)),t.current=setTimeout(()=>{l(null)},1e3))}catch(d){console.error("Unable to copy to clipboard",d)}}},[i]);return u.useEffect(()=>()=>{clearTimeout(t.current)},[]),[r,n]};let L;typeof window<"u"?L=window:typeof self<"u"?L=self:L=b.global;let W=null,G=null;const K=20,N=L.clearTimeout,J=L.setTimeout,Z=L.cancelAnimationFrame||L.mozCancelAnimationFrame||L.webkitCancelAnimationFrame,X=L.requestAnimationFrame||L.mozRequestAnimationFrame||L.webkitRequestAnimationFrame;Z==null||X==null?(W=N,G=function(t){return J(t,K)}):(W=function([t,n]){Z(t),N(n)},G=function(t){const n=X(function(){N(l),t()}),l=J(function(){Z(n),t()},K);return[n,l]});function a0(i){let t,n,l,r,o,c,d;const h=typeof document<"u"&&document.attachEvent;if(!h){c=function(f){const C=f.__resizeTriggers__,A=C.firstElementChild,g=C.lastElementChild,w=A.firstElementChild;g.scrollLeft=g.scrollWidth,g.scrollTop=g.scrollHeight,w.style.width=A.offsetWidth+1+"px",w.style.height=A.offsetHeight+1+"px",A.scrollLeft=A.scrollWidth,A.scrollTop=A.scrollHeight},o=function(f){return f.offsetWidth!==f.__resizeLast__.width||f.offsetHeight!==f.__resizeLast__.height},d=function(f){if(f.target.className&&typeof f.target.className.indexOf=="function"&&f.target.className.indexOf("contract-trigger")<0&&f.target.className.indexOf("expand-trigger")<0)return;const C=this;c(this),this.__resizeRAF__&&W(this.__resizeRAF__),this.__resizeRAF__=G(function(){o(C)&&(C.__resizeLast__.width=C.offsetWidth,C.__resizeLast__.height=C.offsetHeight,C.__resizeListeners__.forEach(function(w){w.call(C,f)}))})};let a=!1,p="";l="animationstart";const m="Webkit Moz O ms".split(" ");let _="webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "),x="";{const f=document.createElement("fakeelement");if(f.style.animationName!==void 0&&(a=!0),a===!1){for(let C=0;C<m.length;C++)if(f.style[m[C]+"AnimationName"]!==void 0){x=m[C],p="-"+x.toLowerCase()+"-",l=_[C],a=!0;break}}}n="resizeanim",t="@"+p+"keyframes "+n+" { from { opacity: 0; } to { opacity: 0; } } ",r=p+"animation: 1ms "+n+"; "}const y=function(a){if(!a.getElementById("detectElementResize")){const p=(t||"")+".resize-triggers { "+(r||"")+'visibility: hidden; opacity: 0; } .resize-triggers, .resize-triggers > div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }',m=a.head||a.getElementsByTagName("head")[0],_=a.createElement("style");_.id="detectElementResize",_.type="text/css",i!=null&&_.setAttribute("nonce",i),_.styleSheet?_.styleSheet.cssText=p:_.appendChild(a.createTextNode(p)),m.appendChild(_)}};return{addResizeListener:function(a,p){if(h)a.attachEvent("onresize",p);else{if(!a.__resizeTriggers__){const m=a.ownerDocument,_=L.getComputedStyle(a);_&&_.position==="static"&&(a.style.position="relative"),y(m),a.__resizeLast__={},a.__resizeListeners__=[],(a.__resizeTriggers__=m.createElement("div")).className="resize-triggers";const x=m.createElement("div");x.className="expand-trigger",x.appendChild(m.createElement("div"));const f=m.createElement("div");f.className="contract-trigger",a.__resizeTriggers__.appendChild(x),a.__resizeTriggers__.appendChild(f),a.appendChild(a.__resizeTriggers__),c(a),a.addEventListener("scroll",d,!0),l&&(a.__resizeTriggers__.__animationListener__=function(A){A.animationName===n&&c(a)},a.__resizeTriggers__.addEventListener(l,a.__resizeTriggers__.__animationListener__))}a.__resizeListeners__.push(p)}},removeResizeListener:function(a,p){if(h)a.detachEvent("onresize",p);else if(a.__resizeListeners__.splice(a.__resizeListeners__.indexOf(p),1),!a.__resizeListeners__.length){a.removeEventListener("scroll",d,!0),a.__resizeTriggers__.__animationListener__&&(a.__resizeTriggers__.removeEventListener(l,a.__resizeTriggers__.__animationListener__),a.__resizeTriggers__.__animationListener__=null);try{a.__resizeTriggers__=!a.removeChild(a.__resizeTriggers__)}catch{}}}}}class r0 extends u.Component{constructor(...t){super(...t),this.state={height:this.props.defaultHeight||0,scaledHeight:this.props.defaultHeight||0,scaledWidth:this.props.defaultWidth||0,width:this.props.defaultWidth||0},this._autoSizer=null,this._detectElementResize=null,this._parentNode=null,this._resizeObserver=null,this._timeoutId=null,this._onResize=()=>{this._timeoutId=null;const{disableHeight:n,disableWidth:l,onResize:r}=this.props;if(this._parentNode){const o=window.getComputedStyle(this._parentNode)||{},c=parseFloat(o.paddingLeft||"0"),d=parseFloat(o.paddingRight||"0"),h=parseFloat(o.paddingTop||"0"),y=parseFloat(o.paddingBottom||"0"),j=this._parentNode.getBoundingClientRect(),v=j.height-h-y,a=j.width-c-d,p=this._parentNode.offsetHeight-h-y,m=this._parentNode.offsetWidth-c-d;(!n&&(this.state.height!==p||this.state.scaledHeight!==v)||!l&&(this.state.width!==m||this.state.scaledWidth!==a))&&(this.setState({height:p,width:m,scaledHeight:v,scaledWidth:a}),typeof r=="function"&&r({height:p,scaledHeight:v,scaledWidth:a,width:m}))}},this._setRef=n=>{this._autoSizer=n}}componentDidMount(){const{nonce:t}=this.props,n=this._autoSizer?this._autoSizer.parentNode:null;if(n!=null&&n.ownerDocument&&n.ownerDocument.defaultView&&n instanceof n.ownerDocument.defaultView.HTMLElement){this._parentNode=n;const l=n.ownerDocument.defaultView.ResizeObserver;l!=null?(this._resizeObserver=new l(()=>{this._timeoutId=setTimeout(this._onResize,0)}),this._resizeObserver.observe(n)):(this._detectElementResize=a0(t),this._detectElementResize.addResizeListener(n,this._onResize)),this._onResize()}}componentWillUnmount(){this._parentNode&&(this._detectElementResize&&this._detectElementResize.removeResizeListener(this._parentNode,this._onResize),this._timeoutId!==null&&clearTimeout(this._timeoutId),this._resizeObserver&&this._resizeObserver.disconnect())}render(){const{children:t,defaultHeight:n,defaultWidth:l,disableHeight:r=!1,disableWidth:o=!1,doNotBailOutOnEmptyChildren:c=!1,nonce:d,onResize:h,style:y={},tagName:j="div",...v}=this.props,{height:a,scaledHeight:p,scaledWidth:m,width:_}=this.state,x={overflow:"visible"},f={};let C=!1;return r||(a===0&&(C=!0),x.height=0,f.height=a,f.scaledHeight=p),o||(_===0&&(C=!0),x.width=0,f.width=_,f.scaledWidth=m),c&&(C=!1),u.createElement(j,{ref:this._setRef,style:{...x,...y},...v},!C&&t(f))}}const o0=s.styled_default("div")({name:"Container",class:"c1itm4k7",propsAsIs:!1}),d0=s.styled_default("div")({name:"IconContainer",class:"i1w4fsni",propsAsIs:!1}),c0=()=>$.B1,p0=s.styled_default(c0())({name:"InviteGameIcon",class:"i19m85r1",propsAsIs:!0}),u0=s.styled_default("div")({name:"Content",class:"c1mbu204",propsAsIs:!1}),h0=s.styled_default("div")({name:"Heading",class:"h1amdqtv",propsAsIs:!1}),C0=s.styled_default("div")({name:"Subtext",class:"s1lhlj9j",propsAsIs:!1}),f0=s.styled_default("div")({name:"LinkContainer",class:"l1wot35e",propsAsIs:!1}),m0=s.styled_default("div")({name:"LinkInfo",class:"l1jdw39q",propsAsIs:!1}),_0=s.styled_default("span")({name:"LinkTitle",class:"l1cr5mk",propsAsIs:!1}),x0=s.styled_default("span")({name:"LinkAddress",class:"lvi87q4",propsAsIs:!1}),y0=()=>$.B1,g0=s.styled_default(y0())({name:"LinkIcon",class:"l1pqlvw3",propsAsIs:!0}),f2=({inviteLink:i,inviteCardTitle:t,inviteCardSubtext:n,primaryColor:l,className:r})=>{const o=u.useRef(null),[c,d]=C2(o),[h]=L2.f({type:"invitation",action:"sent",payload:{from:b.InvitationFrom.MENU}});return e.jsxs(o0,{className:r,children:[e.jsx(d0,{style:{backgroundColor:l},children:e.jsx(p0,{name:"invite-game-icon"})}),e.jsxs(u0,{children:[e.jsx(h0,{children:t||""}),e.jsx(C0,{children:n||""})]}),i&&e.jsxs(f0,{ref:o,"data-a":"intr",onClick:h(()=>c(i)),children:[e.jsxs(m0,{children:[e.jsx(_0,{children:"Invite link"}),e.jsx(x0,{children:i})]}),e.jsx(g0,{name:"icon-copy"})]}),d]})},v0=()=>q.r,j0=s.styled_default(v0())({name:"Container",class:"cll3md7",propsAsIs:!0}),I0=()=>q.S,A0=s.styled_default(I0())({name:"ActionBtn",class:"a10g1iik",propsAsIs:!0}),L0=({questionId:i,...t})=>e.jsxs(j0,{"data-a":"intr","data-name":i,children:[e.jsx(j2.O,{questionId:i,...t}),e.jsx(A0,{"data-a":"intr","data-name":i,children:"View Insight"})]}),w0=()=>q.r,b0=s.styled_default(w0())({name:"Container",class:"cl56x6b",propsAsIs:!0}),$0=s.styled_default("button")({name:"ActionButton",class:"a11pzf92",propsAsIs:!1}),T0=s.styled_default("blockquote")({name:"Quote",class:"q1hbaleq",propsAsIs:!1}),H0=({...i})=>e.jsxs(b0,{"data-a":"intr","data-name":i.tweetId,children:[i.title&&e.jsx(T0,{children:i.title}),e.jsx(z.b,{...i}),e.jsx($0,{"data-a":"intr","data-name":i.tweetId,children:"View Insight"})]}),e2=s.styled_default("div")({name:"QuestionsContainer",class:"qvghv3l",propsAsIs:!1}),V0=({questions:i,openQuestion:t,controlVideo:n})=>{const l=r=>{const o=r.target.getAttribute("data-name");o&&(u2.wt(),t(o,{openedFrom:"list"}))};return i?e.jsx(e2,{"data-a":"intr",onClick:l,children:i==null?void 0:i.map(r=>{var o,c,d;if(r.type==="question"&&((o=r.attributes)==null?void 0:o.attributes.case)==="question"){const h=r.attributes.attributes.value;return e.jsx(q.R,{...h},h.questionId)}if(r.type==="insight"&&((c=r.attributes)==null?void 0:c.attributes.case)==="insight"){const h=r.attributes.attributes.value;return e.jsx(L0,{controlVideo:n,...h},h.questionId)}if(r.type==="tweet"&&((d=r.attributes)==null?void 0:d.attributes.case)==="tweet"){const h=r.attributes.attributes.value,y=r.attributes.id;return e.jsx(H0,{controlVideo:n,...h,tweetId:y},y)}return null})}):e.jsx(e2,{children:Array.from({length:5}).map((r,o)=>e.jsx(q.D,{},o))})},k0=s.styled_default("div")({name:"InsightContainer",class:"i1pqqgpo",propsAsIs:!1}),z0=s.styled_default("img")({name:"Image",class:"igj7luu",propsAsIs:!1}),S0=s.styled_default("div")({name:"ImageContainer",class:"i1qne9g6",propsAsIs:!1}),q0=s.styled_default("div")({name:"InsightContent",class:"itpr98r",propsAsIs:!1}),R0=s.styled_default("h3")({name:"Title",class:"t17iaqp8",propsAsIs:!1}),F0=s.styled_default("div")({name:"Description",class:"d16t3y7s",propsAsIs:!1}),E0=s.styled_default("button")({name:"ActionBtn",class:"a12495er",propsAsIs:!1}),B0=({video:i,image:t,imageMode:n,heading:l,body:r,action:o,controlVideo:c})=>e.jsxs(k0,{children:[(i==null?void 0:i.url)&&e.jsx(u2.Et,{source:i.url,poster:i.thumbnailUrl,controlVideo:c}),t&&!(i!=null&&i.url)&&e.jsx(S0,{"data-rounded":n===b.QuestionImages.ROUNDED,children:e.jsx(z0,{src:t,alt:l})}),e.jsxs(q0,{children:[e.jsx(R0,{children:l}),e.jsx(F0,{children:r}),o&&e.jsx(E0,{onClick:o,children:"View Insight"})]})]}),M0=s.styled_default("div")({name:"Container",class:"c1eptrjd",propsAsIs:!1}),N0=s.styled_default("div")({name:"CloseIconWrap",class:"crylm65",propsAsIs:!1}),Z0=()=>$.B1,O0=s.styled_default(Z0())({name:"CloseIcon",class:"c9mrcz7",propsAsIs:!0}),W0=s.styled_default("div")({name:"Header",class:"hw3lzv4",propsAsIs:!1}),G0=()=>$.B1,P0=s.styled_default(G0())({name:"TypeIcon",class:"t1rrb3kf",propsAsIs:!0}),D0=s.styled_default("span")({name:"TypeName",class:"t1ydnjov",propsAsIs:!1}),Q0=s.styled_default("div")({name:"Question",class:"qlf90cl",propsAsIs:!1}),U0=s.styled_default("button")({name:"AnswerButton",class:"a1e0nhcl",propsAsIs:!1}),Y0=s.styled_default("div")({name:"Container",class:"c1t4f0x4",propsAsIs:!1}),K0=s.styled_default("button")({name:"ActionBtn",class:"a16w1nl6",propsAsIs:!1}),J0=s.styled_default("div")({name:"QuoteWrap",class:"q14u54rf",propsAsIs:!1}),X0=s.styled_default("blockquote")({name:"Quote",class:"q1hxm6zo",propsAsIs:!1}),e1=({action:i,...t})=>e.jsxs(Y0,{children:[t.title&&e.jsx(J0,{children:e.jsx(X0,{children:t.title})}),e.jsx(z.b,{...t}),i&&e.jsx(K0,{onClick:i,children:"View Insight"})]}),s1=({close:i,action:t,controlVideo:n,data:{questionType:l,question:r,insight:o,tweet:c}})=>{const d=z.e[l];return d?e.jsxs(M0,{onClick:t,style:l===b.QuestionType.TWEET?{paddingTop:"12px"}:{},children:[e.jsx(N0,{"data-a":"intr",onClick:h=>{h.stopPropagation(),i&&i(h)},children:e.jsx(O0,{name:"icon-cross"})}),l!==b.QuestionType.TWEET&&e.jsxs(W0,{children:[e.jsx(P0,{"data-type-trivia":l===b.QuestionType.TRIVIA,"data-type-poll":l===b.QuestionType.POLL,name:d.iconName}),e.jsx(D0,{children:d.label})]}),l===b.QuestionType.FACTOID&&o&&e.jsx(B0,{...o,action:t,controlVideo:n}),l===b.QuestionType.TWEET&&c&&e.jsx(e1,{...c,action:t,controlVideo:n}),l!==b.QuestionType.FACTOID&&l!==b.QuestionType.TWEET&&e.jsxs(e.Fragment,{children:[e.jsx(Q0,{children:r==null?void 0:r.title}),e.jsx(U0,{children:"Answer"})]})]}):null},V=s.styled_default("div")({name:"BGWrap",class:"b1dqe0sz",propsAsIs:!1}),I=s.styled_default("div")({name:"BGLineBase",class:"b1v6w7ni",propsAsIs:!1}),t1=()=>I,i1=s.styled_default(t1())({name:"BGOneLineOne",class:"b2nqb1p",propsAsIs:!0}),n1=()=>I,l1=s.styled_default(n1())({name:"BGOneLineTwo",class:"b1xxgmbk",propsAsIs:!0}),a1=()=>I,r1=s.styled_default(a1())({name:"BGOneLineThree",class:"b63lwcb",propsAsIs:!0}),o1=()=>I,s2=s.styled_default(o1())({name:"BGTwoLineOne",class:"b2iah4",propsAsIs:!0}),d1=()=>I,t2=s.styled_default(d1())({name:"BGTwoLineTwo",class:"b1xezvf6",propsAsIs:!0}),c1=()=>I,i2=s.styled_default(c1())({name:"BGTwoLineThree",class:"b1jz1hg0",propsAsIs:!0}),p1=()=>I,n2=s.styled_default(p1())({name:"BGThreeLineOne",class:"b18ho1tk",propsAsIs:!0}),u1=()=>I,l2=s.styled_default(u1())({name:"BGThreeLineTwo",class:"b14uvjfm",propsAsIs:!0}),h1=()=>I,a2=s.styled_default(h1())({name:"BGThreeLineThree",class:"b11c3ns7",propsAsIs:!0}),C1=()=>I,r2=s.styled_default(C1())({name:"BGThreeLineFour",class:"b1bqhhet",propsAsIs:!0}),f1=()=>I,m1=s.styled_default(f1())({name:"BGFourLineOne",class:"b1xyzi7o",propsAsIs:!0}),_1=()=>I,x1=s.styled_default(_1())({name:"BGFourLineTwo",class:"byo0rup",propsAsIs:!0}),y1=()=>I,g1=s.styled_default(y1())({name:"BGFourLineThree",class:"b1oyiqgv",propsAsIs:!0}),v1=()=>I,j1=s.styled_default(v1())({name:"BGFourLineFour",class:"bx3ddqw",propsAsIs:!0}),I1=({step:i,correct:t})=>e.jsxs(e.Fragment,{children:[e.jsxs(V,{"data-active":i===1,"data-first-screen":"true",children:[e.jsx(i1,{}),e.jsx(l1,{}),e.jsx(r1,{})]}),e.jsxs(V,{"data-active":i===2,children:[e.jsx(s2,{}),e.jsx(t2,{}),e.jsx(i2,{})]}),e.jsxs(V,{"data-active":i===3,children:[e.jsx(s2,{}),e.jsx(t2,{}),e.jsx(i2,{})]}),t?e.jsxs(e.Fragment,{children:[e.jsxs(V,{"data-active":i===4,"data-correct":"true",children:[e.jsx(n2,{}),e.jsx(l2,{}),e.jsx(a2,{}),e.jsx(r2,{})]}),e.jsxs(V,{"data-active":i===5,"data-correct":"true",children:[e.jsx(n2,{}),e.jsx(l2,{}),e.jsx(a2,{}),e.jsx(r2,{})]})]}):e.jsxs(V,{"data-active":i===4,"data-correct":"false",children:[e.jsx(m1,{}),e.jsx(x1,{}),e.jsx(g1,{}),e.jsx(j1,{})]})]}),A1=118,L1=()=>A2.f,w1=s.styled_default(L1())({name:"Container",class:"c10131zw",propsAsIs:!0}),b1=s.styled_default("div")({name:"InnerContainer",class:"ir6k2eo",propsAsIs:!1}),H=s.styled_default("div")({name:"Content",class:"c1hwoq9l",propsAsIs:!1}),S=s.styled_default("div")({name:"Title",class:"t4ujo4g",propsAsIs:!1}),$1=()=>S,T1=s.styled_default($1())({name:"PointsTitle",class:"p1pjil1h",propsAsIs:!0}),F=s.styled_default("div")({name:"Subtitle",class:"s1iorwr9",propsAsIs:!1}),o2=s.styled_default("div")({name:"SubtitleFG",class:"s51sv9d",propsAsIs:!1}),E=s.styled_default("div")({name:"AnswerText",class:"a1lbk2ye",propsAsIs:!1}),H1=()=>$.B1,m2=s.styled_default(H1())({name:"FeedbackIcon",class:"frcvk3t",propsAsIs:!0}),V1=()=>m2,d2=s.styled_default(V1())({name:"FeedbackIconCorrect",class:"f33p82r",propsAsIs:!0}),k1=()=>m2,z1=s.styled_default(k1())({name:"FeedbackIconIncorrect",class:"f12r9net",propsAsIs:!0}),c2=s.styled_default("div")({name:"CloseIconWrap",class:"c1fw6699",propsAsIs:!1}),S1=()=>$.B1,p2=s.styled_default(S1())({name:"CloseIcon",class:"c115o126",propsAsIs:!0}),q1="data:image/svg+xml,%3csvg%20width='154'%20height='37'%20viewBox='0%200%20154%2037'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M70.9776%2030.8796L74.668%2018.1381C75.0696%2016.7473%2076.1186%2015.6318%2077.4936%2015.1371L77.5928%2014.7217H72.466L63.7623%2024.9662L60.431%2014.7217H55.7389L55.6255%2015.1371C56.4288%2015.5291%2056.8683%2016.7052%2056.8683%2017.662V17.7227C56.8683%2023.1787%2052.781%2032.5598%2047.0352%2032.5598C44.8002%2032.5598%2043.6425%2031.0009%2043.6425%2029.7035C43.6425%2028.1306%2044.975%2027.0105%2046.3831%2027.0105C47.744%2027.0105%2047.9519%2027.5099%2048.741%2027.5099C49.2182%2027.5099%2049.6766%2027.2672%2049.9081%2026.8518C50.2672%2026.1984%2049.9931%2025.4049%2049.3363%2025.0922L48.9772%2024.9242C45.6271%2023.3327%2041.7383%2025.7457%2041.7383%2029.4188V29.4701C41.7383%2032.1444%2043.8646%2034.38%2046.5674%2034.4733C53.5417%2034.716%2058.2055%2025.4236%2058.9473%2018.6188L59.486%2020.4577L62.2313%2028.5927H63.2709L71.8518%2018.4741L68.2512%2030.8936C67.8401%2032.3171%2066.6966%2033.4232%2065.2412%2033.7966L65.142%2034.212H72.0408L72.1542%2033.7966C71.1383%2033.2039%2070.6516%2032.0044%2070.9776%2030.8796Z'%20fill='white'/%3e%3cpath%20d='M88.2952%2021.6521H88.2385C85.016%2021.6568%2081.5571%2021.9648%2079.7143%2027.1361C78.1692%2031.4813%2077.7487%2033.2828%2076.539%2033.2828C75.7641%2033.2828%2075.9531%2031.794%2074.7954%2031.794C74.2709%2031.794%2073.7275%2032.2094%2073.6897%2032.8068C73.6236%2033.8429%2075.0317%2034.4683%2076.0949%2034.4683C79.3316%2034.4683%2080.5696%2032.1347%2080.9759%2031.0472C81.0279%2030.9072%2081.3162%2030.1371%2081.6517%2029.2317H85.0538L84.4773%2031.3273C84.1749%2032.4334%2083.5464%2033.3388%2082.488%2033.8009L82.3982%2034.2163H87.9597L88.0637%2033.8009C87.3124%2033.1848%2086.9816%2032.2%2087.2273%2031.2853L89.3206%2023.4257C89.4812%2022.8236%2089.9018%2022.3242%2090.4783%2022.0628L90.568%2021.6475H88.7536H88.2952V21.6521ZM85.3231%2028.2189H82.0202C82.3935%2027.2108%2082.7526%2026.2493%2082.8755%2025.9366C83.7118%2023.757%2085.2995%2022.8749%2086.8399%2022.7536L86.8257%2022.7676L85.3231%2028.2189Z'%20fill='white'/%3e%3cpath%20d='M116.358%2022.5486C116.538%2022.2545%20116.708%2021.8112%20116.708%2021.5591C116.732%2021.0877%20116.297%2020.7237%20115.829%2020.8217C115.456%2020.9011%20115.187%2021.2324%20115.191%2021.6058C115.196%2021.9978%20115.12%2022.4226%20114.95%2022.6279C114.558%2023.104%20113.934%2023.062%20111.062%2022.2452V22.2405C110.797%2022.1659%20110.509%2022.0819%20110.206%2021.9978C110.187%2021.9932%20110.173%2021.9885%20110.159%2021.9838C108.723%2021.6011%20106.941%2021.2464%20105.774%2021.8205C105.765%2021.8252%20105.755%2021.8298%20105.746%2021.8345C104.602%2022.3992%20103.808%2023.4727%20103.567%2024.7142C103.53%2024.8962%20103.506%2025.0455%20103.501%2025.0969C103.468%2025.7456%20104.068%2026.2544%20104.711%2026.1143C105.235%2026.0023%20105.604%2025.5403%20105.59%2025.0129C105.58%2024.4808%20105.472%2023.7667%20105.765%2023.286C106.237%2022.6279%20106.729%2022.5812%20108.935%2023.3047L106.544%2031.323C106.214%2032.4291%20105.406%2033.3345%20104.338%2033.7966L104.238%2034.212H109.961L110.074%2033.7966C109.337%2033.1852%20109.03%2032.1957%20109.299%2031.2809L111.392%2024.0561C112.309%2024.2428%20113.24%2024.2941%20114.147%2024.0374L114.473%2023.9441C115.196%2023.7527%20115.943%2023.2347%20116.358%2022.5486Z'%20fill='white'/%3e%3cpath%20d='M118.649%2021.6523L118.536%2022.0677C119.245%2022.5531%20119.561%2023.4259%20119.335%2024.2427L117.208%2031.3228C116.877%2032.429%20116.069%2033.3344%20115.002%2033.7964L114.902%2034.2118H117.931H118.21H125.18L126.101%2030.8934H125.666L125.51%2031.2108C124.934%2032.3963%20123.72%2033.1524%20122.382%2033.1524H119.429L121.003%2027.5937H122.259C123.105%2027.5937%20123.743%2028.3545%20123.582%2029.1759H124.012L125.043%2025.4188H124.613C124.362%2026.1142%20123.696%2026.5763%20122.949%2026.5809H121.291L122.382%2022.7258L125.515%2022.7211C126.536%2022.7211%20127.301%2023.6452%20127.098%2024.6347H127.528L128.35%2021.6523H118.649Z'%20fill='white'/%3e%3cpath%20d='M138.251%2021.6582H131.333L131.22%2022.0736C131.881%2022.5263%20132.207%2023.3197%20132.056%2024.0898L129.892%2031.324C129.561%2032.4301%20128.753%2033.3356%20127.685%2033.7976L127.586%2034.213H133.303L133.417%2033.7976C132.68%2033.1862%20132.373%2032.2014%20132.637%2031.282L133.686%2027.5949H134.126C134.787%2027.5949%20135.34%2028.085%20135.416%2028.7337C135.439%2028.9437%20135.77%2031.506%20136.035%2032.3881C136.379%2033.5409%20136.833%2034.213%20137.868%2034.213H140.453L140.552%2033.7976L140.183%2033.5829C139.451%2033.1536%20138.922%2032.4908%20138.685%2031.6087C138.463%2030.7779%20138.043%2029.2284%20137.84%2028.4117C137.736%2027.9916%20137.202%2027.5996%20136.654%2027.5996H137.523C139.087%2027.5996%20140.457%2026.5681%20140.878%2025.0839C141.365%2023.3617%20140.056%2021.6582%20138.251%2021.6582ZM138.369%2024.6872C138.029%2025.812%20136.98%2026.5868%20135.789%2026.5868H133.974L135.071%2022.7317H136.89C137.925%2022.727%20138.662%2023.7118%20138.369%2024.6872Z'%20fill='white'/%3e%3cpath%20d='M100.265%2022.2961C100.081%2022.2961%2099.6794%2022.1701%2099.0651%2021.9181C98.4508%2021.6661%2097.8318%2021.54%2097.2034%2021.54C95.904%2021.54%2094.8219%2021.9554%2093.9336%2022.8422C93.1964%2023.5796%2092.8704%2024.401%2092.8704%2025.1105C92.8704%2025.8665%2093.3193%2026.7533%2094.2124%2027.4721C95.0582%2028.1488%2095.937%2028.8022%2096.8206%2029.465C97.7468%2030.1977%2098.2098%2030.8745%2098.2098%2031.4252C98.2098%2032.634%2097.416%2033.2828%2095.7669%2033.2828C94.0942%2033.2828%2092.9366%2032.074%2092.568%2029.8057H92.1144L90.8008%2034.2162H91.226C91.7694%2033.8382%2092.1569%2033.6001%2092.946%2033.6001C93.6973%2033.6001%2094.5006%2034.4729%2096.2158%2034.4729C97.5814%2034.4729%2098.6682%2034.1929%2099.5943%2033.2781C100.383%2032.4753%20100.776%2031.3552%20100.776%2030.4404C100.776%2029.591%20100.237%2028.6062%2099.2966%2027.8921C98.4886%2027.2807%2097.6286%2026.7347%2096.7923%2026.1419C95.8898%2025.4792%2095.4362%2024.9144%2095.4362%2024.2937C95.4362%2023.9483%2095.611%2023.6076%2095.9559%2023.2622C96.3954%2022.8282%2096.986%2022.7302%2097.7751%2022.7302C99.3581%2022.7302%20100.464%2023.5983%20100.558%2025.4325H100.974L102.08%2021.5447H101.664C101.215%2022.0441%20100.752%2022.2961%20100.265%2022.2961Z'%20fill='white'/%3e%3cpath%20d='M149.201%2022.7304C150.784%2022.7304%20151.89%2023.6032%20151.984%2025.4327H152.4L153.501%2021.5449H153.085C152.646%2022.049%20152.182%2022.301%20151.696%2022.301C151.512%2022.301%20151.11%2022.175%20150.496%2021.923C149.881%2021.6709%20149.262%2021.5449%20148.634%2021.5449C147.334%2021.5449%20146.252%2021.9603%20145.364%2022.8471C144.627%2023.5845%20144.296%2024.4059%20144.296%2025.1153C144.296%2025.8714%20144.745%2026.7582%20145.638%2027.477C146.484%2028.1537%20147.363%2028.8071%20148.246%2029.4699C149.173%2030.2026%20149.636%2030.8794%20149.636%2031.4301C149.636%2032.6389%20148.842%2033.2876%20147.193%2033.2876C145.52%2033.2876%20144.362%2032.0788%20143.994%2029.8106H143.54L142.227%2034.2211H142.642C143.186%2033.843%20143.573%2033.605%20144.358%2033.605C145.109%2033.605%20145.912%2034.4778%20147.627%2034.4778C148.993%2034.4778%20150.075%2034.1978%20151.006%2033.283C151.795%2032.4802%20152.187%2031.3601%20152.187%2030.4453C152.187%2029.6005%20151.649%2028.6111%20150.708%2027.897C149.9%2027.2856%20149.04%2026.7395%20148.204%2026.1468C147.301%2025.4841%20146.848%2024.9193%20146.848%2024.2986C146.848%2023.9532%20147.023%2023.6125%20147.368%2023.2671C147.826%2022.8237%20148.412%2022.7304%20149.201%2022.7304Z'%20fill='white'/%3e%3cpath%20d='M26.5433%202.60035C26.0377%202.44633%2025.5321%202.72169%2025.0265%203.00173C24.8469%203.09974%2024.7194%203.27243%2024.6768%203.46845L23.883%207.13222C23.8547%207.26757%2023.9775%207.38891%2024.1145%207.36091C24.9509%207.17422%2025.7447%206.4508%2026.5811%206.70283C27.5167%206.98753%2028.4522%205.81606%2029.3878%205.83006V1.60156C28.4475%201.60623%2027.4789%202.88505%2026.5433%202.60035Z'%20fill='white'/%3e%3cpath%20d='M38.4856%2013.8398C38.2871%2013.7044%2038.1643%2013.4851%2038.1643%2013.2471V12.5796C38.1643%2011.9822%2037.6729%2011.4922%2037.0633%2011.4922H36.6239C36.0994%2011.4922%2035.6174%2011.7536%2035.3339%2012.1876L33.9164%2014.3485C33.7746%2014.5632%2033.5383%2014.6892%2033.2832%2014.6892H32.3287C31.8562%2014.6892%2031.4215%2014.9459%2031.1947%2015.3566C30.9631%2015.7814%2030.552%2016.0754%2030.0843%2016.1734V1.1403C30.0843%200.94894%2029.9283%200.794922%2029.7346%200.794922C29.5409%200.794922%2029.3849%200.94894%2029.3849%201.1403V1.60702V5.83552V16.1827C28.9171%2016.0847%2028.506%2015.7907%2028.2745%2015.3613C28.0524%2014.9506%2027.6177%2014.6939%2027.1405%2014.6939H26.4979C25.9875%2014.6939%2025.5292%2014.9879%2025.3213%2015.45L24.7873%2016.6308C24.7023%2016.8175%2024.5133%2016.9388%2024.3054%2016.9388C24.0975%2016.9388%2023.9085%2016.8175%2023.8234%2016.6308L23.2895%2015.45C23.0816%2014.9926%2022.6232%2014.6939%2022.1129%2014.6939H4.00135C3.85487%2014.6939%203.73674%2014.8106%203.73674%2014.9553C3.73674%2015.2633%203.48158%2015.5107%203.17444%2015.5107H2.39007C2.24359%2015.5107%202.12546%2015.6273%202.12546%2015.772V16.6728C2.12546%2017.5176%201.96008%2018.339%201.62931%2019.1184L1.15207%2020.2526C0.707907%2021.3027%200.5%2022.3901%200.5%2023.4589V26.0726C0.5%2026.7773%200.603954%2027.4914%200.811861%2028.1868C1.39306%2030.1377%202.7161%2031.7339%204.53529%2032.6767L7.43182%2034.1842C7.46962%2034.2029%207.51214%2034.2122%207.55467%2034.2122L9.69517%2034.2309C10.196%2034.2355%2010.6875%2034.3616%2011.1269%2034.6043L12.2751%2035.239C12.3129%2035.2623%2012.3602%2035.2717%2012.4074%2035.2717H13.9431C14.4818%2035.2717%2015.0157%2035.4163%2015.474%2035.6917C15.474%2035.6917%2016.2253%2036.1444%2016.4805%2036.2891C16.8869%2036.5225%2017.3783%2036.7465%2018.2335%2036.7932C18.4273%2036.8025%2018.621%2036.7325%2018.7675%2036.5972C18.9092%2036.4618%2018.9943%2036.2704%2018.9943%2036.0791V35.0616C18.9943%2034.3242%2019.4337%2033.6521%2020.1189%2033.3581L22.4673%2032.3406C22.7886%2032.2006%2023.1477%2032.1773%2023.4832%2032.28L24.3621%2032.5367C24.7354%2032.644%2025.1323%2032.6487%2025.5056%2032.5367L27.5846%2031.9253C27.8587%2031.8459%2028.1517%2031.8459%2028.4304%2031.9299L29.2763%2032.1633C29.6684%2032.2706%2029.9472%2032.6347%2029.9472%2033.0361V35.071C29.9472%2036.0184%2030.7269%2036.7932%2031.6861%2036.7932C32.4043%2036.7932%2033.0328%2036.3405%2033.2501%2035.6637C33.6423%2034.4456%2033.8408%2033.1761%2033.8408%2031.8973V31.0292C33.8408%2030.4131%2034.1006%2029.8204%2034.5543%2029.3956L35.419%2028.5882C36.0002%2028.0421%2036.3356%2027.2674%2036.3356%2026.474V21.6481C36.3356%2020.9013%2036.5625%2020.1779%2036.9972%2019.5618C37.0302%2019.5198%2037.0444%2019.4638%2037.0444%2019.4125V18.2737C37.0444%2017.5316%2037.2712%2016.8128%2037.6965%2016.2014L38.5517%2014.9739C38.5848%2014.9319%2038.599%2014.8806%2038.599%2014.8246V14.0545C38.6037%2013.9098%2038.5139%2013.8585%2038.4856%2013.8398ZM30.0843%2025.2838C30.6654%2025.3725%2031.1002%2025.6665%2031.1002%2026.0212C31.1002%2026.3759%2030.6702%2026.67%2030.0843%2026.7587V25.2838ZM5.22516%2032.4433L4.78572%2032.2146C3.59026%2031.5939%202.63577%2030.6698%201.9837%2029.545V28.1355C2.73028%2029.2043%203.74619%2030.1144%204.98891%2030.7631L5.22516%2030.8845V32.4433ZM7.43654%2033.5961L6.2647%2032.9894V31.4305L7.43182%2032.0373H7.43654V33.5961ZM12.3129%2034.6556L11.3868%2034.1422C10.8812%2033.8622%2010.3142%2033.7128%209.73297%2033.7035V32.0793C10.2197%2032.0886%2010.7016%2032.2146%2011.1269%2032.448L12.2751%2033.0827C12.2846%2033.0874%2012.2987%2033.0874%2012.3129%2033.0921V34.6556ZM18.4603%2035.0616V35.8551V36.0791C18.4603%2036.1304%2018.4367%2036.1818%2018.3989%2036.2191C18.3611%2036.2564%2018.3139%2036.2705%2018.2619%2036.2705C17.52%2036.2331%2017.0948%2036.0418%2016.7498%2035.8411C16.4994%2035.6964%2015.7528%2035.2483%2015.7481%2035.2483C15.2803%2034.9683%2014.7511%2034.8143%2014.2077%2034.7723V33.1387C14.6519%2033.1808%2015.0866%2033.3114%2015.474%2033.5401L16.1214%2033.9228C16.8302%2034.3429%2017.6382%2034.5809%2018.4603%2034.6276V35.0616ZM24.8582%2032.0886C24.7448%2032.084%2024.6267%2032.0653%2024.5133%2032.0326L23.6344%2031.7713C23.4454%2031.7152%2023.2517%2031.6966%2023.0579%2031.6966V30.0677C23.1997%2030.0677%2023.3414%2030.0817%2023.4832%2030.1237L24.3621%2030.3804C24.5227%2030.4271%2024.6928%2030.4504%2024.8582%2030.4598V32.0886ZM30.363%2032.4807C30.1929%2032.0886%2029.8574%2031.7759%2029.4275%2031.6592L28.5864%2031.4259C28.3879%2031.3652%2028.18%2031.3419%2027.9721%2031.3419V29.7177C28.1328%2029.713%2028.2934%2029.7317%2028.4493%2029.783L29.1392%2029.9977C29.8716%2030.2264%2030.363%2030.8891%2030.363%2031.6452V32.4807ZM32.787%2035.365C32.7729%2035.4117%2032.7634%2035.4584%2032.7492%2035.505C32.6028%2035.9624%2032.1775%2036.2658%2031.6955%2036.2658C31.653%2036.2658%2031.6105%2036.2564%2031.568%2036.2518V34.6323C31.601%2034.6369%2031.6294%2034.6416%2031.6625%2034.6416C32.135%2034.6416%2032.565%2034.3802%2032.7918%2033.9835V35.365H32.787ZM37.3232%2015.0486C36.794%2015.8047%2036.5152%2016.6915%2036.5152%2017.6109V18.4137L36.1041%2019.0017C35.5702%2019.7625%2035.2867%2020.6539%2035.2867%2021.578V25.6245C35.2867%2026.2779%2035.0126%2026.9173%2034.5306%2027.3654L33.6659%2028.1775C33.0847%2028.7236%2032.7634%2029.489%2032.787%2030.2824L32.7918%2030.4644C32.8248%2031.5146%2032.6878%2032.56%2032.3901%2033.5681C32.2956%2033.8902%2031.9932%2034.1142%2031.6577%2034.1142C31.2372%2034.1142%2030.8923%2033.7782%2030.8923%2033.3581V31.6452C30.8923%2030.6558%2030.2496%2029.7923%2029.2952%2029.4983L28.6053%2029.2836C28.2225%2029.1669%2027.8209%2029.1623%2027.4334%2029.2743L25.3544%2029.881C25.0803%2029.9604%2024.7873%2029.9604%2024.5133%2029.881L23.6344%2029.6243C23.1808%2029.489%2022.6894%2029.5217%2022.2547%2029.7083L20.4071%2030.5111C19.2258%2031.0245%2018.4651%2032.1773%2018.4651%2033.4515V34.1095C17.7374%2034.0675%2017.0286%2033.8528%2016.4002%2033.4795L15.7528%2033.0967C15.2047%2032.7747%2014.581%2032.602%2013.9431%2032.602H12.4736L11.3868%2031.9999C10.8717%2031.7152%2010.2905%2031.5659%209.69989%2031.5612L7.62082%2031.5472L5.23461%2030.3057C1.61514%2028.4249%200.0700101%2024.1917%201.64349%2020.4579L2.12073%2019.3238C2.47512%2018.4837%202.6594%2017.5922%202.6594%2016.6775V16.0427H3.17444C3.68476%2016.0427%204.11948%2015.6927%204.2376%2015.2213H22.1176C22.4153%2015.2213%2022.6894%2015.394%2022.8075%2015.6647L23.3414%2016.8455C23.5115%2017.2235%2023.8896%2017.4662%2024.3101%2017.4662C24.7259%2017.4662%2025.1087%2017.2235%2025.2788%2016.8455L25.8127%2015.66C25.9356%2015.3893%2026.2049%2015.2166%2026.5026%2015.2166H27.1452C27.424%2015.2166%2027.6791%2015.366%2027.8114%2015.6087C28.1375%2016.2061%2028.7234%2016.6075%2029.3897%2016.7148V24.145C28.317%2024.2617%2027.4949%2024.8918%2027.4949%2025.6572C27.4949%2026.5066%2028.4966%2027.1927%2029.7346%2027.1927C30.9726%2027.1927%2031.9743%2026.5066%2031.9743%2025.6572C31.9743%2024.8918%2031.1521%2024.257%2030.0795%2024.145V16.7101C30.7458%2016.6028%2031.3317%2016.2014%2031.6577%2015.604C31.79%2015.3613%2032.0452%2015.212%2032.324%2015.212H33.2785C33.7179%2015.212%2034.1195%2014.9926%2034.3605%2014.6286L35.7781%2012.4676C35.9624%2012.1829%2036.2789%2012.0149%2036.6239%2012.0149H37.0633C37.3752%2012.0149%2037.6303%2012.2669%2037.6303%2012.575V13.2424C37.6303%2013.5644%2037.7579%2013.8725%2037.98%2014.1012L37.3232%2015.0486ZM29.3849%2025.2838V26.7587C28.8037%2026.67%2028.3737%2026.3759%2028.3737%2026.0212C28.3737%2025.6665%2028.8037%2025.3678%2029.3849%2025.2838Z'%20fill='white'/%3e%3c/svg%3e",R1="data:image/svg+xml,%3csvg%20width='159'%20height='28'%20viewBox='0%200%20159%2028'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_6919_71839)'%3e%3cpath%20d='M4.13243%2025.9198C5.34921%2026.9052%207.05161%2027.0267%208.39597%2026.224L22.9838%2017.5138C25.4013%2016.0703%2025.4117%2012.5721%2023.0028%2011.1144L17.4686%207.76522C15.4767%206.55981%2012.8918%207.10053%2011.5501%209.00325L3.27399%2020.7399C2.14132%2022.3462%202.44805%2024.5556%203.97544%2025.7926L4.13243%2025.9198Z'%20stroke='white'%20style='stroke:white;stroke-opacity:1;'%20stroke-width='2.33333'/%3e%3cpath%20d='M4.11673%202.57147C5.33939%201.58127%207.0516%201.46387%208.39797%202.27791L22.9843%2011.0971C25.3835%2012.5477%2025.3874%2016.0265%2022.9914%2017.4824L17.5405%2020.7946C15.5485%2022.005%2012.9594%2021.4661%2011.6157%2019.5615L3.27518%207.7386C2.142%206.1323%202.44856%203.92248%203.97619%202.68529L4.11673%202.57147Z'%20stroke='white'%20style='stroke:white;stroke-opacity:1;'%20stroke-width='2.33333'/%3e%3cpath%20d='M49.8088%2020.0063C47.924%2020.0063%2046.7521%2018.7437%2046.7521%2016.6748V13.1359H50.1977V10.9296H46.7521V7.34668L44.2736%209.18483V10.9271H42.8892V13.1333H44.2736V16.6515C44.2736%2020.2137%2046.3632%2022.4174%2049.8321%2022.4174H50.361V20.0063H49.8088Z'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3cpath%20d='M30.4704%2019.5631L32.6818%2017.8339C33.6722%2019.4231%2035.01%2020.2761%2036.7159%2020.2761C38.5826%2020.2761%2039.757%2019.0783%2039.757%2017.5798C39.757%2015.8505%2037.9137%2015.2983%2035.977%2014.6761C33.6956%2013.9398%2031.23%2013.0168%2031.23%209.92907C31.23%207.37018%2033.5115%205.34277%2036.6226%205.34277C39.1815%205.34277%2040.7707%206.33314%2042.0618%207.83166L40.0111%209.35351C39.2515%208.17907%2038.1211%207.55685%2036.6226%207.55685C34.9167%207.55685%2033.8096%208.57055%2033.8096%209.88499C33.8096%2011.4976%2035.5856%2012.0291%2037.5196%2012.6746C39.8244%2013.4576%2042.3367%2014.4506%2042.3367%2017.585C42.3367%2020.1672%2040.2159%2022.6328%2036.7367%2022.6328C33.8563%2022.6328%2031.8963%2021.4117%2030.4678%2019.5683L30.4704%2019.5631Z'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3cpath%20d='M58.9189%2016.7007C58.9189%2013.3225%2061.5141%2010.6807%2064.8923%2010.6807C68.2704%2010.6807%2070.7982%2013.1384%2070.7982%2016.5399V17.5044H61.286C61.6075%2019.2725%2062.9867%2020.4444%2064.9856%2020.4444C66.5489%2020.4444%2067.7441%2019.6173%2068.3404%2018.3755L70.3627%2019.5007C69.3515%2021.3855%2067.5367%2022.6247%2064.9856%2022.6247C61.356%2022.6247%2058.9189%2020.0296%2058.9189%2016.6981V16.7007ZM61.4001%2015.4147H68.2938C67.9256%2013.7607%2066.663%2012.8403%2064.8923%2012.8403C63.1215%2012.8403%2061.8589%2013.8981%2061.4001%2015.4147Z'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3cpath%20d='M51.8955%2016.6752C51.8955%2013.113%2053.9851%2010.9326%2057.454%2010.9326H58.5559V13.323H57.4307C55.5459%2013.323%2054.33%2014.6322%2054.3533%2016.7011V22.423H51.8955V16.6804V16.6752Z'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3cpath%20d='M72.0138%2016.6774C72.0138%2013.3226%2074.6557%2010.7041%2077.9638%2010.7041C81.272%2010.7041%2083.8672%2013.3226%2083.8672%2016.6774V22.42H81.456V20.9267C80.6523%2022.0052%2079.4105%2022.6274%2077.8938%2022.6274C74.609%2022.6274%2072.0112%2020.0556%2072.0112%2016.6774H72.0138ZM81.5027%2016.6774C81.5027%2014.6319%2079.9394%2013.0011%2077.9638%2013.0011C75.9883%2013.0011%2074.4249%2014.6319%2074.4249%2016.6774C74.4249%2018.723%2075.9649%2020.3537%2077.9638%2020.3537C79.9627%2020.3537%2081.5027%2018.6997%2081.5027%2016.6774Z'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3cpath%20d='M85.4155%2015.978C85.4155%2012.9214%2087.5052%2010.6943%2090.6085%2010.6943C92.3766%2010.6943%2093.8026%2011.4073%2094.697%2012.6025C95.5474%2011.4073%2096.9266%2010.6943%2098.6948%2010.6943C101.819%2010.6943%20104.002%2012.8773%20104.002%2015.978V22.4103H101.544V16.0014C101.544%2014.2566%20100.372%2013.038%2098.6948%2013.038C97.0174%2013.038%2095.9155%2014.2799%2095.9389%2015.934V22.4129H93.4811V16.004C93.4811%2014.2592%2092.2859%2013.0406%2090.6085%2013.0406C88.9311%2013.0406%2087.8526%2014.2825%2087.8733%2015.9366V22.4154H85.4155V15.9832V15.978Z'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3cpath%20d='M105.578%205.6416H108.082V20.0227H114.859V22.4131H105.578V5.6416Z'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3cpath%20d='M138.483%2016.7007C138.483%2013.3225%20141.078%2010.6807%20144.456%2010.6807C147.834%2010.6807%20150.362%2013.1384%20150.362%2016.5399V17.5044H140.85C141.171%2019.2725%20142.551%2020.4444%20144.55%2020.4444C146.113%2020.4444%20147.308%2019.6173%20147.904%2018.3755L149.927%2019.5007C148.916%2021.3855%20147.101%2022.6247%20144.55%2022.6247C140.92%2022.6247%20138.483%2020.0296%20138.483%2016.6981V16.7007ZM140.964%2015.4147H147.858C147.49%2013.7607%20146.227%2012.8403%20144.456%2012.8403C142.685%2012.8403%20141.423%2013.8981%20140.964%2015.4147Z'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3cpath%20d='M115.269%2016.6774C115.269%2013.3226%20117.911%2010.7041%20121.219%2010.7041C124.527%2010.7041%20127.122%2013.3226%20127.122%2016.6774V22.42H124.711V20.9267C123.907%2022.0052%20122.665%2022.6274%20121.149%2022.6274C117.864%2022.6274%20115.266%2020.0556%20115.266%2016.6774H115.269ZM124.758%2016.6774C124.758%2014.6319%20123.194%2013.0011%20121.219%2013.0011C119.243%2013.0011%20117.68%2014.6319%20117.68%2016.6774C117.68%2018.723%20119.22%2020.3537%20121.219%2020.3537C123.218%2020.3537%20124.758%2018.6997%20124.758%2016.6774Z'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3cpath%20d='M131.67%2021.8547L126.915%2010.9658H129.557L132.912%2018.938L136.082%2010.9658H138.678L131.74%2027.7606H129.212L131.67%2021.8573V21.8547Z'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3cpath%20d='M151.897%2016.6674C151.897%2013.1052%20153.987%2010.9248%20157.455%2010.9248H158.557V13.3152H157.432C155.547%2013.3152%20154.331%2014.6244%20154.355%2016.6933V22.4152H151.897V16.6726V16.6674Z'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_6919_71839'%3e%3crect%20width='158.12'%20height='28'%20fill='white'%20style='fill:white;fill-opacity:1;'%20transform='translate(0.44043)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",F1=(i,t,n)=>i===t?"translateY(0px)":i>t?`translateY(${n}px)`:"translateY(-100%)",E1=({close:i,votedAnswer:t,mastersApp:n,correct:l,correctAnswerTitle:r,questionTitle:o,saveHeight:c,style:d,hiding:h})=>{const[y,j]=u.useState(1),v=u.useRef({});u.useEffect(()=>{const _=setInterval(()=>{j(x=>l&&x>4||!l&&x>3?x:++x)},3e3);return()=>clearInterval(_)},[l]),u.useEffect(()=>{var _,x;v.current[y]&&c(((x=(_=v.current[y])==null?void 0:_.getBoundingClientRect())==null?void 0:x.height)||A1)},[y,c]);const a=_=>x=>{v.current&&(v.current[_]=x)},p=_=>({transform:F1(_,y,d.height)}),m={...d};return n&&m.height&&typeof m.height=="number"&&(m.height+=32),e.jsx(w1,{style:d.height?m:{...d,paddingTop:0,paddingBottom:0},hiding:h,children:e.jsxs(b1,{style:{height:d.height,minHeight:d.height,backgroundColor:y>3?l?"var(--color-sdk-prediction-result-success-bg)":"var(--color-sdk-prediction-result-incorrect-bg)":"var(--color-primary-1)"},children:[e.jsx(I1,{step:y,correct:l}),n&&e.jsxs(H,{ref:a(1),style:p(1),children:[e.jsx("img",{alt:"sponsor-logo",src:q1}),e.jsx(o2,{children:"Featured Groups +"})]}),!n&&e.jsx(H,{ref:a(1),style:p(1),children:e.jsx("img",{alt:"sponsor-logo",src:R1})}),e.jsxs(H,{ref:a(2),style:p(2),children:[e.jsx(S,{children:"Prediction results are in!"}),n&&e.jsx(o2,{children:"Featured Groups +"})]}),e.jsxs(H,{ref:a(3),style:p(3),children:[e.jsx(S,{children:o}),e.jsx(F,{children:e.jsxs(E,{children:[e.jsx("span",{children:"Your Pick:"})," ",t==null?void 0:t.title]})})]}),l?e.jsxs(e.Fragment,{children:[e.jsxs(H,{ref:a(4),style:{...p(4),color:"var(--color-sdk-prediction-result-success-text)"},children:[e.jsxs(S,{children:["Congratulations!",e.jsx("br",{}),"You answered correctly."]}),e.jsxs(F,{children:[e.jsx(d2,{name:"selected"}),e.jsxs(E,{children:[e.jsx("span",{children:"Your Pick:"})," ",t==null?void 0:t.title]})]})]}),e.jsxs(H,{ref:a(5),style:{...p(5),color:"var(--color-sdk-prediction-result-success-text)"},children:[e.jsx(T1,{children:y===5&&e.jsx(I2.d,{delay:.5,prefix:"+",suffix:" points",value:t==null?void 0:t.points})}),e.jsxs(F,{children:[e.jsx(d2,{name:"selected"}),e.jsxs(E,{children:[e.jsx("span",{children:"Your Pick:"})," ",t==null?void 0:t.title]})]}),e.jsx(c2,{"data-a":"intr",onClick:i,children:e.jsx(p2,{name:"icon-cross"})})]})]}):e.jsxs(H,{ref:a(4),style:p(4),children:[e.jsxs(S,{style:{color:"var(--color-sdk-prediction-result-error-title)"},children:["Better luck next time!",e.jsx("br",{}),"Correct: ",r,"."]}),e.jsxs(F,{style:{color:"var(--color-sdk-prediction-result-error-subtitle)"},children:[e.jsx(z1,{name:"circleClose"}),e.jsxs(E,{children:[e.jsx("span",{children:"Your Pick:"})," ",t==null?void 0:t.title]})]}),e.jsx(c2,{"data-a":"intr",onClick:i,children:e.jsx(p2,{name:"icon-cross"})})]})]})})},B1=i=>{const[t,n]=u.useState(!1),[l,r]=u.useState(!1),o=u.useRef(null),c=u.useCallback(()=>{r(!0),o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{r(!1)},1e3)},[]),d=u.useCallback(async h=>{n(!0);const y=h.map(j=>new Promise((v,a)=>{const p=new Image;p.onload=()=>v(j),p.onerror=()=>a(),p.src=j}));await Promise.allSettled(y),n(!1)},[]);return u.useEffect(()=>{i&&(c(),d(i))},[i,c,d]),{loading:t,throttled:l}},M1=s.styled_default("div")({name:"Container",class:"cl51m2q",propsAsIs:!1}),N1=s.styled_default("img")({name:"Avatar",class:"a2yhhhr",propsAsIs:!1}),Z1=s.styled_default("div")({name:"AvatarPlaceholder",class:"a1dtxxlr",propsAsIs:!1}),O1=s.styled_default("div")({name:"Content",class:"c12clm3w",propsAsIs:!1}),W1=s.styled_default("span")({name:"Name",class:"n14lctn7",propsAsIs:!1}),G1=({avatar:i,name:t})=>e.jsxs(M1,{children:[i&&e.jsx(N1,{src:i}),!i&&e.jsx(Z1,{children:z.I(t||"")}),e.jsxs(O1,{children:[e.jsxs(W1,{children:[t," "]}),"is waiting for you!"]})]}),P1=s.styled_default("div")({name:"Container",class:"c1htq1lb",propsAsIs:!1}),D1=s.styled_default("div")({name:"Graphic",class:"gjyzpp7",propsAsIs:!1}),Q1=s.styled_default("img")({name:"GraphicImage",class:"g16mldgz",propsAsIs:!1}),U1=s.styled_default("div")({name:"Headline",class:"h69js65",propsAsIs:!1}),Y1=s.styled_default("div")({name:"TaglineContainer",class:"tmm7qmo",propsAsIs:!1}),K1=s.styled_default("div")({name:"Tagline",class:"t17knuw2",propsAsIs:!1}),J1=s.styled_default("div")({name:"Content",class:"c1b74psg",propsAsIs:!1}),X1=s.styled_default("div")({name:"StepsContainer",class:"s1y99ug7",propsAsIs:!1}),ee=s.styled_default("span")({name:"StepIndicator",class:"sgf3v5n",propsAsIs:!1}),se=s.styled_default("div")({name:"InvitingUserWrap",class:"i1sj6gn8",propsAsIs:!1}),te=({loading:i,steps:t,currentStep:n,inviterName:l})=>{const{headline:r,tagline:o}=t[n];return e.jsxs(P1,{children:[o&&e.jsx(Y1,{children:e.jsx(T.i,{loading:i,children:e.jsx(K1,{children:o})})}),e.jsxs(J1,{"data-welcome-screen":n===0,children:[e.jsx(D1,{children:e.jsx(T.i,{loading:i,children:t.map(({graphicSrc:c},d)=>e.jsx(Q1,{src:c,"data-active":n===d}))})}),r&&e.jsx(T.i,{loading:i,children:e.jsx(U1,{children:r})})]}),l&&n===0&&e.jsx(se,{children:e.jsx(G1,{name:l})}),e.jsx(X1,{style:i?{visibility:"hidden"}:{},children:Array.from({length:t.length}).map((c,d)=>e.jsx(ee,{"data-active":n===d},d))})]})},ie=s.styled_default("div")({name:"Container",class:"cm0bev",propsAsIs:!1}),ne=s.styled_default("div")({name:"Content",class:"ce7x737",propsAsIs:!1}),le=s.styled_default("div")({name:"Title",class:"tc2tor6",propsAsIs:!1}),ae=s.styled_default("div")({name:"RulesList",class:"r1k5klql",propsAsIs:!1}),re=s.styled_default("div")({name:"RulesItem",class:"r1tf3ft2",propsAsIs:!1}),oe=s.styled_default("div")({name:"RuleIcon",class:"rwpvg1k",propsAsIs:!1}),de=s.styled_default("div")({name:"RuleText",class:"rbxiag0",propsAsIs:!1}),ce=s.styled_default("button")({name:"TermsButton",class:"t6cyrry",propsAsIs:!1}),pe=({rules:i,rulesTitle:t,termsText:n,primaryColor:l,openTerms:r})=>e.jsxs(ie,{children:[e.jsxs(ne,{children:[e.jsx(le,{children:t}),e.jsx(ae,{children:i==null?void 0:i.map(({label:o,icon:c},d)=>e.jsxs(re,{children:[c&&e.jsx(oe,{style:{backgroundColor:l},children:e.jsx($.B1,{name:c,"data-icon":c})}),e.jsx(de,{children:o})]},d))})]}),n&&e.jsx(ce,{"data-a":"intr",onClick:r,children:"See Terms and Conditions"})]}),ue=s.styled_default("div")({name:"Container",class:"cj0g35h",propsAsIs:!1}),he=s.styled_default("div")({name:"Content",class:"c1xkhrbn",propsAsIs:!1}),Ce=s.styled_default("div")({name:"Title",class:"tifzb8b",propsAsIs:!1}),fe=s.styled_default("div")({name:"ScrollingText",class:"stduw5c",propsAsIs:!1}),me=({termsTitle:i,termsText:t})=>e.jsx(ue,{children:e.jsxs(he,{children:[e.jsx(Ce,{children:i}),e.jsx(fe,{children:t})]})}),_e=s.styled_default("button")({name:"SButton",class:"s1nve60q",propsAsIs:!1}),xe=s.styled_default("span")({name:"ButtonLabel",class:"b1xoswwx",propsAsIs:!1}),ye=({disabled:i,variant:t="primary",onClick:n,children:l,...r})=>e.jsx(_e,{"data-a":"intr",onClick:n,disabled:i,"data-variant":t,...r,children:e.jsx(xe,{children:l})}),ge=s.styled_default("div")({name:"Container",class:"c18uddbs",propsAsIs:!1}),ve=s.styled_default("div")({name:"Content",class:"cvcfjf6",propsAsIs:!1}),je=s.styled_default("div")({name:"OnboardingHeader",class:"o1ie27lw",propsAsIs:!1}),Ie=s.styled_default("button")({name:"CloseBtn",class:"c15cjkwi",propsAsIs:!1}),Ae=()=>$.B1,Le=s.styled_default(Ae())({name:"IconClose",class:"i1mavjt2",propsAsIs:!0}),we=s.styled_default("div")({name:"OnboardingFooter",class:"o1x0dyzv",propsAsIs:!1}),be=()=>ye,$e=s.styled_default(be())({name:"OnboardingActionBtn",class:"o1jfi9c3",propsAsIs:!0}),k={steps:!1,rules:!1,inviteCard:!1},Te=({gamification:i,steps:t,rules:n,rulesBtnLabel:l,rulesTitle:r,termsTitle:o,termsText:c,primaryColor:d,inviteLink:h,inviteCardTitle:y,inviteCardSubtext:j,inviteCardBtnLabel:v,loading:a,inviterName:p,sdk:m,onClose:_})=>{const[x,f]=u.useState(0),[C,A]=u.useState(!1),[g,w]=u.useState(k);u.useEffect(()=>{t!=null&&t.length?w({...k,steps:!0}):n!=null&&n.length?w({...k,rules:!0}):w({...k,inviteCard:!0})},[]);const _2=u.useMemo(()=>g.steps&&x===0?"Continue":g.rules?C||!l?"Got it":l:g.inviteCard?v||"Play Now":"Next",[g,x,C,l,v]),x2=u.useCallback(()=>{t!=null&&t.length&&x<t.length-1?f(B=>++B):n!=null&&n.length&&g.steps?w({...k,rules:!0}):g.rules&&w({...k,inviteCard:!0})},[x,t==null?void 0:t.length,n==null?void 0:n.length,g,f,w]),y2=async()=>{g.inviteCard?await i.onboardingStatus.submitInplay():g.rules&&C?A(!1):x2()};return u.useEffect(()=>{!a&&p&&m.inviteDisplayed()},[a,p,m]),e.jsx(r0,{children:({width:B,height:P})=>e.jsxs(ge,{style:{width:B,height:P,maxHeight:P},children:[e.jsx(je,{children:e.jsx(Ie,{"data-a":"intr",onClick:_,children:e.jsx(Le,{name:"icon-close-btn-gray"})})}),e.jsxs(ve,{children:[g.steps&&(t==null?void 0:t.length)&&e.jsx(te,{loading:a,steps:t,currentStep:x,inviterName:p}),g.rules&&!C&&e.jsx(pe,{rules:n,rulesTitle:r,termsText:c,primaryColor:d,openTerms:()=>A(!0)}),g.rules&&C&&e.jsx(me,{termsTitle:o,termsText:c}),g.inviteCard&&e.jsx(f2,{inviteLink:h,inviteCardTitle:y,inviteCardSubtext:j,primaryColor:d})]}),e.jsx(we,{children:e.jsx(T.i,{loading:a,style:{width:"100%"},children:e.jsx($e,{"data-a":"intr",onClick:y2,children:_2})})})]})})},He=s.styled_default("button")({name:"Container",class:"crkmfw1",propsAsIs:!1}),Ve=s.styled_default("div")({name:"Content",class:"c11awpy4",propsAsIs:!1}),ke=s.styled_default("span")({name:"Title",class:"t154z7mh",propsAsIs:!1}),ze=({title:i,onClick:t,className:n,style:l})=>e.jsx(He,{"data-a":"intr",onClick:t,className:n,style:l,children:e.jsxs(Ve,{"data-a":"intr",children:[e.jsx($.B1,{"data-a":"intr",name:"iconUp"}),i&&e.jsx(ke,{"data-a":"intr",children:i})]})});exports.D=E1;exports.I=B1;exports.M=f2;exports.T=s0;exports.T$1=C2;exports.createSingleStore=w2;exports.f=ze;exports.k=V0;exports.p=b2;exports.tn=Te;exports.w=s1;exports.z=J2;
@@ -1 +0,0 @@
1
- "use strict";function N(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{id:i.id||null,adId:i.adId||null,sequence:i.sequence||null,apiFramework:i.apiFramework||null,universalAdIds:[],creativeExtensions:[]}}const G=["ADCATEGORIES","ADCOUNT","ADPLAYHEAD","ADSERVINGID","ADTYPE","APIFRAMEWORKS","APPBUNDLE","ASSETURI","BLOCKEDADCATEGORIES","BREAKMAXADLENGTH","BREAKMAXADS","BREAKMAXDURATION","BREAKMINADLENGTH","BREAKMINDURATION","BREAKPOSITION","CLICKPOS","CLICKTYPE","CLIENTUA","CONTENTID","CONTENTPLAYHEAD","CONTENTURI","DEVICEIP","DEVICEUA","DOMAIN","EXTENSIONS","GDPRCONSENT","IFA","IFATYPE","INVENTORYSTATE","LATLONG","LIMITADTRACKING","MEDIAMIME","MEDIAPLAYHEAD","OMIDPARTNER","PAGEURL","PLACEMENTTYPE","PLAYERCAPABILITIES","PLAYERSIZE","PLAYERSTATE","PODSEQUENCE","REGULATIONS","SERVERSIDE","SERVERUA","TRANSACTIONID","UNIVERSALADID","VASTVERSIONS","VERIFICATIONVENDORS"];function w(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const r=[],a=M(i);!e.ERRORCODE||t.isCustomCode||/^[0-9]{3}$/.test(e.ERRORCODE)||(e.ERRORCODE=900),e.CACHEBUSTING=q(Math.round(1e8*Math.random())),e.TIMESTAMP=new Date().toISOString(),e.RANDOM=e.random=e.CACHEBUSTING;for(const s in e)e[s]=j(e[s]);for(const s in a){const o=a[s];typeof o=="string"&&r.push(B(o,e))}return r}function B(i,e){const t=(i=L(i,e)).match(/[^[\]]+(?=])/g);if(!t)return i;let r=t.filter(a=>G.indexOf(a)>-1);return r.length===0?i:(r=r.reduce((a,s)=>(a[s]=-1,a),{}),L(i,r))}function L(i,e){let t=i;for(const r in e){const a=e[r];t=t.replace(new RegExp("(?:\\[|%%)(".concat(r,")(?:\\]|%%)"),"g"),a)}return t}function M(i){return Array.isArray(i)?i.map(e=>e&&e.hasOwnProperty("url")?e.url:e):i}function C(i){return/^(https?:\/\/|\/\/)/.test(i)}function U(i,e){for(let t=0;t<e.length;t++)if(W(e[t],i))return!0;return!1}function W(i,e){if(i&&e){const t=Object.getOwnPropertyNames(i),r=Object.getOwnPropertyNames(e);return t.length===r.length&&i.id===e.id&&i.url===e.url}return!1}function j(i){return encodeURIComponent(i).replace(/[!'()*]/g,e=>"%".concat(e.charCodeAt(0).toString(16)))}function q(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:8;return i.toString().padStart(e,"0")}const f={track:function(i,e,t){w(i,e,t).forEach(r=>{typeof window<"u"&&window!==null&&(new Image().src=r)})},resolveURLTemplates:w,extractURLsFromTemplates:M,filterUrlTemplates:function(i){return i.reduce((e,t)=>{const r=t.url||t;return C(r)?e.validUrls.push(r):e.invalidUrls.push(r),e},{validUrls:[],invalidUrls:[]})},containsTemplateObject:U,isTemplateObjectEqual:W,encodeURIComponentRFC3986:j,replaceUrlMacros:B,isNumeric:function(i){return!isNaN(parseFloat(i))&&isFinite(i)},flatten:function i(e){return e.reduce((t,r)=>t.concat(Array.isArray(r)?i(r):r),[])},joinArrayOfUniqueTemplateObjs:function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];const t=Array.isArray(i)?i:[],r=Array.isArray(e)?e:[];return t.concat(r).reduce((a,s)=>(U(s,a)||a.push(s),a),[])},isValidTimeValue:function(i){return Number.isFinite(i)&&i>=-2},addLeadingZeros:q,isValidUrl:C,isBrowserEnvironment:function(){return typeof window<"u"},formatMacrosValues:function(i){return typeof i!="object"?i:JSON.stringify(i)}};function I(i){return["true","TRUE","True","1"].includes(i)}function Y(i){if(i==null)return-1;if(f.isNumeric(i))return parseInt(i);const e=i.split(":");if(e.length!==3)return-1;const t=e[2].split(".");let r=parseInt(t[0]);t.length===2&&(r+=parseFloat("0.".concat(t[1])));const a=parseInt(60*e[1]),s=parseInt(60*e[0]*60);return isNaN(s)||isNaN(a)||isNaN(r)||a>3600||r>60?-1:s+a+r}const l={childByName:function(i,e){return Array.from(i.childNodes).find(t=>t.nodeName===e)},childrenByName:function(i,e){return Array.from(i.childNodes).filter(t=>t.nodeName===e)},resolveVastAdTagURI:function(i,e){if(!e)return i;if(i.startsWith("//")){const{protocol:t}=location;return"".concat(t).concat(i)}if(!i.includes("://")){const t=e.slice(0,e.lastIndexOf("/"));return"".concat(t,"/").concat(i)}return i},parseBoolean:I,parseNodeText:function(i){return i&&(i.textContent||i.text||"").trim()},copyNodeAttribute:function(i,e,t){const r=e.getAttribute(i);r&&t.setAttribute(i,r)},parseAttributes:function(i){return Array.from(i.attributes).reduce((e,t)=>(e[t.nodeName]=t.nodeValue,e),{})},parseDuration:Y,getStandAloneAds:function(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]).filter(i=>!parseInt(i.sequence,10))},getSortedAdPods:function(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]).filter(i=>parseInt(i.sequence,10)).sort((i,e)=>i.sequence-e.sequence)},assignAttributes:function(i,e){i&&Array.from(i).forEach(t=>{let{nodeName:r,nodeValue:a}=t;if(r&&a&&e.hasOwnProperty(r)){let s=a;typeof e[r]=="boolean"&&(s=I(s)),e[r]=s}})},mergeWrapperAdData:function(i,e){var t;i.errorURLTemplates=e.errorURLTemplates.concat(i.errorURLTemplates),i.impressionURLTemplates=e.impressionURLTemplates.concat(i.impressionURLTemplates),i.extensions=e.extensions.concat(i.extensions),e.viewableImpression.length>0&&(i.viewableImpression=[...i.viewableImpression,...e.viewableImpression]),i.followAdditionalWrappers=e.followAdditionalWrappers,i.allowMultipleAds=e.allowMultipleAds,i.fallbackOnNoAd=e.fallbackOnNoAd;const r=(e.creatives||[]).filter(n=>n&&n.type==="companion"),a=r.reduce((n,c)=>((c.variations||[]).forEach(u=>{(u.companionClickTrackingURLTemplates||[]).forEach(d=>{f.containsTemplateObject(d,n)||n.push(d)})}),n),[]);i.creatives=r.concat(i.creatives);const s=e.videoClickTrackingURLTemplates&&e.videoClickTrackingURLTemplates.length,o=e.videoCustomClickURLTemplates&&e.videoCustomClickURLTemplates.length;if(i.creatives.forEach(n=>{if(e.trackingEvents&&e.trackingEvents[n.type])for(const c in e.trackingEvents[n.type]){const u=e.trackingEvents[n.type][c];Array.isArray(n.trackingEvents[c])||(n.trackingEvents[c]=[]),n.trackingEvents[c]=n.trackingEvents[c].concat(u)}n.type==="linear"&&(s&&(n.videoClickTrackingURLTemplates=n.videoClickTrackingURLTemplates.concat(e.videoClickTrackingURLTemplates)),o&&(n.videoCustomClickURLTemplates=n.videoCustomClickURLTemplates.concat(e.videoCustomClickURLTemplates)),!e.videoClickThroughURLTemplate||n.videoClickThroughURLTemplate!==null&&n.videoClickThroughURLTemplate!==void 0||(n.videoClickThroughURLTemplate=e.videoClickThroughURLTemplate)),n.type==="companion"&&a.length&&(n.variations||[]).forEach(c=>{c.companionClickTrackingURLTemplates=f.joinArrayOfUniqueTemplateObjs(c.companionClickTrackingURLTemplates,a)})}),e.adVerifications&&(i.adVerifications=i.adVerifications.concat(e.adVerifications)),e.blockedAdCategories&&(i.blockedAdCategories=i.blockedAdCategories.concat(e.blockedAdCategories)),(t=e.creatives)!==null&&t!==void 0&&t.length){const n=e.creatives.filter(c=>{var u;return((u=c.icons)===null||u===void 0?void 0:u.length)&&!c.mediaFiles.length});n.length&&(i.creatives=i.creatives.concat(n))}}};function Q(i,e){const t=function(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const{id:a,adId:s,sequence:o,apiFramework:n}=N(r);return{id:a,adId:s,sequence:o,apiFramework:n,type:"companion",required:null,variations:[]}}(e);return t.required=i.getAttribute("required")||null,t.variations=l.childrenByName(i,"Companion").map(r=>{const a=function(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{id:n.id||null,adType:"companionAd",width:n.width||0,height:n.height||0,assetWidth:n.assetWidth||null,assetHeight:n.assetHeight||null,expandedWidth:n.expandedWidth||null,expandedHeight:n.expandedHeight||null,apiFramework:n.apiFramework||null,adSlotId:n.adSlotId||null,pxratio:n.pxratio||"1",renderingMode:n.renderingMode||"default",staticResources:[],htmlResources:[],iframeResources:[],adParameters:null,altText:null,companionClickThroughURLTemplate:null,companionClickTrackingURLTemplates:[],trackingEvents:{}}}(l.parseAttributes(r));a.htmlResources=l.childrenByName(r,"HTMLResource").reduce((n,c)=>{const u=l.parseNodeText(c);return u?n.concat(u):n},[]),a.iframeResources=l.childrenByName(r,"IFrameResource").reduce((n,c)=>{const u=l.parseNodeText(c);return u?n.concat(u):n},[]),a.staticResources=l.childrenByName(r,"StaticResource").reduce((n,c)=>{const u=l.parseNodeText(c);return u?n.concat({url:u,creativeType:c.getAttribute("creativeType")||null}):n},[]),a.altText=l.parseNodeText(l.childByName(r,"AltText"))||null;const s=l.childByName(r,"TrackingEvents");s&&l.childrenByName(s,"Tracking").forEach(n=>{const c=n.getAttribute("event"),u=l.parseNodeText(n);c&&u&&(Array.isArray(a.trackingEvents[c])||(a.trackingEvents[c]=[]),a.trackingEvents[c].push(u))}),a.companionClickTrackingURLTemplates=l.childrenByName(r,"CompanionClickTracking").map(n=>({id:n.getAttribute("id")||null,url:l.parseNodeText(n)})),a.companionClickThroughURLTemplate=l.parseNodeText(l.childByName(r,"CompanionClickThrough"))||null;const o=l.childByName(r,"AdParameters");return o&&(a.adParameters={value:l.parseNodeText(o),xmlEncoded:o.getAttribute("xmlEncoded")||null}),a}),t}function X(i,e){let t;const r=function(){let c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const{id:u,adId:d,sequence:g,apiFramework:m}=N(c);return{id:u,adId:d,sequence:g,apiFramework:m,type:"linear",duration:0,skipDelay:null,mediaFiles:[],mezzanine:null,interactiveCreativeFile:null,closedCaptionFiles:[],videoClickThroughURLTemplate:null,videoClickTrackingURLTemplates:[],videoCustomClickURLTemplates:[],adParameters:null,icons:[],trackingEvents:{}}}(e);r.duration=l.parseDuration(l.parseNodeText(l.childByName(i,"Duration")));const a=i.getAttribute("skipoffset");if(a==null)r.skipDelay=null;else if(a.charAt(a.length-1)==="%"&&r.duration!==-1){const c=parseInt(a,10);r.skipDelay=r.duration*(c/100)}else r.skipDelay=l.parseDuration(a);const s=l.childByName(i,"VideoClicks");if(s){const c=l.childByName(s,"ClickThrough");r.videoClickThroughURLTemplate=c?{id:c.getAttribute("id")||null,url:l.parseNodeText(c)}:null,l.childrenByName(s,"ClickTracking").forEach(u=>{r.videoClickTrackingURLTemplates.push({id:u.getAttribute("id")||null,url:l.parseNodeText(u)})}),l.childrenByName(s,"CustomClick").forEach(u=>{r.videoCustomClickURLTemplates.push({id:u.getAttribute("id")||null,url:l.parseNodeText(u)})})}const o=l.childByName(i,"AdParameters");o&&(r.adParameters={value:l.parseNodeText(o),xmlEncoded:o.getAttribute("xmlEncoded")||null}),l.childrenByName(i,"TrackingEvents").forEach(c=>{l.childrenByName(c,"Tracking").forEach(u=>{let d=u.getAttribute("event");const g=l.parseNodeText(u);if(d&&g){if(d==="progress"){if(t=u.getAttribute("offset"),!t)return;d=t.charAt(t.length-1)==="%"?"progress-".concat(t):"progress-".concat(l.parseDuration(t))}Array.isArray(r.trackingEvents[d])||(r.trackingEvents[d]=[]),r.trackingEvents[d].push(g)}})}),l.childrenByName(i,"MediaFiles").forEach(c=>{l.childrenByName(c,"MediaFile").forEach(h=>{r.mediaFiles.push(function(p){const v={id:null,fileURL:null,fileSize:0,deliveryType:"progressive",mimeType:null,mediaType:null,codec:null,bitrate:0,minBitrate:0,maxBitrate:0,width:0,height:0,apiFramework:null,scalable:null,maintainAspectRatio:null};v.id=p.getAttribute("id"),v.fileURL=l.parseNodeText(p),v.deliveryType=p.getAttribute("delivery"),v.codec=p.getAttribute("codec"),v.mimeType=p.getAttribute("type"),v.mediaType=p.getAttribute("mediaType")||"2D",v.apiFramework=p.getAttribute("apiFramework"),v.fileSize=parseInt(p.getAttribute("fileSize")||0),v.bitrate=parseInt(p.getAttribute("bitrate")||0),v.minBitrate=parseInt(p.getAttribute("minBitrate")||0),v.maxBitrate=parseInt(p.getAttribute("maxBitrate")||0),v.width=parseInt(p.getAttribute("width")||0),v.height=parseInt(p.getAttribute("height")||0);const R=p.getAttribute("scalable");R&&typeof R=="string"&&(v.scalable=l.parseBoolean(R));const A=p.getAttribute("maintainAspectRatio");return A&&typeof A=="string"&&(v.maintainAspectRatio=l.parseBoolean(A)),v}(h))});const u=l.childByName(c,"InteractiveCreativeFile");u&&(r.interactiveCreativeFile=function(h){const p=function(){let v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{type:v.type||null,apiFramework:v.apiFramework||null,variableDuration:l.parseBoolean(v.variableDuration),fileURL:null}}(l.parseAttributes(h));return p.fileURL=l.parseNodeText(h),p}(u));const d=l.childByName(c,"ClosedCaptionFiles");d&&l.childrenByName(d,"ClosedCaptionFile").forEach(h=>{const p=function(){let v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{type:v.type||null,language:v.language||null,fileURL:null}}(l.parseAttributes(h));p.fileURL=l.parseNodeText(h),r.closedCaptionFiles.push(p)});const g=l.childByName(c,"Mezzanine"),m=function(h,p){const v={};let R=!1;return p.forEach(A=>{h&&h.getAttribute(A)?v[A]=h.getAttribute(A):R=!0}),R?null:v}(g,["delivery","type","width","height"]);if(m){const h={id:null,fileURL:null,delivery:null,codec:null,type:null,width:0,height:0,fileSize:0,mediaType:"2D"};h.id=g.getAttribute("id"),h.fileURL=l.parseNodeText(g),h.delivery=m.delivery,h.codec=g.getAttribute("codec"),h.type=m.type,h.width=parseInt(m.width,10),h.height=parseInt(m.height,10),h.fileSize=parseInt(g.getAttribute("fileSize"),10),h.mediaType=g.getAttribute("mediaType")||"2D",r.mezzanine=h}});const n=l.childByName(i,"Icons");return n&&l.childrenByName(n,"Icon").forEach(c=>{r.icons.push(function(u){const d={program:null,height:0,width:0,xPosition:0,yPosition:0,apiFramework:null,offset:null,duration:0,type:null,staticResource:null,htmlResource:null,iframeResource:null,pxratio:"1",iconClickThroughURLTemplate:null,iconClickTrackingURLTemplates:[],iconViewTrackingURLTemplate:null,iconClickFallbackImages:[],altText:null,hoverText:null};d.program=u.getAttribute("program"),d.height=parseInt(u.getAttribute("height")||0),d.width=parseInt(u.getAttribute("width")||0),d.xPosition=function(m){return["left","right"].indexOf(m)!==-1?m:parseInt(m||0)}(u.getAttribute("xPosition")),d.yPosition=function(m){return["top","bottom"].indexOf(m)!==-1?m:parseInt(m||0)}(u.getAttribute("yPosition")),d.apiFramework=u.getAttribute("apiFramework"),d.pxratio=u.getAttribute("pxratio")||"1",d.offset=l.parseDuration(u.getAttribute("offset")),d.duration=l.parseDuration(u.getAttribute("duration")),d.altText=u.getAttribute("altText"),d.hoverText=u.getAttribute("hoverText"),l.childrenByName(u,"HTMLResource").forEach(m=>{d.type=m.getAttribute("creativeType")||"text/html",d.htmlResource=l.parseNodeText(m)}),l.childrenByName(u,"IFrameResource").forEach(m=>{d.type=m.getAttribute("creativeType")||0,d.iframeResource=l.parseNodeText(m)}),l.childrenByName(u,"StaticResource").forEach(m=>{d.type=m.getAttribute("creativeType")||0,d.staticResource=l.parseNodeText(m)});const g=l.childByName(u,"IconClicks");if(g){d.iconClickThroughURLTemplate=l.parseNodeText(l.childByName(g,"IconClickThrough")),l.childrenByName(g,"IconClickTracking").forEach(h=>{d.iconClickTrackingURLTemplates.push({id:h.getAttribute("id")||null,url:l.parseNodeText(h)})});const m=l.childByName(g,"IconClickFallbackImages");m&&l.childrenByName(m,"IconClickFallbackImage").forEach(h=>{d.iconClickFallbackImages.push({url:l.parseNodeText(h)||null,width:h.getAttribute("width")||null,height:h.getAttribute("height")||null})})}return d.iconViewTrackingURLTemplate=l.parseNodeText(l.childByName(u,"IconViewTracking")),d}(c))}),r}function Z(i,e){const t=function(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const{id:a,adId:s,sequence:o,apiFramework:n}=N(r);return{id:a,adId:s,sequence:o,apiFramework:n,type:"nonlinear",variations:[],trackingEvents:{}}}(e);return l.childrenByName(i,"TrackingEvents").forEach(r=>{let a,s;l.childrenByName(r,"Tracking").forEach(o=>{a=o.getAttribute("event"),s=l.parseNodeText(o),a&&s&&(Array.isArray(t.trackingEvents[a])||(t.trackingEvents[a]=[]),t.trackingEvents[a].push(s))})}),l.childrenByName(i,"NonLinear").forEach(r=>{const a={id:null,width:0,height:0,expandedWidth:0,expandedHeight:0,scalable:!0,maintainAspectRatio:!0,minSuggestedDuration:0,apiFramework:"static",adType:"nonLinearAd",type:null,staticResource:null,htmlResource:null,iframeResource:null,nonlinearClickThroughURLTemplate:null,nonlinearClickTrackingURLTemplates:[],adParameters:null};a.id=r.getAttribute("id")||null,a.width=r.getAttribute("width"),a.height=r.getAttribute("height"),a.expandedWidth=r.getAttribute("expandedWidth"),a.expandedHeight=r.getAttribute("expandedHeight"),a.scalable=l.parseBoolean(r.getAttribute("scalable")),a.maintainAspectRatio=l.parseBoolean(r.getAttribute("maintainAspectRatio")),a.minSuggestedDuration=l.parseDuration(r.getAttribute("minSuggestedDuration")),a.apiFramework=r.getAttribute("apiFramework"),l.childrenByName(r,"HTMLResource").forEach(o=>{a.type=o.getAttribute("creativeType")||"text/html",a.htmlResource=l.parseNodeText(o)}),l.childrenByName(r,"IFrameResource").forEach(o=>{a.type=o.getAttribute("creativeType")||0,a.iframeResource=l.parseNodeText(o)}),l.childrenByName(r,"StaticResource").forEach(o=>{a.type=o.getAttribute("creativeType")||0,a.staticResource=l.parseNodeText(o)});const s=l.childByName(r,"AdParameters");s&&(a.adParameters={value:l.parseNodeText(s),xmlEncoded:s.getAttribute("xmlEncoded")||null}),a.nonlinearClickThroughURLTemplate=l.parseNodeText(l.childByName(r,"NonLinearClickThrough")),l.childrenByName(r,"NonLinearClickTracking").forEach(o=>{a.nonlinearClickTrackingURLTemplates.push({id:o.getAttribute("id")||null,url:l.parseNodeText(o)})}),t.variations.push(a)}),t}function x(i){const e=[];return i.forEach(t=>{const r=K(t);r&&e.push(r)}),e}function K(i){if(i.nodeName==="#comment")return null;const e={name:null,value:null,attributes:{},children:[]},t=i.attributes,r=i.childNodes;if(e.name=i.nodeName,i.attributes){for(const s in t)if(t.hasOwnProperty(s)){const o=t[s];o.nodeName&&o.nodeValue&&(e.attributes[o.nodeName]=o.nodeValue)}}for(const s in r)if(r.hasOwnProperty(s)){const o=K(r[s]);o&&e.children.push(o)}if(e.children.length===0||e.children.length===1&&["#cdata-section","#text"].indexOf(e.children[0].name)>=0){const s=l.parseNodeText(i);s!==""&&(e.value=s),e.children=[]}return(a=e).value===null&&Object.keys(a.attributes).length===0&&a.children.length===0?null:e;var a}function J(i){return i.getAttribute("AdID")||i.getAttribute("adID")||i.getAttribute("adId")||null}const y={Wrapper:{subElements:["VASTAdTagURI","Impression"]},BlockedAdCategories:{attributes:["authority"]},InLine:{subElements:["AdSystem","AdTitle","Impression","AdServingId","Creatives"]},Category:{attributes:["authority"]},Pricing:{attributes:["model","currency"]},Verification:{oneOfinLineResources:["JavaScriptResource","ExecutableResource"],attributes:["vendor"]},UniversalAdId:{attributes:["idRegistry"]},JavaScriptResource:{attributes:["apiFramework","browserOptional"]},ExecutableResource:{attributes:["apiFramework","type"]},Tracking:{attributes:["event"]},Creatives:{subElements:["Creative"]},Creative:{subElements:["UniversalAdId"]},Linear:{subElements:["MediaFiles","Duration"]},MediaFiles:{subElements:["MediaFile"]},MediaFile:{attributes:["delivery","type","width","height"]},Mezzanine:{attributes:["delivery","type","width","height"]},NonLinear:{oneOfinLineResources:["StaticResource","IFrameResource","HTMLResource"],attributes:["width","height"]},Companion:{oneOfinLineResources:["StaticResource","IFrameResource","HTMLResource"],attributes:["width","height"]},StaticResource:{attributes:["creativeType"]},Icons:{subElements:["Icon"]},Icon:{oneOfinLineResources:["StaticResource","IFrameResource","HTMLResource"]}};function S(i,e){if(!y[i.nodeName]||!y[i.nodeName].attributes)return;const t=y[i.nodeName].attributes.filter(r=>!i.getAttribute(r));t.length>0&&k({name:i.nodeName,parentName:i.parentNode.nodeName,attributes:t},e)}function V(i,e,t){const r=y[i.nodeName],a=!t&&i.nodeName!=="Wrapper";if(!(!r||a)){if(r.subElements){const s=r.subElements.filter(o=>!l.childByName(i,o));s.length>0&&k({name:i.nodeName,parentName:i.parentNode.nodeName,subElements:s},e)}!t||!r.oneOfinLineResources||r.oneOfinLineResources.some(s=>l.childByName(i,s))||k({name:i.nodeName,parentName:i.parentNode.nodeName,oneOfResources:r.oneOfinLineResources},e)}}function D(i){return i.children&&i.children.length!==0}function k(i,e){let{name:t,parentName:r,attributes:a,subElements:s,oneOfResources:o}=i,n="Element '".concat(t,"'");n+=a?" missing required attribute(s) '".concat(a.join(", "),"' "):s?" missing required sub element(s) '".concat(s.join(", "),"' "):o?" must provide one of the following '".concat(o.join(", "),"' "):" is empty",e("VAST-warning",{message:n,parentElement:r,specVersion:4.1})}const $={verifyRequiredValues:function i(e,t,r){if(e&&e.nodeName)if(e.nodeName==="InLine"&&(r=!0),S(e,t),D(e)){V(e,t,r);for(let a=0;a<e.children.length;a++)i(e.children[a],t,r)}else l.parseNodeText(e).length===0&&k({name:e.nodeName,parentName:e.parentNode.nodeName},t)},hasSubElements:D,emitMissingValueWarning:k,verifyRequiredAttributes:S,verifyRequiredSubElements:V};function ee(i,e){let{allowMultipleAds:t,followAdditionalWrappers:r}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const a=Array.from(i.childNodes).filter(s=>{const o=s.nodeName.toLowerCase();return o==="inline"||r!==!1&&o==="wrapper"});for(const s of a){if(l.copyNodeAttribute("id",i,s),l.copyNodeAttribute("sequence",i,s),l.copyNodeAttribute("adType",i,s),s.nodeName==="Wrapper")return{ad:re(s,e),type:"WRAPPER"};if(s.nodeName==="InLine")return{ad:te(s,e,{allowMultipleAds:t}),type:"INLINE"};const o=s.nodeName.toLowerCase();e("VAST-warning",{message:"<".concat(s.nodeName,o==="inline"?"> must be written <InLine>":"> must be written <Wrapper>"),wrongNode:s})}}function te(i,e){let{allowMultipleAds:t}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return t===!1&&i.getAttribute("sequence")?null:H(i,e)}function H(i,e){let t=[];e&&$.verifyRequiredValues(i,e);const r=Array.from(i.childNodes),a=function(){let s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{id:s.id||null,sequence:s.sequence||null,adType:s.adType||null,adServingId:null,categories:[],expires:null,viewableImpression:[],system:null,title:null,description:null,advertiser:null,pricing:null,survey:null,errorURLTemplates:[],impressionURLTemplates:[],creatives:[],extensions:[],adVerifications:[],blockedAdCategories:[],followAdditionalWrappers:!0,allowMultipleAds:!1,fallbackOnNoAd:null}}(l.parseAttributes(i));return r.forEach(s=>{switch(s.nodeName){case"Error":a.errorURLTemplates.push(l.parseNodeText(s));break;case"Impression":a.impressionURLTemplates.push({id:s.getAttribute("id")||null,url:l.parseNodeText(s)});break;case"Creatives":a.creatives=function(o){const n=[];return o.forEach(c=>{const u={id:c.getAttribute("id")||null,adId:J(c),sequence:c.getAttribute("sequence")||null,apiFramework:c.getAttribute("apiFramework")||null},d=[];let g;l.childrenByName(c,"UniversalAdId").forEach(h=>{const p={idRegistry:h.getAttribute("idRegistry")||"unknown",value:l.parseNodeText(h)};d.push(p)});const m=l.childByName(c,"CreativeExtensions");m&&(g=x(l.childrenByName(m,"CreativeExtension")));for(const h in c.childNodes){const p=c.childNodes[h];let v;switch(p.nodeName){case"Linear":v=X(p,u);break;case"NonLinearAds":v=Z(p,u);break;case"CompanionAds":v=Q(p,u)}v&&(d&&(v.universalAdIds=d),g&&(v.creativeExtensions=g),n.push(v))}}),n}(l.childrenByName(s,"Creative"));break;case"Extensions":{const o=l.childrenByName(s,"Extension");a.extensions=x(o),a.adVerifications.length||(t=function(n){let c=null,u=[];return n.some(d=>c=l.childByName(d,"AdVerifications")),c&&(u=O(l.childrenByName(c,"Verification"))),u}(o));break}case"AdVerifications":a.adVerifications=O(l.childrenByName(s,"Verification"));break;case"AdSystem":a.system={value:l.parseNodeText(s),version:s.getAttribute("version")||null};break;case"AdTitle":a.title=l.parseNodeText(s);break;case"AdServingId":a.adServingId=l.parseNodeText(s);break;case"Category":a.categories.push({authority:s.getAttribute("authority")||null,value:l.parseNodeText(s)});break;case"Expires":a.expires=parseInt(l.parseNodeText(s),10);break;case"ViewableImpression":a.viewableImpression.push(function(o){const n=(c,u)=>{const d=l.parseNodeText(u);return d&&c.push(d),c};return{id:o.getAttribute("id")||null,viewable:l.childrenByName(o,"Viewable").reduce(n,[]),notViewable:l.childrenByName(o,"NotViewable").reduce(n,[]),viewUndetermined:l.childrenByName(o,"ViewUndetermined").reduce(n,[])}}(s));break;case"Description":a.description=l.parseNodeText(s);break;case"Advertiser":a.advertiser={id:s.getAttribute("id")||null,value:l.parseNodeText(s)};break;case"Pricing":a.pricing={value:l.parseNodeText(s),model:s.getAttribute("model")||null,currency:s.getAttribute("currency")||null};break;case"Survey":a.survey={value:l.parseNodeText(s),type:s.getAttribute("type")||null};break;case"BlockedAdCategories":a.blockedAdCategories.push({authority:s.getAttribute("authority")||null,value:l.parseNodeText(s)})}}),t.length&&(a.adVerifications=a.adVerifications.concat(t)),a}function re(i,e){const t=H(i,e),r=i.getAttribute("followAdditionalWrappers"),a=i.getAttribute("allowMultipleAds"),s=i.getAttribute("fallbackOnNoAd");t.followAdditionalWrappers=!r||l.parseBoolean(r),t.allowMultipleAds=!!a&&l.parseBoolean(a),t.fallbackOnNoAd=s?l.parseBoolean(s):null;let o=l.childByName(i,"VASTAdTagURI");if(o?t.nextWrapperURL=l.parseNodeText(o):(o=l.childByName(i,"VASTAdTagURL"),o&&(t.nextWrapperURL=l.parseNodeText(l.childByName(o,"URL")))),t.creatives.forEach(n=>{if(["linear","nonlinear"].includes(n.type)){if(n.trackingEvents){t.trackingEvents||(t.trackingEvents={}),t.trackingEvents[n.type]||(t.trackingEvents[n.type]={});for(const c in n.trackingEvents){const u=n.trackingEvents[c];Array.isArray(t.trackingEvents[n.type][c])||(t.trackingEvents[n.type][c]=[]),u.forEach(d=>{t.trackingEvents[n.type][c].push(d)})}}n.videoClickTrackingURLTemplates&&(Array.isArray(t.videoClickTrackingURLTemplates)||(t.videoClickTrackingURLTemplates=[]),n.videoClickTrackingURLTemplates.forEach(c=>{t.videoClickTrackingURLTemplates.push(c)})),n.videoClickThroughURLTemplate&&(t.videoClickThroughURLTemplate=n.videoClickThroughURLTemplate),n.videoCustomClickURLTemplates&&(Array.isArray(t.videoCustomClickURLTemplates)||(t.videoCustomClickURLTemplates=[]),n.videoCustomClickURLTemplates.forEach(c=>{t.videoCustomClickURLTemplates.push(c)}))}}),t.nextWrapperURL)return t}function O(i){const e=[];return i.forEach(t=>{const r={resource:null,vendor:null,browserOptional:!1,apiFramework:null,type:null,parameters:null,trackingEvents:{}},a=Array.from(t.childNodes);l.assignAttributes(t.attributes,r),a.forEach(o=>{let{nodeName:n,textContent:c,attributes:u}=o;switch(n){case"JavaScriptResource":case"ExecutableResource":r.resource=c.trim(),l.assignAttributes(u,r);break;case"VerificationParameters":r.parameters=c.trim()}});const s=l.childByName(t,"TrackingEvents");s&&l.childrenByName(s,"Tracking").forEach(o=>{const n=o.getAttribute("event"),c=l.parseNodeText(o);n&&c&&(Array.isArray(r.trackingEvents[n])||(r.trackingEvents[n]=[]),r.trackingEvents[n].push(c))}),e.push(r)}),e}class _{constructor(){this._handlers=[]}on(e,t){if(typeof t!="function")throw new TypeError("The handler argument must be of type Function. Received type ".concat(typeof t));if(!e)throw new TypeError("The event argument must be of type String. Received type ".concat(typeof e));return this._handlers.push({event:e,handler:t}),this}once(e,t){return this.on(e,function(r,a,s){const o={fired:!1,wrapFn:void 0};function n(){o.fired||(r.off(a,o.wrapFn),o.fired=!0,s.bind(r)(...arguments))}return o.wrapFn=n,n}(this,e,t))}off(e,t){return this._handlers=this._handlers.filter(r=>r.event!==e||r.handler!==t),this}emit(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),a=1;a<t;a++)r[a-1]=arguments[a];let s=!1;return this._handlers.forEach(o=>{o.event==="*"&&(s=!0,o.handler(e,...r)),o.event===e&&(s=!0,o.handler(...r))}),s}removeAllListeners(e){return e?(this._handlers=this._handlers.filter(t=>t.event!==e),this):(this._handlers=[],this)}listenerCount(e){return this._handlers.filter(t=>t.event===e).length}listeners(e){return this._handlers.reduce((t,r)=>(r.event===e&&t.push(r.handler),t),[])}eventNames(){return this._handlers.map(e=>e.event)}}let F=0,E=0;const z=(i,e)=>{!i||!e||i<=0||e<=0||(E=(E*F+8*i/e)/++F)},ie={ERRORCODE:900,extensions:[]},P="VAST response version not supported";class ae extends _{constructor(){let{fetcher:e}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};super(),this.maxWrapperDepth=null,this.rootErrorURLTemplates=[],this.errorURLTemplates=[],this.remainingAds=[],this.parsingOptions={},this.fetcher=e||null,this.keepFailedAdPod=!1}trackVastError(e,t){for(var r=arguments.length,a=new Array(r>2?r-2:0),s=2;s<r;s++)a[s-2]=arguments[s];this.emit("VAST-error",Object.assign({},ie,t,...a)),f.track(e,t)}getErrorURLTemplates(){return this.rootErrorURLTemplates.concat(this.errorURLTemplates)}getEstimatedBitrate(){return E}initParsingStatus(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.maxWrapperDepth=e.wrapperLimit||10,this.parsingOptions={allowMultipleAds:e.allowMultipleAds},this.keepFailedAdPod=e.keepFailedAdPod||!1,this.rootURL="",this.resetParsingStatus(),z(e.byteLength,e.requestDuration)}resetParsingStatus(){this.errorURLTemplates=[],this.rootErrorURLTemplates=[],this.vastVersion=null}getRemainingAds(e){if(this.remainingAds.length===0)return Promise.reject(new Error("No more ads are available for the given VAST"));const t=e?this.remainingAds:[this.remainingAds.shift()];return this.errorURLTemplates=[],this.resolveAds(t,{wrapperDepth:0,url:this.rootURL}).then(r=>this.buildVASTResponse(r))}parseVAST(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.initParsingStatus(t),t.isRootVAST=!0,this.parse(e,t).then(r=>this.buildVASTResponse(r))}buildVASTResponse(e){const t=function(r){let{ads:a,errorURLTemplates:s,version:o}=r;return{ads:a||[],errorURLTemplates:s||[],version:o||null}}({ads:e,errorURLTemplates:this.getErrorURLTemplates(),version:this.vastVersion});return this.completeWrapperResolving(t),t}parseVastXml(e,t){let{isRootVAST:r=!1,url:a=null,wrapperDepth:s=0,allowMultipleAds:o,followAdditionalWrappers:n}=t;if(!e||!e.documentElement||e.documentElement.nodeName!=="VAST"){var c;this.emit("VAST-ad-parsed",{type:"ERROR",url:a,wrapperDepth:s});const m=(e==null||(c=e.documentElement)===null||c===void 0?void 0:c.nodeName)==="VideoAdServingTemplate";throw new Error(m?P:"Invalid VAST XMLDocument")}const u=[],d=e.documentElement.childNodes,g=e.documentElement.getAttribute("version");r&&g&&(this.vastVersion=g);for(const m in d){const h=d[m];if(h.nodeName==="Error"){const p=l.parseNodeText(h);r?this.rootErrorURLTemplates.push(p):this.errorURLTemplates.push(p)}else if(h.nodeName==="Ad"){if(this.vastVersion&&parseFloat(this.vastVersion)<3)o=!0;else if(o===!1&&u.length>1)break;const p=ee(h,this.emit.bind(this),{allowMultipleAds:o,followAdditionalWrappers:n});p.ad?(u.push(p.ad),this.emit("VAST-ad-parsed",{type:p.type,url:a,wrapperDepth:s,adIndex:u.length-1,vastVersion:g})):this.trackVastError(this.getErrorURLTemplates(),{ERRORCODE:101})}}return u}parse(e){let{url:t=null,resolveAll:r=!0,wrapperSequence:a=null,previousUrl:s=null,wrapperDepth:o=0,isRootVAST:n=!1,followAdditionalWrappers:c,allowMultipleAds:u}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},d=[];this.vastVersion&&parseFloat(this.vastVersion)<3&&n&&(u=!0);try{d=this.parseVastXml(e,{isRootVAST:n,url:t,wrapperDepth:o,allowMultipleAds:u,followAdditionalWrappers:c})}catch(g){return Promise.reject(g)}if(d.length===1&&a!=null&&(d[0].sequence=a),r===!1){const g=l.getSortedAdPods(d),m=l.getStandAloneAds(d);g.length?d=g:m.length&&(d=[m.shift()]),this.remainingAds=m}return this.resolveAds(d,{wrapperDepth:o,previousUrl:s,url:t})}resolveAds(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],{wrapperDepth:t,previousUrl:r,url:a}=arguments.length>1?arguments[1]:void 0;const s=[];return r=a,e.forEach(o=>{const n=this.resolveWrappers(o,t,r);s.push(n)}),Promise.all(s).then(o=>f.flatten(o))}resolveWrappers(e,t,r){const a={...e};return new Promise(s=>{var o;if(t++,!a.nextWrapperURL)return delete a.nextWrapperURL,s(a);if(!this.fetcher)return a.VASTAdTagURI=a.nextWrapperURL,delete a.nextWrapperURL,s(a);if(t>=this.maxWrapperDepth)return a.errorCode=302,delete a.nextWrapperURL,s(a);a.nextWrapperURL=l.resolveVastAdTagURI(a.nextWrapperURL,r);const n=(o=this.parsingOptions.allowMultipleAds)!==null&&o!==void 0?o:a.allowMultipleAds,c=a.sequence;this.fetcher.fetchVAST({url:a.nextWrapperURL,emitter:this.emit.bind(this),maxWrapperDepth:this.maxWrapperDepth}).then(u=>this.parse(u,{url:a.nextWrapperURL,previousUrl:r,wrapperSequence:c,wrapperDepth:t,followAdditionalWrappers:a.followAdditionalWrappers,allowMultipleAds:n}).then(d=>{if(delete a.nextWrapperURL,d.length===0)return a.creatives=[],s(a);d.forEach(g=>{g&&l.mergeWrapperAdData(g,a)}),s(d)})).catch(u=>{a.errorCode=u.message===P?102:301,a.errorMessage=u.message,s(a)})})}completeWrapperResolving(e){if(e.ads.length===0)this.trackVastError(e.errorURLTemplates,{ERRORCODE:303});else for(let t=e.ads.length-1;t>=0;t--){const r=e.ads[t],a=!r.creatives.some(s=>{var o,n;return((o=s.mediaFiles)===null||o===void 0?void 0:o.length)>0||((n=s.variations)===null||n===void 0?void 0:n.length)>0});!r.errorCode&&!a||r.VASTAdTagURI||(this.trackVastError(r.errorURLTemplates.concat(e.errorURLTemplates),{ERRORCODE:r.errorCode||303},{ERRORMESSAGE:r.errorMessage||""},{extensions:r.extensions},{system:r.system}),this.keepFailedAdPod&&r.sequence?r.hasFailed=!0:e.ads.splice(t,1))}}}let T=null;const se={data:{},length:0,getItem(i){return this.data[i]},setItem(i,e){this.data[i]=e,this.length=Object.keys(this.data).length},removeItem(i){delete this.data[i],this.length=Object.keys(this.data).length},clear(){this.data={},this.length=0}};class ne{constructor(){this.storage=this.initStorage()}initStorage(){if(T)return T;try{T=typeof window<"u"&&window!==null?window.localStorage||window.sessionStorage:null}catch{T=null}return T&&!this.isStorageDisabled(T)||(T=se,T.clear()),T}isStorageDisabled(e){const t="__VASTStorage__";try{if(e.setItem(t,t),e.getItem(t)!==t)return e.removeItem(t),!0}catch{return!0}return e.removeItem(t),!1}getItem(e){return this.storage.getItem(e)}setItem(e,t){return this.storage.setItem(e,t)}removeItem(e){return this.storage.removeItem(e)}clear(){return this.storage.clear()}}const b=12e4,oe={get:async function(i,e){try{const t=new AbortController,r=setTimeout(()=>{throw t.abort(),new Error("URLHandler: Request timed out after ".concat(e.timeout||b," ms (408)"))},e.timeout||b),a=await fetch(i,{...e,signal:t.signal,credentials:e.withCredentials?"include":"omit"}).finally(()=>{clearTimeout(r)}),s=function(o){return f.isBrowserEnvironment()&&window.location.protocol==="https:"&&o.url.includes("http://")?"URLHandler: Cannot go from HTTPS to HTTP.":o.status===200&&o.ok?null:"URLHandler: ".concat(o.statusText," (").concat(o.status,")")}(a);return s?{error:new Error(s),statusCode:a.status}:async function(o){const n=await o.text();let c;return c=f.isBrowserEnvironment()?new DOMParser:new(await Promise.resolve().then(()=>require("./index7.js")).then(u=>u.index)).DOMParser,{xml:c.parseFromString(n,"text/xml"),details:{byteLength:n.length,statusCode:o.status,rawXml:n}}}(a)}catch(t){return{error:t,statusCode:t.name==="AbortError"?408:null}}}};class le{constructor(){this.URLTemplateFilters=[]}setOptions(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.urlHandler=e.urlHandler||e.urlhandler||oe,this.fetchingOptions={...e.fetchOptions,timeout:e.timeout||b,withCredentials:!!e.withCredentials}}addURLTemplateFilter(e){typeof e=="function"&&this.URLTemplateFilters.push(e)}removeLastURLTemplateFilter(){this.URLTemplateFilters.pop()}countURLTemplateFilters(){return this.URLTemplateFilters.length}clearURLTemplateFilters(){this.URLTemplateFilters=[]}async fetchVAST(e){var t;let{url:r,maxWrapperDepth:a,emitter:s,wrapperDepth:o=0,previousUrl:n=null,wrapperAd:c=null}=e;const u=Date.now();this.URLTemplateFilters.forEach(m=>{r=m(r)}),s("VAST-resolving",{url:r,previousUrl:n,wrapperDepth:o,maxWrapperDepth:a,timeout:this.fetchingOptions.timeout,wrapperAd:c});const d=await this.urlHandler.get(r,this.fetchingOptions),g=Math.round(Date.now()-u);if(s("VAST-resolved",{url:r,previousUrl:n,wrapperDepth:o,error:(d==null?void 0:d.error)||null,duration:g,statusCode:(d==null?void 0:d.statusCode)||null,...d==null?void 0:d.details}),z(d==null||(t=d.details)===null||t===void 0?void 0:t.byteLength,g),d.error)throw new Error(d.error);return d.xml}}class ce{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:new ne;this.cappingFreeLunch=e,this.cappingMinimumTimeInterval=t,this.fetcher=new le,this.vastParser=new ae({fetcher:this.fetcher}),this.storage=r,this.lastSuccessfulAd===void 0&&(this.lastSuccessfulAd=0),this.totalCalls===void 0&&(this.totalCalls=0),this.totalCallsTimeout===void 0&&(this.totalCallsTimeout=0)}addURLTemplateFilter(e){this.fetcher.addURLTemplateFilter(e)}removeLastURLTemplateFilter(){this.fetcher.removeLastURLTemplateFilter()}countURLTemplateFilters(){return this.fetcher.countURLTemplateFilters()}clearURLTemplateFilters(){this.fetcher.clearURLTemplateFilters()}getParser(){return this.vastParser}get lastSuccessfulAd(){return this.storage.getItem("vast-client-last-successful-ad")}set lastSuccessfulAd(e){this.storage.setItem("vast-client-last-successful-ad",e)}get totalCalls(){return this.storage.getItem("vast-client-total-calls")}set totalCalls(e){this.storage.setItem("vast-client-total-calls",e)}get totalCallsTimeout(){return this.storage.getItem("vast-client-total-calls-timeout")}set totalCallsTimeout(e){this.storage.setItem("vast-client-total-calls-timeout",e)}hasRemainingAds(){return this.vastParser.remainingAds.length>0}getNextAds(e){return this.vastParser.getRemainingAds(e)}parseVAST(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.fetcher.setOptions(t),this.vastParser.parseVAST(e,t)}get(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=Date.now();return t.hasOwnProperty("resolveAll")||(t.resolveAll=!1),this.totalCallsTimeout<r?(this.totalCalls=1,this.totalCallsTimeout=r+36e5):this.totalCalls++,new Promise((a,s)=>{if(this.cappingFreeLunch>=this.totalCalls)return s(new Error("VAST call canceled – FreeLunch capping not reached yet ".concat(this.totalCalls,"/").concat(this.cappingFreeLunch)));const o=r-this.lastSuccessfulAd;if(o<0)this.lastSuccessfulAd=0;else if(o<this.cappingMinimumTimeInterval)return s(new Error("VAST call canceled – (".concat(this.cappingMinimumTimeInterval,")ms minimum interval reached")));this.vastParser.initParsingStatus(t),this.fetcher.setOptions(t),this.vastParser.rootURL=e,this.fetcher.fetchVAST({url:e,emitter:this.vastParser.emit.bind(this.vastParser),maxWrapperDepth:this.vastParser.maxWrapperDepth}).then(n=>(t.previousUrl=e,t.isRootVAST=!0,t.url=e,this.vastParser.parse(n,t).then(c=>{const u=this.vastParser.buildVASTResponse(c);a(u)}))).catch(n=>s(n))})}}class ue extends _{constructor(e,t,r){var a;let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null,o=arguments.length>4&&arguments[4]!==void 0&&arguments[4];super(),this.ad=t,this.creative=r,this.variation=s,this.muted=o,this.impressed=!1,this.skippable=!1,this.trackingEvents={},this.trackedProgressEvents=[],this.lastPercentage=0,this._alreadyTriggeredQuartiles={},this.emitAlwaysEvents=["creativeView","start","firstQuartile","midpoint","thirdQuartile","complete","resume","pause","rewind","skip","closeLinear","close"];for(const n in this.creative.trackingEvents){const c=this.creative.trackingEvents[n];this.trackingEvents[n]=c.slice(0)}this.viewableImpressionTrackers=((a=this.ad.viewableImpression)===null||a===void 0?void 0:a.reduce((n,c)=>(n.notViewable.push(...c.notViewable),n.viewUndetermined.push(...c.viewUndetermined),n.viewable.push(...c.viewable),n),{notViewable:[],viewUndetermined:[],viewable:[]}))||{},Object.entries(this.viewableImpressionTrackers).forEach(n=>{let[c,u]=n;u.length&&(this.trackingEvents[c]=u)}),function(n){return n.type==="linear"}(this.creative)?this._initLinearTracking():this._initVariationTracking(),e&&this.on("start",()=>{e.lastSuccessfulAd=Date.now()})}_initLinearTracking(){this.linear=!0,this.skipDelay=this.creative.skipDelay,this.setDuration(this.creative.duration),this.clickThroughURLTemplate=this.creative.videoClickThroughURLTemplate,this.clickTrackingURLTemplates=this.creative.videoClickTrackingURLTemplates}_initVariationTracking(){if(this.linear=!1,this.skipDelay=-1,this.variation){for(const e in this.variation.trackingEvents){const t=this.variation.trackingEvents[e];this.trackingEvents[e]?this.trackingEvents[e]=this.trackingEvents[e].concat(t.slice(0)):this.trackingEvents[e]=t.slice(0)}this.variation.adType==="nonLinearAd"?(this.clickThroughURLTemplate=this.variation.nonlinearClickThroughURLTemplate,this.clickTrackingURLTemplates=this.variation.nonlinearClickTrackingURLTemplates,this.setDuration(this.variation.minSuggestedDuration)):function(e){return e.adType==="companionAd"}(this.variation)&&(this.clickThroughURLTemplate=this.variation.companionClickThroughURLTemplate,this.clickTrackingURLTemplates=this.variation.companionClickTrackingURLTemplates)}}setDuration(e){f.isValidTimeValue(e)?(this.assetDuration=e,this.quartiles={firstQuartile:Math.round(25*this.assetDuration)/100,midpoint:Math.round(50*this.assetDuration)/100,thirdQuartile:Math.round(75*this.assetDuration)/100}):this.emit("TRACKER-error",{message:"the duration provided is not valid. duration: ".concat(e)})}setProgress(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2];if(!f.isValidTimeValue(e)||typeof t!="object")return void this.emit("TRACKER-error",{message:"One given setProgress parameter has the wrong type. progress: ".concat(e,", macros: ").concat(f.formatMacrosValues(t))});const a=this.skipDelay||-1;if(a===-1||this.skippable||(a>e?this.emit("skip-countdown",a-e):(this.skippable=!0,this.emit("skip-countdown",0))),this.assetDuration>0){const s=Math.round(e/this.assetDuration*100),o=[];if(e>0){o.push("start");for(let n=this.lastPercentage;n<s;n++)o.push("progress-".concat(n+1,"%"));o.push("progress-".concat(e));for(const n in this.quartiles)this.isQuartileReached(n,this.quartiles[n],e)&&(o.push(n),this._alreadyTriggeredQuartiles[n]=!0);this.lastPercentage=s}o.forEach(n=>{this.track(n,{macros:t,once:r})}),e<this.progress&&(this.track("rewind",{macros:t}),this.trackedProgressEvents&&this.trackedProgressEvents.splice(0))}this.progress=e}isQuartileReached(e,t,r){let a=!1;return t<=r&&!this._alreadyTriggeredQuartiles[e]&&(a=!0),a}setMuted(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};typeof e=="boolean"&&typeof t=="object"?(this.muted!==e&&this.track(e?"mute":"unmute",{macros:t}),this.muted=e):this.emit("TRACKER-error",{message:"One given setMuted parameter has the wrong type. muted: ".concat(e,", macros: ").concat(f.formatMacrosValues(t))})}setPaused(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};typeof e=="boolean"&&typeof t=="object"?(this.paused!==e&&this.track(e?"pause":"resume",{macros:t}),this.paused=e):this.emit("TRACKER-error",{message:"One given setPaused parameter has the wrong type. paused: ".concat(e,", macros: ").concat(f.formatMacrosValues(t))})}setFullscreen(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};typeof e=="boolean"&&typeof t=="object"?(this.fullscreen!==e&&this.track(e?"fullscreen":"exitFullscreen",{macros:t}),this.fullscreen=e):this.emit("TRACKER-error",{message:"One given setFullScreen parameter has the wrong type. fullscreen: ".concat(e,", macros: ").concat(f.formatMacrosValues(t))})}setExpand(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};typeof e=="boolean"&&typeof t=="object"?(this.expanded!==e&&(this.track(e?"expand":"collapse",{macros:t}),this.track(e?"playerExpand":"playerCollapse",{macros:t})),this.expanded=e):this.emit("TRACKER-error",{message:"One given setExpand parameter has the wrong type. expanded: ".concat(e,", macros: ").concat(f.formatMacrosValues(t))})}setSkipDelay(e){f.isValidTimeValue(e)?this.skipDelay=e:this.emit("TRACKER-error",{message:"setSkipDelay parameter does not have a valid value. duration: ".concat(e)})}trackImpression(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};typeof e=="object"?this.impressed||(this.impressed=!0,this.trackURLs(this.ad.impressionURLTemplates,e),this.track("creativeView",{macros:e})):this.emit("TRACKER-error",{message:"trackImpression parameter has the wrong type. macros: ".concat(e)})}trackViewableImpression(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];typeof e=="object"?this.track("viewable",{macros:e,once:t}):this.emit("TRACKER-error",{message:"trackViewableImpression given macros has the wrong type. macros: ".concat(e)})}trackNotViewableImpression(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];typeof e=="object"?this.track("notViewable",{macros:e,once:t}):this.emit("TRACKER-error",{message:"trackNotViewableImpression given macros has the wrong type. macros: ".concat(e)})}trackUndeterminedImpression(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];typeof e=="object"?this.track("viewUndetermined",{macros:e,once:t}):this.emit("TRACKER-error",{message:"trackUndeterminedImpression given macros has the wrong type. macros: ".concat(e)})}error(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];typeof e=="object"&&typeof t=="boolean"?this.trackURLs(this.ad.errorURLTemplates,e,{isCustomCode:t}):this.emit("TRACKER-error",{message:"One given error parameter has the wrong type. macros: ".concat(f.formatMacrosValues(e),", isCustomCode: ").concat(t)})}errorWithCode(e){let t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];typeof e=="string"&&typeof t=="boolean"?(this.error({ERRORCODE:e},t),console.log("The method errorWithCode is deprecated, please use vast tracker error method instead")):this.emit("TRACKER-error",{message:"One given errorWithCode parameter has the wrong type. errorCode: ".concat(e,", isCustomCode: ").concat(t)})}complete(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};typeof e=="object"?this.track("complete",{macros:e}):this.emit("TRACKER-error",{message:"complete given macros has the wrong type. macros: ".concat(e)})}notUsed(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};typeof e=="object"?(this.track("notUsed",{macros:e}),this.trackingEvents=[]):this.emit("TRACKER-error",{message:"notUsed given macros has the wrong type. macros: ".concat(e)})}otherAdInteraction(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};typeof e=="object"?this.track("otherAdInteraction",{macros:e}):this.emit("TRACKER-error",{message:"otherAdInteraction given macros has the wrong type. macros: ".concat(e)})}acceptInvitation(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};typeof e=="object"?this.track("acceptInvitation",{macros:e}):this.emit("TRACKER-error",{message:"acceptInvitation given macros has the wrong type. macros: ".concat(e)})}adExpand(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};typeof e=="object"?this.track("adExpand",{macros:e}):this.emit("TRACKER-error",{message:"adExpand given macros has the wrong type. macros: ".concat(e)})}adCollapse(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};typeof e=="object"?this.track("adCollapse",{macros:e}):this.emit("TRACKER-error",{message:"adCollapse given macros has the wrong type. macros: ".concat(e)})}minimize(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};typeof e=="object"?this.track("minimize",{macros:e}):this.emit("TRACKER-error",{message:"minimize given macros has the wrong type. macros: ".concat(e)})}verificationNotExecuted(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(typeof e!="string"||typeof t!="object")return void this.emit("TRACKER-error",{message:"One given verificationNotExecuted parameter has to wrong type. vendor: ".concat(e,", macros: ").concat(f.formatMacrosValues(t))});if(!this.ad||!this.ad.adVerifications||!this.ad.adVerifications.length)throw new Error("No adVerifications provided");if(!e)throw new Error("No vendor provided, unable to find associated verificationNotExecuted");const r=this.ad.adVerifications.find(s=>s.vendor===e);if(!r)throw new Error("No associated verification element found for vendor: ".concat(e));const a=r.trackingEvents;if(a&&a.verificationNotExecuted){const s=a.verificationNotExecuted;this.trackURLs(s,t),this.emit("verificationNotExecuted",{trackingURLTemplates:s})}}overlayViewDuration(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};typeof e=="string"&&typeof t=="object"?(t.ADPLAYHEAD=e,this.track("overlayViewDuration",{macros:t})):this.emit("TRACKER-error",{message:"One given overlayViewDuration parameters has the wrong type. formattedDuration: ".concat(e,", macros: ").concat(f.formatMacrosValues(t))})}close(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};typeof e=="object"?this.track(this.linear?"closeLinear":"close",{macros:e}):this.emit("TRACKER-error",{message:"close given macros has the wrong type. macros: ".concat(e)})}skip(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};typeof e=="object"?this.track("skip",{macros:e}):this.emit("TRACKER-error",{message:"skip given macros has the wrong type. macros: ".concat(e)})}load(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};typeof e=="object"?this.track("loaded",{macros:e}):this.emit("TRACKER-error",{message:"load given macros has the wrong type. macros: ".concat(e)})}click(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(e!==null&&typeof e!="string"||typeof t!="object")return void this.emit("TRACKER-error",{message:"One given click parameter has the wrong type. fallbackClickThroughURL: ".concat(e,", macros: ").concat(f.formatMacrosValues(t))});this.clickTrackingURLTemplates&&this.clickTrackingURLTemplates.length&&this.trackURLs(this.clickTrackingURLTemplates,t);const r=this.clickThroughURLTemplate||e,a={...t};if(r){this.progress&&(a.ADPLAYHEAD=this.progressFormatted());const s=f.resolveURLTemplates([r],a)[0];this.emit("clickthrough",s)}}trackProgressEvents(e,t,r){const a=parseFloat(e.split("-")[1]);Object.entries(this.trackingEvents).filter(s=>{let[o]=s;return o.startsWith("progress-")}).map(s=>{let[o,n]=s;return{name:o,time:parseFloat(o.split("-")[1]),urls:n}}).filter(s=>{let{time:o}=s;return o<=a&&o>this.progress}).forEach(s=>{let{name:o,urls:n}=s;!r&&this.trackedProgressEvents.includes(o)||(this.emit(o,{trackingURLTemplates:n}),this.trackURLs(n,t),r?delete this.trackingEvents[o]:this.trackedProgressEvents.push(o))})}track(e){let{macros:t={},once:r=!1}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(typeof t!="object")return void this.emit("TRACKER-error",{message:"track given macros has the wrong type. macros: ".concat(t)});e==="closeLinear"&&!this.trackingEvents[e]&&this.trackingEvents.close&&(e="close"),e.startsWith("progress-")&&!e.endsWith("%")&&this.trackProgressEvents(e,t,r);const a=this.trackingEvents[e],s=this.emitAlwaysEvents.indexOf(e)>-1;a?(this.emit(e,{trackingURLTemplates:a}),this.trackURLs(a,t)):s&&this.emit(e,null),r&&(delete this.trackingEvents[e],s&&this.emitAlwaysEvents.splice(this.emitAlwaysEvents.indexOf(e),1))}trackURLs(e){var t;let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const{validUrls:s,invalidUrls:o}=f.filterUrlTemplates(e);o.length&&this.emit("TRACKER-error",{message:"Provided urls are malformed. url: ".concat(o)});const n={...r};this.linear&&(this.creative&&this.creative.mediaFiles&&this.creative.mediaFiles[0]&&this.creative.mediaFiles[0].fileURL&&(n.ASSETURI=this.creative.mediaFiles[0].fileURL),this.progress&&(n.ADPLAYHEAD=this.progressFormatted())),(t=this.creative)!==null&&t!==void 0&&(t=t.universalAdIds)!==null&&t!==void 0&&t.length&&(n.UNIVERSALADID=this.creative.universalAdIds.map(c=>c.idRegistry.concat(" ",c.value)).join(",")),this.ad&&(this.ad.sequence&&(n.PODSEQUENCE=this.ad.sequence),this.ad.adType&&(n.ADTYPE=this.ad.adType),this.ad.adServingId&&(n.ADSERVINGID=this.ad.adServingId),this.ad.categories&&this.ad.categories.length&&(n.ADCATEGORIES=this.ad.categories.map(c=>c.value).join(",")),this.ad.blockedAdCategories&&this.ad.blockedAdCategories.length&&(n.BLOCKEDADCATEGORIES=this.ad.blockedAdCategories.map(c=>c.value).join(","))),f.track(s,n,a)}convertToTimecode(e){if(!f.isValidTimeValue(e))return"";const t=1e3*e,r=Math.floor(t/36e5),a=Math.floor(t/6e4%60),s=Math.floor(t/1e3%60),o=Math.floor(t%1e3);return"".concat(f.addLeadingZeros(r,2),":").concat(f.addLeadingZeros(a,2),":").concat(f.addLeadingZeros(s,2),".").concat(f.addLeadingZeros(o,3))}progressFormatted(){return this.convertToTimecode(this.progress)}}exports._=ce;exports.z=ue;
@@ -1 +0,0 @@
1
- "use strict";let n=[],i=0;const r=4;let s=o=>{let l=[],e={get(){return e.lc||e.listen(()=>{})(),e.value},lc:0,listen(t){return e.lc=l.push(t),()=>{for(let f=i+r;f<n.length;)n[f]===t?n.splice(f,r):f+=r;let u=l.indexOf(t);~u&&(l.splice(u,1),--e.lc||e.off())}},notify(t,u){let f=!n.length;for(let v of l)n.push(v,e.value,t,u);if(f){for(i=0;i<n.length;i+=r)n[i](n[i+1],n[i+2],n[i+3]);n.length=0}},off(){},set(t){let u=e.value;u!==t&&(e.value=t,e.notify(u))},subscribe(t){let u=e.listen(t);return t(e.value),u},value:o};return e},a=(o={})=>{let l=s(o);return l.setKey=function(e,t){let u=l.value;typeof t>"u"&&e in l.value?(l.value={...l.value},delete l.value[e],l.notify(u,e)):l.value[e]!==t&&(l.value={...l.value,[e]:t},l.notify(u,e))},l};exports.a=s;exports.i=a;
@@ -1,4 +0,0 @@
1
- "use strict";const e=require("react/jsx-runtime"),a=require("react"),s=require("./sl-types.js"),te=require("./index8.js"),$=require("./index5.js"),n=require("./useStreamLayerApp2.js"),xe=require("./index10.js"),Ie=require("./index4.js"),Le=s.styled_default("div")({name:"SDKContainer",class:"sopqfe6",propsAsIs:!1}),je=s.styled_default("div")({name:"SDKScrollContainer",class:"s102vcph",propsAsIs:!1}),ie=s.styled_default("div")({name:"SDKContentContainer",class:"s1meqjjv",propsAsIs:!1}),Be=()=>ie,oe=s.styled_default(Be())({name:"SDKWhiteContainer",class:"s1burm22",propsAsIs:!0}),Fe=()=>oe,We=s.styled_default(Fe())({name:"SDKSummaryContainer",class:"sm5r3j5",propsAsIs:!0}),Me=s.styled_default("div")({name:"TabsContainer",class:"tysxwr6",propsAsIs:!1}),Ye=()=>ie,ze=s.styled_default(Ye())({name:"LeaderboardContainer",class:"l9er3b1",propsAsIs:!0}),Ue=()=>oe,Ke=s.styled_default(Ue())({name:"TabsNavContainer",class:"t19dtrb3",propsAsIs:!0}),He=s.styled_default("div")({name:"UserSummaryContainer",class:"u1552n3j",propsAsIs:!1});var Ge=Object.defineProperty,Je=(t,i,o)=>i in t?Ge(t,i,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[i]=o,Xe=(t,i,o)=>Je(t,i+"",o);let Ze=class{constructor(){Xe(this,"observers",new Set)}subscribe(i){this.observers.add(i)}unsubscribe(i){this.observers.delete(i)}notify(i){this.observers.forEach(o=>o(i))}};const z=new Ze,es={hiding:!1,finished:!1},ve=()=>{const[t,i]=a.useState(es),o=a.useRef(null);a.useEffect(()=>{const u=m=>{i(m)};return z.subscribe(u),()=>{z.unsubscribe(u)}},[]);const c=a.useCallback(u=>{const m={hiding:!0,finished:!1};o.current&&clearTimeout(o.current),u!=null&&u.delay?o.current=setTimeout(()=>{z.notify(m)},u==null?void 0:u.delay):z.notify(m)},[]),r=a.useCallback(()=>{t.hiding&&(o.current=null,z.notify({hiding:!1,finished:!0}))},[t.hiding]);return{...t,runAnimation:c,onAnimationEnd:r}},ss=s.styled_default("div")({name:"Container",class:"c1pgyo67",propsAsIs:!1}),ts="sx17qu6",ns="h1692c5m",re=({children:t,style:i,className:o,enabled:c=!0,hiding:r,onAnimationEnd:u})=>e.jsx(ss,{style:i,className:s.cx_default(o,c&&ts,c&&r&&ns),onAnimationEnd:u,children:t}),is=()=>re,os=s.styled_default(is())({name:"GrowingContainer",class:"gck55ev",propsAsIs:!0}),Te=({children:t,style:i,enabled:o,animate:c,...r})=>{const u=a.useRef(null);return e.jsx(os,{...r,enabled:o&&c,style:{...i,...(()=>{const m=u==null?void 0:u.current,j=m&&window.getComputedStyle(m),b=j==null?void 0:j.getPropertyValue("height");return o?{height:c?b:0}:{}})()},children:e.jsx("div",{ref:u,children:t})})},rs=s.styled_default("div")({name:"Container",class:"c1gcvmcj",propsAsIs:!1}),as=s.styled_default("div")({name:"Title",class:"tnr592a",propsAsIs:!1}),ds=s.styled_default("div")({name:"Description",class:"d1e8jqpv",propsAsIs:!1}),ls=()=>$.B1,cs=s.styled_default(ls())({name:"Icon",class:"i1vs651k",propsAsIs:!0}),us=({icon:t,title:i,description:o})=>e.jsxs(rs,{children:[e.jsx(cs,{name:t}),e.jsx(as,{children:i}),e.jsx(ds,{children:o})]}),ps=()=>Te,ys=s.styled_default(ps())({name:"ShowInContainer",class:"s16sbdnm",propsAsIs:!0}),L=s.styled_default("div")({name:"FeedbackContainer",class:"fbhorgl",propsAsIs:!1}),pe="s1g20ja7",ms=s.styled_default("div")({name:"Container",class:"c455ozj",propsAsIs:!1}),hs=()=>$.B1,ye=s.styled_default(hs())({name:"IconPrediction",class:"i1913njx",propsAsIs:!0}),U=s.styled_default("div")({name:"FeedbackIconWrap",class:"fzfk69z",propsAsIs:!1}),G=s.styled_default("div")({name:"FeedbackHeader",class:"fx87qaj",propsAsIs:!1}),fs=s.styled_default("span")({name:"FeedbackTitle",class:"fvek9ew",propsAsIs:!1}),B=s.styled_default("span")({name:"FeedbackDescription",class:"f1kbtp09",propsAsIs:!1}),xs=s.styled_default("div")({name:"FeedbackTitleWrap",class:"f4i8rro",propsAsIs:!1}),Is=s.styled_default("div")({name:"FeedbackResultDescriptionWrap",class:"fqyssr",propsAsIs:!1}),js=()=>B,vs=s.styled_default(js())({name:"FeedbackDynamicDescription",class:"fyv794i",propsAsIs:!0}),Ts=()=>B,As=s.styled_default(Ts())({name:"FeedbackResultDescription",class:"f1jkj9vx",propsAsIs:!0}),ne=s.styled_default("div")({name:"FeedbackText",class:"f1pxh3a6",propsAsIs:!1}),Cs=s.styled_default("span")({name:"DynamicWrap",class:"d1afvufn",propsAsIs:!1}),$s=s.styled_default("div")({name:"EarlyFeedbackDescription",class:"eq8u24d",propsAsIs:!1}),me=({feedbackMessages:t,questionVotedCorrectly:i,questionVoted:o,questionType:c,hasCorrectAnswer:r,showExpiredNotification:u,showClosedNotificationTrivia:m,votedInCurrentRender:j,votedAfterQuestionClosed:b,voteErrorMessage:h,enteredAnActiveQuestion:d,marketClosed:g,percentsAnimated:C,votedAnswer:I,isEarlyPrediction:y,correctAnswer:_,onAnimationEnd:P})=>{const E=o&&(c===n.QuestionType.TRIVIA||c===n.QuestionType.PREDICTION),T=c===n.QuestionType.PREDICTION&&!r,q=g&&c===n.QuestionType.PREDICTION&&!o||c===n.QuestionType.PREDICTION&&b&&j&&d,Q=E&&T,S=E&&r,w=c===n.QuestionType.PREDICTION&&o&&j&&r,R=o&&c===n.QuestionType.POLL&&j,f=i?"correct":"incorrect",k=i?t==null?void 0:t.correctFeedback:t==null?void 0:t.incorrectFeedback;return u||m||Q||S||q||R||w||h?e.jsx(ys,{enabled:j,animate:!h&&u?!0:C,onAnimationEnd:P,children:e.jsxs(ms,{"data-prediction":T,children:[h&&!q&&e.jsxs(L,{children:[!y&&e.jsx(ye,{name:"questionExpired"}),e.jsx(B,{children:h})]}),!h&&u&&e.jsxs(L,{children:[!y&&e.jsx(U,{children:e.jsx($.B1,{name:"questionExpired"})}),e.jsxs("div",{children:[e.jsx(G,{children:e.jsx(B,{children:"Question Expired"})}),e.jsx(ne,{children:"You can still answer to see if you're correct, but no points are awarded for expired questions."})]})]}),!h&&m&&e.jsxs(L,{className:s.cx_default(pe),children:[e.jsx(U,{children:e.jsx($.B1,{name:"questionExpired"})}),e.jsxs("div",{children:[e.jsx(G,{children:e.jsx(B,{children:"Question Closed"})}),e.jsx(ne,{children:"This question was answered after the moderator closed the question. So the points for this answer won’t tally."})]})]}),q&&e.jsxs(L,{children:[!y&&e.jsx(U,{children:e.jsx($.B1,{name:"questionExpired"})}),e.jsxs("div",{children:[e.jsx(G,{children:e.jsx(B,{children:y?r?"The results are already in!":"Question is Closed":"Question Closed"})}),e.jsx(ne,{children:y?e.jsx($s,{children:r?`Correct: ${_==null?void 0:_.text}`:"Event affecting the outcome has occurred."}):"This event has already taken place, so the ability to make a prediction on its outcome is no longer available."})]})]}),!h&&Q&&e.jsxs(L,{children:[!y&&e.jsx(ye,{name:"icon-prediction"}),e.jsxs(vs,{children:["Your pick has been recorded. ",e.jsx(Cs,{children:"We’ll notify you of the result."})]})]}),!h&&R&&e.jsxs(L,{children:[!y&&e.jsx(U,{"data-feedback-type":"correct",children:e.jsx($.B1,{name:"correct"})}),e.jsx(B,{children:"Thanks for answering. Please stay tuned for the next question."})]}),!h&&(S||w)&&e.jsxs(L,{className:s.cx_default(m&&pe),children:[!y&&e.jsx(U,{"data-feedback-type":f,children:e.jsx($.B1,{name:f})}),e.jsx("div",{children:e.jsxs(G,{children:[y?e.jsx(xs,{children:f==="incorrect"?e.jsxs(e.Fragment,{children:[e.jsx("div",{children:"So close!"}),e.jsx("div",{children:"Better luck next time"})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{children:"That’s correct!"}),e.jsx("div",{children:"You chose wisely."})]})}):e.jsx(fs,{"data-feedback-type":f,children:k==null?void 0:k.title}),y?e.jsxs(Is,{children:[e.jsxs("div",{children:["Your pick: ",I==null?void 0:I.text]}),e.jsx("div",{children:f==="incorrect"?`Correct: ${_==null?void 0:_.text}`:""})]}):e.jsx(As,{children:k==null?void 0:k.description})]})})]})]})}):null},Es=s.styled_default("div")({name:"Container",class:"c1hygj0s",propsAsIs:!1}),bs=s.styled_default("div")({name:"Title",class:"t1r84tez",propsAsIs:!1}),gs=s.styled_default("div")({name:"Description",class:"d1aj1a7k",propsAsIs:!1}),ws=s.styled_default("div")({name:"AdditionalDescription",class:"ax09ezs",propsAsIs:!1}),_s=()=>$.B1,Ps=s.styled_default(_s())({name:"Icon",class:"inkrac",propsAsIs:!0}),Qs=({icon:t,title:i,description:o,additionalDescription:c})=>e.jsxs(Es,{children:[t&&e.jsx(Ps,{name:t}),e.jsx(bs,{children:i}),e.jsx(gs,{children:o}),c&&e.jsx(ws,{children:c})]}),Ae=s.styled_default("div")({name:"Container",class:"c14ielyq",propsAsIs:!1}),Rs=()=>je,qs=s.styled_default(Rs())({name:"QuestionScrollContainer",class:"q1tlqx57",propsAsIs:!0}),Ss=s.styled_default("div")({name:"TopShadow",class:"t1hq58md",propsAsIs:!1}),ks=s.styled_default("div")({name:"BottomShadow",class:"b1c8nxcx",propsAsIs:!1}),Ds=s.styled_default("div")({name:"SponsorLogo",class:"siozuc3",propsAsIs:!1}),Ce=s.styled_default("div")({name:"Content",class:"cpnc44r",propsAsIs:!1}),Os=s.styled_default("div")({name:"Title",class:"tq7p3w0",propsAsIs:!1}),Ns=s.styled_default("div")({name:"OptionsWrap",class:"o1jlfj9g",propsAsIs:!1}),$e=s.styled_default("div")({name:"Options",class:"o84pmnd",propsAsIs:!1}),Vs=()=>re,he=s.styled_default(Vs())({name:"AlertContainer",class:"a1dybjw9",propsAsIs:!0}),Ls=s.styled_default("div")({name:"EarlyPrediction",class:"e1l05ict",propsAsIs:!1}),Bs=()=>$.B1,Fs=s.styled_default(Bs())({name:"EarlyPredictionIcon",class:"ez9juex",propsAsIs:!0}),Ws=()=>$.B1,Ms=s.styled_default(Ws())({name:"SponsorIcon",class:"s8p4aob",propsAsIs:!0}),Ys=s.styled_default("button")({name:"ButtonContainer",class:"b1b6dl8t",propsAsIs:!1}),zs=s.styled_default("div")({name:"ButtonPctWrap",class:"b4iik8i",propsAsIs:!1}),Us=s.styled_default("div")({name:"ButtonPct",class:"b1gq1lnf",propsAsIs:!1}),Ks=s.styled_default("span")({name:"ButtonBody",class:"b1j65z51",propsAsIs:!1}),Hs=s.styled_default("div")({name:"IconContainer",class:"i19tpfua",propsAsIs:!1}),Gs=s.styled_default("div")({name:"IconWrap",class:"i1tubmma",propsAsIs:!1}),Ee=s.styled_default("img")({name:"Icon",class:"i1grrgwj",propsAsIs:!1}),Js=()=>Ee,Xs=s.styled_default(Js())({name:"IconDefault",class:"ibemyq8",propsAsIs:!0}),Zs=()=>Ee,et=s.styled_default(Zs())({name:"IconCircle",class:"i1dceht",propsAsIs:!0}),st=s.styled_default("span")({name:"Title",class:"t116q4vq",propsAsIs:!1}),tt=s.styled_default("span")({name:"Indicators",class:"i17ajcu2",propsAsIs:!1}),nt=s.styled_default("div")({name:"PtsWrap",class:"pu9kmlb",propsAsIs:!1}),it=s.styled_default("span")({name:"Pts",class:"p1j2j0s0",propsAsIs:!1}),ot=s.styled_default("span")({name:"Percentage",class:"p1mzj1sj",propsAsIs:!1}),rt=()=>$.B1,at=s.styled_default(rt())({name:"CheckIcon",class:"cichgz8",propsAsIs:!0}),fe={[n.QuestionImages.CENTERED]:t=>e.jsx(Xs,{"data-testid":"vote-icon",alt:"option-icon",src:t}),[n.QuestionImages.TRANSPARENT]:t=>e.jsx(Hs,{"data-testid":"vote-icon",children:e.jsx(Gs,{style:{backgroundImage:`url(${t})`}})}),[n.QuestionImages.ROUNDED]:t=>e.jsx(et,{"data-testid":"vote-icon",alt:"option-icon",src:t}),[n.QuestionImages.NONE]:()=>null,[n.QuestionImages.UNSET]:()=>null},dt=({questionType:t,hasCorrectAnswer:i,correct:o,youVoted:c,questionVoted:r})=>{if(t===n.QuestionType.POLL&&c)return"voted";if(t===n.QuestionType.PREDICTION){if(!i&&r)return c?"voted":"unset";if(i&&r)return c?o?"correct":"incorrect":"unset";if(c)return"correct"}return t===n.QuestionType.TRIVIA&&r&&c?o?"correct":"incorrect":"unset"},lt=({questionType:t,questionVoted:i,correct:o,hasCorrectAnswer:c,questionStatus:r})=>t===n.QuestionType.TRIVIA?i&&o:t===n.QuestionType.PREDICTION?i&&o&&c||r===n.QuestionStatus.RESOLVED&&o:!1,ct=xe.O(Ys),ut=t=>{var i;const{id:o,icon:c,text:r,percentageDecimal:u,points:m,onVote:j,markThatVoted:b,firstOption:h,onPercentsAnimated:d,youSelected:g,youVoted:C,questionVoted:I,imageMode:y,answerTimeExpired:_,questionStatus:P,isLoading:E,questionType:T,correct:q,hasCorrectAnswer:Q,marketClosed:S,isEarlyPrediction:w,isAd:R,webos:f}=t,[k,F]=a.useState(0),Y=dt(t),K=lt({questionType:T,questionVoted:I,correct:q,hasCorrectAnswer:Q,questionStatus:P}),D=S&&T===n.QuestionType.PREDICTION,O=I||D,J=T===n.QuestionType.PREDICTION&&!I&&!S&&!R,N=I&&!g&&Y!=="incorrect"&&!C;return a.useLayoutEffect(()=>{F(0),requestAnimationFrame(()=>{F(u)})},[u]),e.jsxs(ct,{value:o,webos:f,autoFocus:h,"data-selected":g,"data-answer-state":Y,disabled:I||E||_||D,"data-is-not-checked":N,"data-a":"intr",onClick:H=>{b(T===n.QuestionType.PREDICTION?S:P===n.QuestionStatus.RESOLVED),j(H)},"data-is-ad":R,children:[e.jsx(zs,{children:e.jsx(Us,{"data-answer-state":Y,"data-is-not-checked":N,style:{width:`${O?k:0}%`},onTransitionEnd:()=>{D||d==null||d()},"data-is-ad":R})}),e.jsxs(Ks,{"data-a":"intr",children:[c&&y&&((i=fe[y])==null?void 0:i.call(fe,c)),e.jsx(st,{"data-a":"intr",children:r}),J&&e.jsxs(nt,{children:[m,e.jsx(it,{children:"pts"})]}),O&&e.jsxs(tt,{children:[K&&e.jsx(at,{name:w?"selectedBetPack":"selected"}),e.jsx(ot,{children:e.jsx(Ie.d,{value:u,suffix:"%"})})]})]})]})},pt=()=>Te,yt=s.styled_default(pt())({name:"ShowInContainer",class:"sie6cqo",propsAsIs:!0}),mt=s.styled_default("div")({name:"WinBarContainer",class:"wgizw4u",propsAsIs:!1}),ht=s.styled_default("div")({name:"Content",class:"c1l3ucjp",propsAsIs:!1}),ft=s.styled_default("div")({name:"Title",class:"tx7j799",propsAsIs:!1}),xt=()=>$.B1,It=s.styled_default(xt())({name:"WinIcon",class:"w4lwuj0",propsAsIs:!0}),jt=s.styled_default("div")({name:"Points",class:"po9i64o",propsAsIs:!1}),vt=s.styled_default("span")({name:"PointsCount",class:"pe5g05h",propsAsIs:!1}),Tt=s.styled_default("span")({name:"PointsUnits",class:"p1hdtpmb",propsAsIs:!1}),At=({title:t,points:i,isPlayingTimer:o,isTimer:c,animatePoints:r,questionType:u,timerDuration:m,votedInCurrentRender:j,percentsAnimated:b,onTimerExpired:h})=>e.jsx(yt,{enabled:u===n.QuestionType.PREDICTION&&j,animate:b,children:e.jsxs(mt,{style:{justifyContent:u===n.QuestionType.PREDICTION?"center":"space-between"},children:[e.jsxs(ht,{children:[t&&e.jsx(ft,{children:t}),i!==void 0&&u!==n.QuestionType.POLL&&e.jsxs(e.Fragment,{children:[e.jsx(It,{name:"icon-trophy"}),e.jsxs(jt,{children:[e.jsx(vt,{children:r?e.jsx(Ie.d,{value:i,delay:.3}):i}),e.jsx(Tt,{children:"PTS"})]})]})]}),c&&u!==n.QuestionType.PREDICTION&&e.jsx(xe.L,{isPlaying:o,onTimerExpired:h,duration:m})]})}),Ct=(t,i)=>{switch(t){case"already_voted":return i===n.QuestionType.POLL?"You’ve already answered this question on another device.":"You’ve already answered this question on another device. So the points for this answer won't tally.";default:return"Something went wrong, please try again"}},$t=()=>e.jsx(Ae,{children:e.jsxs(Ce,{children:[e.jsx(te.i,{loading:!0,style:{height:"40px",borderRadius:"100px"}}),e.jsx(te.i,{loading:!0,style:{height:"24px",margin:"16px 0"}}),e.jsx($e,{children:Array.from({length:5}).map((t,i)=>e.jsx(te.i,{loading:!0,style:{height:"44px"}},i))})]})}),Et=({openedQuestion:t,isLoading:i,vote:o,close:c,isEarlyPrediction:r,mastersApp:u,webos:m})=>{var j,b;const h=t.subject,d=t.type,g=t.status,C=(j=t.options)==null?void 0:j.options,I=t.marketClosed,y=t.id,_=a.useRef(),P=a.useRef(),E=u?!1:(t==null?void 0:t.adUnit)===n.AdUnit.STANDART,[T,q]=a.useState(!1),[Q,S]=a.useState(!1),[w,R]=a.useState(!0),[f,k]=a.useState(!1),[F,Y]=a.useState(!1),[K,D]=a.useState(""),[O,J]=a.useState(""),[N,H]=a.useState(!1),[be,ge]=a.useState(!1),[ae,we]=a.useState(!1),{runAnimation:W,finished:de}=ve();a.useEffect(()=>{de&&c(y)},[c,de]),a.useEffect(()=>{d===n.QuestionType.PREDICTION?I&&R(!1):g===n.QuestionStatus.RESOLVED&&R(!1)},[]);const _e=a.useCallback(p=>{S(p),q(!0)},[]),Pe=a.useCallback(()=>{r&&q(!1)},[r]),X=a.useRef(!1),le=a.useCallback(()=>{P.current&&clearTimeout(P.current),P.current=setTimeout(()=>{we(!0),W({delay:5500})},4e3)},[W]),ce=a.useCallback(async p=>{if(!X.current&&(X.current=!0,y)){const A=p.currentTarget.value;D(A);try{await o(y,A),E&&le()}catch(M){J(Ct(M.message,d)),D(""),console.error("Error while voting",M),X.current=!1}}},[d,y,D,o,E,le]),Qe=a.useCallback(()=>{k(!0),W({delay:3500})},[W]),Re=a.useCallback(()=>{Y(!0),W({delay:3500})},[W]),l=t==null?void 0:t.answers.find(p=>p.youVoted===!0),v=a.useMemo(()=>!!(t!=null&&t.answers.find(p=>p.correct===!0)),[t]),x=a.useMemo(()=>t==null?void 0:t.answers.find(p=>p.correct===!0),[t]);a.useEffect(()=>{l&&T&&!be&&(_.current=setTimeout(Re,1e4),ge(!0))},[l]),a.useEffect(()=>()=>{clearTimeout(_.current),clearTimeout(P.current)},[]);const Z=a.useMemo(()=>t?t.answers.map(p=>{var A;return{...p,questionVoted:!!l,youSelected:K===p.id,isLoading:i,hasCorrectAnswer:v,questionType:t.type,answerTimeExpired:f,questionStatus:g,imageMode:(A=t.appearance)==null?void 0:A.images,onVote:ce}}):[],[v,f,i,t,l,g,ce,K]);a.useEffect(()=>{const p=Z.some(({percentageDecimal:M})=>M!==0),A=l&&d===n.QuestionType.PREDICTION;O&&(r||!p||I&&A)&&H(!0)},[Z,O,r,I,d,l]);const ue=C&&(C.case==="trivia"||C.case==="prediction")?C.value:void 0,V=g===n.QuestionStatus.RESOLVED&&d===n.QuestionType.TRIVIA&&!l&&!w,ee=d===n.QuestionType.TRIVIA&&Q,se=a.useMemo(()=>E?!1:d===n.QuestionType.PREDICTION?r?!1:!!(l&&!v||l&&v&&x!=null&&x.youVoted):!0,[d,l,v,x,r,E]),qe=a.useMemo(()=>{if(d===n.QuestionType.PREDICTION&&l&&(!v||v&&x!=null&&x.youVoted))return l.points;if(!(V||f))return l?l.correct?l.pointsEarned:0:x==null?void 0:x.points},[f,l,x,V,d,v]),Se=a.useMemo(()=>d===n.QuestionType.PREDICTION&&l?v?v&&x!=null&&x.youVoted?"You won":"":"To win":V||f?"Time expired":d===n.QuestionType.POLL?"Time remaining":l?"You won":"To win",[f,d,l,V,v,x]),ke=!se||se&&d===n.QuestionType.PREDICTION&&T&&!N,De=(d===n.QuestionType.TRIVIA||d===n.QuestionType.PREDICTION)&&l&&v&&(x==null?void 0:x.youVoted),Oe=l||V||ee||d===n.QuestionType.TRIVIA&&g===n.QuestionStatus.RESOLVED&&w,Ne=!r&&(f||F)||ae,Ve=()=>{const p=()=>d===n.QuestionType.TRIVIA?l!=null&&l.correct?`That's correct!
2
- You chose wisely.`:`So close!
3
- Better luck next time.`:d===n.QuestionType.POLL?`Thanks for answering.
4
- Please stay tuned for the next question.`:d===n.QuestionType.PREDICTION?"Stay tuned to see if your prediction was correct.":"",A=()=>d===n.QuestionType.TRIVIA?`Your Pick: ${x==null?void 0:x.text}`:d===n.QuestionType.POLL||d===n.QuestionType.PREDICTION?`Your Pick: ${l==null?void 0:l.text}`:"",M=()=>d===n.QuestionType.TRIVIA&&(C==null?void 0:C.case)==="trivia"?C==null?void 0:C.value.explanation:d===n.QuestionType.PREDICTION?h:"";return ae?e.jsx(he,{children:e.jsx(Qs,{title:p(),description:A(),...l!=null&&l.correct||d===n.QuestionType.POLL||d===n.QuestionType.PREDICTION?{icon:"icon-correct"}:{},...d===n.QuestionType.TRIVIA||d===n.QuestionType.PREDICTION?{additionalDescription:M()}:{}})}):!r&&(f||F)?e.jsx(he,{children:e.jsx(us,{icon:"icon-check-circle",title:"More to come...",description:F?e.jsxs(e.Fragment,{children:["Stay tuned for more questions ",e.jsx("br",{})," and insights."]}):e.jsxs(e.Fragment,{children:["Watch for additional enhanced stream ",e.jsx("br",{})," interactive experience."]})})}):null};return e.jsxs(qs,{children:[r&&e.jsx(Ss,{}),e.jsx(Ae,{style:r?{marginTop:"-40px"}:{},children:e.jsxs(Ce,{children:[!r&&!E&&e.jsx(me,{feedbackMessages:ue,questionVoted:!!l,questionVotedCorrectly:l==null?void 0:l.correct,questionType:d,hasCorrectAnswer:v,showExpiredNotification:V,showClosedNotificationTrivia:ee,votedInCurrentRender:T,votedAfterQuestionClosed:Q,enteredAnActiveQuestion:w,marketClosed:I,percentsAnimated:N,voteErrorMessage:O,votedAnswer:l}),se&&e.jsx(At,{title:Se,points:qe,onTimerExpired:Qe,questionType:t.type,isTimer:!i,isPlayingTimer:!l,animatePoints:De,timerDuration:Oe?0:Number(((b=t==null?void 0:t.appearance)==null?void 0:b.autoHideInterval)||"30"),votedInCurrentRender:T,percentsAnimated:N}),Ne?Ve():e.jsxs(e.Fragment,{children:[r&&e.jsxs(Ls,{children:[e.jsx(Fs,{name:"iconEarlyPrediction"}),"EARLY PREDICTION"]}),e.jsx(Os,{style:ke?{marginTop:0}:{},children:h}),r&&e.jsx(me,{feedbackMessages:ue,questionVoted:!!l,questionVotedCorrectly:l==null?void 0:l.correct,questionType:d,hasCorrectAnswer:v,showExpiredNotification:V,showClosedNotificationTrivia:ee,votedInCurrentRender:T,votedAfterQuestionClosed:Q,enteredAnActiveQuestion:w,marketClosed:I,percentsAnimated:N,voteErrorMessage:O,isEarlyPrediction:r,correctAnswer:x,votedAnswer:l,onAnimationEnd:Pe}),e.jsxs(Ns,{children:[e.jsx($e,{children:Z.sort((p,A)=>p.id>A.id?1:-1).map((p,A)=>e.jsx(ut,{...p,firstOption:A===0,markThatVoted:_e,onPercentsAnimated:()=>H(!0),votedAfterQuestionClosed:Q,enteredAnActiveQuestion:w,marketClosed:I,isEarlyPrediction:r,isAd:E,webos:m},p.id))}),r&&e.jsxs(e.Fragment,{children:[e.jsx(ks,{}),e.jsx(Ds,{children:e.jsx(Ms,{name:"mastersLogoWhite"})})]})]})]})]})})]})};exports.C=ze;exports.S=Ke;exports.S$1=ve;exports.a=oe;exports.c=je;exports.d=He;exports.ee=Et;exports.f=re;exports.l=Me;exports.m=We;exports.n=ie;exports.p=Le;exports.te=$t;
@@ -1 +0,0 @@
1
- "use strict";function N(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{id:i.id||null,adId:i.adId||null,sequence:i.sequence||null,apiFramework:i.apiFramework||null,universalAdIds:[],creativeExtensions:[]}}const G=["ADCATEGORIES","ADCOUNT","ADPLAYHEAD","ADSERVINGID","ADTYPE","APIFRAMEWORKS","APPBUNDLE","ASSETURI","BLOCKEDADCATEGORIES","BREAKMAXADLENGTH","BREAKMAXADS","BREAKMAXDURATION","BREAKMINADLENGTH","BREAKMINDURATION","BREAKPOSITION","CLICKPOS","CLICKTYPE","CLIENTUA","CONTENTID","CONTENTPLAYHEAD","CONTENTURI","DEVICEIP","DEVICEUA","DOMAIN","EXTENSIONS","GDPRCONSENT","IFA","IFATYPE","INVENTORYSTATE","LATLONG","LIMITADTRACKING","MEDIAMIME","MEDIAPLAYHEAD","OMIDPARTNER","PAGEURL","PLACEMENTTYPE","PLAYERCAPABILITIES","PLAYERSIZE","PLAYERSTATE","PODSEQUENCE","REGULATIONS","SERVERSIDE","SERVERUA","TRANSACTIONID","UNIVERSALADID","VASTVERSIONS","VERIFICATIONVENDORS"];function w(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const r=[],a=M(i);!e.ERRORCODE||t.isCustomCode||/^[0-9]{3}$/.test(e.ERRORCODE)||(e.ERRORCODE=900),e.CACHEBUSTING=q(Math.round(1e8*Math.random())),e.TIMESTAMP=new Date().toISOString(),e.RANDOM=e.random=e.CACHEBUSTING;for(const s in e)e[s]=j(e[s]);for(const s in a){const o=a[s];typeof o=="string"&&r.push(B(o,e))}return r}function B(i,e){const t=(i=L(i,e)).match(/[^[\]]+(?=])/g);if(!t)return i;let r=t.filter(a=>G.indexOf(a)>-1);return r.length===0?i:(r=r.reduce((a,s)=>(a[s]=-1,a),{}),L(i,r))}function L(i,e){let t=i;for(const r in e){const a=e[r];t=t.replace(new RegExp("(?:\\[|%%)(".concat(r,")(?:\\]|%%)"),"g"),a)}return t}function M(i){return Array.isArray(i)?i.map(e=>e&&e.hasOwnProperty("url")?e.url:e):i}function C(i){return/^(https?:\/\/|\/\/)/.test(i)}function U(i,e){for(let t=0;t<e.length;t++)if(W(e[t],i))return!0;return!1}function W(i,e){if(i&&e){const t=Object.getOwnPropertyNames(i),r=Object.getOwnPropertyNames(e);return t.length===r.length&&i.id===e.id&&i.url===e.url}return!1}function j(i){return encodeURIComponent(i).replace(/[!'()*]/g,e=>"%".concat(e.charCodeAt(0).toString(16)))}function q(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:8;return i.toString().padStart(e,"0")}const f={track:function(i,e,t){w(i,e,t).forEach(r=>{typeof window<"u"&&window!==null&&(new Image().src=r)})},resolveURLTemplates:w,extractURLsFromTemplates:M,filterUrlTemplates:function(i){return i.reduce((e,t)=>{const r=t.url||t;return C(r)?e.validUrls.push(r):e.invalidUrls.push(r),e},{validUrls:[],invalidUrls:[]})},containsTemplateObject:U,isTemplateObjectEqual:W,encodeURIComponentRFC3986:j,replaceUrlMacros:B,isNumeric:function(i){return!isNaN(parseFloat(i))&&isFinite(i)},flatten:function i(e){return e.reduce((t,r)=>t.concat(Array.isArray(r)?i(r):r),[])},joinArrayOfUniqueTemplateObjs:function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];const t=Array.isArray(i)?i:[],r=Array.isArray(e)?e:[];return t.concat(r).reduce((a,s)=>(U(s,a)||a.push(s),a),[])},isValidTimeValue:function(i){return Number.isFinite(i)&&i>=-2},addLeadingZeros:q,isValidUrl:C,isBrowserEnvironment:function(){return typeof window<"u"},formatMacrosValues:function(i){return typeof i!="object"?i:JSON.stringify(i)}};function I(i){return["true","TRUE","True","1"].includes(i)}function Y(i){if(i==null)return-1;if(f.isNumeric(i))return parseInt(i);const e=i.split(":");if(e.length!==3)return-1;const t=e[2].split(".");let r=parseInt(t[0]);t.length===2&&(r+=parseFloat("0.".concat(t[1])));const a=parseInt(60*e[1]),s=parseInt(60*e[0]*60);return isNaN(s)||isNaN(a)||isNaN(r)||a>3600||r>60?-1:s+a+r}const l={childByName:function(i,e){return Array.from(i.childNodes).find(t=>t.nodeName===e)},childrenByName:function(i,e){return Array.from(i.childNodes).filter(t=>t.nodeName===e)},resolveVastAdTagURI:function(i,e){if(!e)return i;if(i.startsWith("//")){const{protocol:t}=location;return"".concat(t).concat(i)}if(!i.includes("://")){const t=e.slice(0,e.lastIndexOf("/"));return"".concat(t,"/").concat(i)}return i},parseBoolean:I,parseNodeText:function(i){return i&&(i.textContent||i.text||"").trim()},copyNodeAttribute:function(i,e,t){const r=e.getAttribute(i);r&&t.setAttribute(i,r)},parseAttributes:function(i){return Array.from(i.attributes).reduce((e,t)=>(e[t.nodeName]=t.nodeValue,e),{})},parseDuration:Y,getStandAloneAds:function(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]).filter(i=>!parseInt(i.sequence,10))},getSortedAdPods:function(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]).filter(i=>parseInt(i.sequence,10)).sort((i,e)=>i.sequence-e.sequence)},assignAttributes:function(i,e){i&&Array.from(i).forEach(t=>{let{nodeName:r,nodeValue:a}=t;if(r&&a&&e.hasOwnProperty(r)){let s=a;typeof e[r]=="boolean"&&(s=I(s)),e[r]=s}})},mergeWrapperAdData:function(i,e){var t;i.errorURLTemplates=e.errorURLTemplates.concat(i.errorURLTemplates),i.impressionURLTemplates=e.impressionURLTemplates.concat(i.impressionURLTemplates),i.extensions=e.extensions.concat(i.extensions),e.viewableImpression.length>0&&(i.viewableImpression=[...i.viewableImpression,...e.viewableImpression]),i.followAdditionalWrappers=e.followAdditionalWrappers,i.allowMultipleAds=e.allowMultipleAds,i.fallbackOnNoAd=e.fallbackOnNoAd;const r=(e.creatives||[]).filter(n=>n&&n.type==="companion"),a=r.reduce((n,c)=>((c.variations||[]).forEach(u=>{(u.companionClickTrackingURLTemplates||[]).forEach(d=>{f.containsTemplateObject(d,n)||n.push(d)})}),n),[]);i.creatives=r.concat(i.creatives);const s=e.videoClickTrackingURLTemplates&&e.videoClickTrackingURLTemplates.length,o=e.videoCustomClickURLTemplates&&e.videoCustomClickURLTemplates.length;if(i.creatives.forEach(n=>{if(e.trackingEvents&&e.trackingEvents[n.type])for(const c in e.trackingEvents[n.type]){const u=e.trackingEvents[n.type][c];Array.isArray(n.trackingEvents[c])||(n.trackingEvents[c]=[]),n.trackingEvents[c]=n.trackingEvents[c].concat(u)}n.type==="linear"&&(s&&(n.videoClickTrackingURLTemplates=n.videoClickTrackingURLTemplates.concat(e.videoClickTrackingURLTemplates)),o&&(n.videoCustomClickURLTemplates=n.videoCustomClickURLTemplates.concat(e.videoCustomClickURLTemplates)),!e.videoClickThroughURLTemplate||n.videoClickThroughURLTemplate!==null&&n.videoClickThroughURLTemplate!==void 0||(n.videoClickThroughURLTemplate=e.videoClickThroughURLTemplate)),n.type==="companion"&&a.length&&(n.variations||[]).forEach(c=>{c.companionClickTrackingURLTemplates=f.joinArrayOfUniqueTemplateObjs(c.companionClickTrackingURLTemplates,a)})}),e.adVerifications&&(i.adVerifications=i.adVerifications.concat(e.adVerifications)),e.blockedAdCategories&&(i.blockedAdCategories=i.blockedAdCategories.concat(e.blockedAdCategories)),(t=e.creatives)!==null&&t!==void 0&&t.length){const n=e.creatives.filter(c=>{var u;return((u=c.icons)===null||u===void 0?void 0:u.length)&&!c.mediaFiles.length});n.length&&(i.creatives=i.creatives.concat(n))}}};function Q(i,e){const t=function(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const{id:a,adId:s,sequence:o,apiFramework:n}=N(r);return{id:a,adId:s,sequence:o,apiFramework:n,type:"companion",required:null,variations:[]}}(e);return t.required=i.getAttribute("required")||null,t.variations=l.childrenByName(i,"Companion").map(r=>{const a=function(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{id:n.id||null,adType:"companionAd",width:n.width||0,height:n.height||0,assetWidth:n.assetWidth||null,assetHeight:n.assetHeight||null,expandedWidth:n.expandedWidth||null,expandedHeight:n.expandedHeight||null,apiFramework:n.apiFramework||null,adSlotId:n.adSlotId||null,pxratio:n.pxratio||"1",renderingMode:n.renderingMode||"default",staticResources:[],htmlResources:[],iframeResources:[],adParameters:null,altText:null,companionClickThroughURLTemplate:null,companionClickTrackingURLTemplates:[],trackingEvents:{}}}(l.parseAttributes(r));a.htmlResources=l.childrenByName(r,"HTMLResource").reduce((n,c)=>{const u=l.parseNodeText(c);return u?n.concat(u):n},[]),a.iframeResources=l.childrenByName(r,"IFrameResource").reduce((n,c)=>{const u=l.parseNodeText(c);return u?n.concat(u):n},[]),a.staticResources=l.childrenByName(r,"StaticResource").reduce((n,c)=>{const u=l.parseNodeText(c);return u?n.concat({url:u,creativeType:c.getAttribute("creativeType")||null}):n},[]),a.altText=l.parseNodeText(l.childByName(r,"AltText"))||null;const s=l.childByName(r,"TrackingEvents");s&&l.childrenByName(s,"Tracking").forEach(n=>{const c=n.getAttribute("event"),u=l.parseNodeText(n);c&&u&&(Array.isArray(a.trackingEvents[c])||(a.trackingEvents[c]=[]),a.trackingEvents[c].push(u))}),a.companionClickTrackingURLTemplates=l.childrenByName(r,"CompanionClickTracking").map(n=>({id:n.getAttribute("id")||null,url:l.parseNodeText(n)})),a.companionClickThroughURLTemplate=l.parseNodeText(l.childByName(r,"CompanionClickThrough"))||null;const o=l.childByName(r,"AdParameters");return o&&(a.adParameters={value:l.parseNodeText(o),xmlEncoded:o.getAttribute("xmlEncoded")||null}),a}),t}function X(i,e){let t;const r=function(){let c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const{id:u,adId:d,sequence:g,apiFramework:m}=N(c);return{id:u,adId:d,sequence:g,apiFramework:m,type:"linear",duration:0,skipDelay:null,mediaFiles:[],mezzanine:null,interactiveCreativeFile:null,closedCaptionFiles:[],videoClickThroughURLTemplate:null,videoClickTrackingURLTemplates:[],videoCustomClickURLTemplates:[],adParameters:null,icons:[],trackingEvents:{}}}(e);r.duration=l.parseDuration(l.parseNodeText(l.childByName(i,"Duration")));const a=i.getAttribute("skipoffset");if(a==null)r.skipDelay=null;else if(a.charAt(a.length-1)==="%"&&r.duration!==-1){const c=parseInt(a,10);r.skipDelay=r.duration*(c/100)}else r.skipDelay=l.parseDuration(a);const s=l.childByName(i,"VideoClicks");if(s){const c=l.childByName(s,"ClickThrough");r.videoClickThroughURLTemplate=c?{id:c.getAttribute("id")||null,url:l.parseNodeText(c)}:null,l.childrenByName(s,"ClickTracking").forEach(u=>{r.videoClickTrackingURLTemplates.push({id:u.getAttribute("id")||null,url:l.parseNodeText(u)})}),l.childrenByName(s,"CustomClick").forEach(u=>{r.videoCustomClickURLTemplates.push({id:u.getAttribute("id")||null,url:l.parseNodeText(u)})})}const o=l.childByName(i,"AdParameters");o&&(r.adParameters={value:l.parseNodeText(o),xmlEncoded:o.getAttribute("xmlEncoded")||null}),l.childrenByName(i,"TrackingEvents").forEach(c=>{l.childrenByName(c,"Tracking").forEach(u=>{let d=u.getAttribute("event");const g=l.parseNodeText(u);if(d&&g){if(d==="progress"){if(t=u.getAttribute("offset"),!t)return;d=t.charAt(t.length-1)==="%"?"progress-".concat(t):"progress-".concat(l.parseDuration(t))}Array.isArray(r.trackingEvents[d])||(r.trackingEvents[d]=[]),r.trackingEvents[d].push(g)}})}),l.childrenByName(i,"MediaFiles").forEach(c=>{l.childrenByName(c,"MediaFile").forEach(h=>{r.mediaFiles.push(function(p){const v={id:null,fileURL:null,fileSize:0,deliveryType:"progressive",mimeType:null,mediaType:null,codec:null,bitrate:0,minBitrate:0,maxBitrate:0,width:0,height:0,apiFramework:null,scalable:null,maintainAspectRatio:null};v.id=p.getAttribute("id"),v.fileURL=l.parseNodeText(p),v.deliveryType=p.getAttribute("delivery"),v.codec=p.getAttribute("codec"),v.mimeType=p.getAttribute("type"),v.mediaType=p.getAttribute("mediaType")||"2D",v.apiFramework=p.getAttribute("apiFramework"),v.fileSize=parseInt(p.getAttribute("fileSize")||0),v.bitrate=parseInt(p.getAttribute("bitrate")||0),v.minBitrate=parseInt(p.getAttribute("minBitrate")||0),v.maxBitrate=parseInt(p.getAttribute("maxBitrate")||0),v.width=parseInt(p.getAttribute("width")||0),v.height=parseInt(p.getAttribute("height")||0);const R=p.getAttribute("scalable");R&&typeof R=="string"&&(v.scalable=l.parseBoolean(R));const A=p.getAttribute("maintainAspectRatio");return A&&typeof A=="string"&&(v.maintainAspectRatio=l.parseBoolean(A)),v}(h))});const u=l.childByName(c,"InteractiveCreativeFile");u&&(r.interactiveCreativeFile=function(h){const p=function(){let v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{type:v.type||null,apiFramework:v.apiFramework||null,variableDuration:l.parseBoolean(v.variableDuration),fileURL:null}}(l.parseAttributes(h));return p.fileURL=l.parseNodeText(h),p}(u));const d=l.childByName(c,"ClosedCaptionFiles");d&&l.childrenByName(d,"ClosedCaptionFile").forEach(h=>{const p=function(){let v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{type:v.type||null,language:v.language||null,fileURL:null}}(l.parseAttributes(h));p.fileURL=l.parseNodeText(h),r.closedCaptionFiles.push(p)});const g=l.childByName(c,"Mezzanine"),m=function(h,p){const v={};let R=!1;return p.forEach(A=>{h&&h.getAttribute(A)?v[A]=h.getAttribute(A):R=!0}),R?null:v}(g,["delivery","type","width","height"]);if(m){const h={id:null,fileURL:null,delivery:null,codec:null,type:null,width:0,height:0,fileSize:0,mediaType:"2D"};h.id=g.getAttribute("id"),h.fileURL=l.parseNodeText(g),h.delivery=m.delivery,h.codec=g.getAttribute("codec"),h.type=m.type,h.width=parseInt(m.width,10),h.height=parseInt(m.height,10),h.fileSize=parseInt(g.getAttribute("fileSize"),10),h.mediaType=g.getAttribute("mediaType")||"2D",r.mezzanine=h}});const n=l.childByName(i,"Icons");return n&&l.childrenByName(n,"Icon").forEach(c=>{r.icons.push(function(u){const d={program:null,height:0,width:0,xPosition:0,yPosition:0,apiFramework:null,offset:null,duration:0,type:null,staticResource:null,htmlResource:null,iframeResource:null,pxratio:"1",iconClickThroughURLTemplate:null,iconClickTrackingURLTemplates:[],iconViewTrackingURLTemplate:null,iconClickFallbackImages:[],altText:null,hoverText:null};d.program=u.getAttribute("program"),d.height=parseInt(u.getAttribute("height")||0),d.width=parseInt(u.getAttribute("width")||0),d.xPosition=function(m){return["left","right"].indexOf(m)!==-1?m:parseInt(m||0)}(u.getAttribute("xPosition")),d.yPosition=function(m){return["top","bottom"].indexOf(m)!==-1?m:parseInt(m||0)}(u.getAttribute("yPosition")),d.apiFramework=u.getAttribute("apiFramework"),d.pxratio=u.getAttribute("pxratio")||"1",d.offset=l.parseDuration(u.getAttribute("offset")),d.duration=l.parseDuration(u.getAttribute("duration")),d.altText=u.getAttribute("altText"),d.hoverText=u.getAttribute("hoverText"),l.childrenByName(u,"HTMLResource").forEach(m=>{d.type=m.getAttribute("creativeType")||"text/html",d.htmlResource=l.parseNodeText(m)}),l.childrenByName(u,"IFrameResource").forEach(m=>{d.type=m.getAttribute("creativeType")||0,d.iframeResource=l.parseNodeText(m)}),l.childrenByName(u,"StaticResource").forEach(m=>{d.type=m.getAttribute("creativeType")||0,d.staticResource=l.parseNodeText(m)});const g=l.childByName(u,"IconClicks");if(g){d.iconClickThroughURLTemplate=l.parseNodeText(l.childByName(g,"IconClickThrough")),l.childrenByName(g,"IconClickTracking").forEach(h=>{d.iconClickTrackingURLTemplates.push({id:h.getAttribute("id")||null,url:l.parseNodeText(h)})});const m=l.childByName(g,"IconClickFallbackImages");m&&l.childrenByName(m,"IconClickFallbackImage").forEach(h=>{d.iconClickFallbackImages.push({url:l.parseNodeText(h)||null,width:h.getAttribute("width")||null,height:h.getAttribute("height")||null})})}return d.iconViewTrackingURLTemplate=l.parseNodeText(l.childByName(u,"IconViewTracking")),d}(c))}),r}function Z(i,e){const t=function(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const{id:a,adId:s,sequence:o,apiFramework:n}=N(r);return{id:a,adId:s,sequence:o,apiFramework:n,type:"nonlinear",variations:[],trackingEvents:{}}}(e);return l.childrenByName(i,"TrackingEvents").forEach(r=>{let a,s;l.childrenByName(r,"Tracking").forEach(o=>{a=o.getAttribute("event"),s=l.parseNodeText(o),a&&s&&(Array.isArray(t.trackingEvents[a])||(t.trackingEvents[a]=[]),t.trackingEvents[a].push(s))})}),l.childrenByName(i,"NonLinear").forEach(r=>{const a={id:null,width:0,height:0,expandedWidth:0,expandedHeight:0,scalable:!0,maintainAspectRatio:!0,minSuggestedDuration:0,apiFramework:"static",adType:"nonLinearAd",type:null,staticResource:null,htmlResource:null,iframeResource:null,nonlinearClickThroughURLTemplate:null,nonlinearClickTrackingURLTemplates:[],adParameters:null};a.id=r.getAttribute("id")||null,a.width=r.getAttribute("width"),a.height=r.getAttribute("height"),a.expandedWidth=r.getAttribute("expandedWidth"),a.expandedHeight=r.getAttribute("expandedHeight"),a.scalable=l.parseBoolean(r.getAttribute("scalable")),a.maintainAspectRatio=l.parseBoolean(r.getAttribute("maintainAspectRatio")),a.minSuggestedDuration=l.parseDuration(r.getAttribute("minSuggestedDuration")),a.apiFramework=r.getAttribute("apiFramework"),l.childrenByName(r,"HTMLResource").forEach(o=>{a.type=o.getAttribute("creativeType")||"text/html",a.htmlResource=l.parseNodeText(o)}),l.childrenByName(r,"IFrameResource").forEach(o=>{a.type=o.getAttribute("creativeType")||0,a.iframeResource=l.parseNodeText(o)}),l.childrenByName(r,"StaticResource").forEach(o=>{a.type=o.getAttribute("creativeType")||0,a.staticResource=l.parseNodeText(o)});const s=l.childByName(r,"AdParameters");s&&(a.adParameters={value:l.parseNodeText(s),xmlEncoded:s.getAttribute("xmlEncoded")||null}),a.nonlinearClickThroughURLTemplate=l.parseNodeText(l.childByName(r,"NonLinearClickThrough")),l.childrenByName(r,"NonLinearClickTracking").forEach(o=>{a.nonlinearClickTrackingURLTemplates.push({id:o.getAttribute("id")||null,url:l.parseNodeText(o)})}),t.variations.push(a)}),t}function x(i){const e=[];return i.forEach(t=>{const r=K(t);r&&e.push(r)}),e}function K(i){if(i.nodeName==="#comment")return null;const e={name:null,value:null,attributes:{},children:[]},t=i.attributes,r=i.childNodes;if(e.name=i.nodeName,i.attributes){for(const s in t)if(t.hasOwnProperty(s)){const o=t[s];o.nodeName&&o.nodeValue&&(e.attributes[o.nodeName]=o.nodeValue)}}for(const s in r)if(r.hasOwnProperty(s)){const o=K(r[s]);o&&e.children.push(o)}if(e.children.length===0||e.children.length===1&&["#cdata-section","#text"].indexOf(e.children[0].name)>=0){const s=l.parseNodeText(i);s!==""&&(e.value=s),e.children=[]}return(a=e).value===null&&Object.keys(a.attributes).length===0&&a.children.length===0?null:e;var a}function J(i){return i.getAttribute("AdID")||i.getAttribute("adID")||i.getAttribute("adId")||null}const y={Wrapper:{subElements:["VASTAdTagURI","Impression"]},BlockedAdCategories:{attributes:["authority"]},InLine:{subElements:["AdSystem","AdTitle","Impression","AdServingId","Creatives"]},Category:{attributes:["authority"]},Pricing:{attributes:["model","currency"]},Verification:{oneOfinLineResources:["JavaScriptResource","ExecutableResource"],attributes:["vendor"]},UniversalAdId:{attributes:["idRegistry"]},JavaScriptResource:{attributes:["apiFramework","browserOptional"]},ExecutableResource:{attributes:["apiFramework","type"]},Tracking:{attributes:["event"]},Creatives:{subElements:["Creative"]},Creative:{subElements:["UniversalAdId"]},Linear:{subElements:["MediaFiles","Duration"]},MediaFiles:{subElements:["MediaFile"]},MediaFile:{attributes:["delivery","type","width","height"]},Mezzanine:{attributes:["delivery","type","width","height"]},NonLinear:{oneOfinLineResources:["StaticResource","IFrameResource","HTMLResource"],attributes:["width","height"]},Companion:{oneOfinLineResources:["StaticResource","IFrameResource","HTMLResource"],attributes:["width","height"]},StaticResource:{attributes:["creativeType"]},Icons:{subElements:["Icon"]},Icon:{oneOfinLineResources:["StaticResource","IFrameResource","HTMLResource"]}};function S(i,e){if(!y[i.nodeName]||!y[i.nodeName].attributes)return;const t=y[i.nodeName].attributes.filter(r=>!i.getAttribute(r));t.length>0&&k({name:i.nodeName,parentName:i.parentNode.nodeName,attributes:t},e)}function V(i,e,t){const r=y[i.nodeName],a=!t&&i.nodeName!=="Wrapper";if(!(!r||a)){if(r.subElements){const s=r.subElements.filter(o=>!l.childByName(i,o));s.length>0&&k({name:i.nodeName,parentName:i.parentNode.nodeName,subElements:s},e)}!t||!r.oneOfinLineResources||r.oneOfinLineResources.some(s=>l.childByName(i,s))||k({name:i.nodeName,parentName:i.parentNode.nodeName,oneOfResources:r.oneOfinLineResources},e)}}function D(i){return i.children&&i.children.length!==0}function k(i,e){let{name:t,parentName:r,attributes:a,subElements:s,oneOfResources:o}=i,n="Element '".concat(t,"'");n+=a?" missing required attribute(s) '".concat(a.join(", "),"' "):s?" missing required sub element(s) '".concat(s.join(", "),"' "):o?" must provide one of the following '".concat(o.join(", "),"' "):" is empty",e("VAST-warning",{message:n,parentElement:r,specVersion:4.1})}const $={verifyRequiredValues:function i(e,t,r){if(e&&e.nodeName)if(e.nodeName==="InLine"&&(r=!0),S(e,t),D(e)){V(e,t,r);for(let a=0;a<e.children.length;a++)i(e.children[a],t,r)}else l.parseNodeText(e).length===0&&k({name:e.nodeName,parentName:e.parentNode.nodeName},t)},hasSubElements:D,emitMissingValueWarning:k,verifyRequiredAttributes:S,verifyRequiredSubElements:V};function ee(i,e){let{allowMultipleAds:t,followAdditionalWrappers:r}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const a=Array.from(i.childNodes).filter(s=>{const o=s.nodeName.toLowerCase();return o==="inline"||r!==!1&&o==="wrapper"});for(const s of a){if(l.copyNodeAttribute("id",i,s),l.copyNodeAttribute("sequence",i,s),l.copyNodeAttribute("adType",i,s),s.nodeName==="Wrapper")return{ad:re(s,e),type:"WRAPPER"};if(s.nodeName==="InLine")return{ad:te(s,e,{allowMultipleAds:t}),type:"INLINE"};const o=s.nodeName.toLowerCase();e("VAST-warning",{message:"<".concat(s.nodeName,o==="inline"?"> must be written <InLine>":"> must be written <Wrapper>"),wrongNode:s})}}function te(i,e){let{allowMultipleAds:t}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return t===!1&&i.getAttribute("sequence")?null:H(i,e)}function H(i,e){let t=[];e&&$.verifyRequiredValues(i,e);const r=Array.from(i.childNodes),a=function(){let s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{id:s.id||null,sequence:s.sequence||null,adType:s.adType||null,adServingId:null,categories:[],expires:null,viewableImpression:[],system:null,title:null,description:null,advertiser:null,pricing:null,survey:null,errorURLTemplates:[],impressionURLTemplates:[],creatives:[],extensions:[],adVerifications:[],blockedAdCategories:[],followAdditionalWrappers:!0,allowMultipleAds:!1,fallbackOnNoAd:null}}(l.parseAttributes(i));return r.forEach(s=>{switch(s.nodeName){case"Error":a.errorURLTemplates.push(l.parseNodeText(s));break;case"Impression":a.impressionURLTemplates.push({id:s.getAttribute("id")||null,url:l.parseNodeText(s)});break;case"Creatives":a.creatives=function(o){const n=[];return o.forEach(c=>{const u={id:c.getAttribute("id")||null,adId:J(c),sequence:c.getAttribute("sequence")||null,apiFramework:c.getAttribute("apiFramework")||null},d=[];let g;l.childrenByName(c,"UniversalAdId").forEach(h=>{const p={idRegistry:h.getAttribute("idRegistry")||"unknown",value:l.parseNodeText(h)};d.push(p)});const m=l.childByName(c,"CreativeExtensions");m&&(g=x(l.childrenByName(m,"CreativeExtension")));for(const h in c.childNodes){const p=c.childNodes[h];let v;switch(p.nodeName){case"Linear":v=X(p,u);break;case"NonLinearAds":v=Z(p,u);break;case"CompanionAds":v=Q(p,u)}v&&(d&&(v.universalAdIds=d),g&&(v.creativeExtensions=g),n.push(v))}}),n}(l.childrenByName(s,"Creative"));break;case"Extensions":{const o=l.childrenByName(s,"Extension");a.extensions=x(o),a.adVerifications.length||(t=function(n){let c=null,u=[];return n.some(d=>c=l.childByName(d,"AdVerifications")),c&&(u=O(l.childrenByName(c,"Verification"))),u}(o));break}case"AdVerifications":a.adVerifications=O(l.childrenByName(s,"Verification"));break;case"AdSystem":a.system={value:l.parseNodeText(s),version:s.getAttribute("version")||null};break;case"AdTitle":a.title=l.parseNodeText(s);break;case"AdServingId":a.adServingId=l.parseNodeText(s);break;case"Category":a.categories.push({authority:s.getAttribute("authority")||null,value:l.parseNodeText(s)});break;case"Expires":a.expires=parseInt(l.parseNodeText(s),10);break;case"ViewableImpression":a.viewableImpression.push(function(o){const n=(c,u)=>{const d=l.parseNodeText(u);return d&&c.push(d),c};return{id:o.getAttribute("id")||null,viewable:l.childrenByName(o,"Viewable").reduce(n,[]),notViewable:l.childrenByName(o,"NotViewable").reduce(n,[]),viewUndetermined:l.childrenByName(o,"ViewUndetermined").reduce(n,[])}}(s));break;case"Description":a.description=l.parseNodeText(s);break;case"Advertiser":a.advertiser={id:s.getAttribute("id")||null,value:l.parseNodeText(s)};break;case"Pricing":a.pricing={value:l.parseNodeText(s),model:s.getAttribute("model")||null,currency:s.getAttribute("currency")||null};break;case"Survey":a.survey={value:l.parseNodeText(s),type:s.getAttribute("type")||null};break;case"BlockedAdCategories":a.blockedAdCategories.push({authority:s.getAttribute("authority")||null,value:l.parseNodeText(s)})}}),t.length&&(a.adVerifications=a.adVerifications.concat(t)),a}function re(i,e){const t=H(i,e),r=i.getAttribute("followAdditionalWrappers"),a=i.getAttribute("allowMultipleAds"),s=i.getAttribute("fallbackOnNoAd");t.followAdditionalWrappers=!r||l.parseBoolean(r),t.allowMultipleAds=!!a&&l.parseBoolean(a),t.fallbackOnNoAd=s?l.parseBoolean(s):null;let o=l.childByName(i,"VASTAdTagURI");if(o?t.nextWrapperURL=l.parseNodeText(o):(o=l.childByName(i,"VASTAdTagURL"),o&&(t.nextWrapperURL=l.parseNodeText(l.childByName(o,"URL")))),t.creatives.forEach(n=>{if(["linear","nonlinear"].includes(n.type)){if(n.trackingEvents){t.trackingEvents||(t.trackingEvents={}),t.trackingEvents[n.type]||(t.trackingEvents[n.type]={});for(const c in n.trackingEvents){const u=n.trackingEvents[c];Array.isArray(t.trackingEvents[n.type][c])||(t.trackingEvents[n.type][c]=[]),u.forEach(d=>{t.trackingEvents[n.type][c].push(d)})}}n.videoClickTrackingURLTemplates&&(Array.isArray(t.videoClickTrackingURLTemplates)||(t.videoClickTrackingURLTemplates=[]),n.videoClickTrackingURLTemplates.forEach(c=>{t.videoClickTrackingURLTemplates.push(c)})),n.videoClickThroughURLTemplate&&(t.videoClickThroughURLTemplate=n.videoClickThroughURLTemplate),n.videoCustomClickURLTemplates&&(Array.isArray(t.videoCustomClickURLTemplates)||(t.videoCustomClickURLTemplates=[]),n.videoCustomClickURLTemplates.forEach(c=>{t.videoCustomClickURLTemplates.push(c)}))}}),t.nextWrapperURL)return t}function O(i){const e=[];return i.forEach(t=>{const r={resource:null,vendor:null,browserOptional:!1,apiFramework:null,type:null,parameters:null,trackingEvents:{}},a=Array.from(t.childNodes);l.assignAttributes(t.attributes,r),a.forEach(o=>{let{nodeName:n,textContent:c,attributes:u}=o;switch(n){case"JavaScriptResource":case"ExecutableResource":r.resource=c.trim(),l.assignAttributes(u,r);break;case"VerificationParameters":r.parameters=c.trim()}});const s=l.childByName(t,"TrackingEvents");s&&l.childrenByName(s,"Tracking").forEach(o=>{const n=o.getAttribute("event"),c=l.parseNodeText(o);n&&c&&(Array.isArray(r.trackingEvents[n])||(r.trackingEvents[n]=[]),r.trackingEvents[n].push(c))}),e.push(r)}),e}class _{constructor(){this._handlers=[]}on(e,t){if(typeof t!="function")throw new TypeError("The handler argument must be of type Function. Received type ".concat(typeof t));if(!e)throw new TypeError("The event argument must be of type String. Received type ".concat(typeof e));return this._handlers.push({event:e,handler:t}),this}once(e,t){return this.on(e,function(r,a,s){const o={fired:!1,wrapFn:void 0};function n(){o.fired||(r.off(a,o.wrapFn),o.fired=!0,s.bind(r)(...arguments))}return o.wrapFn=n,n}(this,e,t))}off(e,t){return this._handlers=this._handlers.filter(r=>r.event!==e||r.handler!==t),this}emit(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),a=1;a<t;a++)r[a-1]=arguments[a];let s=!1;return this._handlers.forEach(o=>{o.event==="*"&&(s=!0,o.handler(e,...r)),o.event===e&&(s=!0,o.handler(...r))}),s}removeAllListeners(e){return e?(this._handlers=this._handlers.filter(t=>t.event!==e),this):(this._handlers=[],this)}listenerCount(e){return this._handlers.filter(t=>t.event===e).length}listeners(e){return this._handlers.reduce((t,r)=>(r.event===e&&t.push(r.handler),t),[])}eventNames(){return this._handlers.map(e=>e.event)}}let F=0,E=0;const z=(i,e)=>{!i||!e||i<=0||e<=0||(E=(E*F+8*i/e)/++F)},ie={ERRORCODE:900,extensions:[]},P="VAST response version not supported";class ae extends _{constructor(){let{fetcher:e}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};super(),this.maxWrapperDepth=null,this.rootErrorURLTemplates=[],this.errorURLTemplates=[],this.remainingAds=[],this.parsingOptions={},this.fetcher=e||null,this.keepFailedAdPod=!1}trackVastError(e,t){for(var r=arguments.length,a=new Array(r>2?r-2:0),s=2;s<r;s++)a[s-2]=arguments[s];this.emit("VAST-error",Object.assign({},ie,t,...a)),f.track(e,t)}getErrorURLTemplates(){return this.rootErrorURLTemplates.concat(this.errorURLTemplates)}getEstimatedBitrate(){return E}initParsingStatus(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.maxWrapperDepth=e.wrapperLimit||10,this.parsingOptions={allowMultipleAds:e.allowMultipleAds},this.keepFailedAdPod=e.keepFailedAdPod||!1,this.rootURL="",this.resetParsingStatus(),z(e.byteLength,e.requestDuration)}resetParsingStatus(){this.errorURLTemplates=[],this.rootErrorURLTemplates=[],this.vastVersion=null}getRemainingAds(e){if(this.remainingAds.length===0)return Promise.reject(new Error("No more ads are available for the given VAST"));const t=e?this.remainingAds:[this.remainingAds.shift()];return this.errorURLTemplates=[],this.resolveAds(t,{wrapperDepth:0,url:this.rootURL}).then(r=>this.buildVASTResponse(r))}parseVAST(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.initParsingStatus(t),t.isRootVAST=!0,this.parse(e,t).then(r=>this.buildVASTResponse(r))}buildVASTResponse(e){const t=function(r){let{ads:a,errorURLTemplates:s,version:o}=r;return{ads:a||[],errorURLTemplates:s||[],version:o||null}}({ads:e,errorURLTemplates:this.getErrorURLTemplates(),version:this.vastVersion});return this.completeWrapperResolving(t),t}parseVastXml(e,t){let{isRootVAST:r=!1,url:a=null,wrapperDepth:s=0,allowMultipleAds:o,followAdditionalWrappers:n}=t;if(!e||!e.documentElement||e.documentElement.nodeName!=="VAST"){var c;this.emit("VAST-ad-parsed",{type:"ERROR",url:a,wrapperDepth:s});const m=(e==null||(c=e.documentElement)===null||c===void 0?void 0:c.nodeName)==="VideoAdServingTemplate";throw new Error(m?P:"Invalid VAST XMLDocument")}const u=[],d=e.documentElement.childNodes,g=e.documentElement.getAttribute("version");r&&g&&(this.vastVersion=g);for(const m in d){const h=d[m];if(h.nodeName==="Error"){const p=l.parseNodeText(h);r?this.rootErrorURLTemplates.push(p):this.errorURLTemplates.push(p)}else if(h.nodeName==="Ad"){if(this.vastVersion&&parseFloat(this.vastVersion)<3)o=!0;else if(o===!1&&u.length>1)break;const p=ee(h,this.emit.bind(this),{allowMultipleAds:o,followAdditionalWrappers:n});p.ad?(u.push(p.ad),this.emit("VAST-ad-parsed",{type:p.type,url:a,wrapperDepth:s,adIndex:u.length-1,vastVersion:g})):this.trackVastError(this.getErrorURLTemplates(),{ERRORCODE:101})}}return u}parse(e){let{url:t=null,resolveAll:r=!0,wrapperSequence:a=null,previousUrl:s=null,wrapperDepth:o=0,isRootVAST:n=!1,followAdditionalWrappers:c,allowMultipleAds:u}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},d=[];this.vastVersion&&parseFloat(this.vastVersion)<3&&n&&(u=!0);try{d=this.parseVastXml(e,{isRootVAST:n,url:t,wrapperDepth:o,allowMultipleAds:u,followAdditionalWrappers:c})}catch(g){return Promise.reject(g)}if(d.length===1&&a!=null&&(d[0].sequence=a),r===!1){const g=l.getSortedAdPods(d),m=l.getStandAloneAds(d);g.length?d=g:m.length&&(d=[m.shift()]),this.remainingAds=m}return this.resolveAds(d,{wrapperDepth:o,previousUrl:s,url:t})}resolveAds(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],{wrapperDepth:t,previousUrl:r,url:a}=arguments.length>1?arguments[1]:void 0;const s=[];return r=a,e.forEach(o=>{const n=this.resolveWrappers(o,t,r);s.push(n)}),Promise.all(s).then(o=>f.flatten(o))}resolveWrappers(e,t,r){const a={...e};return new Promise(s=>{var o;if(t++,!a.nextWrapperURL)return delete a.nextWrapperURL,s(a);if(!this.fetcher)return a.VASTAdTagURI=a.nextWrapperURL,delete a.nextWrapperURL,s(a);if(t>=this.maxWrapperDepth)return a.errorCode=302,delete a.nextWrapperURL,s(a);a.nextWrapperURL=l.resolveVastAdTagURI(a.nextWrapperURL,r);const n=(o=this.parsingOptions.allowMultipleAds)!==null&&o!==void 0?o:a.allowMultipleAds,c=a.sequence;this.fetcher.fetchVAST({url:a.nextWrapperURL,emitter:this.emit.bind(this),maxWrapperDepth:this.maxWrapperDepth}).then(u=>this.parse(u,{url:a.nextWrapperURL,previousUrl:r,wrapperSequence:c,wrapperDepth:t,followAdditionalWrappers:a.followAdditionalWrappers,allowMultipleAds:n}).then(d=>{if(delete a.nextWrapperURL,d.length===0)return a.creatives=[],s(a);d.forEach(g=>{g&&l.mergeWrapperAdData(g,a)}),s(d)})).catch(u=>{a.errorCode=u.message===P?102:301,a.errorMessage=u.message,s(a)})})}completeWrapperResolving(e){if(e.ads.length===0)this.trackVastError(e.errorURLTemplates,{ERRORCODE:303});else for(let t=e.ads.length-1;t>=0;t--){const r=e.ads[t],a=!r.creatives.some(s=>{var o,n;return((o=s.mediaFiles)===null||o===void 0?void 0:o.length)>0||((n=s.variations)===null||n===void 0?void 0:n.length)>0});!r.errorCode&&!a||r.VASTAdTagURI||(this.trackVastError(r.errorURLTemplates.concat(e.errorURLTemplates),{ERRORCODE:r.errorCode||303},{ERRORMESSAGE:r.errorMessage||""},{extensions:r.extensions},{system:r.system}),this.keepFailedAdPod&&r.sequence?r.hasFailed=!0:e.ads.splice(t,1))}}}let T=null;const se={data:{},length:0,getItem(i){return this.data[i]},setItem(i,e){this.data[i]=e,this.length=Object.keys(this.data).length},removeItem(i){delete this.data[i],this.length=Object.keys(this.data).length},clear(){this.data={},this.length=0}};class ne{constructor(){this.storage=this.initStorage()}initStorage(){if(T)return T;try{T=typeof window<"u"&&window!==null?window.localStorage||window.sessionStorage:null}catch{T=null}return T&&!this.isStorageDisabled(T)||(T=se,T.clear()),T}isStorageDisabled(e){const t="__VASTStorage__";try{if(e.setItem(t,t),e.getItem(t)!==t)return e.removeItem(t),!0}catch{return!0}return e.removeItem(t),!1}getItem(e){return this.storage.getItem(e)}setItem(e,t){return this.storage.setItem(e,t)}removeItem(e){return this.storage.removeItem(e)}clear(){return this.storage.clear()}}const b=12e4,oe={get:async function(i,e){try{const t=new AbortController,r=setTimeout(()=>{throw t.abort(),new Error("URLHandler: Request timed out after ".concat(e.timeout||b," ms (408)"))},e.timeout||b),a=await fetch(i,{...e,signal:t.signal,credentials:e.withCredentials?"include":"omit"}).finally(()=>{clearTimeout(r)}),s=function(o){return f.isBrowserEnvironment()&&window.location.protocol==="https:"&&o.url.includes("http://")?"URLHandler: Cannot go from HTTPS to HTTP.":o.status===200&&o.ok?null:"URLHandler: ".concat(o.statusText," (").concat(o.status,")")}(a);return s?{error:new Error(s),statusCode:a.status}:async function(o){const n=await o.text();let c;return c=f.isBrowserEnvironment()?new DOMParser:new(await Promise.resolve().then(()=>require("./index6.js")).then(u=>u.index)).DOMParser,{xml:c.parseFromString(n,"text/xml"),details:{byteLength:n.length,statusCode:o.status,rawXml:n}}}(a)}catch(t){return{error:t,statusCode:t.name==="AbortError"?408:null}}}};class le{constructor(){this.URLTemplateFilters=[]}setOptions(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.urlHandler=e.urlHandler||e.urlhandler||oe,this.fetchingOptions={...e.fetchOptions,timeout:e.timeout||b,withCredentials:!!e.withCredentials}}addURLTemplateFilter(e){typeof e=="function"&&this.URLTemplateFilters.push(e)}removeLastURLTemplateFilter(){this.URLTemplateFilters.pop()}countURLTemplateFilters(){return this.URLTemplateFilters.length}clearURLTemplateFilters(){this.URLTemplateFilters=[]}async fetchVAST(e){var t;let{url:r,maxWrapperDepth:a,emitter:s,wrapperDepth:o=0,previousUrl:n=null,wrapperAd:c=null}=e;const u=Date.now();this.URLTemplateFilters.forEach(m=>{r=m(r)}),s("VAST-resolving",{url:r,previousUrl:n,wrapperDepth:o,maxWrapperDepth:a,timeout:this.fetchingOptions.timeout,wrapperAd:c});const d=await this.urlHandler.get(r,this.fetchingOptions),g=Math.round(Date.now()-u);if(s("VAST-resolved",{url:r,previousUrl:n,wrapperDepth:o,error:(d==null?void 0:d.error)||null,duration:g,statusCode:(d==null?void 0:d.statusCode)||null,...d==null?void 0:d.details}),z(d==null||(t=d.details)===null||t===void 0?void 0:t.byteLength,g),d.error)throw new Error(d.error);return d.xml}}class ce{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:new ne;this.cappingFreeLunch=e,this.cappingMinimumTimeInterval=t,this.fetcher=new le,this.vastParser=new ae({fetcher:this.fetcher}),this.storage=r,this.lastSuccessfulAd===void 0&&(this.lastSuccessfulAd=0),this.totalCalls===void 0&&(this.totalCalls=0),this.totalCallsTimeout===void 0&&(this.totalCallsTimeout=0)}addURLTemplateFilter(e){this.fetcher.addURLTemplateFilter(e)}removeLastURLTemplateFilter(){this.fetcher.removeLastURLTemplateFilter()}countURLTemplateFilters(){return this.fetcher.countURLTemplateFilters()}clearURLTemplateFilters(){this.fetcher.clearURLTemplateFilters()}getParser(){return this.vastParser}get lastSuccessfulAd(){return this.storage.getItem("vast-client-last-successful-ad")}set lastSuccessfulAd(e){this.storage.setItem("vast-client-last-successful-ad",e)}get totalCalls(){return this.storage.getItem("vast-client-total-calls")}set totalCalls(e){this.storage.setItem("vast-client-total-calls",e)}get totalCallsTimeout(){return this.storage.getItem("vast-client-total-calls-timeout")}set totalCallsTimeout(e){this.storage.setItem("vast-client-total-calls-timeout",e)}hasRemainingAds(){return this.vastParser.remainingAds.length>0}getNextAds(e){return this.vastParser.getRemainingAds(e)}parseVAST(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.fetcher.setOptions(t),this.vastParser.parseVAST(e,t)}get(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=Date.now();return t.hasOwnProperty("resolveAll")||(t.resolveAll=!1),this.totalCallsTimeout<r?(this.totalCalls=1,this.totalCallsTimeout=r+36e5):this.totalCalls++,new Promise((a,s)=>{if(this.cappingFreeLunch>=this.totalCalls)return s(new Error("VAST call canceled – FreeLunch capping not reached yet ".concat(this.totalCalls,"/").concat(this.cappingFreeLunch)));const o=r-this.lastSuccessfulAd;if(o<0)this.lastSuccessfulAd=0;else if(o<this.cappingMinimumTimeInterval)return s(new Error("VAST call canceled – (".concat(this.cappingMinimumTimeInterval,")ms minimum interval reached")));this.vastParser.initParsingStatus(t),this.fetcher.setOptions(t),this.vastParser.rootURL=e,this.fetcher.fetchVAST({url:e,emitter:this.vastParser.emit.bind(this.vastParser),maxWrapperDepth:this.vastParser.maxWrapperDepth}).then(n=>(t.previousUrl=e,t.isRootVAST=!0,t.url=e,this.vastParser.parse(n,t).then(c=>{const u=this.vastParser.buildVASTResponse(c);a(u)}))).catch(n=>s(n))})}}class ue extends _{constructor(e,t,r){var a;let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null,o=arguments.length>4&&arguments[4]!==void 0&&arguments[4];super(),this.ad=t,this.creative=r,this.variation=s,this.muted=o,this.impressed=!1,this.skippable=!1,this.trackingEvents={},this.trackedProgressEvents=[],this.lastPercentage=0,this._alreadyTriggeredQuartiles={},this.emitAlwaysEvents=["creativeView","start","firstQuartile","midpoint","thirdQuartile","complete","resume","pause","rewind","skip","closeLinear","close"];for(const n in this.creative.trackingEvents){const c=this.creative.trackingEvents[n];this.trackingEvents[n]=c.slice(0)}this.viewableImpressionTrackers=((a=this.ad.viewableImpression)===null||a===void 0?void 0:a.reduce((n,c)=>(n.notViewable.push(...c.notViewable),n.viewUndetermined.push(...c.viewUndetermined),n.viewable.push(...c.viewable),n),{notViewable:[],viewUndetermined:[],viewable:[]}))||{},Object.entries(this.viewableImpressionTrackers).forEach(n=>{let[c,u]=n;u.length&&(this.trackingEvents[c]=u)}),function(n){return n.type==="linear"}(this.creative)?this._initLinearTracking():this._initVariationTracking(),e&&this.on("start",()=>{e.lastSuccessfulAd=Date.now()})}_initLinearTracking(){this.linear=!0,this.skipDelay=this.creative.skipDelay,this.setDuration(this.creative.duration),this.clickThroughURLTemplate=this.creative.videoClickThroughURLTemplate,this.clickTrackingURLTemplates=this.creative.videoClickTrackingURLTemplates}_initVariationTracking(){if(this.linear=!1,this.skipDelay=-1,this.variation){for(const e in this.variation.trackingEvents){const t=this.variation.trackingEvents[e];this.trackingEvents[e]?this.trackingEvents[e]=this.trackingEvents[e].concat(t.slice(0)):this.trackingEvents[e]=t.slice(0)}this.variation.adType==="nonLinearAd"?(this.clickThroughURLTemplate=this.variation.nonlinearClickThroughURLTemplate,this.clickTrackingURLTemplates=this.variation.nonlinearClickTrackingURLTemplates,this.setDuration(this.variation.minSuggestedDuration)):function(e){return e.adType==="companionAd"}(this.variation)&&(this.clickThroughURLTemplate=this.variation.companionClickThroughURLTemplate,this.clickTrackingURLTemplates=this.variation.companionClickTrackingURLTemplates)}}setDuration(e){f.isValidTimeValue(e)?(this.assetDuration=e,this.quartiles={firstQuartile:Math.round(25*this.assetDuration)/100,midpoint:Math.round(50*this.assetDuration)/100,thirdQuartile:Math.round(75*this.assetDuration)/100}):this.emit("TRACKER-error",{message:"the duration provided is not valid. duration: ".concat(e)})}setProgress(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2];if(!f.isValidTimeValue(e)||typeof t!="object")return void this.emit("TRACKER-error",{message:"One given setProgress parameter has the wrong type. progress: ".concat(e,", macros: ").concat(f.formatMacrosValues(t))});const a=this.skipDelay||-1;if(a===-1||this.skippable||(a>e?this.emit("skip-countdown",a-e):(this.skippable=!0,this.emit("skip-countdown",0))),this.assetDuration>0){const s=Math.round(e/this.assetDuration*100),o=[];if(e>0){o.push("start");for(let n=this.lastPercentage;n<s;n++)o.push("progress-".concat(n+1,"%"));o.push("progress-".concat(e));for(const n in this.quartiles)this.isQuartileReached(n,this.quartiles[n],e)&&(o.push(n),this._alreadyTriggeredQuartiles[n]=!0);this.lastPercentage=s}o.forEach(n=>{this.track(n,{macros:t,once:r})}),e<this.progress&&(this.track("rewind",{macros:t}),this.trackedProgressEvents&&this.trackedProgressEvents.splice(0))}this.progress=e}isQuartileReached(e,t,r){let a=!1;return t<=r&&!this._alreadyTriggeredQuartiles[e]&&(a=!0),a}setMuted(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};typeof e=="boolean"&&typeof t=="object"?(this.muted!==e&&this.track(e?"mute":"unmute",{macros:t}),this.muted=e):this.emit("TRACKER-error",{message:"One given setMuted parameter has the wrong type. muted: ".concat(e,", macros: ").concat(f.formatMacrosValues(t))})}setPaused(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};typeof e=="boolean"&&typeof t=="object"?(this.paused!==e&&this.track(e?"pause":"resume",{macros:t}),this.paused=e):this.emit("TRACKER-error",{message:"One given setPaused parameter has the wrong type. paused: ".concat(e,", macros: ").concat(f.formatMacrosValues(t))})}setFullscreen(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};typeof e=="boolean"&&typeof t=="object"?(this.fullscreen!==e&&this.track(e?"fullscreen":"exitFullscreen",{macros:t}),this.fullscreen=e):this.emit("TRACKER-error",{message:"One given setFullScreen parameter has the wrong type. fullscreen: ".concat(e,", macros: ").concat(f.formatMacrosValues(t))})}setExpand(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};typeof e=="boolean"&&typeof t=="object"?(this.expanded!==e&&(this.track(e?"expand":"collapse",{macros:t}),this.track(e?"playerExpand":"playerCollapse",{macros:t})),this.expanded=e):this.emit("TRACKER-error",{message:"One given setExpand parameter has the wrong type. expanded: ".concat(e,", macros: ").concat(f.formatMacrosValues(t))})}setSkipDelay(e){f.isValidTimeValue(e)?this.skipDelay=e:this.emit("TRACKER-error",{message:"setSkipDelay parameter does not have a valid value. duration: ".concat(e)})}trackImpression(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};typeof e=="object"?this.impressed||(this.impressed=!0,this.trackURLs(this.ad.impressionURLTemplates,e),this.track("creativeView",{macros:e})):this.emit("TRACKER-error",{message:"trackImpression parameter has the wrong type. macros: ".concat(e)})}trackViewableImpression(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];typeof e=="object"?this.track("viewable",{macros:e,once:t}):this.emit("TRACKER-error",{message:"trackViewableImpression given macros has the wrong type. macros: ".concat(e)})}trackNotViewableImpression(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];typeof e=="object"?this.track("notViewable",{macros:e,once:t}):this.emit("TRACKER-error",{message:"trackNotViewableImpression given macros has the wrong type. macros: ".concat(e)})}trackUndeterminedImpression(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];typeof e=="object"?this.track("viewUndetermined",{macros:e,once:t}):this.emit("TRACKER-error",{message:"trackUndeterminedImpression given macros has the wrong type. macros: ".concat(e)})}error(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];typeof e=="object"&&typeof t=="boolean"?this.trackURLs(this.ad.errorURLTemplates,e,{isCustomCode:t}):this.emit("TRACKER-error",{message:"One given error parameter has the wrong type. macros: ".concat(f.formatMacrosValues(e),", isCustomCode: ").concat(t)})}errorWithCode(e){let t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];typeof e=="string"&&typeof t=="boolean"?(this.error({ERRORCODE:e},t),console.log("The method errorWithCode is deprecated, please use vast tracker error method instead")):this.emit("TRACKER-error",{message:"One given errorWithCode parameter has the wrong type. errorCode: ".concat(e,", isCustomCode: ").concat(t)})}complete(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};typeof e=="object"?this.track("complete",{macros:e}):this.emit("TRACKER-error",{message:"complete given macros has the wrong type. macros: ".concat(e)})}notUsed(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};typeof e=="object"?(this.track("notUsed",{macros:e}),this.trackingEvents=[]):this.emit("TRACKER-error",{message:"notUsed given macros has the wrong type. macros: ".concat(e)})}otherAdInteraction(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};typeof e=="object"?this.track("otherAdInteraction",{macros:e}):this.emit("TRACKER-error",{message:"otherAdInteraction given macros has the wrong type. macros: ".concat(e)})}acceptInvitation(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};typeof e=="object"?this.track("acceptInvitation",{macros:e}):this.emit("TRACKER-error",{message:"acceptInvitation given macros has the wrong type. macros: ".concat(e)})}adExpand(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};typeof e=="object"?this.track("adExpand",{macros:e}):this.emit("TRACKER-error",{message:"adExpand given macros has the wrong type. macros: ".concat(e)})}adCollapse(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};typeof e=="object"?this.track("adCollapse",{macros:e}):this.emit("TRACKER-error",{message:"adCollapse given macros has the wrong type. macros: ".concat(e)})}minimize(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};typeof e=="object"?this.track("minimize",{macros:e}):this.emit("TRACKER-error",{message:"minimize given macros has the wrong type. macros: ".concat(e)})}verificationNotExecuted(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(typeof e!="string"||typeof t!="object")return void this.emit("TRACKER-error",{message:"One given verificationNotExecuted parameter has to wrong type. vendor: ".concat(e,", macros: ").concat(f.formatMacrosValues(t))});if(!this.ad||!this.ad.adVerifications||!this.ad.adVerifications.length)throw new Error("No adVerifications provided");if(!e)throw new Error("No vendor provided, unable to find associated verificationNotExecuted");const r=this.ad.adVerifications.find(s=>s.vendor===e);if(!r)throw new Error("No associated verification element found for vendor: ".concat(e));const a=r.trackingEvents;if(a&&a.verificationNotExecuted){const s=a.verificationNotExecuted;this.trackURLs(s,t),this.emit("verificationNotExecuted",{trackingURLTemplates:s})}}overlayViewDuration(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};typeof e=="string"&&typeof t=="object"?(t.ADPLAYHEAD=e,this.track("overlayViewDuration",{macros:t})):this.emit("TRACKER-error",{message:"One given overlayViewDuration parameters has the wrong type. formattedDuration: ".concat(e,", macros: ").concat(f.formatMacrosValues(t))})}close(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};typeof e=="object"?this.track(this.linear?"closeLinear":"close",{macros:e}):this.emit("TRACKER-error",{message:"close given macros has the wrong type. macros: ".concat(e)})}skip(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};typeof e=="object"?this.track("skip",{macros:e}):this.emit("TRACKER-error",{message:"skip given macros has the wrong type. macros: ".concat(e)})}load(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};typeof e=="object"?this.track("loaded",{macros:e}):this.emit("TRACKER-error",{message:"load given macros has the wrong type. macros: ".concat(e)})}click(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(e!==null&&typeof e!="string"||typeof t!="object")return void this.emit("TRACKER-error",{message:"One given click parameter has the wrong type. fallbackClickThroughURL: ".concat(e,", macros: ").concat(f.formatMacrosValues(t))});this.clickTrackingURLTemplates&&this.clickTrackingURLTemplates.length&&this.trackURLs(this.clickTrackingURLTemplates,t);const r=this.clickThroughURLTemplate||e,a={...t};if(r){this.progress&&(a.ADPLAYHEAD=this.progressFormatted());const s=f.resolveURLTemplates([r],a)[0];this.emit("clickthrough",s)}}trackProgressEvents(e,t,r){const a=parseFloat(e.split("-")[1]);Object.entries(this.trackingEvents).filter(s=>{let[o]=s;return o.startsWith("progress-")}).map(s=>{let[o,n]=s;return{name:o,time:parseFloat(o.split("-")[1]),urls:n}}).filter(s=>{let{time:o}=s;return o<=a&&o>this.progress}).forEach(s=>{let{name:o,urls:n}=s;!r&&this.trackedProgressEvents.includes(o)||(this.emit(o,{trackingURLTemplates:n}),this.trackURLs(n,t),r?delete this.trackingEvents[o]:this.trackedProgressEvents.push(o))})}track(e){let{macros:t={},once:r=!1}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(typeof t!="object")return void this.emit("TRACKER-error",{message:"track given macros has the wrong type. macros: ".concat(t)});e==="closeLinear"&&!this.trackingEvents[e]&&this.trackingEvents.close&&(e="close"),e.startsWith("progress-")&&!e.endsWith("%")&&this.trackProgressEvents(e,t,r);const a=this.trackingEvents[e],s=this.emitAlwaysEvents.indexOf(e)>-1;a?(this.emit(e,{trackingURLTemplates:a}),this.trackURLs(a,t)):s&&this.emit(e,null),r&&(delete this.trackingEvents[e],s&&this.emitAlwaysEvents.splice(this.emitAlwaysEvents.indexOf(e),1))}trackURLs(e){var t;let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const{validUrls:s,invalidUrls:o}=f.filterUrlTemplates(e);o.length&&this.emit("TRACKER-error",{message:"Provided urls are malformed. url: ".concat(o)});const n={...r};this.linear&&(this.creative&&this.creative.mediaFiles&&this.creative.mediaFiles[0]&&this.creative.mediaFiles[0].fileURL&&(n.ASSETURI=this.creative.mediaFiles[0].fileURL),this.progress&&(n.ADPLAYHEAD=this.progressFormatted())),(t=this.creative)!==null&&t!==void 0&&(t=t.universalAdIds)!==null&&t!==void 0&&t.length&&(n.UNIVERSALADID=this.creative.universalAdIds.map(c=>c.idRegistry.concat(" ",c.value)).join(",")),this.ad&&(this.ad.sequence&&(n.PODSEQUENCE=this.ad.sequence),this.ad.adType&&(n.ADTYPE=this.ad.adType),this.ad.adServingId&&(n.ADSERVINGID=this.ad.adServingId),this.ad.categories&&this.ad.categories.length&&(n.ADCATEGORIES=this.ad.categories.map(c=>c.value).join(",")),this.ad.blockedAdCategories&&this.ad.blockedAdCategories.length&&(n.BLOCKEDADCATEGORIES=this.ad.blockedAdCategories.map(c=>c.value).join(","))),f.track(s,n,a)}convertToTimecode(e){if(!f.isValidTimeValue(e))return"";const t=1e3*e,r=Math.floor(t/36e5),a=Math.floor(t/6e4%60),s=Math.floor(t/1e3%60),o=Math.floor(t%1e3);return"".concat(f.addLeadingZeros(r,2),":").concat(f.addLeadingZeros(a,2),":").concat(f.addLeadingZeros(s,2),".").concat(f.addLeadingZeros(o,3))}progressFormatted(){return this.convertToTimecode(this.progress)}}exports._=ce;exports.z=ue;