@clickview/exchange 0.35.0-rc.0 → 0.36.0-rc.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 (109) hide show
  1. package/dist/bundles.json +2 -2
  2. package/dist/css/{484-exchange-d1708c5277.chunk.css → 212-exchange-9d6d021263.chunk.css} +5 -5
  3. package/dist/css/lite-exchange-189249dd03.css +14 -0
  4. package/dist/scripts/127-772bee3dfd-exchange.chunk.js +1 -0
  5. package/dist/scripts/{173-ee4e592f31-exchange.chunk.js → 173-43b652e061-exchange.chunk.js} +1 -1
  6. package/dist/scripts/{203-ebe5b2f277-exchange.chunk.js → 203-d1a21c9dd9-exchange.chunk.js} +1 -1
  7. package/dist/scripts/21-b353c515d0-exchange.chunk.js +1 -0
  8. package/dist/scripts/212-6e386cf758-exchange.chunk.js +2 -0
  9. package/dist/scripts/240-264121a5f0-exchange.chunk.js +1 -0
  10. package/dist/scripts/{267-1c2c594fbb-exchange.chunk.js → 267-1a5207911b-exchange.chunk.js} +1 -1
  11. package/dist/scripts/273-529929d04b-exchange.chunk.js +1 -0
  12. package/dist/scripts/{812-62bc3ec549-exchange.chunk.js → 291-46f55263da-exchange.chunk.js} +1 -1
  13. package/dist/scripts/298-eaed8474db-exchange.chunk.js +1 -0
  14. package/dist/scripts/3-f858de8661-exchange.chunk.js +1 -0
  15. package/dist/scripts/332-0f1741405b-exchange.chunk.js +1 -0
  16. package/dist/scripts/{127-3b54dd51e9-exchange.chunk.js → 439-342d636136-exchange.chunk.js} +1 -1
  17. package/dist/scripts/442-75bf1f36bd-exchange.chunk.js +1 -0
  18. package/dist/scripts/455-d4e505946d-exchange.chunk.js +1 -0
  19. package/dist/scripts/457-ec818bc2dd-exchange.chunk.js +1 -0
  20. package/dist/scripts/485-e9927421c9-exchange.chunk.js +1 -0
  21. package/dist/scripts/49-f2550b990f-exchange.chunk.js +1 -0
  22. package/dist/scripts/{636-6d4b24822f-exchange.chunk.js → 494-43a6254444-exchange.chunk.js} +2 -2
  23. package/dist/scripts/497-bbafd743c6-exchange.chunk.js +2 -0
  24. package/dist/scripts/531-7db93115a5-exchange.chunk.js +1 -0
  25. package/dist/scripts/589-b730cdaadd-exchange.chunk.js +1 -0
  26. package/dist/scripts/607-fb3554c2be-exchange.chunk.js +1 -0
  27. package/dist/scripts/68-da29f4017e-exchange.chunk.js +1 -0
  28. package/dist/scripts/{957-309ee0d7bc-exchange.chunk.js → 704-70f0aea5d6-exchange.chunk.js} +1 -1
  29. package/dist/scripts/725-a57dfa9b3d-exchange.chunk.js +1 -0
  30. package/dist/scripts/726-bace6b7939-exchange.chunk.js +1 -0
  31. package/dist/scripts/772-0c83e3b8b4-exchange.chunk.js +1 -0
  32. package/dist/scripts/773-b0b857888b-exchange.chunk.js +2 -0
  33. package/dist/scripts/774-1e240d6850-exchange.chunk.js +1 -0
  34. package/dist/scripts/782-5483e4f5a8-exchange.chunk.js +1 -0
  35. package/dist/scripts/837-6da52b7edf-exchange.chunk.js +1 -0
  36. package/dist/scripts/{851-89f520a59f-exchange.chunk.js → 851-2ba191f180-exchange.chunk.js} +2 -2
  37. package/dist/scripts/{243-2b9cb1b416-exchange.chunk.js → 858-51c9b42098-exchange.chunk.js} +1 -1
  38. package/dist/scripts/87-40988e7506-exchange.chunk.js +1 -0
  39. package/dist/scripts/875-a26e7cd65c-exchange.chunk.js +2 -0
  40. package/dist/scripts/875-a26e7cd65c-exchange.chunk.js.LICENSE.txt +60 -0
  41. package/dist/scripts/{925-f364716a3e-exchange.chunk.js → 925-e0f4aee722-exchange.chunk.js} +1 -1
  42. package/dist/scripts/927-fc135105ff-exchange.chunk.js +1 -0
  43. package/dist/scripts/979-4a93b8c356-exchange.chunk.js +2 -0
  44. package/dist/scripts/bundle-e220801ad4.min.js +2 -0
  45. package/dist/scripts/{bundle-81546a5363.min.js.LICENSE.txt → bundle-e220801ad4.min.js.LICENSE.txt} +4 -4
  46. package/package.json +1 -1
  47. package/dist/css/lite-exchange-7679ccfc88.css +0 -14
  48. package/dist/scripts/114-96a7ca1b6f-exchange.chunk.js +0 -1
  49. package/dist/scripts/125-4de7501548-exchange.chunk.js +0 -2
  50. package/dist/scripts/125-4de7501548-exchange.chunk.js.LICENSE.txt +0 -32
  51. package/dist/scripts/15-0b24f8e8d5-exchange.chunk.js +0 -1
  52. package/dist/scripts/16-b1986189af-exchange.chunk.js +0 -1
  53. package/dist/scripts/225-4dce38d6b2-exchange.chunk.js +0 -1
  54. package/dist/scripts/232-b795e80ab5-exchange.chunk.js +0 -1
  55. package/dist/scripts/239-6ef7e1a1ff-exchange.chunk.js +0 -1
  56. package/dist/scripts/26-0710e67a29-exchange.chunk.js +0 -1
  57. package/dist/scripts/302-4d7bcdd1e5-exchange.chunk.js +0 -1
  58. package/dist/scripts/332-10ee7a3bc3-exchange.chunk.js +0 -1
  59. package/dist/scripts/378-18bc3cc2ec-exchange.chunk.js +0 -1
  60. package/dist/scripts/455-b5030cf69f-exchange.chunk.js +0 -1
  61. package/dist/scripts/484-ba57b42a81-exchange.chunk.js +0 -2
  62. package/dist/scripts/497-3fd3d785e8-exchange.chunk.js +0 -2
  63. package/dist/scripts/521-6ef2eb7c1a-exchange.chunk.js +0 -1
  64. package/dist/scripts/555-842cc659ed-exchange.chunk.js +0 -2
  65. package/dist/scripts/564-d3ed7c210f-exchange.chunk.js +0 -1
  66. package/dist/scripts/626-987007553d-exchange.chunk.js +0 -1
  67. package/dist/scripts/677-5c68a6f3b9-exchange.chunk.js +0 -1
  68. package/dist/scripts/689-a93b7bcc21-exchange.chunk.js +0 -1
  69. package/dist/scripts/717-b5c905eed1-exchange.chunk.js +0 -1
  70. package/dist/scripts/725-32d72c9d52-exchange.chunk.js +0 -1
  71. package/dist/scripts/786-ad8d61c977-exchange.chunk.js +0 -1
  72. package/dist/scripts/789-dc62cae314-exchange.chunk.js +0 -1
  73. package/dist/scripts/839-06ecbb43f8-exchange.chunk.js +0 -1
  74. package/dist/scripts/846-bc37c29aba-exchange.chunk.js +0 -1
  75. package/dist/scripts/87-aecefc1fc2-exchange.chunk.js +0 -1
  76. package/dist/scripts/907-688857b6a5-exchange.chunk.js +0 -1
  77. package/dist/scripts/967-de6ba67f10-exchange.chunk.js +0 -1
  78. package/dist/scripts/979-c36cb50cfa-exchange.chunk.js +0 -2
  79. package/dist/scripts/bundle-81546a5363.min.js +0 -2
  80. package/typings/libs/CVLanguages.d.ts +0 -24
  81. /package/dist/css/{232-exchange-9b33dd51bd.chunk.css → 127-exchange-9b33dd51bd.chunk.css} +0 -0
  82. /package/dist/css/{225-exchange-015d6143ca.chunk.css → 273-exchange-015d6143ca.chunk.css} +0 -0
  83. /package/dist/css/{812-exchange-be9d9f0cdb.chunk.css → 291-exchange-be9d9f0cdb.chunk.css} +0 -0
  84. /package/dist/css/{839-exchange-762f6a9c6d.chunk.css → 298-exchange-762f6a9c6d.chunk.css} +0 -0
  85. /package/dist/css/{302-exchange-d71527fc65.chunk.css → 3-exchange-d71527fc65.chunk.css} +0 -0
  86. /package/dist/css/{636-exchange-949a42ef69.chunk.css → 494-exchange-949a42ef69.chunk.css} +0 -0
  87. /package/dist/css/{564-exchange-cbf2bb5621.chunk.css → 531-exchange-cbf2bb5621.chunk.css} +0 -0
  88. /package/dist/css/{846-exchange-fa098d9131.chunk.css → 589-exchange-fa098d9131.chunk.css} +0 -0
  89. /package/dist/css/{786-exchange-6a6621c902.chunk.css → 68-exchange-6a6621c902.chunk.css} +0 -0
  90. /package/dist/css/{626-exchange-8c1b8716b3.chunk.css → 726-exchange-8c1b8716b3.chunk.css} +0 -0
  91. /package/dist/css/{907-exchange-17e09cf7ed.chunk.css → 772-exchange-17e09cf7ed.chunk.css} +0 -0
  92. /package/dist/css/{555-exchange-1387f35e92.chunk.css → 773-exchange-1387f35e92.chunk.css} +0 -0
  93. /package/dist/css/{15-exchange-6d2304419c.chunk.css → 774-exchange-6d2304419c.chunk.css} +0 -0
  94. /package/dist/css/{967-exchange-e80e6c6649.chunk.css → 837-exchange-e80e6c6649.chunk.css} +0 -0
  95. /package/dist/css/{243-exchange-06944bdfa4.chunk.css → 858-exchange-06944bdfa4.chunk.css} +0 -0
  96. /package/dist/scripts/{170-79229969eb-exchange.chunk.js → 170-8a3dadfb8d-exchange.chunk.js} +0 -0
  97. /package/dist/scripts/{484-ba57b42a81-exchange.chunk.js.LICENSE.txt → 212-6e386cf758-exchange.chunk.js.LICENSE.txt} +0 -0
  98. /package/dist/scripts/{351-a4dd056451-exchange.chunk.js → 351-0818b5954b-exchange.chunk.js} +0 -0
  99. /package/dist/scripts/{497-3fd3d785e8-exchange.chunk.js.LICENSE.txt → 494-43a6254444-exchange.chunk.js.LICENSE.txt} +0 -0
  100. /package/dist/scripts/{555-842cc659ed-exchange.chunk.js.LICENSE.txt → 497-bbafd743c6-exchange.chunk.js.LICENSE.txt} +0 -0
  101. /package/dist/scripts/{599-38dabdb582-exchange.chunk.js → 599-bdcf1403ff-exchange.chunk.js} +0 -0
  102. /package/dist/scripts/{601-e90552b212-exchange.chunk.js → 601-77fb6a087c-exchange.chunk.js} +0 -0
  103. /package/dist/scripts/{619-98c2e095f2-exchange.chunk.js → 619-eece92ee6d-exchange.chunk.js} +0 -0
  104. /package/dist/scripts/{648-73c70f58cb-exchange.chunk.js → 648-31d7866d49-exchange.chunk.js} +0 -0
  105. /package/dist/scripts/{636-6d4b24822f-exchange.chunk.js.LICENSE.txt → 773-b0b857888b-exchange.chunk.js.LICENSE.txt} +0 -0
  106. /package/dist/scripts/{851-89f520a59f-exchange.chunk.js.LICENSE.txt → 851-2ba191f180-exchange.chunk.js.LICENSE.txt} +0 -0
  107. /package/dist/scripts/{877-fb2b1494d7-exchange.chunk.js → 877-e693257ae6-exchange.chunk.js} +0 -0
  108. /package/dist/scripts/{880-0b1c8ffea6-exchange.chunk.js → 880-3b6aaea14e-exchange.chunk.js} +0 -0
  109. /package/dist/scripts/{979-c36cb50cfa-exchange.chunk.js.LICENSE.txt → 979-4a93b8c356-exchange.chunk.js.LICENSE.txt} +0 -0
@@ -0,0 +1,2 @@
1
+ /*! For license information please see 212-6e386cf758-exchange.chunk.js.LICENSE.txt */
2
+ (self.webpackChunk_clickview_exchange=self.webpackChunk_clickview_exchange||[]).push([[212],{66090:(t,e,n)=>{"use strict";function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}n.d(e,{O:()=>o});var o={isNumber:function(t){return o.isType(t,"number")},isString:function(t){return o.isType(t,"string")},isType:function(t,e){return r(t)===e}}},16035:(t,e,n)=>{"use strict";n.d(e,{z:()=>l});var r=n(32735),o=n(23481),i=n(28825),a=n(44829),u=n(2096),c=o.T.encloseNamespace("shared.tags");function l(t){var e,n,o=t.tag,l=t.appLink,s=t.onClick,f=t.disabled,p=t.tagClass,y=void 0===p?"tag":p,h=o.name.toLowerCase(),d=null===(e=o.tagType)||void 0===e?void 0:e.toLowerCase(),v=d===a.Q.Normal&&t.themeColours&&!!(null===(n=t.themeColours)||void 0===n?void 0:n.secondary),b="".concat(u.Z.badgeBase," rounded-pill py-1 px-2 my-1 me-1 ").concat(y," ").concat(function(t,e){switch(t){case a.Q.Pedagogy:case a.Q.Skill:return"pedagogy-tag text-white";case a.Q.Hidden:return"hidden-tag fw-normal";case a.Q.Normal:return e?"":"bg-gray-100 fw-normal";default:return""}}(d,v)),m="text-truncate text-nowrap";v&&(b+=" text-white"),!l&&!s||f||(b+=" cursor-pointer"),f&&(b+=" "+u.Z.disabled),t.onRemove&&(b+=" "+u.Z.removeBadge,m+=" "+"".concat(u.Z.removeBadgeText," d-inline-flex align-items-center lh-1")),l||(b+=" d-inline-block");var g=v?{backgroundColor:t.themeColours.secondary}:{};return l?r.createElement(i.F,{onClick:s,appLink:l,className:b,title:h,style:g},r.createElement("span",{className:m},h)):r.createElement("button",{onClick:s,className:b,title:h,style:g,"aria-label":"".concat(c("ariaFilter")," ").concat(h)},r.createElement("span",{className:m},h,t.onRemove&&r.createElement("button",{onClick:t.onRemove,className:"".concat(u.Z.close," btn-close font-size-normal"),role:"button","aria-label":"Close"})))}},44829:(t,e,n)=>{"use strict";var r,o;n.d(e,{Q:()=>r}),function(t){t.Normal="normal",t.Pedagogy="pedagogy",t.Hidden="hidden",t.Skill="skill",t.Curation="curation"}(r||(r={})),function(t){t[t.Normal=0]="Normal",t[t.Pedagogy=1]="Pedagogy",t[t.Hidden=2]="Hidden",t[t.Skill=3]="Skill",t[t.Curation=4]="Curation"}(o||(o={}))},23455:(t,e,n)=>{"use strict";n.d(e,{h:()=>a});var r=n(32735),o=n(81886),i=n(20470);function a(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];r.useEffect((function(){e.length&&e.some(o.Q.Ry.isStatusCodeError)&&o.Q.Ry.throw(new i.x)}),e)}},45778:(t,e,n)=>{"use strict";n.d(e,{G:()=>o});var r=n(4594),o={isType:function(t,e){var n;return(null==t?void 0:t.typeId)?t.typeId===e:(null===(n=null==t?void 0:t.type)||void 0===n?void 0:n.toLowerCase())===r.E[e].toLowerCase()},isResource:function(t){return o.isType(t,r.E.Resource)},isClassification:function(t){return"Subject"===t.type}}},7017:(t,e,n)=>{"use strict";n.d(e,{Z:()=>u});var r=n(32735),o=n(83345);const i={adFreeBadge:"xUXHs",small:"rqFjv"};var a="tv.adFreeBadge";function u(t){return r.createElement("div",{className:"".concat(i.adFreeBadge," ").concat(t.small?i.small:""," ").concat(t.className||""," d-flex align-items-center rounded bg-red text-white fw-semibold px-1 font-size-sm")},r.createElement(o.x,{namespace:a,phrase:"adFree"}))}},69435:(t,e,n)=>{"use strict";n.d(e,{J:()=>i});var r=n(32735);const o={channelBadge:"Ud_W9",small:"A0WD4"};function i(t){return r.createElement("div",{className:"".concat(o.channelBadge," ").concat(t.small?o.small:""," ").concat(t.className||"")},r.createElement("img",{className:"h-100 align-baseline",src:t.logoUrl}))}},65972:(t,e,n)=>{"use strict";n.d(e,{B:()=>u});var r=n(32735),o=n(14965),i=n(55667);const a={programTimeBadge:"Avu4L",small:"a1Wkd",hover:"fbzDz"};function u(t){var e=t.program.timeZone||t.program.region.timeZone,n=(0,i.h)(t.program.startTime,e),u=(0,i.h)(t.program.stopTime,e);return r.createElement("div",{className:"".concat(a.programTimeBadge," ").concat(t.small?"".concat(a.small," align-items-end"):"align-items-center"," ").concat(t.hover?a.hover:""," ").concat(t.className||""," d-flex bg-white text-nowrap border border-dark rounded-pill px-2")},r.createElement("span",null,t.showDate&&"".concat(o.O.format(n,"D MMM")," @ "),o.O.format(n,"hh:mma"),t.showEndTime&&" - ".concat(o.O.format(u,"hh:mma"))))}},55667:(t,e,n)=>{"use strict";n.d(e,{h:()=>i});var r=n(14965),o={"AUS Eastern Standard Time":"Australia/Sydney","W. Australia Standard Time":"Australia/Perth","E. Australia Standard Time":"Australia/Brisbane","Cen. Australia Standard Time":"Australia/Adelaide","New Zealand Standard Time":"Pacific/Auckland","GMT Standard Time":"Europe/London"};function i(t,e){return r.O.getUtcTimeByTimezone(t,"YYYY-MM-DDTHH:mm:ss",o[e])}},1557:(t,e,n)=>{"use strict";n.d(e,{$:()=>c});var r=n(32735),o=n(11607),i=n(83914),a=n(35223);const u={overlay:"Ux3Um",close:"D1Gyv",preview:"IGttc"};function c(t){return r.createElement(r.Fragment,null,r.createElement("div",{className:"".concat(u.overlay," ").concat(u.preview," d-flex align-items-center justify-content-start")},r.createElement(i.x,{svgName:a.vn.VisibleOn,size:i.S.Large})),r.createElement(o.L,{className:"".concat(u.overlay," ").concat(u.close," d-flex align-items-center justify-content-center"),onClick:t.closePopup},r.createElement(i.x,{svgName:a.vn.Close,size:i.S.Large})))}},84034:(t,e,n)=>{"use strict";n.d(e,{d:()=>U});var r=n(32735),o=n(42648),i=n(78259),a=n(65858),u=n(18967),c=n(28203),l=n(17464),s=n(42029),f=n(83345),p=n(49439);const y={copyrightDisclaimer:"z8YoI",overlayContainer:"eJDbJ"};function h(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}var d="shared.copyrightDisclaimer",v=150;function b(t){var e,n,o,i=(n=(0,p.L)({}),o=2,function(t){if(Array.isArray(t))return t}(n)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,u=[],c=!0,l=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(u.push(r.value),u.length!==e);c=!0);}catch(t){l=!0,o=t}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}(n,o)||function(t,e){if(t){if("string"==typeof t)return h(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?h(t,e):void 0}}(n,o)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),a=i[0],u=i[1];return r.createElement("div",{ref:a,className:t.className},r.createElement("p",{className:"".concat(y.copyrightDisclaimer," ").concat(null!==(e=t.phraseClassName)&&void 0!==e?e:"mb-1")},r.createElement(f.x,{namespace:d,phrase:"copyrightDisclaimer"})),r.createElement(s.Z,{target:a.current,show:u,placement:t.overflowPlacement&&function(){var t;return document.documentElement.clientHeight-(null===(t=a.current)||void 0===t?void 0:t.getBoundingClientRect().bottom)<v}()?t.overflowPlacement:t.placement},r.createElement("div",{className:"".concat(y.overlayContainer," mw-100 bg-white border rounded-3 p-2")},r.createElement("p",null,r.createElement(f.x,{namespace:d,phrase:"warning"})),r.createElement("p",{className:"fw-semibold mb-0"},r.createElement(f.x,{namespace:d,phrase:"sharing"})))))}var m=n(82302),g=n(1048),w=n(66090);function O(t){return function(t){if(Array.isArray(t))return P(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return P(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?P(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function P(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function S(t){var e=t.page,n=t.totalPages,r=w.O.isNumber(e)&&e>0&&e<n&&e+1,o=w.O.isNumber(e)&&e>1&&e-1,i={};if(r&&r<=n&&(i.next=r.toString()),o&&(i.previous=o.toString()),!g.t.isEmpty(i))return i}var j={isEmpty:function(t){return t&&!(t.data&&t.data.length)},length:function(t){return t&&t.data&&t.data.length},at:function(t,e){if(t&&t.data&&t.data.length&&!(e>t.data.length))return t.data[e]},get:function(t,e){if(t&&t.data&&t.data.length)return t.data.find((function(t){return t.id&&t.id.toString()===e}))},flattenCollections:function(t){if(t&&t.length){var e=[];return t.forEach((function(t){e=[].concat(O(e),O(t.data))})),e}},getNextCursor:function(t){return t.pagination&&t.pagination.cursors&&t.pagination.cursors.next},convertLegacyPaginatedCollection:function(t){if(t)return{data:t.data,pagination:{cursors:S(t.pagination),limit:t.pagination.pageSize}}},hasData:function(t){return!j.isEmpty(t)}},k=n(23481),_=n(16035),C=n(44829),E=n(2096);function T(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function x(t){var e;switch(null===(e=t.tagType)||void 0===e?void 0:e.toLowerCase()){case C.Q.Pedagogy:return 0;case C.Q.Skill:return 1;default:return 2}}function L(t){if(!t.tags)return r.createElement(r.Fragment,null);var e,n=(e=t.tags,function(t){if(Array.isArray(t))return T(t)}(e)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(e)||function(t,e){if(t){if("string"==typeof t)return T(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?T(t,e):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).sort((function(t,e){return x(t)-x(e)}));return r.createElement("div",{className:"".concat(E.Z.tagList," ").concat(t.className)},n.map((function(e){var n="function"==typeof t.getAppLink?t.getAppLink(e):null,o="function"==typeof t.onRemove?function(){return t.onRemove(e)}:null,i="function"==typeof t.onClick?function(){return t.onClick(e)}:null;return r.createElement(_.z,{key:e.id||e.name,tag:e,appLink:n,themeColours:t.themeColours,onRemove:o,onClick:i})})))}function R(t){var e=t.label,n=t.items;if(!(n&&n.data&&n.data.length))return r.createElement(r.Fragment,null);var o=n.data.map((function(t){return t.name})).join(", ");return r.createElement("div",{className:"mb-2"},e,": ",o)}var I="exchange.detailsSection",D=k.T.encloseNamespace(I);function B(t){var e,n,o,i,a,u,c,l,s,p,y=t.video,h=t.hasPPDD,d=t.description;return r.createElement("div",{className:d?"col-md-5 ps-md-3 pt-3 pt-md-0":"col-12"},r.createElement("h2",{className:"h6 mb-2"},r.createElement(f.x,{namespace:I,phrase:"details"})),h&&r.createElement("div",null,r.createElement(R,{label:D("productionCompanies",{smartCount:null===(n=null===(e=y.productionCompanies)||void 0===e?void 0:e.data)||void 0===n?void 0:n.length}),items:y.productionCompanies}),r.createElement(R,{label:D("distributors",{smartCount:null===(i=null===(o=y.distributors)||void 0===o?void 0:o.data)||void 0===i?void 0:i.length}),items:y.distributors}),r.createElement(R,{label:D("producers",{smartCount:null===(u=null===(a=y.producers)||void 0===a?void 0:a.data)||void 0===u?void 0:u.length}),items:y.producers}),r.createElement(R,{label:D("directors",{smartCount:null===(l=null===(c=y.directors)||void 0===c?void 0:c.data)||void 0===l?void 0:l.length}),items:y.directors})),!!(null===(p=null===(s=y.tags)||void 0===s?void 0:s.data)||void 0===p?void 0:p.length)&&r.createElement(L,{tags:y.tags.data}))}var N=n(55215),M=n(7017),A=n(69435),F=n(65972);const Z={previewBadge:"JA0mN",previewAlert:"qFT4M"};var V="exchange.previewVideoDetails",z=200;function U(t){var e,n,s,p,y,h=t.title,d=t.description,v=t.video,g=t.videoActions,w=function(t){return!!t&&!j.isEmpty(t)},O=!!(null==v?void 0:v.series),P=!!(null===(e=null==v?void 0:v.rating)||void 0===e?void 0:e.value)||!!(null==v?void 0:v.productionYear)||t.program,S=w(null==v?void 0:v.productionCompanies)||w(null==v?void 0:v.producers)||w(null==v?void 0:v.distributors)||w(null==v?void 0:v.directors),k=!!d,_=S||!!(null===(s=null===(n=null==v?void 0:v.tags)||void 0===n?void 0:n.data)||void 0===s?void 0:s.length);return r.createElement("div",{className:"p-3"},r.createElement("div",{className:"".concat(O||P?"mb-3":"mb-2"," position-relative")},r.createElement("div",{className:"w-100"},r.createElement("div",{className:"ms-2 float-end"},r.createElement(u.e,{actions:g,actionsDropdownClassName:"btn btn-outline-dark px-1"})),!!v&&r.createElement(m.$,{type:"series",video:v,appLink:(0,N.cL)(v.series),className:"text-wrap",analyticsOptions:{location:a.LZ.PlayPage}}),r.createElement("h1",{className:"h4 mb-1 ".concat(O||P?"":"mb-0 pt-2")},r.createElement("span",{className:"align-self-center"},h))),P&&r.createElement(l.c,null,r.createElement(c.C,{type:c.g.Rating,data:null==v?void 0:v.rating,className:"".concat(Z.previewBadge," fw-semibold py-0 font-size-normal align-items-center px-2")}),r.createElement(c.C,{type:c.g.ProductionYear,data:null==v?void 0:v.productionYear,className:"".concat(Z.previewBadge," fw-semibold font-size-sm align-items-center px-1")}),(null===(p=t.program)||void 0===p?void 0:p.channelLogoUrl)&&r.createElement(A.J,{logoUrl:t.program.channelLogoUrl,className:"me-1"}),(null===(y=t.program)||void 0===y?void 0:y.hasAdsFree)&&r.createElement(M.Z,{className:"me-1"}),t.program&&r.createElement(F.B,{program:t.program,showDate:!0,showEndTime:!0}))),r.createElement("div",null,r.createElement(o.$B,{autoHeight:!0,autoHeightMax:z},r.createElement("div",{className:"row g-0"},k&&r.createElement("div",{className:_?"border-end pe-3 col-md-7":"col-12"},r.createElement("div",{className:"d-flex align-items-center"},r.createElement("h2",{className:"h6 mb-2"},r.createElement(f.x,{namespace:V,phrase:"description"}))),r.createElement("p",{className:"mb-2",dangerouslySetInnerHTML:{__html:i.O.linkifyText(d,{nl2br:!0})}})),_&&r.createElement(B,{video:v,hasPPDD:S,description:d}))),t.video&&r.createElement("div",{className:"row"},r.createElement("div",{className:"".concat(S?"d-md-block col-7":""," d-none")}),r.createElement("div",{className:"".concat(S?"col-md-5 ps-md-3":"ps-2 "," ")},r.createElement(b,{placement:S?"bottom-end":"bottom-start",overflowPlacement:S?"top-end":"top-start"})))))}},60202:(t,e,n)=>{"use strict";n.d(e,{L:()=>hw});var r=n(32735),o=(n(39682),n(76032));function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function u(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,l(r.key),r)}}function c(t,e,n){return e&&u(t.prototype,e),n&&u(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function l(t){var e=function(t){if("object"!=i(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==i(e)?e:e+""}function s(t,e,n){return e=h(e),function(t,e){if(e&&("object"==i(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,f()?Reflect.construct(e,n||[],h(t).constructor):e.apply(t,n))}function f(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(f=function(){return!!t})()}function p(t,e,n,r){var o=y(h(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof o?function(t){return o.apply(n,t)}:o}function y(){return y="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=h(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},y.apply(null,arguments)}function h(t){return h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},h(t)}function d(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&v(t,e)}function v(t,e){return v=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},v(t,e)}var b=function(t){function e(t,n){return a(this,e),s(this,e,[t,n])}return d(e,t),c(e,[{key:"handleClick",value:function(t){var n=this;p(e,"handleClick",this,3)([t]),this.requestAnimationFrame((function(){n.options_.item.showCollapsibleMenu()}))}},{key:"createEl",value:function(t,n,r){if(!this.options_.item)return p(e,"createEl",this,3)([t,n,r]);var i=this.options_.item.getCollabsibleName(),a=this.options_.item.getCollabsibleValue(),u=this.options_.item.className,c='<span class="vjs-menu-item-text">'.concat(i,"</span>");this.valueHolder_=o.Z.dom.createEl("span",{innerHTML:a});var l=p(e,"createEl",this,3)([t,{className:"vjs-menu-item cv-cog-menu-item ".concat(a?"cv-has-cog-value":""," ").concat(u||"").trim(),innerHTML:c},r]);return l.appendChild(this.valueHolder_),l}},{key:"updateCollapsibleValue",value:function(){this.valueHolder_.innerHTML=this.options_.item.getCollabsibleValue()}}])}(o.Z.getComponent("MenuItem")),m=function(t){function e(t,n){var r;return a(this,e),(r=s(this,e,[t,n])).controlText("Settings"),r}return d(e,t),c(e,[{key:"buildWrapperCSSClass",value:function(){return"cv-menu-small cv-cog-menu-button ".concat(p(e,"buildWrapperCSSClass",this,3)([]))}},{key:"buildCSSClass",value:function(){return"cv-cog-button ".concat(p(e,"buildCSSClass",this,3)([]))}},{key:"pressButton",value:function(){this.player_.options_.deferMenus?this.player_.deferMenusPlugin().deferMenu():(this.menu.children_.forEach((function(t){t.updateCollapsibleValue&&t.updateCollapsibleValue()})),p(e,"pressButton",this,3)([]))}},{key:"createItems",value:function(){for(var t,e=this,n=[],r=0;r<this.options_.items.length;r++){var o=this.options_.items[r];o.isCollabsible&&o.showInCollabsibleMenu()&&o.isCollapsed&&n.push(new b(this.player_,{item:o}))}return(null===(t=this.additionalItems)||void 0===t?void 0:t.length)&&this.additionalItems.forEach((function(t){var r,o=new t.ctor(e.player_,Object.assign(Object.assign({},e.options_),null!==(r=t.options)&&void 0!==r?r:{}));n.splice(t.index,0,o)})),n}},{key:"update",value:function(){p(e,"update",this,3)([]),this.player_.trigger("resizemenus")}},{key:"addItem",value:function(t){this.additionalItems||(this.additionalItems=[]),this.additionalItems.some((function(e){return e.name===t.name}))||(this.additionalItems.push(t),this.update())}}])}(o.Z.getComponent("MenuButton"));function g(t){return g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},g(t)}function w(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,O(r.key),r)}}function O(t){var e=function(t){if("object"!=g(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=g(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==g(e)?e:e+""}function P(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(P=function(){return!!t})()}function S(){return S="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=j(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},S.apply(null,arguments)}function j(t){return j=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},j(t)}function k(t,e){return k=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},k(t,e)}o.Z.registerComponent("cogButton",m);var _=function(t){function e(t,n){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,n){return e=j(e),function(t,e){if(e&&("object"==g(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,P()?Reflect.construct(e,n||[],j(t).constructor):e.apply(t,n))}(this,e,[t,n])}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&k(t,e)}(e,t),n=e,r=[{key:"createEl",value:function(){return o.Z.dom.createEl("li",{className:"vjs-menu-item cv-collapsible-menu-heading cv-divider-after-menu-item",innerHTML:'<span class="vjs-menu-item-text">'.concat(this.localize(this.options_.label),"</span>"),tabIndex:-1})}},{key:"handleClick",value:function(t){var n,r,o,i=this;(n=e,r=this,"function"==typeof(o=S(j(1&3?n.prototype:n),"handleClick",r))?function(t){return o.apply(r,t)}:o)([t]),this.options_.onClickBack?this.options_.onClickBack():this.requestAnimationFrame((function(){i.player_.getChild("collapserator").getChild("cogButton").pressButton()}))}}],r&&w(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getComponent("MenuItem"));function C(t){return C="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},C(t)}function E(){return E="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=B(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},E.apply(null,arguments)}function T(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function x(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,R(r.key),r)}}function L(t,e,n){return e&&x(t.prototype,e),n&&x(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function R(t){var e=function(t){if("object"!=C(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=C(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==C(e)?e:e+""}function I(t,e,n){return e=B(e),function(t,e){if(e&&("object"==C(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,D()?Reflect.construct(e,n||[],B(t).constructor):e.apply(t,n))}function D(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(D=function(){return!!t})()}function B(t){return B=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},B(t)}function N(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&M(t,e)}function M(t,e){return M=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},M(t,e)}var A=o.Z.getComponent("MenuItem"),F=o.Z.getComponent("MenuButton"),Z=["large","medium","small"],V=function(t){function e(t,n){return T(this,e),I(this,e,[t,n])}return N(e,t),L(e,[{key:"handleClick",value:function(){this.player_.textTrackSettings.setSizeSetting(this.options_.value)}}])}(A),z=function(t){function e(t,n){var r;return T(this,e),(r=I(this,e,[t,n])).alwaysCollapsed=!0,r.isCollapsed=!1,r.isCollabsible=!0,r.player_.ready((function(){r.update()})),r}return N(e,t),L(e,[{key:"createItems",value:function(){var t=this,e=this.player_.textTrackSettings;if(e){var n=e.getSizeSetting(),r=[new _(this.player_,{label:"Caption Text Size",onClickBack:function(){t.requestAnimationFrame((function(){t.player_.getChild("collapserator").getChild("subsCapsButton").pressButton()}))}})];return Z.map((function(e){r.push(new V(t.player_,{label:e.charAt(0).toUpperCase()+e.substring(1),selectable:!0,multiSelectable:!1,selected:e===n,value:e}))})),r}}},{key:"buildWrapperCSSClass",value:function(){return"cv-menu-small cv-has-left-icons ".concat((t=e,n=this,"function"==typeof(r=E(B(1&3?t.prototype:t),"buildWrapperCSSClass",n))?function(t){return r.apply(n,t)}:r)([]));var t,n,r}},{key:"getCollabsibleName",value:function(){return"Subtitle Size"}},{key:"getCollabsibleValue",value:function(){return""}},{key:"showInCollabsibleMenu",value:function(){return!1}},{key:"showCollapsibleMenu",value:function(){F.prototype.handleClick.apply(this)}}])}(F);o.Z.registerComponent("SubtitleSizeButton",z);var U=n(28400);function G(t,e,n,r){if(t.length)for(var o=t.length-1;o>=0;o--){var i=t[o];if(i.kind===e){if(n&&i.label!==n)continue;if(r&&i.language!==r)continue;return i}}}function q(t,e,n,r){t.kind===e&&(n&&t.label!==n||(t.loaded_?r(t):t.one("loadeddata",(function(){r(t)}))))}function H(t){if(null==t?void 0:t.cues.length)for(var e=0;e<t.cues.length;e++){var n=t.cues[e];(null==n?void 0:n.text)&&(n.text=U.m.sanitize(n.text))}}var W={getTrack:function(t,e,n,r){return G(t.textTracks(),e,n,r)},useTrack:function(t,e,n,r,o){var i=t.textTracks(),a=G(i,e,n,o);if(a)q(a,e,n,r);else{var u=function(t){q(t.track,e,n,r)};i.addEventListener("addtrack",u),t.one("dispose",(function(){i.removeEventListener("addtrack",u)}))}},getCurrentTextTrack:function(t){return this.findTrackByPredicate(t,(function(t){return"showing"===t.mode}))},findTrackByPredicate:function(t,e){if(!t)return null;for(var n=t.textTracks(),r=0;r<n.length;r++){var o=n[r];if(e(o))return o}return null},forEachTrack:function(t,e){if(t)for(var n=t.textTracks(),r=0;r<n.length;r++)e(n[r])},sanitizeTrack:function(t,e){if(t&&e)if(t.loaded)H(t);else{var n=function(){return H(t)};t.addEventListener("loadeddata",n),e.one("dispose",(function(){t.removeEventListener("loadeddata",n)}))}}},Q=function(t,e,n){var r,o=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:window,a=function(){for(var a=arguments.length,u=new Array(a),c=0;c<a;c++)u[c]=arguments[c];var l=!1,s=function(){r=null,s=null,t.apply(this,u)};return!r&&n&&(t.apply(o,u),l=!0),i.clearTimeout(r),r=i.setTimeout(s,e),l};return a.cancel=function(){i.clearTimeout(r),r=null},a};function Y(t){return Y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Y(t)}function $(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function K(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,J(r.key),r)}}function X(t,e,n){return e&&K(t.prototype,e),n&&K(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function J(t){var e=function(t){if("object"!=Y(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Y(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Y(e)?e:e+""}function tt(t,e,n){return e=ot(e),function(t,e){if(e&&("object"==Y(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,et()?Reflect.construct(e,n||[],ot(t).constructor):e.apply(t,n))}function et(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(et=function(){return!!t})()}function nt(t,e,n,r){var o=rt(ot(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof o?function(t){return o.apply(n,t)}:o}function rt(){return rt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=ot(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},rt.apply(null,arguments)}function ot(t){return ot=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ot(t)}function it(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&at(t,e)}function at(t,e){return at=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},at(t,e)}var ut=o.Z.getComponent("MenuItem"),ct=function(t){function e(t,n){var r;return $(this,e),(r=tt(this,e,[t,n])).onChange=Q(r.onChange,100,!1,r),r.bindEventListeners(),r}return it(e,t),X(e,[{key:"createEl",value:function(){var t=this.localize("Search");return nt(e,"createEl",this,3)(["li",{className:"vjs-menu-item cv-search-input-menu-item-container ".concat(this.options_.className||"").trim(),innerHTML:'\n <div class="cv-search-input-menu-item">\n <span class="cv-search-icon">\n <svg viewBox="0 0 24 24">\n <path d="M15.803 14.306l3.917 3.954a1 1 0 0 1-.007 1.417l-.018.018-.018.018a.997.997 0 0 1-1.41 0l-3.918-3.953-.3.214c-1.14.713-2.323 1.07-3.549 1.07-1.796 0-3.328-.642-4.597-1.925C4.634 13.836 4 12.296 4 10.5c0-1.796.634-3.328 1.903-4.597C7.172 4.634 8.704 4 10.5 4c1.796 0 3.329.634 4.597 1.903 1.27 1.269 1.904 2.801 1.904 4.597a6.447 6.447 0 0 1-1.027 3.507l-.17.3zM10.5 5.368c-1.425 0-2.637.5-3.635 1.497-.998.998-1.497 2.21-1.497 3.635 0 1.426.5 2.637 1.497 3.635.998.998 2.21 1.497 3.635 1.497 1.426 0 2.637-.499 3.635-1.497 1.027-1.026 1.54-2.238 1.54-3.635 0-1.397-.513-2.608-1.54-3.635-.998-.998-2.21-1.497-3.635-1.497z"/>\n </svg>\n </span><input placeholder="'.concat(t,'" type="text" autocomplete="off" spellcheck="false" aria-label="').concat(t,'" />\n </div>\n ')}])}},{key:"focus",value:function(){this.$("input").focus()}},{key:"handleClick",value:function(t){t.stopImmediatePropagation(),this.$("input").focus()}},{key:"handleKeyDown",value:function(){this.focus()}},{key:"bindEventListeners",value:function(){var t=this,e=this.$("input");this.onChange=this.onChange.bind(this),e.addEventListener("keyup",this.onChange),e.addEventListener("blur",(function(e){t.options_.menuButton.menu.handleBlur(e)}))}},{key:"onChange",value:function(t){var e=t.target;this.options_.search(e.value)}}])}(ut);o.Z.registerComponent("SearchInputMenuItem",ct);var lt=function(t){function e(){return $(this,e),tt(this,e,arguments)}return it(e,t),X(e,[{key:"createEl",value:function(t,n,r){return nt(e,"createEl",this,3)([t,Object.assign(Object.assign({},n),{className:"vjs-menu-item cv-no-results"}),r])}},{key:"setLabel",value:function(t){var e=this.$(".vjs-menu-item-text");e&&(e.innerHTML=t)}}])}(ut);function st(t){return st="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},st(t)}function ft(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,pt(r.key),r)}}function pt(t){var e=function(t){if("object"!=st(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=st(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==st(e)?e:e+""}function yt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(yt=function(){return!!t})()}function ht(t){return ht=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ht(t)}function dt(t,e){return dt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},dt(t,e)}o.Z.registerComponent("NoMatchingResultsMenuItem",lt);var vt=function(t){function e(t,n){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,n){return e=ht(e),function(t,e){if(e&&("object"==st(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,yt()?Reflect.construct(e,n||[],ht(t).constructor):e.apply(t,n))}(this,e,[t,n])}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&dt(t,e)}(e,t),n=e,(r=[{key:"update",value:function(t,e){var n=this;if(null==t?void 0:t.length){var r=[],o=0;t.forEach((function(t){var i=n.options_.label.substr(o,t);i&&r.push(i),r.push('<span class="cv-highlight">'),r.push(n.options_.label.substr(t,e)),r.push("</span>"),o=t+e})),r.push(this.options_.label.substring(o,this.options_.label.length)),this.el().innerHTML='<span class="vjs-menu-item-text">'.concat(r.join(""),"</span>")}else this.el().innerHTML='<span class="vjs-menu-item-text">'.concat(this.options_.label,"</span>")}},{key:"handleClick",value:function(t){t.stopImmediatePropagation(),this.player_.currentTime(this.options_.cue.startTime)}}])&&ft(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getComponent("MenuItem"));function bt(t){return bt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bt(t)}function mt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,gt(r.key),r)}}function gt(t){var e=function(t){if("object"!=bt(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=bt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==bt(e)?e:e+""}function wt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(wt=function(){return!!t})()}function Ot(t,e,n,r){var o=Pt(St(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof o?function(t){return o.apply(n,t)}:o}function Pt(){return Pt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=St(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Pt.apply(null,arguments)}function St(t){return St=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},St(t)}function jt(t,e){return jt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},jt(t,e)}var kt=o.Z.getComponent("MenuButton"),_t=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=St(e),function(t,e){if(e&&("object"==bt(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,wt()?Reflect.construct(e,n||[],St(t).constructor):e.apply(t,n))}(this,e,[t,n])).alwaysCollapsed=!0,r.isCollapsed=!1,r.isCollabsible=!0,r.update=r.update.bind(r),r.search=r.search.bind(r),r.player_.textTracks().addEventListener("selectedlanguagechange",r.update),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&jt(t,e)}(e,t),n=e,(r=[{key:"bindTrackEvents",value:function(t){var e=this;t.removeEventListener("loadeddata",this.update),t.addEventListener("loadeddata",this.update),this.player_.one("dispose",(function(){t.removeEventListener("loadeddata",e.update)}))}},{key:"createItems",value:function(){var t,e=W.getCurrentTextTrack(this.player_);if(e){if(null===(t=e.cues)||void 0===t?void 0:t.length){for(var n=[new ct(this.player_,{menuButton:this,search:this.search})],r=0;r<e.cues.length;r++){var o=e.cues[r];n.push(new vt(this.player_,{cue:o,label:o.text,selected:!1,multiSelectable:!1}))}var i=new lt(this.player_,{label:"No matching results",selected:!1,selectable:!1,multiSelectable:!1});return i.hide(),n.push(i),n}this.bindTrackEvents(e)}}},{key:"search",value:function(t){var e;t=t.trim();var n=W.getCurrentTextTrack(this.player_);if(null===(e=null==n?void 0:n.cues)||void 0===e?void 0:e.length){var r=this.findMatches(t,n);this.toggleItemVisibility(t,r),this.toggleNoResults(t,r)}}},{key:"findMatches",value:function(t,e){var n={};if(!t)return n;for(var r=new RegExp(t,"gi"),o=0;o<e.cues.length;o++){for(var i=e.cues[o].text,a=[],u=void 0;u=r.exec(i);)a.push(u.index);a.length&&(n[o]=a)}return n}},{key:"toggleItemVisibility",value:function(t,e){this.menu.children_.slice(1,this.menu.children_.length-1).forEach((function(n,r){!t||e[r]?n.show():n.hide(),n.update(e[r],t.length)}))}},{key:"toggleNoResults",value:function(t,e){var n=this.menu.children_[this.menu.children_.length-1];!t||Object.keys(e).length?n.hide():n.show()}},{key:"buildWrapperCSSClass",value:function(){return"cv-menu-big cv-subtitle-search-button ".concat(Ot(e,"buildWrapperCSSClass",this,3)([]))}},{key:"update",value:function(){Ot(e,"update",this,3)([]),this.player_.trigger("resizemenus")}},{key:"pressButton",value:function(){Ot(e,"pressButton",this,3)([]);var t=this.menu.children_[0];(null==t?void 0:t.focus)&&(null==t||t.focus())}},{key:"getCollabsibleName",value:function(){return"Subtitle Size"}},{key:"getCollabsibleValue",value:function(){return""}},{key:"showInCollabsibleMenu",value:function(){return!1}},{key:"showCollapsibleMenu",value:function(){kt.prototype.handleClick.apply(this)}}])&&mt(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(kt);function Ct(t){return Ct="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ct(t)}function Et(){return Et="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Bt(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Et.apply(null,arguments)}function Tt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function xt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Rt(r.key),r)}}function Lt(t,e,n){return e&&xt(t.prototype,e),n&&xt(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Rt(t){var e=function(t){if("object"!=Ct(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Ct(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ct(e)?e:e+""}function It(t,e,n){return e=Bt(e),function(t,e){if(e&&("object"==Ct(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Dt()?Reflect.construct(e,n||[],Bt(t).constructor):e.apply(t,n))}function Dt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Dt=function(){return!!t})()}function Bt(t){return Bt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Bt(t)}function Nt(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Mt(t,e)}function Mt(t,e){return Mt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Mt(t,e)}o.Z.registerComponent("subtitleSearchButton",_t);var At=o.Z.getComponent("MenuItem"),Ft=o.Z.getComponent("MenuButton"),Zt=[{label:"Play / Pause",type:"play-pause"},{label:"Volume",type:"volume"},{label:"Mute",type:"mute"},{label:"Toggle fullscreen",type:"fullscreen"},{label:"Exit fullscreen",type:"exit-fullscreen"}],Vt=function(t){function e(t,n){return Tt(this,e),It(this,e,[t,n])}return Nt(e,t),Lt(e,[{key:"createEl",value:function(){return o.Z.dom.createEl("li",{className:"vjs-menu-item",tabIndex:-1,innerHTML:'\n <span class="vjs-menu-item-text">'.concat(this.options_.label,"</span>\n <span>").concat(this.getDisplayHtml(this.options_.type),"\n ")})}},{key:"getDisplayHtml",value:function(t){switch(t){case"play-pause":return'<span class="cv-keyboard-button">Spacebar</span>';case"volume":return'<span class="cv-keyboard-button">Shift</span> + \n <span class="cv-keyboard-button cv-single-key">&uArr;</span> / \n <span class="cv-keyboard-button">Shift</span> +\n <span class="cv-keyboard-button cv-single-key">&dArr;</span>';case"mute":return'<span class="cv-keyboard-button cv-single-key">m</span>';case"fullscreen":return'<span class="cv-keyboard-button cv-single-key">f</span>';case"exit-fullscreen":return'<span class="cv-keyboard-button cv-single-key">esc</span>'}return""}}])}(At),zt=function(t){function e(){var t;return Tt(this,e),(t=It(this,e,arguments)).alwaysCollapsed=!0,t.isCollapsed=!1,t.isCollabsible=!0,t}return Nt(e,t),Lt(e,[{key:"createItems",value:function(){var t=this,e=[];return e.push(new _(this.player_,{label:"Keyboard Shortcuts"})),Zt.forEach((function(n){e.push(new Vt(t.player_,n))})),e}},{key:"buildWrapperCSSClass",value:function(){return"cv-menu-small cv-keyboard-shortcuts ".concat((t=e,n=this,"function"==typeof(r=Et(Bt(1&3?t.prototype:t),"buildWrapperCSSClass",n))?function(t){return r.apply(n,t)}:r)([]));var t,n,r}},{key:"getCollabsibleName",value:function(){return"Keyboard Shortcuts"}},{key:"getCollabsibleValue",value:function(){return""}},{key:"showInCollabsibleMenu",value:function(){return!this.player_.options_.mobile}},{key:"showCollapsibleMenu",value:function(){Ft.prototype.handleClick.apply(this)}}])}(Ft);function Ut(t){return Ut="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ut(t)}function Gt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,qt(r.key),r)}}function qt(t){var e=function(t){if("object"!=Ut(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Ut(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ut(e)?e:e+""}function Ht(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Ht=function(){return!!t})()}function Wt(t,e,n,r){var o=Qt(Yt(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof o?function(t){return o.apply(n,t)}:o}function Qt(){return Qt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Yt(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Qt.apply(null,arguments)}function Yt(t){return Yt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Yt(t)}function $t(t,e){return $t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},$t(t,e)}o.Z.registerComponent("KeyboardShortcutsButton",zt);var Kt="cv-collapsed",Xt=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=Yt(e),function(t,e){if(e&&("object"==Ut(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Ht()?Reflect.construct(e,n||[],Yt(t).constructor):e.apply(t,n))}(this,e,[t,n])).addChild("cogButton",{items:r.children_},r.children_.length-1),r.update=r.update.bind(r),r.player_.on("cv-updatecog",r.update),r.player_.on("playerresize",r.update),r.player_.one("play",r.update),r.player_.on("dispose",(function(){r.player_.off("cv-updatecog",r.update),r.player_.off("playerresize",r.update),r.player_.off("play",r.update)})),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&$t(t,e)}(e,t),n=e,(r=[{key:"toggleHidden",value:function(t){for(var e=0;e<this.children_.length;e++){var n=this.children_[e];n.isCollabsible&&(n.alwaysCollapsed||t?(n.isCollapsed=!0,n.addClass(Kt)):(n.isCollapsed=!1,n.removeClass(Kt)))}this.getChild("cogButton").update()}},{key:"update",value:function(){var t=this.player_.isFullscreen(),e=this.player_.whiteboardModePlugin().side,n=this.player_.el().getBoundingClientRect(),r=!t||"left"!==e&&"right"!==e?n.width:n.height;if(r){this.addClass("cv-collapsorator-ready");var o=r<(!t||"left"!==e&&"right"!==e&&"top"!==e?600:1200);this.player_.options_.deferMenus&&(o=!0),this.toggleHidden(o)}}},{key:"buildCSSClass",value:function(){return"cv-collapsorator ".concat(Wt(e,"buildCSSClass",this,3)([]))}},{key:"createEl",value:function(t,n,r){return Wt(e,"createEl",this,3)([t,Object.assign(Object.assign({},n),{className:this.buildCSSClass()}),r])}}])&&Gt(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getComponent("Component"));o.Z.registerComponent("collapserator",Xt);var Jt=["playToggle","volumePanel","customControlSpacer","playbackRateMenuButton","chaptersButton","qualityButton","keyboardShortcutsButton","subsCapsButton","whiteboardModeButton","subtitleSizeButton","subtitleSearchButton","fullscreenToggle"],te=n(57900),ee=n(52881),ne=n(65858),re=n(50873);function oe(t){return oe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},oe(t)}function ie(){ie=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,n){return t[e]=n}}function s(t,e,n,r){var i=e&&e.prototype instanceof b?e:b,a=Object.create(i.prototype),u=new x(r||[]);return o(a,"_invoke",{value:_(t,n,u)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var p="suspendedStart",y="suspendedYield",h="executing",d="completed",v={};function b(){}function m(){}function g(){}var w={};l(w,a,(function(){return this}));var O=Object.getPrototypeOf,P=O&&O(O(L([])));P&&P!==n&&r.call(P,a)&&(w=P);var S=g.prototype=b.prototype=Object.create(w);function j(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function n(o,i,a,u){var c=f(t[o],t,i);if("throw"!==c.type){var l=c.arg,s=l.value;return s&&"object"==oe(s)&&r.call(s,"__await")?e.resolve(s.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,u)}))}u(c.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function _(e,n,r){var o=p;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var u=r.delegate;if(u){var c=C(u,r);if(c){if(c===v)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=h;var l=f(e,n,r);if("normal"===l.type){if(o=r.done?d:y,l.arg===v)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=d,r.method="throw",r.arg=l.arg)}}}function C(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,C(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=f(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function x(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function L(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(oe(e)+" is not iterable")}return m.prototype=g,o(S,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:m,configurable:!0}),m.displayName=l(g,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,l(t,c,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},j(k.prototype),l(k.prototype,u,(function(){return this})),e.AsyncIterator=k,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new k(s(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},j(S),l(S,c,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=L,x.prototype={constructor:x,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return u.type="throw",u.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),l=r.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),T(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;T(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:L(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}function ae(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,ue(r.key),r)}}function ue(t){var e=function(t){if("object"!=oe(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=oe(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==oe(e)?e:e+""}var ce=function(){return t=function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.options=e,this.initialize()},(e=[{key:"logStream",value:function(){var t="v:".concat(this.options.videoId);te.SG.cacheExists(t)||(this.collectionApiClient.log({type:ne.Vw.WebPlayerStream,actionContext:this.getActionContext(),data:this.getAnalyticsData(),eventVersion:ne.eq.V3}),te.SG&&te.SG.cacheSet(t,null,300))}},{key:"logVideoProgress",value:function(t){var e=this,n=this.getAnalyticsData();this.collectionApiClient.log(t.map((function(t){return{type:ne.Vw.StreamProgress,actionContext:e.getActionContext(),data:Object.assign(Object.assign({},n),{progress:t}),eventVersion:ne.eq.V2}})))}},{key:"logUserAction",value:function(t,e){var n=Object.assign(Object.assign({},this.getAnalyticsData()),t),r=Object.assign(Object.assign({},this.getActionContext()),e);this.collectionApiClient.log({type:e.actionType,data:n,actionContext:r,eventVersion:e.eventVersion||ne.eq.V2})}},{key:"getAnalyticsData",value:function(){var t=Object.assign({video:{id:this.options.videoId},flags:{isUsingLocalCache:this.options.isUsingLocalCache}},this.options.additionalAnalyticsData||{});this.options.shareId&&(t.video.shareId=this.options.shareId);var e=this.getEntityType();return e===ne.py.Interactive?t.interactive={id:+this.options.mediaId}:e===ne.py.Clip&&(t.clip={id:+this.options.mediaId}),t}},{key:"initialize",value:function(){this.setupCollectionApiClient()}},{key:"setupCollectionApiClient",value:function(){var t=this;this.collectionApiClient=new ee.q({productName:"player.web",productVersion:this.options.productVersion,regionName:this.options.regionName,collectionApiUrls:this.options.collectionApiUrls,collectionApiClientId:this.options.collectionApiClientId,getUser:function(){return t.getCurrentUser()},shouldLog:re.k.shouldLog,formatData:re.k.formatData})}},{key:"getCurrentUser",value:function(){return t=this,e=void 0,n=void 0,r=ie().mark((function t(){return ie().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",{id:this.options.userId,customerId:this.options.customerId});case 1:case"end":return t.stop()}}),t,this)})),new(n||(n=Promise))((function(o,i){function a(t){try{c(r.next(t))}catch(t){i(t)}}function u(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,u)}c((r=r.apply(t,e||[])).next())}));var t,e,n,r}},{key:"getActionContext",value:function(){return{entity:this.getEntityType(),location:this.getLocationContext(),productArea:void 0,descriptor:this.options.isEmbedded?ne.MC.Embedded:void 0,workflowPhase:void 0}}},{key:"getEntityType",value:function(){switch(this.options.mediaType){case"MasterVideo":return ne.py.Video;case"MasterInteractive":return ne.py.Interactive;case"MasterClip":return ne.py.Clip}}},{key:"getLocationContext",value:function(){switch(this.options.playerType){case"player":return ne.LZ.Player;case"interactive-player":return ne.LZ.InteractivePlayer;case"create-clip-player":return ne.LZ.CreateClipPlayer}}}])&&ae(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function le(t){return le="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},le(t)}function se(t){var e="function"==typeof Map?new Map:void 0;return se=function(t){if(null===t||!function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return function(t,e,n){if(fe())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,e);var o=new(t.bind.apply(t,r));return n&&pe(o,n.prototype),o}(t,arguments,ye(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),pe(n,t)},se(t)}function fe(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(fe=function(){return!!t})()}function pe(t,e){return pe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},pe(t,e)}function ye(t){return ye=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ye(t)}var he=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=ye(e),function(t,e){if(e&&("object"==le(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,fe()?Reflect.construct(e,n||[],ye(t).constructor):e.apply(t,n))}(this,e,[(null==n?void 0:n.title)||"Ajax error"])).url=t,r.response=n,r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&pe(t,e)}(e,t),n=e,Object.defineProperty(n,"prototype",{writable:!1}),n;var n}(se(Error));function de(t){return de="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},de(t)}function ve(){ve=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,n){return t[e]=n}}function s(t,e,n,r){var i=e&&e.prototype instanceof b?e:b,a=Object.create(i.prototype),u=new x(r||[]);return o(a,"_invoke",{value:_(t,n,u)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var p="suspendedStart",y="suspendedYield",h="executing",d="completed",v={};function b(){}function m(){}function g(){}var w={};l(w,a,(function(){return this}));var O=Object.getPrototypeOf,P=O&&O(O(L([])));P&&P!==n&&r.call(P,a)&&(w=P);var S=g.prototype=b.prototype=Object.create(w);function j(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function n(o,i,a,u){var c=f(t[o],t,i);if("throw"!==c.type){var l=c.arg,s=l.value;return s&&"object"==de(s)&&r.call(s,"__await")?e.resolve(s.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,u)}))}u(c.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function _(e,n,r){var o=p;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var u=r.delegate;if(u){var c=C(u,r);if(c){if(c===v)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=h;var l=f(e,n,r);if("normal"===l.type){if(o=r.done?d:y,l.arg===v)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=d,r.method="throw",r.arg=l.arg)}}}function C(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,C(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=f(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function x(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function L(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(de(e)+" is not iterable")}return m.prototype=g,o(S,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:m,configurable:!0}),m.displayName=l(g,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,l(t,c,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},j(k.prototype),l(k.prototype,u,(function(){return this})),e.AsyncIterator=k,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new k(s(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},j(S),l(S,c,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=L,x.prototype={constructor:x,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return u.type="throw",u.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),l=r.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),T(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;T(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:L(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}function be(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,me(r.key),r)}}function me(t){var e=function(t){if("object"!=de(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=de(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==de(e)?e:e+""}var ge=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{c(r.next(t))}catch(t){i(t)}}function u(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,u)}c((r=r.apply(t,e||[])).next())}))},we=new(function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.tokens={gateway:null}},e=[{key:"get",value:function(t,e){return ge(this,void 0,void 0,ve().mark((function n(){return ve().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.t0=this,n.next=3,fetch(t,{method:"GET",mode:"cors",headers:this.getHeaders(e)});case 3:return n.t1=n.sent,n.next=6,n.t0.parseResponse.call(n.t0,n.t1);case 6:return n.abrupt("return",n.sent);case 7:case"end":return n.stop()}}),n,this)})))}},{key:"delete",value:function(t,e){return ge(this,void 0,void 0,ve().mark((function n(){return ve().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,fetch(t,{method:"DELETE",headers:this.getHeaders(e)});case 2:case"end":return n.stop()}}),n,this)})))}},{key:"post",value:function(t,e,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return ge(this,void 0,void 0,ve().mark((function o(){var i;return ve().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,fetch(t,{method:"POST",headers:this.getHeaders(n),body:e,mode:"cors"});case 2:if(i=o.sent,!r){o.next=7;break}return o.next=6,this.parseResponse(i);case 6:return o.abrupt("return",o.sent);case 7:case"end":return o.stop()}}),o,this)})))}},{key:"put",value:function(t,e,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return ge(this,void 0,void 0,ve().mark((function o(){var i;return ve().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,fetch(t,{method:"PUT",headers:this.getHeaders(n),body:e,mode:"cors"});case 2:if(i=o.sent,!r){o.next=7;break}return o.next=6,this.parseResponse(i);case 6:return o.abrupt("return",o.sent);case 7:case"end":return o.stop()}}),o,this)})))}},{key:"setToken",value:function(t,e){this.tokens[t]=e}},{key:"getHeaders",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e={"Content-Type":"application/json"};return this.tokens[t.tokenName]&&(e.authorization="Bearer ".concat(this.tokens[t.tokenName])),e}},{key:"parseResponse",value:function(t){return ge(this,void 0,void 0,ve().mark((function e(){var n,r;return ve().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(404!==t.status){e.next=2;break}return e.abrupt("return",null);case 2:if(t.ok){e.next=15;break}return e.prev=3,e.next=6,t.json();case 6:n=e.sent,e.next=12;break;case 9:throw e.prev=9,e.t0=e.catch(3),new he(t.url);case 12:throw e.prev=12,new he(t.url,n);case 15:return e.next=17,t.json();case 17:return r=e.sent,e.abrupt("return",r);case 19:case"end":return e.stop()}}),e,null,[[3,9,12,15]])})))}}],e&&be(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}()),Oe=n(19389),Pe=n.n(Oe);function Se(t){return Se="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Se(t)}function je(t,e,n){return(e=function(t){var e=function(t){if("object"!=Se(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Se(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Se(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ke(t){t.paused()?t.play():t.pause()}function _e(t,e){t.currentTime(t.currentTime()+e)}function Ce(t,e){t.volume(t.volume()+e)}var Ee,Te=je(je(je(je(je(je(je(je(je(je({},"f",(function(t){document[t.fsApi_.fullscreenEnabled]&&(t.isFullscreen()?t.exitFullscreen():t.requestFullscreen())})),"m",(function(t){var e=t.volume(),n=t.lastVolume_();if(0===e){var r=n<.1?.1:n;t.volume(r),t.muted(!1)}else t.muted(!t.muted())})),"k",ke),"space",ke),"left",(function(t){return _e(t,-5)})),"right",(function(t){return _e(t,5)})),"j",(function(t){return _e(t,-10)})),"l",(function(t){return _e(t,10)})),"up",(function(t){return Ce(t,.05)})),"down",(function(t){return Ce(t,-.05)}));!function(t){t.PhysicallyChapteredVideo="physically-chaptered-video"}(Ee||(Ee={}));var xe=n(83765);function Le(t){return Le="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Le(t)}function Re(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Ie(r.key),r)}}function Ie(t){var e=function(t){if("object"!=Le(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Le(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Le(e)?e:e+""}function De(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(De=function(){return!!t})()}function Be(){return Be="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Ne(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Be.apply(null,arguments)}function Ne(t){return Ne=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ne(t)}function Me(t,e){return Me=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Me(t,e)}n(35571);var Ae=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=Ne(e),function(t,e){if(e&&("object"==Le(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,De()?Reflect.construct(e,n||[],Ne(t).constructor):e.apply(t,n))}(this,e,[t])).options=n,r.configureMenuDimensions=r.configureMenuDimensions.bind(r),r.initialize(),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Me(t,e)}(e,t),n=e,r=[{key:"initialize",value:function(){this.player.ready(this.configureMenuDimensions),this.player.one("play",this.configureMenuDimensions),this.player.on("resize",this.configureMenuDimensions),this.player.on("fullscreenchange",this.configureMenuDimensions),this.player.on("resizemenus",this.configureMenuDimensions),this.player.on("ready",this.configureMenuDimensions)}},{key:"dispose",value:function(){var t,n,r;this.player.off("resize",this.configureMenuDimensions),this.player.off("fullscreenchange",this.configureMenuDimensions),this.player.off("resizemenus",this.configureMenuDimensions),this.player.off("ready",this.configureMenuDimensions),(t=e,n=this,"function"==typeof(r=Be(Ne(1&3?t.prototype:t),"dispose",n))?function(t){return r.apply(n,t)}:r)([])}},{key:"configureMenuDimensions",value:function(){var t=this,e=function(e){if(!t.options.mobile){var n=t.player.getChild("collapserator"),r=n.getChild("volumePanel"),o=n.children_.indexOf(r);n.removeChild(r),n.addChild("volumePanel",{inline:e},o),t.player.trigger("volumechange")}},n=this.player.isFullscreen();if(n&&!this.options.mobile){var r=this.player.whiteboardModePlugin().side;if(e("top"!==r),"left"===r||"right"===r||"top"===r){var o=this.player.currentWidth();return void this.player.el().querySelectorAll(".vjs-menu").forEach((function(t){t.style.paddingTop=null,t.style.marginBottom=null,t.style.width="calc(".concat(o,"px - 4em)")}))}}n||e(!0);var i=this.player.currentWidth(),a=this.player.currentHeight()/i*100,u=this.player.el().querySelector(".cv-collapsorator"),c=this.player.el().querySelectorAll(".vjs-menu"),l=u&&u.offsetHeight;l?("CreateClipSeekBar"===this.options.seekBarName&&(l+=22),c&&c.length&&c.forEach((function(e){!n&&t.options.overflowControls?e.style.paddingTop="80%":e.style.paddingTop="calc(".concat(a,"% - ").concat(l,"px)"),e.style.marginBottom="".concat(l,"px"),e.style.width=null,e.querySelector(".vjs-menu-content")&&(i<=450?t.player.addClass("cv-player-small"):t.player.removeClass("cv-player-small"))}))):this.player.one("play",this.configureMenuDimensions)}}],r&&Re(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getPlugin("plugin"));o.Z.registerPlugin("configureMenuDimensionsPlugin",Ae);var Fe="cv-persisttest",Ze=function(){try{return window.localStorage.setItem(Fe,"cv-player-storage-test"),window.localStorage.removeItem(Fe),!0}catch(t){return!1}},Ve=function(t){return window.localStorage.getItem(t)},ze=function(t,e){window.localStorage.setItem(t,e)};function Ue(t){return Ue="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ue(t)}function Ge(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,qe(r.key),r)}}function qe(t){var e=function(t){if("object"!=Ue(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Ue(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ue(e)?e:e+""}function He(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(He=function(){return!!t})()}function We(){return We="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Qe(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},We.apply(null,arguments)}function Qe(t){return Qe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Qe(t)}function Ye(t,e){return Ye=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ye(t,e)}var $e=o.Z.getPlugin("plugin"),Ke="cvplayer-volume",Xe="cvplayer-mute",Je=function(t){function e(t){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=function(t,e,n){return e=Qe(e),function(t,e){if(e&&("object"==Ue(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,He()?Reflect.construct(e,n||[],Qe(t).constructor):e.apply(t,n))}(this,e,[t])).enabled=!0,n.player.ready((function(){return n.initialize()})),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ye(t,e)}(e,t),n=e,r=[{key:"initialize",value:function(){this.player.options_.mobile?this.removeVolumeControl():Ze()&&(this.saveVolumeState=this.saveVolumeState.bind(this),this.player.on("volumechange",this.saveVolumeState),this.applyUserPreferences())}},{key:"applyUserPreferences",value:function(){var t=Ve(Ke),e=Ve(Xe);t&&this.player.volume(+t),e&&this.player.muted("true"===e)}},{key:"saveVolumeState",value:function(){this.enabled&&(ze(Ke,this.player.volume().toString()),ze(Xe,this.player.muted().toString()))}},{key:"removeVolumeControl",value:function(){this.player.volume(1);var t=this.player.getChild("collapserator"),e=t.getChild("volumePanel");t.removeChild(e)}},{key:"enable",value:function(){this.enabled=!0}},{key:"disable",value:function(){this.enabled=!1}},{key:"dispose",value:function(){var t,n,r;this.player.off("volumechange",this.saveVolumeState),(t=e,n=this,"function"==typeof(r=We(Qe(1&3?t.prototype:t),"dispose",n))?function(t){return r.apply(n,t)}:r)([])}}],r&&Ge(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}($e);function tn(t){return tn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},tn(t)}function en(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,nn(r.key),r)}}function nn(t){var e=function(t){if("object"!=tn(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=tn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==tn(e)?e:e+""}function rn(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(rn=function(){return!!t})()}function on(t){return on=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},on(t)}function an(t,e){return an=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},an(t,e)}o.Z.registerPlugin("persistVolumePlugin",Je);var un=o.Z.getPlugin("plugin"),cn="cvplayer-playback-rate",ln=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=on(e),function(t,e){if(e&&("object"==tn(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,rn()?Reflect.construct(e,n||[],on(t).constructor):e.apply(t,n))}(this,e,[t])).options=n,r.player.dataLoaded((function(){return r.initialize()})),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&an(t,e)}(e,t),n=e,(r=[{key:"initialize",value:function(){var t,e=this;if(Ze()){this.savePlaybackRate=this.savePlaybackRate.bind(this),this.player.on("ratechange",this.savePlaybackRate),this.one("dispose",(function(){e.player.off("ratechange",e.savePlaybackRate)}));var n=+Ve(cn);(null===(t=this.player.options_.playbackRates)||void 0===t?void 0:t.some((function(t){return t===n})))&&this.player.playbackRate(n)}}},{key:"savePlaybackRate",value:function(){var t,e=this.player.playbackRate().toString();ze(cn,e),null===(t=this.options.analyticsService)||void 0===t||t.logUserAction({rate:e},{actionType:ne.Vw.Select,workflowPhase:ne.eu.Complete,descriptor:ne.UX.ChangeSpeed,entity:ne.py.PlaybackSpeed,eventVersion:ne.eq.V3})}}])&&en(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(un);function sn(t){return sn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},sn(t)}function fn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,pn(r.key),r)}}function pn(t){var e=function(t){if("object"!=sn(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=sn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==sn(e)?e:e+""}function yn(t,e){if(e&&("object"==sn(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function hn(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(hn=function(){return!!t})()}function dn(t){return dn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},dn(t)}function vn(t,e){return vn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},vn(t,e)}o.Z.registerPlugin("persistPlaybackRatePlugin",ln);var bn=function(t){function e(t){var n,r,o,i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),r=this,i=[t],o=dn(o=e),(n=yn(r,hn()?Reflect.construct(o,i||[],dn(r).constructor):o.apply(r,i))).fullscreenBecauseOfRotate=!1,n.player.supportsFullScreen()?(n.onRotate=n.onRotate.bind(n),n.onFullscreenChange=n.onFullscreenChange.bind(n),n.player.ready((function(){return n.initialize()})),n):yn(n)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&vn(t,e)}(e,t),n=e,(r=[{key:"initialize",value:function(){this.player.on("fullscreenchange",this.onFullscreenChange),window.addEventListener("orientationchange",this.onRotate)}},{key:"dispose",value:function(){this.player.off("fullscreenchange",this.onFullscreenChange),window.removeEventListener("orientationchange",this.onRotate)}},{key:"onFullscreenChange",value:function(){this.player.isFullscreen()||(this.fullscreenBecauseOfRotate=!1)}},{key:"onRotate",value:function(){var t=this.getAngle();90===t||-90===t||270===t?(this.player.requestFullscreen(),this.fullscreenBecauseOfRotate=!0):this.fullscreenBecauseOfRotate&&this.player.isFullscreen()&&this.player.exitFullscreen()}},{key:"getAngle",value:function(){var t,e;return"number"==typeof(null===(e=null===(t=window.screen)||void 0===t?void 0:t.orientation)||void 0===e?void 0:e.angle)?window.screen.orientation.angle:0}}])&&fn(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getPlugin("plugin"));o.Z.registerPlugin("fullscreenOnRotatePlugin",bn);var mn="\n <svg viewBox='0 0 434 71'>\n <g>\n <path fill='#FFFFFF' d='M114.44 56.57l3.5 3.5a32.87 32.87 0 0 1-25.16 11.26c-19.63 0-33.62-15.54-33.62-35.16C59.16 16.55 73.16 1 92.78 1a32.31 32.31 0 0 1 24.19 10.4l-3.6 3.3a27.32 27.32 0 0 0-20.59-8.74c-16.91 0-28.39 13.5-28.39 30.21s11.48 30.21 28.39 30.21a28.08 28.08 0 0 0 21.66-9.81zM126.64 1h4.55v70.22h-4.73L126.64 1zm17.3 10.6a3.7 3.7 0 1 1 0 7.4 3.7 3.7 0 0 1 0-7.4zm-2.41 15.07h4.81v44.56h-4.81V26.67zm48 33.15l3.33 3.15a21.8 21.8 0 0 1-17.31 8.61c-12.59 0-21.76-10-21.76-22.22 0-12.22 9.17-22.22 21.76-22.22a21.84 21.84 0 0 1 16.85 8l-3.43 3.06a17.15 17.15 0 0 0-13.42-6.3c-10.09 0-16.76 8.15-16.76 17.5s6.67 17.5 16.76 17.5a17.38 17.38 0 0 0 13.98-7.08zm14.99-9.33v20.74h-4.73V1.01h4.73v47.75l20.74-19.02h6.64l-21.56 19.84L234 71.23h-7.01l-22.47-20.74z'/>\n <path fill='#F8981D' d='M304.09 19.4a5.56 5.56 0 1 1 0-11.12 5.56 5.56 0 0 1 0 11.12zm-5.56 7.27h11.11v44.56h-11.11V26.67zm61.42 22.15c0 .81 0 2.42-.09 4h-31.75c.8 3.77 5.2 8.61 11.93 8.61a17.11 17.11 0 0 0 11.66-4.31l5.38 8.16a27.23 27.23 0 0 1-17 6.1c-12.92 0-22.88-9.87-22.88-22.34s9.06-22.33 21.35-22.33c11.62-.04 21.4 9.02 21.4 22.11zm-10.77-3.76c-.18-3.68-3.58-8.62-10.67-8.62-6.91 0-10.05 4.85-10.4 8.62h21.07zM385.92 71h-6.42l-19.64-44.37h13.97l9.16 23.98 9.72-23.98h8.31l9.63 23.98 9.16-23.98h13.97L414.24 71h-6.52l-10.85-23.7L385.92 71zm-120.22.35h-6L226.11 1.01h17.01l19.42 44.18 18.08-44.18h16.91L265.7 71.35zM0 1l41 35L0 71V1z'/>\n </g>\n </svg>\n";function gn(t){return gn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gn(t)}function wn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,On(r.key),r)}}function On(t){var e=function(t){if("object"!=gn(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=gn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==gn(e)?e:e+""}function Pn(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Pn=function(){return!!t})()}function Sn(t){return Sn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Sn(t)}function jn(t,e){return jn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},jn(t,e)}var kn=function(t){function e(t,n){var r,o,i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=Sn(e),function(t,e){if(e&&("object"==gn(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Pn()?Reflect.construct(e,n||[],Sn(t).constructor):e.apply(t,n))}(this,e,[t,n])).update=(o=r.update.bind(r),i=window.performance.now(),function(){var t=window.performance.now();t-i>=1e3&&(o.apply(void 0,arguments),i=t)}),t.on("timeupdate",r.update),t.one("dispose",(function(){t.off("timeupdate",r.update),r.el_.removeEventListener("click",r.pause)})),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&jn(t,e)}(e,t),n=e,(r=[{key:"update",value:function(){var t=this.player_.currentTime();this.el_.href=this.options_.getExternalLink({currentTime:Math.round(t)})}},{key:"buildCSSClass",value:function(){return"cv-open-externally-button"}},{key:"createEl",value:function(){var t={innerHTML:mn,className:this.buildCSSClass()},e={type:"button",href:this.options_.getExternalLink({currentTime:0}),target:"_blank"},n=o.Z.dom.createEl("a",t,e);return this.createControlTextEl(n),n.addEventListener("click",this.pause.bind(this)),n}},{key:"pause",value:function(){this.player_.pause()}}])&&wn(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getComponent("Button"));function _n(t){return _n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_n(t)}function Cn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,En(r.key),r)}}function En(t){var e=function(t){if("object"!=_n(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=_n(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==_n(e)?e:e+""}function Tn(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Tn=function(){return!!t})()}function xn(t){return xn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},xn(t)}function Ln(t,e){return Ln=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ln(t,e)}kn.prototype.controlText_="Open in ClickView",o.Z.registerComponent("OpenExternallyButton",kn);var Rn=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=xn(e),function(t,e){if(e&&("object"==_n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Tn()?Reflect.construct(e,n||[],xn(t).constructor):e.apply(t,n))}(this,e,[t,n])).options=n,t.ready((function(){return r.onReady()})),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ln(t,e)}(e,t),n=e,(r=[{key:"onReady",value:function(){var t=this.player.getChild("collapserator"),e=t.getChild("customControlSpacer"),n=t.children_.indexOf(e);t.addChild("OpenExternallyButton",{getExternalLink:this.options.getExternalLink},n+1)}}])&&Cn(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getPlugin("plugin"));function In(t){return In="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},In(t)}function Dn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Bn(r.key),r)}}function Bn(t){var e=function(t){if("object"!=In(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=In(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==In(e)?e:e+""}function Nn(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Nn=function(){return!!t})()}function Mn(t,e,n,r){var o=An(Fn(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof o?function(t){return o.apply(n,t)}:o}function An(){return An="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Fn(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},An.apply(null,arguments)}function Fn(t){return Fn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Fn(t)}function Zn(t,e){return Zn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Zn(t,e)}o.Z.registerPlugin("openExternallyPlugin",Rn);var Vn=function(t){function e(t,n){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,n){return e=Fn(e),function(t,e){if(e&&("object"==In(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Nn()?Reflect.construct(e,n||[],Fn(t).constructor):e.apply(t,n))}(this,e,[t,n])}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Zn(t,e)}(e,t),n=e,(r=[{key:"buildCSSClass",value:function(){return"cv-touch-control-ui ".concat(Mn(e,"buildCSSClass",this,3)([]))}},{key:"createEl",value:function(t,n,r){return Mn(e,"createEl",this,3)([t,Object.assign(Object.assign({},n),{className:this.buildCSSClass()}),r])}},{key:"setUi",value:function(t,e){var n=this,r=t>0,o=r?"cv-touch-right":"cv-touch-left";this.el_.className=this.buildCSSClass()+" cv-ui-touch-active",this.el_.innerHTML="\n <div class='".concat(o,"'>\n <div class='cv-touch-text'>\n ").concat(r?"+":"").concat(10*t,"s\n </div>\n </div>\n "),window.clearTimeout(this.timeoutId),this.timeoutId=window.setTimeout((function(){n.removeText()}),e)}},{key:"removeText",value:function(){this.el_.className=this.buildCSSClass(),this.el_.innerHTML=""}}])&&Dn(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getComponent("component"));function zn(t){return zn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zn(t)}function Un(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Gn(r.key),r)}}function Gn(t){var e=function(t){if("object"!=zn(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=zn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==zn(e)?e:e+""}function qn(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(qn=function(){return!!t})()}function Hn(){return Hn="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Wn(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Hn.apply(null,arguments)}function Wn(t){return Wn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Wn(t)}function Qn(t,e){return Qn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Qn(t,e)}o.Z.registerComponent("TouchControls",Vn);var Yn=o.Z.getPlugin("plugin"),$n=function(t){function e(t){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=function(t,e,n){return e=Wn(e),function(t,e){if(e&&("object"==zn(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,qn()?Reflect.construct(e,n||[],Wn(t).constructor):e.apply(t,n))}(this,e,[t])).doubleTouchCount=0,n.seekStartTime=0,n.directionModifier=0,n.bindFunctions(),n.player.ready((function(){return n.initialize()})),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Qn(t,e)}(e,t),n=e,r=[{key:"bindFunctions",value:function(){this.onTouchStart=this.onTouchStart.bind(this),this.onTouchEnd=this.onTouchEnd.bind(this),this.reBindEventListeners=this.reBindEventListeners.bind(this),this.unBindEventListeners=this.unBindEventListeners.bind(this)}},{key:"initialize",value:function(){var t=this;this.player.addChild("TouchControls"),this.touchControls=this.player.getChild("TouchControls"),this.player.on("ready",this.reBindEventListeners),this.one("dispose",(function(){t.player.off("ready",t.reBindEventListeners)})),this.reBindEventListeners()}},{key:"reBindEventListeners",value:function(){this.unBindEventListeners(),this.tech=this.player.tech(!0),"Html5"===this.tech.name()&&(this.tech.on("touchstart",this.onTouchStart),this.tech.on("touchend",this.onTouchEnd))}},{key:"unBindEventListeners",value:function(){this.tech&&"Html5"===this.tech.name()&&(this.tech.off("touchstart",this.onTouchStart),this.tech.off("touchend",this.onTouchEnd))}},{key:"dispose",value:function(){var t,n,r;(t=e,n=this,"function"==typeof(r=Hn(Wn(1&3?t.prototype:t),"dispose",n))?function(t){return r.apply(n,t)}:r)([]),this.unBindEventListeners()}},{key:"onTouchStart",value:function(t){this.touchStartTime=t.timeStamp,this.userActive=this.player.userActive()}},{key:"onTouchEnd",value:function(t){var e=this;if(t.changedTouches.length){if(t.timeStamp-this.lastTouchTime<300)return this.onDoubleTouch(t),void(this.lastTouchTime=t.timeStamp);this.resetProperties(),this.lastTouchTime=t.timeStamp,t.timeStamp-this.touchStartTime<300&&window.setTimeout((function(){e.doubleTouchCount||(e.player.paused()?e.player.play():e.userActive&&e.player.pause())}),300)}}},{key:"resetProperties",value:function(){this.doubleTouchCount=0,this.seekStartTime=0,this.directionModifier=0}},{key:"onDoubleTouch",value:function(t){var e=this.player.el().getBoundingClientRect(),n=e.left+e.width/2;if(0===this.doubleTouchCount&&(this.seekStartTime=this.player.currentTime(),t.changedTouches[0].pageX<n?this.directionModifier=-1:this.directionModifier=1),this.doubleTouchCount++,this.directionModifier<0){if(10*this.doubleTouchCount>this.seekStartTime+10)return;return this.touchControls.setUi(-this.doubleTouchCount,900),void this.player.currentTime(this.player.currentTime()-10)}var r=this.player.duration()-this.seekStartTime;10*this.doubleTouchCount>r+10||(this.touchControls.setUi(this.doubleTouchCount,900),this.player.currentTime(this.player.currentTime()+10))}}],r&&Un(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Yn);function Kn(t){return Kn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Kn(t)}function Xn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Jn(r.key),r)}}function Jn(t){var e=function(t){if("object"!=Kn(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Kn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Kn(e)?e:e+""}o.Z.registerPlugin("touchControls",$n);var tr=function(){return t=function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.id=n.id,this.plugin=e,this.source=n,this.enabled=this.enabled.bind(this)},(e=[{key:"enabled",value:function(t){return void 0===t?this.plugin.currentSource===this.source:(t&&this.plugin.setSource(this.source.id),t)}}])&&Xn(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function er(t){return er="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},er(t)}function nr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,rr(r.key),r)}}function rr(t){var e=function(t){if("object"!=er(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=er(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==er(e)?e:e+""}function or(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(or=function(){return!!t})()}function ir(t){return ir=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ir(t)}function ar(t,e){return ar=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ar(t,e)}var ur=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=ir(e),function(t,e){if(e&&("object"==er(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,or()?Reflect.construct(e,n||[],ir(t).constructor):e.apply(t,n))}(this,e,[t])).options_=n,r.player.ready((function(){return r.initialize()})),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ar(t,e)}(e,t),n=e,r=[{key:"initialize",value:function(){var t=this;this.sources=[],this.qualityLevels=this.player.qualityLevels(),this.populateSources(this.options_.sources),this.onQualityChange=this.onQualityChange.bind(this),this.qualityLevels.on("change",this.onQualityChange),this.player.one("dispose",(function(){t.qualityLevels.off("change",t.onQualityChange)}))}},{key:"currentSource",get:function(){return this._currentSource}},{key:"onQualityChange",value:function(){var t=this.qualityLevels[this.qualityLevels.selectedIndex];this.player.trigger("cv-quality-change",t.id)}},{key:"setSource",value:function(t){var e=this,n=this.getSourceById(t);if(null===n)return this.currentSource;var r=this.player.currentTime(),o=!this.player.paused();this._currentSource=n;var i=this.player.playbackRate();return this.player.src({src:n.url,type:n.mimeType}),this.player.one("loadedmetadata",(function(){e.player.playbackRate(i),e.player.currentTime()!==r&&e.player.currentTime(r),o&&e.player.play()})),this.trigger({event:"sourcechange",source:n}),this.sourceChangeUpdateQualityLevels(n),n}},{key:"getSourceById",value:function(t){return this.sources.find((function(e){return e.id===t}))}},{key:"repopulateSources",value:function(t){for(var e=null;this.qualityLevels.length;)this.qualityLevels[0].enabled&&(e=this.qualityLevels[0].id),this.qualityLevels.removeQualityLevel(this.qualityLevels[0]);this.sources=[],this.populateSources(t,e)}},{key:"sortSources",value:function(t){return t.sort((function(t,e){return t.id===e.id?0:+t.id>+e.id?-1:1}))}},{key:"populateSources",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=null;(t=this.sortSources(t)).forEach((function(t){e.qualityLevels.addQualityLevel(new tr(e,t)),e.sources.push(t),e.trigger({event:"addsource",source:t}),null===n?t.default&&(r=t):t.id===n&&(r=t)})),null===r&&(r=this.sources[0]),null!==r&&this.setSource(r.id)}},{key:"sourceChangeUpdateQualityLevels",value:function(t){for(var e=this.qualityLevels,n=-1,r=0;r<e.length;r++)if(e[r].id===t.id){n=r;break}e.selectedIndex_=n,e.trigger({selectedIndex:n,type:"change"})}}],r&&nr(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getPlugin("plugin"));function cr(t){return cr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},cr(t)}function lr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,sr(r.key),r)}}function sr(t){var e=function(t){if("object"!=cr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=cr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==cr(e)?e:e+""}o.Z.registerPlugin("progressiveFiles",ur);var fr=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)},e=[{key:"getKnownProfiles",value:function(){return["1080","720","480","360","240"]}},{key:"enableProfileOrNextBest",value:function(t,e){var n=t.getQualityLevelById(e);if(n||(n=this.getNextBestQuality(t,e)),!n)return null;for(var r=0;r<t.length;r++){var o=t[r];o.enabled=n.id===o.id}return n}},{key:"getNextBestQuality",value:function(t,e){var n=this.getKnownProfiles(),r=n.indexOf(e);if(r>=0){for(var o=r+1;o<n.length;o++){var i=n[o],a=t.getQualityLevelById(i);if(a)return a}for(var u=r-1;u>0;u--){var c=n[u],l=t.getQualityLevelById(c);if(l)return l}}return null}}],null&&lr(t.prototype,null),e&&lr(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function pr(t){return pr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pr(t)}function yr(){yr=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,n){return t[e]=n}}function s(t,e,n,r){var i=e&&e.prototype instanceof b?e:b,a=Object.create(i.prototype),u=new x(r||[]);return o(a,"_invoke",{value:_(t,n,u)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var p="suspendedStart",y="suspendedYield",h="executing",d="completed",v={};function b(){}function m(){}function g(){}var w={};l(w,a,(function(){return this}));var O=Object.getPrototypeOf,P=O&&O(O(L([])));P&&P!==n&&r.call(P,a)&&(w=P);var S=g.prototype=b.prototype=Object.create(w);function j(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function n(o,i,a,u){var c=f(t[o],t,i);if("throw"!==c.type){var l=c.arg,s=l.value;return s&&"object"==pr(s)&&r.call(s,"__await")?e.resolve(s.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,u)}))}u(c.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function _(e,n,r){var o=p;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var u=r.delegate;if(u){var c=C(u,r);if(c){if(c===v)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=h;var l=f(e,n,r);if("normal"===l.type){if(o=r.done?d:y,l.arg===v)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=d,r.method="throw",r.arg=l.arg)}}}function C(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,C(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=f(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function x(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function L(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(pr(e)+" is not iterable")}return m.prototype=g,o(S,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:m,configurable:!0}),m.displayName=l(g,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,l(t,c,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},j(k.prototype),l(k.prototype,u,(function(){return this})),e.AsyncIterator=k,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new k(s(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},j(S),l(S,c,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=L,x.prototype={constructor:x,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return u.type="throw",u.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),l=r.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),T(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;T(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:L(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}function hr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,dr(r.key),r)}}function dr(t){var e=function(t){if("object"!=pr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=pr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==pr(e)?e:e+""}var vr=function(){return t=function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.name=e.name,this.playbackProfile=e.playbackProfile,this.address=new URL(e.httpsAddress)},(e=[{key:"getUrl",value:function(t){return t?this.address+"cache?file="+encodeURIComponent(t):null}},{key:"ping",value:function(){return t=this,e=void 0,n=void 0,r=yr().mark((function t(){var e,n,r,o;return yr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=new AbortController,n=setTimeout((function(){return e.abort()}),1e3),t.prev=3,t.next=6,fetch(this.address+"ping",{method:"GET",mode:"cors",signal:e.signal});case 6:return r=t.sent,t.next=9,r.text();case 9:return o=t.sent,clearTimeout(n),t.abrupt("return","PONG"===o);case 14:return t.prev=14,t.t0=t.catch(3),t.abrupt("return",!1);case 17:case"end":return t.stop()}}),t,this,[[3,14]])})),new(n||(n=Promise))((function(o,i){function a(t){try{c(r.next(t))}catch(t){i(t)}}function u(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,u)}c((r=r.apply(t,e||[])).next())}));var t,e,n,r}}])&&hr(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function br(t){return br="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},br(t)}function mr(){mr=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,n){return t[e]=n}}function s(t,e,n,r){var i=e&&e.prototype instanceof b?e:b,a=Object.create(i.prototype),u=new x(r||[]);return o(a,"_invoke",{value:_(t,n,u)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var p="suspendedStart",y="suspendedYield",h="executing",d="completed",v={};function b(){}function m(){}function g(){}var w={};l(w,a,(function(){return this}));var O=Object.getPrototypeOf,P=O&&O(O(L([])));P&&P!==n&&r.call(P,a)&&(w=P);var S=g.prototype=b.prototype=Object.create(w);function j(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function n(o,i,a,u){var c=f(t[o],t,i);if("throw"!==c.type){var l=c.arg,s=l.value;return s&&"object"==br(s)&&r.call(s,"__await")?e.resolve(s.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,u)}))}u(c.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function _(e,n,r){var o=p;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var u=r.delegate;if(u){var c=C(u,r);if(c){if(c===v)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=h;var l=f(e,n,r);if("normal"===l.type){if(o=r.done?d:y,l.arg===v)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=d,r.method="throw",r.arg=l.arg)}}}function C(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,C(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=f(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function x(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function L(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(br(e)+" is not iterable")}return m.prototype=g,o(S,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:m,configurable:!0}),m.displayName=l(g,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,l(t,c,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},j(k.prototype),l(k.prototype,u,(function(){return this})),e.AsyncIterator=k,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new k(s(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},j(S),l(S,c,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=L,x.prototype={constructor:x,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return u.type="throw",u.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),l=r.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),T(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;T(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:L(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}function gr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,wr(r.key),r)}}function wr(t){var e=function(t){if("object"!=br(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=br(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==br(e)?e:e+""}var Or=function(){return t=function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.player=e,this.logger=o.Z.log.createLogger("localcache")},(e=[{key:"setSource",value:function(t,e){return n=this,r=void 0,o=void 0,i=mr().mark((function n(){var r;return mr().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!this.player.localCache||void 0===(null==t?void 0:t.src)){n.next=5;break}return n.next=3,this.player.localCache().getActiveLocalCache();case 3:null!==(r=n.sent)&&(this.logger.debug("Using Local Cache",r),t.src=r.getUrl(t.src));case 5:e(null,t);case 6:case"end":return n.stop()}}),n,this)})),new(o||(o=Promise))((function(t,e){function a(t){try{c(i.next(t))}catch(t){e(t)}}function u(t){try{c(i.throw(t))}catch(t){e(t)}}function c(e){var n;e.done?t(e.value):(n=e.value,n instanceof o?n:new o((function(t){t(n)}))).then(a,u)}c((i=i.apply(n,r||[])).next())}));var n,r,o,i}}])&&gr(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function Pr(t){return Pr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pr(t)}function Sr(){Sr=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,n){return t[e]=n}}function s(t,e,n,r){var i=e&&e.prototype instanceof b?e:b,a=Object.create(i.prototype),u=new x(r||[]);return o(a,"_invoke",{value:_(t,n,u)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var p="suspendedStart",y="suspendedYield",h="executing",d="completed",v={};function b(){}function m(){}function g(){}var w={};l(w,a,(function(){return this}));var O=Object.getPrototypeOf,P=O&&O(O(L([])));P&&P!==n&&r.call(P,a)&&(w=P);var S=g.prototype=b.prototype=Object.create(w);function j(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function n(o,i,a,u){var c=f(t[o],t,i);if("throw"!==c.type){var l=c.arg,s=l.value;return s&&"object"==Pr(s)&&r.call(s,"__await")?e.resolve(s.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,u)}))}u(c.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function _(e,n,r){var o=p;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var u=r.delegate;if(u){var c=C(u,r);if(c){if(c===v)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=h;var l=f(e,n,r);if("normal"===l.type){if(o=r.done?d:y,l.arg===v)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=d,r.method="throw",r.arg=l.arg)}}}function C(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,C(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=f(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function x(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function L(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(Pr(e)+" is not iterable")}return m.prototype=g,o(S,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:m,configurable:!0}),m.displayName=l(g,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,l(t,c,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},j(k.prototype),l(k.prototype,u,(function(){return this})),e.AsyncIterator=k,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new k(s(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},j(S),l(S,c,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=L,x.prototype={constructor:x,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return u.type="throw",u.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),l=r.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),T(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;T(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:L(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}function jr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,kr(r.key),r)}}function kr(t){var e=function(t){if("object"!=Pr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Pr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Pr(e)?e:e+""}function _r(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(_r=function(){return!!t})()}function Cr(){return Cr="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Er(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Cr.apply(null,arguments)}function Er(t){return Er=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Er(t)}function Tr(t,e){return Tr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Tr(t,e)}o.Z.use("*",(function(t){return new Or(t)}));var xr='<?xml version="1.0" encoding="UTF-8"?><svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g id="Artboard" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" opacity="0.9"><g id="Local-Cache" transform="translate(2.000000, 2.000000)"><rect id="Rectangle" fill="#FFFFFF" x="0" y="2.4" width="18.8" height="15.2"></rect><ellipse id="Oval" fill="#FFFFFF" cx="9.4" cy="2.4" rx="9.4" ry="2.4"></ellipse><ellipse id="Oval-Copy" fill="#FFFFFF" cx="9.4" cy="17.6" rx="9.4" ry="2.4"></ellipse><g id="Logo/Circle" transform="translate(2.500000, 3.000000)"><circle id="Oval" fill="#FFFFFF" cx="7" cy="7" r="7"></circle><polygon id="Fill-1" fill="#F8981D" points="4.66666667 2.33333333 4.66666667 11.4245258 10.0383286 6.87866667"></polygon></g></g></g></svg>',Lr=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=Er(e),function(t,e){if(e&&("object"==Pr(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,_r()?Reflect.construct(e,n||[],Er(t).constructor):e.apply(t,n))}(this,e,[t,n])).hide(),r.onLocalCacheChange=r.onLocalCacheChange.bind(r),t.ready((function(){r.initialize()})),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Tr(t,e)}(e,t),n=e,r=[{key:"createEl",value:function(){return(t=e,n=this,"function"==typeof(r=Cr(Er(1&3?t.prototype:t),"createEl",n))?function(t){return r.apply(n,t)}:r)(["div",{className:"vjs-local-cache-indicator",innerHTML:'<div class="vjs-local-cache-indicator-icon">'.concat(xr,"</div>")},{title:"Streaming from ClickView Local Cache"}]);var t,n,r}},{key:"initialize",value:function(){var t=this;this.localCachePlugin=this.player_.localCache(),this.localCachePlugin&&(this.localCachePlugin.on("localcachechanged",this.onLocalCacheChange),this.player_.on("dispose",(function(){t.localCachePlugin.off("localcachechanged",t.onLocalCacheChange)})),this.onLocalCacheChange())}},{key:"onLocalCacheChange",value:function(){return t=this,e=void 0,n=void 0,r=Sr().mark((function t(){return Sr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.localCachePlugin.getActiveLocalCache();case 2:t.sent?this.show():this.hide();case 4:case"end":return t.stop()}}),t,this)})),new(n||(n=Promise))((function(o,i){function a(t){try{c(r.next(t))}catch(t){i(t)}}function u(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,u)}c((r=r.apply(t,e||[])).next())}));var t,e,n,r}}],r&&jr(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getComponent("Component"));function Rr(t){return Rr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Rr(t)}function Ir(){Ir=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,n){return t[e]=n}}function s(t,e,n,r){var i=e&&e.prototype instanceof b?e:b,a=Object.create(i.prototype),u=new x(r||[]);return o(a,"_invoke",{value:_(t,n,u)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var p="suspendedStart",y="suspendedYield",h="executing",d="completed",v={};function b(){}function m(){}function g(){}var w={};l(w,a,(function(){return this}));var O=Object.getPrototypeOf,P=O&&O(O(L([])));P&&P!==n&&r.call(P,a)&&(w=P);var S=g.prototype=b.prototype=Object.create(w);function j(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function n(o,i,a,u){var c=f(t[o],t,i);if("throw"!==c.type){var l=c.arg,s=l.value;return s&&"object"==Rr(s)&&r.call(s,"__await")?e.resolve(s.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,u)}))}u(c.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function _(e,n,r){var o=p;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var u=r.delegate;if(u){var c=C(u,r);if(c){if(c===v)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=h;var l=f(e,n,r);if("normal"===l.type){if(o=r.done?d:y,l.arg===v)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=d,r.method="throw",r.arg=l.arg)}}}function C(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,C(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=f(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function x(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function L(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(Rr(e)+" is not iterable")}return m.prototype=g,o(S,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:m,configurable:!0}),m.displayName=l(g,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,l(t,c,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},j(k.prototype),l(k.prototype,u,(function(){return this})),e.AsyncIterator=k,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new k(s(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},j(S),l(S,c,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=L,x.prototype={constructor:x,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return u.type="throw",u.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),l=r.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),T(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;T(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:L(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}function Dr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Br(r.key),r)}}function Br(t){var e=function(t){if("object"!=Rr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Rr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Rr(e)?e:e+""}function Nr(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Nr=function(){return!!t})()}function Mr(){return Mr="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Ar(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Mr.apply(null,arguments)}function Ar(t){return Ar=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ar(t)}function Fr(t,e){return Fr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Fr(t,e)}o.Z.registerComponent("localCacheIndicator",Lr);var Zr=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{c(r.next(t))}catch(t){i(t)}}function u(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,u)}c((r=r.apply(t,e||[])).next())}))},Vr=function(t){function e(t,n){var r;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=Ar(e),function(t,e){if(e&&("object"==Rr(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Nr()?Reflect.construct(e,n||[],Ar(t).constructor):e.apply(t,n))}(this,e,[t])).logger_=o.Z.log.createLogger("localcache"),void 0===n)throw Error("no options defined");return r.localCaches_=n.localCacheAddresses.map((function(t){return new vr(t)})),r.player.ready((function(){r.initialize(),n.enabled&&r.enable()})),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Fr(t,e)}(e,t),n=e,r=[{key:"isEnabled",get:function(){return this.enabled_}},{key:"enable",value:function(){this.enabled_=!0,this.resetActiveLocalCache()}},{key:"disable",value:function(){this.enabled_=!1}},{key:"getActiveLocalCache",value:function(){return this.enabled_?this.activeLocalCache_:null}},{key:"resetActiveLocalCache",value:function(){this.clearActiveLocalCache(),this.activeLocalCache_=this.getActiveLocalCacheInternal()}},{key:"clearActiveLocalCache",value:function(){this.activeLocalCache_&&(this.activeLocalCache_=null,this.onLocalCacheChange(null))}},{key:"removeLocalCache",value:function(t){this.localCaches_=this.localCaches_.filter((function(e){return e!==t}))}},{key:"dispose",value:function(){var t,n,r;(t=e,n=this,"function"==typeof(r=Mr(Ar(1&3?t.prototype:t),"dispose",n))?function(t){return r.apply(n,t)}:r)([])}},{key:"initialize",value:function(){this.player.controlBar.addChild("localCacheIndicator")}},{key:"handleNetworkError",value:function(){return Zr(this,void 0,void 0,Ir().mark((function t(){var e;return Ir().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getActiveLocalCache();case 2:if(!(e=t.sent)){t.next=8;break}return t.next=6,e.ping();case 6:t.sent&&this.removeLocalCache(e);case 8:return this.resetActiveLocalCache(),t.next=11,this.getActiveLocalCache();case 11:return this.resetSource(),t.abrupt("return",!0);case 13:case"end":return t.stop()}}),t,this)})))}},{key:"resetSource",value:function(){for(var t=this.player.qualityLevels(),e=0;e<t.length;e++)t[e].enabled&&(t[e].enabled=!0)}},{key:"getActiveLocalCacheInternal",value:function(){return Zr(this,void 0,void 0,Ir().mark((function t(){var e,n,r,o=this;return Ir().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=[],n=function(t){return Zr(o,void 0,void 0,Ir().mark((function n(){return Ir().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,t.ping();case 2:if(!n.sent){n.next=4;break}e.push(t);case 4:case"end":return n.stop()}}),n)})))},t.next=4,Promise.all(this.localCaches_.map((function(t){return n(t)})));case 4:if(!(e.length>0)){t.next=8;break}return r=e[0],this.onLocalCacheChange(r),t.abrupt("return",r);case 8:return t.abrupt("return",null);case 9:case"end":return t.stop()}}),t,this)})))}},{key:"onLocalCacheChange",value:function(t){this.logger_.debug("Local Cache changed",t),this.trigger("localcachechanged",{localCache:t});var e=!1;t&&t.playbackProfile&&(this.logger_.debug("Changing active profile for local cache",t.playbackProfile),fr.enableProfileOrNextBest(this.player.qualityLevels(),t.playbackProfile),e=!0),e||this.player.src(this.player.src())}}],r&&Dr(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getPlugin("plugin"));function zr(t){return zr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zr(t)}function Ur(){Ur=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,n){return t[e]=n}}function s(t,e,n,r){var i=e&&e.prototype instanceof b?e:b,a=Object.create(i.prototype),u=new x(r||[]);return o(a,"_invoke",{value:_(t,n,u)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var p="suspendedStart",y="suspendedYield",h="executing",d="completed",v={};function b(){}function m(){}function g(){}var w={};l(w,a,(function(){return this}));var O=Object.getPrototypeOf,P=O&&O(O(L([])));P&&P!==n&&r.call(P,a)&&(w=P);var S=g.prototype=b.prototype=Object.create(w);function j(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function n(o,i,a,u){var c=f(t[o],t,i);if("throw"!==c.type){var l=c.arg,s=l.value;return s&&"object"==zr(s)&&r.call(s,"__await")?e.resolve(s.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,u)}))}u(c.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function _(e,n,r){var o=p;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var u=r.delegate;if(u){var c=C(u,r);if(c){if(c===v)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=h;var l=f(e,n,r);if("normal"===l.type){if(o=r.done?d:y,l.arg===v)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=d,r.method="throw",r.arg=l.arg)}}}function C(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,C(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=f(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function x(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function L(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(zr(e)+" is not iterable")}return m.prototype=g,o(S,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:m,configurable:!0}),m.displayName=l(g,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,l(t,c,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},j(k.prototype),l(k.prototype,u,(function(){return this})),e.AsyncIterator=k,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new k(s(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},j(S),l(S,c,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=L,x.prototype={constructor:x,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return u.type="throw",u.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),l=r.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),T(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;T(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:L(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}function Gr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,qr(r.key),r)}}function qr(t){var e=function(t){if("object"!=zr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=zr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==zr(e)?e:e+""}function Hr(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Hr=function(){return!!t})()}function Wr(){return Wr="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Qr(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Wr.apply(null,arguments)}function Qr(t){return Qr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Qr(t)}function Yr(t,e){return Yr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Yr(t,e)}o.Z.registerPlugin("localCache",Vr);var $r=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{c(r.next(t))}catch(t){i(t)}}function u(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,u)}c((r=r.apply(t,e||[])).next())}))},Kr=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=Qr(e),function(t,e){if(e&&("object"==zr(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Hr()?Reflect.construct(e,n||[],Qr(t).constructor):e.apply(t,n))}(this,e,[t])).playerApi=n.playerApi,r.fileToken=n.fileToken,r.logger=o.Z.log.createLogger("video-signature-expiry-plugin"),r.bindErrorHandlers(),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Yr(t,e)}(e,t),n=e,r=[{key:"bindErrorHandlers",value:function(){this.onError=this.onError.bind(this),this.player.on("error",this.onError)}},{key:"dispose",value:function(){var t,n,r;this.player.off("error",this.onError),(t=e,n=this,"function"==typeof(r=Wr(Qr(1&3?t.prototype:t),"dispose",n))?function(t){return r.apply(n,t)}:r)([])}},{key:"onError",value:function(){return $r(this,void 0,void 0,Ur().mark((function t(){var e,n=this;return Ur().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if((e=this.player.error().code)===MediaError.MEDIA_ERR_NETWORK||e===MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED){t.next=3;break}return t.abrupt("return");case 3:return t.next=5,this.player.localCache().getActiveLocalCache();case 5:if(!t.sent){t.next=8;break}return this.callErrorHandler((function(){return n.player.localCache().handleNetworkError()})),t.abrupt("return");case 8:this.callErrorHandler((function(){return n.handleVideoSignatureExpiry()}));case 9:case"end":return t.stop()}}),t,this)})))}},{key:"handleVideoSignatureExpiry",value:function(){return $r(this,void 0,void 0,Ur().mark((function t(){var e,n;return Ur().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.playerApi&&this.fileToken){t.next=2;break}return t.abrupt("return",!1);case 2:if(!(this.refetchedSourcesTimestamp+9e5>Date.now())){t.next=4;break}return t.abrupt("return",!1);case 4:return this.refetchedSourcesTimestamp=Date.now(),e=null,t.prev=6,this.logger.debug("Detected expired mp4 urls, attempting to refetch"),n="".concat(this.playerApi.origin,"/api/files?fileToken=").concat(this.fileToken),t.next=11,we.get(n);case 11:e=t.sent,t.next=18;break;case 14:return t.prev=14,t.t0=t.catch(6),this.logger.error("Failed to refetch expired mp4 urls"),t.abrupt("return",!1);case 18:return this.logger.debug("Mp4 urls successfully refetched"),this.player.progressiveFiles().repopulateSources(e.progressive.map((function(t){return{id:t.profile,mimeType:t.mimeType,url:t.url}}))),this.fileToken=e.fileToken,t.abrupt("return",!0);case 22:case"end":return t.stop()}}),t,this,[[6,14]])})))}},{key:"callErrorHandler",value:function(t){return $r(this,void 0,void 0,Ur().mark((function e(){var n,r,o,i,a=this;return Ur().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this.player.currentTime(),r=!this.player.paused(),o=this.player.playbackRate(),i=function(){a.player.playbackRate(o),a.player.currentTime(n),r&&a.player.play(),a.player.error(null)},this.player.one("loadedmetadata",i),e.next=7,t();case 7:if(!e.sent){e.next=9;break}return e.abrupt("return");case 9:this.player.off("loadedmetadata",i);case 10:case"end":return e.stop()}}),e,this)})))}}],r&&Gr(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getPlugin("plugin"));function Xr(t){return Xr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xr(t)}function Jr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,to(r.key),r)}}function to(t){var e=function(t){if("object"!=Xr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Xr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Xr(e)?e:e+""}function eo(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(eo=function(){return!!t})()}function no(t){return no=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},no(t)}function ro(t,e){return ro=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ro(t,e)}o.Z.registerPlugin("handleNetworkErrors",Kr);var oo=o.Z.getPlugin("plugin"),io="cvplayer-show-subtitles",ao="cvplayer-selected-language",uo="cvplayer-subtitle-size",co=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=no(e),function(t,e){if(e&&("object"==Xr(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,eo()?Reflect.construct(e,n||[],no(t).constructor):e.apply(t,n))}(this,e,[t])).options=n,r.initialize(),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ro(t,e)}(e,t),n=e,(r=[{key:"initialize",value:function(){this.applyUserPreferences=this.applyUserPreferences.bind(this),this.player.textTracks().length&&(this.bindEventListeners(),this.applyUserPreferences())}},{key:"applyUserPreferences",value:function(){var t=!!this.options.showSubtitles,e=this.safeGet(io);if("true"===e&&(t=!0),"false"===e&&(t=!1),t){var n=this.guessWhichTrack();n&&(n.mode="showing")}else this.disableSubtitles();var r=this.safeGet(uo);r||(r=this.options.subtitleSize),this.player.options_.mobile&&(r="medium"),r&&this.player.textTrackSettings.setSizeSetting(r)}},{key:"safeGet",value:function(t){if(Ze())return Ve(t)}},{key:"onSelectedLanguageChange",value:function(){for(var t,e,n=this.player.textTracks(),r=0;r<n.length;r++){var o=n[r];if("showing"===o.mode)return ze(io,"true"),ze(ao,o.language),void(null===(t=this.options.analyticsService)||void 0===t||t.logUserAction({language:o.language},{actionType:ne.Vw.Select,entity:ne.py.Subtitle,workflowPhase:ne.eu.Complete,descriptor:ne.DL.On}))}var i;ze(io,"false"),i=ao,window.localStorage.removeItem(i),null===(e=this.options.analyticsService)||void 0===e||e.logUserAction({language:""},{actionType:ne.Vw.Select,entity:ne.py.Subtitle,workflowPhase:ne.eu.Complete,descriptor:ne.DL.Off,eventVersion:ne.eq.V3})}},{key:"bindEventListeners",value:function(){var t=this;Ze()&&(this.onSelectedLanguageChange=this.onSelectedLanguageChange.bind(this),this.onChangeSubtitleSize=this.onChangeSubtitleSize.bind(this),this.player.on("cv:languageselected",this.onSelectedLanguageChange),this.player.on("changesubtitlesize",this.onChangeSubtitleSize),this.one("dispose",(function(){t.player.off("cv:languageselected",t.onSelectedLanguageChange),t.player.off("changesubtitlesize",t.onChangeSubtitleSize)})))}},{key:"onChangeSubtitleSize",value:function(){var t=this.player.textTrackSettings.getSizeSetting();ze(uo,t)}},{key:"guessWhichTrack",value:function(){for(var t,e,n=this.safeGet(ao)||window.navigator.language,r=this.getLanguageParts(n),o=r.language,i=r.country,a=this.player.textTracks(),u=0;u<a.length;u++){var c=a[u],l=this.getLanguageParts(c.language),s=l.language,f=l.country;if(s===o&&(t=c,f||(e=c),f===i))return t}return e||t||null}},{key:"getLanguageParts",value:function(t){var e=t.toLowerCase().split("-");return{language:e[0],country:e[1]}}},{key:"disableSubtitles",value:function(){for(var t=this.player.textTracks(),e=0;e<t.length;e++)t[e].mode="disabled"}},{key:"previewModeSubtitles",value:function(){var t=this.guessWhichTrack();t&&(t.mode="showing"),this.player.off("changesubtitlesize",this.onChangeSubtitleSize),this.player.textTrackSettings.setSizeSetting("large"),this.player.on("changesubtitlesize",this.onChangeSubtitleSize)}}])&&Jr(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(oo);function lo(t){return lo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},lo(t)}function so(){so=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,n){return t[e]=n}}function s(t,e,n,r){var i=e&&e.prototype instanceof b?e:b,a=Object.create(i.prototype),u=new x(r||[]);return o(a,"_invoke",{value:_(t,n,u)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var p="suspendedStart",y="suspendedYield",h="executing",d="completed",v={};function b(){}function m(){}function g(){}var w={};l(w,a,(function(){return this}));var O=Object.getPrototypeOf,P=O&&O(O(L([])));P&&P!==n&&r.call(P,a)&&(w=P);var S=g.prototype=b.prototype=Object.create(w);function j(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function n(o,i,a,u){var c=f(t[o],t,i);if("throw"!==c.type){var l=c.arg,s=l.value;return s&&"object"==lo(s)&&r.call(s,"__await")?e.resolve(s.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,u)}))}u(c.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function _(e,n,r){var o=p;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var u=r.delegate;if(u){var c=C(u,r);if(c){if(c===v)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=h;var l=f(e,n,r);if("normal"===l.type){if(o=r.done?d:y,l.arg===v)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=d,r.method="throw",r.arg=l.arg)}}}function C(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,C(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=f(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function x(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function L(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(lo(e)+" is not iterable")}return m.prototype=g,o(S,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:m,configurable:!0}),m.displayName=l(g,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,l(t,c,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},j(k.prototype),l(k.prototype,u,(function(){return this})),e.AsyncIterator=k,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new k(s(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},j(S),l(S,c,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=L,x.prototype={constructor:x,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return u.type="throw",u.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),l=r.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),T(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;T(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:L(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}function fo(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,po(r.key),r)}}function po(t){var e=function(t){if("object"!=lo(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=lo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==lo(e)?e:e+""}function yo(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(yo=function(){return!!t})()}function ho(t){return ho=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ho(t)}function vo(t,e){return vo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},vo(t,e)}o.Z.registerPlugin("persistSubtitleSettingsPlugin",co);var bo=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{c(r.next(t))}catch(t){i(t)}}function u(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,u)}c((r=r.apply(t,e||[])).next())}))},mo=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=ho(e),function(t,e){if(e&&("object"==lo(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,yo()?Reflect.construct(e,n||[],ho(t).constructor):e.apply(t,n))}(this,e,[t])).options=n,r.player.ready((function(){return r.initialize()})),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&vo(t,e)}(e,t),n=e,(r=[{key:"initialize",value:function(){return bo(this,void 0,void 0,so().mark((function t(){var e,n,r,o,i=this;return so().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getActiveLocalCache();case 2:if(e=t.sent,(n=e?this.options.playbackProfileLocalCache:this.options.playbackProfile)||(n="1080"),Ze()&&(r=Ve(this.getStorageKey(!!e)))&&(n=r),o=this.player.qualityLevels(),(null==e?void 0:e.playbackProfile)||fr.enableProfileOrNextBest(o,n),Ze()){t.next=10;break}return t.abrupt("return");case 10:this.onQualityLevelsChange=this.onQualityLevelsChange.bind(this),o.on("change",this.onQualityLevelsChange),this.on("dispose",(function(){o.off("change",i.onQualityLevelsChange)}));case 13:case"end":return t.stop()}}),t,this)})))}},{key:"onQualityLevelsChange",value:function(){var t;return bo(this,void 0,void 0,so().mark((function e(){var n,r,o;return so().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.isLocalCacheActive();case 2:n=e.sent,r=this.player.qualityLevels(),o=r[r.selectedIndex],ze(this.getStorageKey(n),o.id),null===(t=this.options.analyticsService)||void 0===t||t.logUserAction({quality:o.id},{actionType:ne.Vw.Select,workflowPhase:ne.eu.Complete,descriptor:ne.UX.ChangeResolution,entity:ne.py.Resolution,eventVersion:ne.eq.V3});case 7:case"end":return e.stop()}}),e,this)})))}},{key:"isLocalCacheActive",value:function(){return bo(this,void 0,void 0,so().mark((function t(){return so().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.player.localCache().getActiveLocalCache();case 2:return t.abrupt("return",!!t.sent);case 3:case"end":return t.stop()}}),t,this)})))}},{key:"getActiveLocalCache",value:function(){return this.player.localCache().getActiveLocalCache()}},{key:"getStorageKey",value:function(t){return t?"cvplayer-localcache-playback-quality":"cvplayer-playback-quality"}}])&&fo(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getPlugin("plugin"));function go(t){return go="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},go(t)}function wo(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Oo(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Po(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,jo(r.key),r)}}function So(t,e,n){return e&&Po(t.prototype,e),n&&Po(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function jo(t){var e=function(t){if("object"!=go(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=go(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==go(e)?e:e+""}function ko(t,e,n){return e=Co(e),function(t,e){if(e&&("object"==go(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,_o()?Reflect.construct(e,n||[],Co(t).constructor):e.apply(t,n))}function _o(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(_o=function(){return!!t})()}function Co(t){return Co=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Co(t)}function Eo(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&To(t,e)}function To(t,e){return To=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},To(t,e)}o.Z.registerPlugin("persistQualitySettingsPlugin",mo);var xo=o.Z.getComponent("Component"),Lo=function(t){function e(t,n){return Oo(this,e),ko(this,e,[t,n])}return Eo(e,t),So(e,[{key:"createEl",value:function(){return o.Z.dom.createEl("div",{className:"cv-progress-reporter-item"})}},{key:"update",value:function(){var t=this.options_.event,e=this.player_.duration(),n=(t.end.time-t.start.time)/e;this.el_.style.width=100*n+"%";var r=t.start.time/e;this.el_.style.left=100*r+"%"}}])}(xo),Ro=function(t){function e(){var t;return Oo(this,e),(t=ko(this,e,arguments)).events_=[],t}return Eo(e,t),So(e,[{key:"update",value:function(){for(var t=this,e=this.children(),n=e.length;n>0;n--)this.removeChild(e[n]);this.events_.forEach((function(e){var n=new Lo(t.player(),{event:e});t.addChild(n),n.update()}))}},{key:"addEvents",value:function(t){var e,n;(e=this.events_).push.apply(e,function(t){if(Array.isArray(t))return wo(t)}(n=t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(n)||function(t,e){if(t){if("string"==typeof t)return wo(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?wo(t,e):void 0}}(n)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),this.update()}},{key:"createEl",value:function(){return o.Z.dom.createEl("div",{className:"cv-progress-reporter-display"})}}])}(xo);function Io(t){return Io="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Io(t)}function Do(t,e,n){return(e=No(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Bo(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,No(r.key),r)}}function No(t){var e=function(t){if("object"!=Io(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Io(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Io(e)?e:e+""}function Mo(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Mo=function(){return!!t})()}function Ao(t){return Ao=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ao(t)}function Fo(t,e){return Fo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Fo(t,e)}var Zo=o.Z.getPlugin("plugin"),Vo="play",zo="playing",Uo="pause",Go="seekstart",qo="ended",Ho="pausedseek",Wo=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=Ao(e),function(t,e){if(e&&("object"==Io(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Mo()?Reflect.construct(e,n||[],Ao(t).constructor):e.apply(t,n))}(this,e,[t,n])).eventBuffer=[],r.latestTime=0,r.lastPlayingTime=0,r.isPlaying=!1,r.isSeeking=!1,r.hasEnded=!1,r.shouldLogPlayOnTimeUpdate=!1,r.options=n,r.player.ready((function(){return r.initialize()})),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Fo(t,e)}(e,t),n=e,r=[{key:"initialize",value:function(){this.validateOptions(),this.bindListeners(),this.startInterval(),this.addEasterEgg()}},{key:"validateOptions",value:function(){if("function"!=typeof this.options.onFlush)throw new Error("Please provide the onFlush option")}},{key:"bindListeners",value:function(){var t=this,e=Do(Do(Do(Do(Do(Do({},Vo,(function(){return t.onPlay()})),Uo,(function(){return t.onPause()})),"timeupdate",(function(){return t.onTimeUpdate()})),"seeking",(function(){return t.onSeeking()})),qo,(function(){return t.onEnded()})),zo,(function(){return t.onPlaying()})),n=Object.keys(e);n.forEach((function(n){return t.player.on(n,e[n])})),this.one("dispose",(function(){n.forEach((function(n){return t.player.off(n,e[n])}))}))}},{key:"startInterval",value:function(){var t=this,e=this.options.interval||5e3;this.interval=window.setInterval((function(){return t.flushBuffer()}),e),this.player.one("dispose",(function(){return window.clearInterval(t.interval)}))}},{key:"addEasterEgg",value:function(){var t,e,n=this,r="",o=function(e){"ArrowUpArrowUpArrowDownArrowDownArrowLeftArrowRightArrowLeftArrowRightba"===(r+=e.key)&&n.addDisplay(),window.clearTimeout(t),t=window.setTimeout((function(){r=""}),500)},i=!1,a=function(){i=!0,e=window.setTimeout((function(){i&&n.addDisplay()}),1e4)};function u(){i=!1,window.clearTimeout(e)}this.player.el().addEventListener("keyup",o);var c=this.player.getChild("Collapserator").getChild("PlayToggle");c.on("touchstart",a),c.on("touchend",u),this.player.one("dispose",(function(){var t,e;null===(e=null===(t=n.player)||void 0===t?void 0:t.el())||void 0===e||e.removeEventListener("keyup",o),c.off("touchstart",a),c.off("touchend",u)}))}},{key:"addDisplay",value:function(){var t=this;this.progressReporterDisplay||(this.progressReporterDisplay=new Ro(this.player),this.player.addChild(this.progressReporterDisplay),this.player.options_.inactivityTimeout=0,this.player.one("dispose",(function(){t.progressReporterDisplay=void 0})))}},{key:"onPlay",value:function(){return this.isPlaying=!0,this.isSeeking?(this.logEvent("seekend"),void(this.isSeeking=!1)):this.hasEnded?(this.shouldLogPlayOnTimeUpdate=!0,void(this.hasEnded=!1)):void this.logEvent(Vo)}},{key:"onPause",value:function(){var t=this;this.isSeeking||(this.pauseTimeout=window.setTimeout((function(){t.isPlaying=!1,t.logEvent(Uo),delete t.pauseTimeout}),50))}},{key:"onTimeUpdate",value:function(){this.shouldLogPlayOnTimeUpdate&&(this.shouldLogPlayOnTimeUpdate=!1,this.logEvent(Vo)),this.isPlaying&&!this.isSeeking&&this.logEvent(zo)}},{key:"onSeeking",value:function(){this.pauseTimeout&&(this.latestTime=this.previousLatestTime,window.clearTimeout(this.pauseTimeout),delete this.pauseTimeout),this.isPlaying||this.logEvent(Ho),!this.isSeeking&&this.isPlaying&&(this.isSeeking=!0,this.logEvent(Go))}},{key:"onEnded",value:function(){this.hasEnded=!0,this.logEvent(qo)}},{key:"onPlaying",value:function(){this.isSeeking=!1,this.isPlaying=!0}},{key:"logEvent",value:function(t){if(this.player){var e=this.player.currentTime();t===Go&&(e=this.latestTime),this.previousLatestTime=this.latestTime,this.latestTime=this.player.currentTime(),this.eventBuffer.push({time:e,type:t})}}},{key:"shouldUseCarriedOverTime",value:function(t){return this.lastPlayingTime&&(t===zo||t===Vo)}},{key:"shouldSaveCarriedOverTime",value:function(t){return t===zo||t===Uo}},{key:"shouldClearCarriedOverTime",value:function(t){return t===qo||t===Ho}},{key:"flushBuffer",value:function(){for(var t,e,n=[],r={};this.eventBuffer.length;){var o=this.eventBuffer.shift();this.shouldClearCarriedOverTime(o.type)?delete this.lastPlayingTime:r.start?o.type===zo&&this.eventBuffer.length>0||(this.shouldSaveCarriedOverTime(o.type)&&(this.lastPlayingTime=o.time),r.end=o,n.push(r),r={}):(this.shouldUseCarriedOverTime(o.type)&&(o.time=this.lastPlayingTime,delete this.lastPlayingTime),r.start=o)}this.eventBuffer=[],n.length&&this.validateEvents(n)&&(this.options.onFlush(n),null===(t=this.player)||void 0===t||t.trigger("progressflush"),null===(e=this.progressReporterDisplay)||void 0===e||e.addEvents(n))}},{key:"validateEvents",value:function(t){var e=0;t.forEach((function(t){e+=t.end.time-t.start.time}));var n=this.options.interval||5e3;return n/=1e3,n+=.5,n*=this.player.playbackRate(),e<n}}],r&&Bo(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Zo);function Qo(t){return Qo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qo(t)}function Yo(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,$o(r.key),r)}}function $o(t){var e=function(t){if("object"!=Qo(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Qo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Qo(e)?e:e+""}function Ko(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Ko=function(){return!!t})()}function Xo(t){return Xo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Xo(t)}function Jo(t,e){return Jo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Jo(t,e)}o.Z.registerPlugin("progressReporterPlugin",Wo);var ti=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,n){return e=Xo(e),function(t,e){if(e&&("object"==Qo(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Ko()?Reflect.construct(e,n||[],Xo(t).constructor):e.apply(t,n))}(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Jo(t,e)}(e,t),n=e,(r=[{key:"createEl",value:function(){return o.Z.dom.createEl("span",{innerHTML:'<span class="vjs-icon-placeholder"></span>',className:"cv-drag-handle vjs-control vjs-button"},{})}}])&&Yo(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getComponent("Component")),ei=["top","left","right","bottom"],ni={top:"Top",left:"Left",right:"Right",bottom:"Bottom"};function ri(t){return ri="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ri(t)}function oi(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ii(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,ui(r.key),r)}}function ai(t,e,n){return e&&ii(t.prototype,e),n&&ii(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function ui(t){var e=function(t){if("object"!=ri(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=ri(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ri(e)?e:e+""}function ci(t,e,n){return e=fi(e),function(t,e){if(e&&("object"==ri(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,li()?Reflect.construct(e,n||[],fi(t).constructor):e.apply(t,n))}function li(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(li=function(){return!!t})()}function si(){return si="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=fi(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},si.apply(null,arguments)}function fi(t){return fi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},fi(t)}function pi(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&yi(t,e)}function yi(t,e){return yi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},yi(t,e)}var hi=o.Z.getComponent("Component"),di=function(t){function e(t,n){var r;return oi(this,e),(r=ci(this,e,[t,n])).bindEventListeners(),r}return pi(e,t),ai(e,[{key:"createEl",value:function(){return(t=e,n=this,"function"==typeof(r=si(fi(1&3?t.prototype:t),"createEl",n))?function(t){return r.apply(n,t)}:r)(["div",{},{class:"cv-drop-target cv-drop-".concat(this.options_.side)}]);var t,n,r}},{key:"bindEventListeners",value:function(){var t=this,e=this.el(),n=function(e){e.preventDefault(),e.dataTransfer.dropEffect="move",t.addClass("cv-drag-over")},r=function(e){e.preventDefault(),t.removeClass("cv-drag-over"),t.player_.whiteboardModePlugin().setWhiteboardMode(t.options_.side)},o=function(){t.removeClass("cv-drag-over")};e.addEventListener("dragover",n),e.addEventListener("drop",r),e.addEventListener("dragleave",o),this.on("dispose",(function(){e.removeEventListener("dragover",n),e.removeEventListener("drop",r),e.removeEventListener("dragleave",o)}))}}])}(hi),vi=function(t){function e(t,n){var r;return oi(this,e),(r=ci(this,e,[t,n])).addChildren(),r}return pi(e,t),ai(e,[{key:"addChildren",value:function(){var t=this;ei.forEach((function(e){t.addChild(new di(t.player_,{side:e}))}))}}])}(hi);function bi(t){return bi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bi(t)}function mi(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,gi(r.key),r)}}function gi(t){var e=function(t){if("object"!=bi(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=bi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==bi(e)?e:e+""}function wi(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(wi=function(){return!!t})()}function Oi(t){return Oi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Oi(t)}function Pi(t,e){return Pi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Pi(t,e)}var Si=function(t){function e(t,n){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,n){return e=Oi(e),function(t,e){if(e&&("object"==bi(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,wi()?Reflect.construct(e,n||[],Oi(t).constructor):e.apply(t,n))}(this,e,[t,n])}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Pi(t,e)}(e,t),n=e,(r=[{key:"handleClick",value:function(){this.player_.whiteboardModePlugin().setWhiteboardMode(this.options_.side)}}])&&mi(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getComponent("MenuItem"));function ji(t){return ji="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ji(t)}function ki(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,_i(r.key),r)}}function _i(t){var e=function(t){if("object"!=ji(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=ji(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ji(e)?e:e+""}function Ci(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Ci=function(){return!!t})()}function Ei(){return Ei="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Ti(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Ei.apply(null,arguments)}function Ti(t){return Ti=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ti(t)}function xi(t,e){return xi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},xi(t,e)}var Li=o.Z.getComponent("MenuButton"),Ri=function(t){function e(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=function(t,e,n){return e=Ti(e),function(t,e){if(e&&("object"==ji(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Ci()?Reflect.construct(e,n||[],Ti(t).constructor):e.apply(t,n))}(this,e,arguments)).alwaysCollapsed=!0,t.isCollapsed=!1,t.isCollabsible=!0,t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&xi(t,e)}(e,t),n=e,r=[{key:"createItems",value:function(){var t=this,e=this.player_.whiteboardModePlugin().side,n=[new _(this.player_,{label:"Video Controls"})];return ei.forEach((function(r){n.push(new Si(t.player_,{side:r,label:ni[r],selectable:!0,multiSelectable:!1,selected:r===e}))})),n}},{key:"buildWrapperCSSClass",value:function(){return"cv-menu-small cv-has-left-icons ".concat((t=e,n=this,"function"==typeof(r=Ei(Ti(1&3?t.prototype:t),"buildWrapperCSSClass",n))?function(t){return r.apply(n,t)}:r)([]));var t,n,r}},{key:"getCollabsibleName",value:function(){return"Video Controls"}},{key:"getCollabsibleValue",value:function(){var t=this.player_.whiteboardModePlugin().side;return ni[t]}},{key:"showInCollabsibleMenu",value:function(){return this.player_.isFullscreen()}},{key:"showCollapsibleMenu",value:function(){Li.prototype.handleClick.apply(this)}}],r&&ki(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Li);function Ii(t){return Ii="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ii(t)}function Di(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Bi(r.key),r)}}function Bi(t){var e=function(t){if("object"!=Ii(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Ii(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ii(e)?e:e+""}function Ni(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Ni=function(){return!!t})()}function Mi(t){return Mi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Mi(t)}function Ai(t,e){return Ai=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ai(t,e)}var Fi="cv-whiteboard-side",Zi=function(t){function e(t){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=function(t,e,n){return e=Mi(e),function(t,e){if(e&&("object"==Ii(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Ni()?Reflect.construct(e,n||[],Mi(t).constructor):e.apply(t,n))}(this,e,[t])).side="bottom",n.player.ready((function(){n.initialize()})),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ai(t,e)}(e,t),n=e,r=[{key:"initialize",value:function(){if(!this.player.options_.mobile){if(Ze()){var t=Ve(Fi);t&&(this.side=t)}this.initCollapserator(),this.initDragTargets(),this.initFullscreenListener()}}},{key:"initCollapserator",value:function(){var t=this,e=this.player.getChild("collapserator"),n=new ti(this.player);this.button=new Ri(this.player),e.addChild(n),e.addChild(this.button),this.player.trigger("cv-updatecog");var r=function(){t.player.isFullscreen()&&e.el().setAttribute("draggable","true")},o=function(){t.player.isFullscreen()&&e.el().setAttribute("draggable","false")},i=function(e){t.player.isFullscreen()&&(t.player.addClass("cv-dragging"),e.dataTransfer.setData("text/plain","handle"))},a=function(){t.player.isFullscreen()&&(t.player.removeClass("cv-dragging"),e.el().setAttribute("draggable","false"))};n.el().addEventListener("mousedown",r),n.el().addEventListener("mouseup",o),e.el().addEventListener("dragstart",i),e.el().addEventListener("dragend",a),this.on("dispose",(function(){n.el().removeEventListener("mousedown",r),n.el().removeEventListener("mouseup",o),e.el().removeEventListener("dragstart",i),e.el().removeEventListener("dragend",a)}))}},{key:"initDragTargets",value:function(){this.player.addChild(new vi(this.player))}},{key:"initFullscreenListener",value:function(){var t=this;this.update=this.update.bind(this),this.player.on("fullscreenchange",this.update),this.one("dispose",(function(){t.player.off("fullscreenchange",t.update)}))}},{key:"setWhiteboardMode",value:function(t){this.side=t,this.button.update(),Ze()&&ze(Fi,t),this.player.trigger("cv-whiteboard-change"),this.update()}},{key:"update",value:function(){this.player.removeClass("cv-whiteboard-top"),this.player.removeClass("cv-whiteboard-left"),this.player.removeClass("cv-whiteboard-right"),o.Z.dom.removeClass(window.document.documentElement,"cv-whiteboard-html-font-size"),this.player.trigger("resizemenus"),this.player.trigger("cv-updatecog"),this.player.isFullscreen()&&"bottom"!==this.side&&(this.player.addClass("cv-whiteboard-".concat(this.side)),o.Z.dom.addClass(window.document.documentElement,"cv-whiteboard-html-font-size"))}}],r&&Di(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getPlugin("plugin"));function Vi(t){return Vi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vi(t)}function zi(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Ui(r.key),r)}}function Ui(t){var e=function(t){if("object"!=Vi(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Vi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Vi(e)?e:e+""}function Gi(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Gi=function(){return!!t})()}function qi(t){return qi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},qi(t)}function Hi(t,e){return Hi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Hi(t,e)}o.Z.registerPlugin("whiteboardModePlugin",Zi);var Wi=function(t){function e(t){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,n){return e=qi(e),function(t,e){if(e&&("object"==Vi(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Gi()?Reflect.construct(e,n||[],qi(t).constructor):e.apply(t,n))}(this,e,[t])}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Hi(t,e)}(e,t),n=e,(r=[{key:"deferMenu",value:function(){var t={subtitles:this.buildSubtitles(),qualities:this.buildQualities(),playbackSpeeds:this.buildPlaybackSpeeds()};this.player.trigger("cv-defer-menus",t)}},{key:"buildSubtitles",value:function(){for(var t=[],e=!1,n=this.player.textTracks(),r=0;r<n.length;r++){var o=n[r],i="showing"===o.mode;t.unshift({id:o.label,name:o.label,selected:i}),i&&(e=!0)}return t.push({id:null,name:"Off",selected:!e}),t}},{key:"buildQualities",value:function(){for(var t=[],e=this.player.qualityLevels(),n=0;n<e.length;n++){var r=e[n];t.push({id:r.id,name:r.id+"p",selected:r.enabled})}return t}},{key:"buildPlaybackSpeeds",value:function(){var t=this.player.playbackRate();return this.player.options_.playbackRates.map((function(e){return{id:e,name:e+"x"+(1===e?" (Normal)":""),selected:t===e}}))}}])&&zi(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getPlugin("plugin"));o.Z.registerPlugin("deferMenusPlugin",Wi);var Qi="PreventScrubbingTooltip";function Yi(t){return Yi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yi(t)}function $i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Ki(r.key),r)}}function Ki(t){var e=function(t){if("object"!=Yi(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Yi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Yi(e)?e:e+""}function Xi(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Xi=function(){return!!t})()}function Ji(t,e,n,r){var o=ta(ea(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof o?function(t){return o.apply(n,t)}:o}function ta(){return ta="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=ea(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},ta.apply(null,arguments)}function ea(t){return ea=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ea(t)}function na(t,e){return na=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},na(t,e)}var ra=o.Z.getComponent("Component"),oa="cv-prevent-scrubbing-tooltip-show",ia="cv-prevent-scrubbing-tooltip-remove-transition",aa=function(t){function e(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=function(t,e,n){return e=ea(e),function(t,e){if(e&&("object"==Yi(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Xi()?Reflect.construct(e,n||[],ea(t).constructor):e.apply(t,n))}(this,e,arguments)).isShowing=!1,t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&na(t,e)}(e,t),n=e,r=[{key:"buildCSSClass",value:function(){return"cv-prevent-scrubbing-tooltip ".concat(Ji(e,"buildCSSClass",this,3)([]))}},{key:"createEl",value:function(t,n,r){return Ji(e,"createEl",this,3)([t,Object.assign(Object.assign({},n),{className:this.buildCSSClass(),innerText:"No skipping ahead!"}),r])}},{key:"show",value:function(){this.isShowing||(this.player_.userActive(!0),this.addClass(oa),this.isShowing=!0)}},{key:"hide",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.isShowing&&(e&&(this.addClass(ia),window.requestAnimationFrame((function(){t.removeClass(ia)}))),this.player_.userActive(!1),this.removeClass(oa),this.isShowing=!1)}}],r&&$i(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(ra);function ua(t){return ua="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ua(t)}function ca(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,la(r.key),r)}}function la(t){var e=function(t){if("object"!=ua(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=ua(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ua(e)?e:e+""}function sa(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(sa=function(){return!!t})()}function fa(){return fa="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=pa(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},fa.apply(null,arguments)}function pa(t){return pa=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},pa(t)}function ya(t,e){return ya=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ya(t,e)}o.Z.registerComponent(Qi,aa);var ha=function(t){function e(t,n){var r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=pa(e),function(t,e){if(e&&("object"==ua(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,sa()?Reflect.construct(e,n||[],pa(t).constructor):e.apply(t,n))}(this,e,[t])).isEnabled=!1,r.isPreviewing=!1;var o=null!=n?n:{},i=o.furthestVisitedTime,a=void 0===i?0:i,u=o.isEnabled,c=void 0!==u&&u;return r.playerCurrentTimeFn=r.player.currentTime.bind(t),r.player.currentTime=r.currentTime.bind(r),r.onTimeUpdate=r.onTimeUpdate.bind(r),r.furthestVisitedTime=a,r.isEnabled=c,c&&r.enable(),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ya(t,e)}(e,t),n=e,r=[{key:"dispose",value:function(){var t,n,r;this.player.currentTime=this.playerCurrentTimeFn,this.isEnabled&&(this.disable(),(t=e,n=this,"function"==typeof(r=fa(pa(1&3?t.prototype:t),"dispose",n))?function(t){return r.apply(n,t)}:r)([]))}},{key:"togglePreview",value:function(t){if(t){if(this.configurePreview(),this.isEnabled)return;this.enable(),this.isPreviewing=!0}else this.disable(),this.isPreviewing=!1}},{key:"configurePreview",value:function(){this.player.currentTime(0),this.furthestVisitedTime=0}},{key:"enable",value:function(){this.player.on("timeupdate",this.onTimeUpdate),this.getProgressControl().addChild(Qi),this.isEnabled=!0}},{key:"disable",value:function(){this.player.off("timeupdate",this.onTimeUpdate),this.getProgressControl().removeChild(this.getPreventScrubbingTooltip()),this.isEnabled=!1}},{key:"getProgressControl",value:function(){return this.player.controlBar.getChild("progressControl")}},{key:"onTimeUpdate",value:function(){var t=this.playerCurrentTimeFn();t>this.furthestVisitedTime&&(this.furthestVisitedTime=t)}},{key:"currentTime",value:function(t){for(var e,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];if("number"!=typeof t)return this.playerCurrentTimeFn.apply(this,[t].concat(r));if(this.isEnabled){var i=this.getPreventScrubbingTooltip(),a=null===(e=this.getSeekBar())||void 0===e?void 0:e.getChild("MouseTimeDisplay");if(t>this.furthestVisitedTime)return i.show(),Q(i.hide,1e3,!1,i)(),null==a||a.hide(),void this.playerCurrentTimeFn(this.furthestVisitedTime,r);null==a||a.show(),i.hide(!0),this.playerCurrentTimeFn(t,r)}else this.playerCurrentTimeFn.apply(this,[t].concat(r))}},{key:"getPreventScrubbingTooltip",value:function(){return this.getProgressControl().getChild(Qi)}},{key:"getSeekBar",value:function(){var t;return null===(t=this.player.controlBar.getChild("ProgressControl"))||void 0===t?void 0:t.getChild("SeekBar")}}],r&&ca(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getPlugin("plugin"));function da(t){return da="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},da(t)}function va(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,ba(r.key),r)}}function ba(t){var e=function(t){if("object"!=da(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=da(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==da(e)?e:e+""}function ma(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(ma=function(){return!!t})()}function ga(t){return ga=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ga(t)}function wa(t,e){return wa=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},wa(t,e)}o.Z.registerPlugin("preventScrubbingPlugin",ha);var Oa=o.Z.getComponent("Button"),Pa="cv-muted",Sa=function(t){function e(t){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=function(t,e,n){return e=ga(e),function(t,e){if(e&&("object"==da(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,ma()?Reflect.construct(e,n||[],ga(t).constructor):e.apply(t,n))}(this,e,[t])).update(),n.update=n.update.bind(n),t.on("volumechange",n.update),t.on("dispose",(function(){return t.off("volumechange",n.update)})),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&wa(t,e)}(e,t),n=e,(r=[{key:"handleClick",value:function(){this.player_.muted(!this.player_.muted()),this.update()}},{key:"update",value:function(){this.player_.muted()?this.addClass(Pa):this.removeClass(Pa)}},{key:"buildCSSClass",value:function(){return"cv-mute-button cv-muted"}}])&&va(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Oa);function ja(t){return ja="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ja(t)}function ka(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,_a(r.key),r)}}function _a(t){var e=function(t){if("object"!=ja(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=ja(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ja(e)?e:e+""}function Ca(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Ca=function(){return!!t})()}function Ea(){return Ea="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Ta(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Ea.apply(null,arguments)}function Ta(t){return Ta=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ta(t)}function xa(t,e){return xa=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},xa(t,e)}o.Z.registerComponent("muteButton",Sa),Sa.prototype.controlText_="Mute";var La,Ra=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=Ta(e),function(t,e){if(e&&("object"==ja(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Ca()?Reflect.construct(e,n||[],Ta(t).constructor):e.apply(t,n))}(this,e,[t,n]))._onClickHandler=n.onClickHandler,r.bindEventListeners(),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&xa(t,e)}(e,t),n=e,r=[{key:"createEl",value:function(){return o.Z.dom.createEl("div",{className:"cv-player-overlay"})}},{key:"handleClick",value:function(t){"function"==typeof this._onClickHandler&&(t.stopImmediatePropagation(),this._onClickHandler())}},{key:"dispose",value:function(){var t,n,r;this.off("click",this.handleClick),(t=e,n=this,"function"==typeof(r=Ea(Ta(1&3?t.prototype:t),"dispose",n))?function(t){return r.apply(n,t)}:r)([])}},{key:"bindEventListeners",value:function(){this.on("click",this.handleClick)}}],r&&ka(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getComponent("Component"));function Ia(t){return Ia="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ia(t)}function Da(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Ba(r.key),r)}}function Ba(t){var e=function(t){if("object"!=Ia(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Ia(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ia(e)?e:e+""}function Na(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Na=function(){return!!t})()}function Ma(t){return Ma=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ma(t)}function Aa(t,e){return Aa=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Aa(t,e)}o.Z.registerComponent("playerOverlay",Ra),function(t){t.Default="play",t.Hover="hover"}(La||(La={}));var Fa=o.Z.getPlugin("plugin"),Za="cv-preview-mode",Va=function(t){function e(t){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=function(t,e,n){return e=Ma(e),function(t,e){if(e&&("object"==Ia(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Na()?Reflect.construct(e,n||[],Ma(t).constructor):e.apply(t,n))}(this,e,[t])).buttonAdded=!1,n.mode=null,n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Aa(t,e)}(e,t),n=e,(r=[{key:"getMode",value:function(){return this.mode}},{key:"setPlayerMode",value:function(t,e){var n=this.mode;if(this.mode=t,t===La.Hover)return this.buttonAdded||this.addButtons(e),this.player.addClass(Za),this.enableSubtites(),this.mute(),this.removeActivityTimeout(),void this.player.trigger("resize");n===La.Hover&&(this.player.removeClass(Za),this.disableSubtitles(),this.unmute(),this.restoreActivityTimeout(),this.player.trigger("resize"))}},{key:"addButtons",value:function(t){var e=new Sa(this.player),n=new Ra(this.player,{onClickHandler:t});this.player.addChild(e),this.player.addChild(n),this.buttonAdded=!0}},{key:"enableSubtites",value:function(){var t=this;this.player.dataLoaded((function(){return t.player.persistSubtitleSettingsPlugin().previewModeSubtitles()}))}},{key:"disableSubtitles",value:function(){var t=this;this.player.dataLoaded((function(){return t.player.persistSubtitleSettingsPlugin().applyUserPreferences()}))}},{key:"mute",value:function(){var t=this;this.player.ready((function(){t.player.persistVolumePlugin().disable(),t.player.muted(!0)}))}},{key:"unmute",value:function(){var t=this;this.player.ready((function(){t.player.persistVolumePlugin().applyUserPreferences(),t.player.persistVolumePlugin().enable()}))}},{key:"removeActivityTimeout",value:function(){this.player.cache_.inactivityTimeout=this.player.options_.inactivityTimeout,this.player.options_.inactivityTimeout=0}},{key:"restoreActivityTimeout",value:function(){this.player.options_.inactivityTimeout=this.player.cache_.inactivityTimeout}}])&&Da(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Fa);function za(t){return za="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},za(t)}function Ua(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ga(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Ha(r.key),r)}}function qa(t,e,n){return e&&Ga(t.prototype,e),n&&Ga(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Ha(t){var e=function(t){if("object"!=za(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=za(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==za(e)?e:e+""}function Wa(t,e,n){return e=Ya(e),function(t,e){if(e&&("object"==za(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Qa()?Reflect.construct(e,n||[],Ya(t).constructor):e.apply(t,n))}function Qa(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Qa=function(){return!!t})()}function Ya(t){return Ya=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ya(t)}function $a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ka(t,e)}function Ka(t,e){return Ka=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ka(t,e)}o.Z.registerPlugin("playerModePlugin",Va);var Xa=o.Z.getComponent("Component"),Ja=o.Z.getComponent("ClickableComponent"),tu=function(t){function e(){return Ua(this,e),Wa(this,e,arguments)}return $a(e,t),qa(e,[{key:"createEl",value:function(){return Xa.prototype.createEl.call(this,"span",{className:"cv-favourite-button-svg",innerHTML:"<span class='cv-favourite-heart'>".concat('\n <svg version="1.1" viewBox="0 0 24 24">\n <path id="Heart-Filled" d="m18.833 5.9735c-0.78916-0.95022-1.8839-1.4735-3.0826-1.4735-1.6859 0-2.7532 1.0685-3.3517 1.9648-0.15528 0.2326-0.28738 0.46582-0.39828 0.68529-0.11091-0.21946-0.24297-0.45269-0.39828-0.68529-0.5985-0.89636-1.6658-1.9648-3.3517-1.9648-1.1987 0-2.2935 0.52333-3.0827 1.4735-0.75275 0.90644-1.1673 2.1204-1.1673 3.4183 0 1.4128 0.51978 2.7268 1.6358 4.1353 0.99741 1.2588 2.4323 2.5564 4.0939 4.0589 0.61916 0.5599 1.2594 1.1389 1.9411 1.7718l0.02047 0.01903c0.08837 0.08211 0.19856 0.12313 0.30875 0.12313s0.22038-0.04105 0.30875-0.12313l0.02047-0.01903c0.68166-0.63289 1.3219-1.2119 1.9412-1.7719 1.6615-1.5024 3.0964-2.8 4.0938-4.0588 1.116-1.4085 1.6358-2.7225 1.6358-4.1353 0-1.2979-0.41459-2.5119-1.1674-3.4183z"/>\n </svg>\n',"</span><span class='cv-favourite-outline'>").concat('\n <svg version="1.1" viewBox="0 0 24 24">\n <path id="Shape" d="m18.959 5.9741c-0.76992-0.92705-1.9357-1.5351-3.1052-1.5351-1.6448 0-2.8808 0.74937-3.4647 1.6238-0.15149 0.22693-0.28074 0.55125-0.38894 0.76537-0.10821-0.21411-0.23718-0.53844-0.38871-0.76537-0.58391-0.87451-1.8205-1.6238-3.4653-1.6238-1.1695 0-2.2376 0.60808-3.0075 1.5351-0.7344 0.88434-1.1388 1.9712-1.1388 3.2374 0 1.3784 0.50711 3.0509 1.5959 4.4251 0.97309 1.2281 2.373 2.4941 3.9941 3.9599 0.60406 0.54625 1.2285 1.1104 1.8936 1.7278l0.01997 0.01934c0.08622 0.08011 0.38931 0.21727 0.49681 0.21727 0.1075 0 0.40992-0.13796 0.49614-0.21804l0.0201-0.0178c0.66504-0.61746 1.2897-1.1824 1.8939-1.7287 1.621-1.4658 3.0209-2.7317 3.994-3.9598 1.0888-1.3742 1.5955-3.0467 1.5955-4.4251 0-1.2663-0.30646-2.3531-1.0409-3.2374zm-5.337 10.688c-0.51948 0.47226-1.0567 0.95549-1.6218 1.4768-0.56507-0.52124-1.101-1.0059-1.6219-1.4769-3.1725-2.8689-5.2684-4.7641-5.2684-7.2556 0-1.0298 0.32333-1.9863 0.91044-2.6933 0.59385-0.71497 1.4183-1.1088 2.3213-1.1088 1.254 0 2.0645 0.81976 2.5237 1.5074 0.41187 0.61679 0.62678 1.2385 0.70006 1.4772 0.06131 0.19978 0.23683 0.33499 0.43482 0.33499s0.37351-0.1352 0.43482-0.33499c0.07329-0.23867 0.28821-0.86044 0.70006-1.4773 0.45914-0.68766 1.2698-1.5074 2.5237-1.5074 0.90309 0 1.7274 0.39377 2.3213 1.1088 0.58714 0.70695 0.91047 1.6634 0.91047 2.6933 0 2.4914-2.1035 4.3783-5.2685 7.2557z" stroke-width=".97562"/>\n </svg>\n',"</span>")})}}])}(Xa),eu=function(t){function e(t,n){var r;return Ua(this,e),(r=Wa(this,e,[t,n])).isFavourited=n.isFavourited,r.renderIcon(),r.update(),r}return $a(e,t),qa(e,[{key:"renderIcon",value:function(){this.icon&&this.removeChild(this.icon),this.icon=new tu(this.player_),this.addChild(this.icon)}},{key:"update",value:function(){this.isFavourited?this.addClass("cv-favourited"):this.removeClass("cv-favourited")}},{key:"createEl",value:function(t,e,n){e=Object.assign({innerHTML:"",className:"cv-favourite-button"},e),n=Object.assign({type:"button"},n);var r=Xa.prototype.createEl.call(this,"button",e,n);return this.createControlTextEl(r),r}},{key:"handleClick",value:function(){this.isFavourited=!this.isFavourited,this.update(),this.options_.onClick&&this.options_.onClick(this.isFavourited)}}])}(Ja);function nu(t){return nu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nu(t)}function ru(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,ou(r.key),r)}}function ou(t){var e=function(t){if("object"!=nu(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=nu(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==nu(e)?e:e+""}function iu(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(iu=function(){return!!t})()}function au(t){return au=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},au(t)}function uu(t,e){return uu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},uu(t,e)}eu.prototype.controlText_="Favourite";var cu=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,n){return e=au(e),function(t,e){if(e&&("object"==nu(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,iu()?Reflect.construct(e,n||[],au(t).constructor):e.apply(t,n))}(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&uu(t,e)}(e,t),n=e,(r=[{key:"setFavourite",value:function(t,e){if(!this.initialized){var n=new eu(this.player,{isFavourited:t,onClick:e});this.player.addChild(n),this.initialized=!0}}}])&&ru(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getPlugin("plugin"));o.Z.registerPlugin("favouritePlugin",cu);var lu=n(18204),su=o.Z.getComponent("Menu"),fu=su.prototype.createEl;su.prototype.createEl=function(){var t=fu.call(this);return this.simpleBar=new lu.Z(this.contentEl(),{autoHide:!1}),t};var pu=su.prototype.contentEl;su.prototype.contentEl=function(){return this.simpleBar?this.simpleBar.getContentElement():pu.call(this)};var yu=su.prototype.dispose;su.prototype.dispose=function(){this.simpleBar&&(this.simpleBar.unMount(),delete this.simpleBar),yu.call(this)};var hu=su.prototype.addItem;su.prototype.addItem=function(t){hu.call(this,t),this.simpleBar.recalculate()};var du=su.prototype.lockShowing;su.prototype.lockShowing=function(){du.call(this),this.simpleBar.recalculate()},su.prototype.recalculateScrollBar=function(){this.simpleBar.recalculate()};var vu=su.prototype.handleBlur;function bu(t){return bu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bu(t)}function mu(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,gu(r.key),r)}}function gu(t){var e=function(t){if("object"!=bu(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=bu(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==bu(e)?e:e+""}function wu(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(wu=function(){return!!t})()}function Ou(t){return Ou=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ou(t)}function Pu(t,e){return Pu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Pu(t,e)}su.prototype.handleBlur=function(t){var e=t.relatedTarget||document.activeElement;this.el().contains(e)||vu.call(this,t)};var Su=o.Z.getComponent("Menu"),ju=o.Z.getComponent("Component"),ku=o.Z.getComponent("MenuButton"),_u=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,n){return e=Ou(e),function(t,e){if(e&&("object"==bu(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,wu()?Reflect.construct(e,n||[],Ou(t).constructor):e.apply(t,n))}(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Pu(t,e)}(e,t),n=e,(r=[{key:"createMenu",value:function(){var t,e=new Su(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){var n=o.Z.dom.createEl("li",{className:"vjs-menu-title",innerHTML:(t=this.options_.title,"string"!=typeof t?t:t.replace(/./,(function(t){return t.toUpperCase()}))),tabIndex:-1});this.hideThreshold_+=1;var r=new ju(this.player_,{el:n});e.addItem(r)}if(this.items=this.createItems(),this.items)for(var i=0;i<this.items.length;i++)e.addItem(this.items[i]);return e}}])&&mu(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(ku),Cu=ku.prototype.pressButton;ku.prototype.pressButton=function(){Cu.call(this),this.inactivityTimeout=this.player_.cache_.inactivityTimeout,this.player_.cache_.inactivityTimeout=0,this.player_.options_.inactivityTimeout=0};var Eu=ku.prototype.unpressButton;function Tu(t){return Tu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Tu(t)}function xu(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Lu(r.key),r)}}function Lu(t){var e=function(t){if("object"!=Tu(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Tu(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Tu(e)?e:e+""}function Ru(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Ru=function(){return!!t})()}function Iu(t,e,n,r){var o=Du(Bu(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof o?function(t){return o.apply(n,t)}:o}function Du(){return Du="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Bu(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Du.apply(null,arguments)}function Bu(t){return Bu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Bu(t)}function Nu(t,e){return Nu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Nu(t,e)}ku.prototype.unpressButton=function(){Eu.call(this),this.player_.cache_.inactivityTimeout=this.inactivityTimeout,this.player_.options_.inactivityTimeout=this.inactivityTimeout,this.player_.reportUserActivity()},o.Z.registerComponent("MenuButton",_u);var Mu=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,n){return e=Bu(e),function(t,e){if(e&&("object"==Tu(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Ru()?Reflect.construct(e,n||[],Bu(t).constructor):e.apply(t,n))}(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Nu(t,e)}(e,t),n=e,(r=[{key:"buildCSSClass",value:function(){return"cv-time-wrapper ".concat(Iu(e,"buildCSSClass",this,3)([]))}},{key:"createEl",value:function(t,n,r){return Iu(e,"createEl",this,3)([t,Object.assign(Object.assign({},n),{className:this.buildCSSClass()}),r])}}])&&xu(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getComponent("Component"));function Au(t){return Au="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Au(t)}function Fu(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Zu(r.key),r)}}function Zu(t){var e=function(t){if("object"!=Au(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Au(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Au(e)?e:e+""}function Vu(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Vu=function(){return!!t})()}function zu(t){return zu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},zu(t)}function Uu(t,e){return Uu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Uu(t,e)}Mu.prototype.options_={children:["currentTimeDisplay","remainingTimeDisplay"]},o.Z.registerComponent("TimeWrapper",Mu);var Gu=o.Z.getComponent("SeekBar"),qu=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,n){return e=zu(e),function(t,e){if(e&&("object"==Au(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Vu()?Reflect.construct(e,n||[],zu(t).constructor):e.apply(t,n))}(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Uu(t,e)}(e,t),n=e,(r=[{key:"handleMouseDown",value:function(t){var e=this.player_.preventScrubbingPlugin();e.isEnabled&&this.getMouseTime(t)>e.furthestVisitedTime||(Gu.prototype.handleMouseDown.call(this,t),this.player_.addClass("cv-disable-play-pause-feedback"))}},{key:"handleMouseMove",value:function(t){Gu.prototype.handleMouseMove.call(this,t),this.update()}},{key:"getPercent",value:function(){var t=this.player_.currentTime()/this.player_.duration();return t>=1?1:t}},{key:"handleMouseUp",value:function(t){var e=this;Gu.prototype.handleMouseUp.call(this,t),this.timeoutId&&window.clearTimeout(this.timeoutId),this.timeoutId=window.setTimeout((function(){e.player_.removeClass("cv-disable-play-pause-feedback")}),500)}},{key:"clamp",value:function(t,e,n){return Math.min(Math.max(t,e),n)}},{key:"getMouseTime",value:function(t){return this.clamp(Gu.prototype.calculateDistance.call(this,t).x,0,1)*this.player_.duration()}}])&&Fu(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Gu);function Hu(t){return Hu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hu(t)}function Wu(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Qu(r.key),r)}}function Qu(t){var e=function(t){if("object"!=Hu(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Hu(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Hu(e)?e:e+""}function Yu(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Yu=function(){return!!t})()}function $u(t,e,n,r){var o=Ku(Xu(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof o?function(t){return o.apply(n,t)}:o}function Ku(){return Ku="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Xu(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Ku.apply(null,arguments)}function Xu(t){return Xu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Xu(t)}function Ju(t,e){return Ju=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ju(t,e)}o.Z.registerComponent("SeekBar",qu);var tc=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,n){return e=Xu(e),function(t,e){if(e&&("object"==Hu(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Yu()?Reflect.construct(e,n||[],Xu(t).constructor):e.apply(t,n))}(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ju(t,e)}(e,t),n=e,(r=[{key:"buildCSSClass",value:function(){return"cv-chapter-bar-load-progress ".concat($u(e,"buildCSSClass",this,3)([]))}},{key:"createEl",value:function(t,n,r){return $u(e,"createEl",this,3)([t,Object.assign(Object.assign({},n),{className:this.buildCSSClass()}),r])}},{key:"update",value:function(t){this.el_.style.width=100*t+"%"}}])&&Wu(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getComponent("Component"));function ec(t){return ec="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ec(t)}function nc(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,rc(r.key),r)}}function rc(t){var e=function(t){if("object"!=ec(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=ec(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ec(e)?e:e+""}function oc(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(oc=function(){return!!t})()}function ic(t,e,n,r){var o=ac(uc(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof o?function(t){return o.apply(n,t)}:o}function ac(){return ac="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=uc(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},ac.apply(null,arguments)}function uc(t){return uc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},uc(t)}function cc(t,e){return cc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},cc(t,e)}var lc=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,n){return e=uc(e),function(t,e){if(e&&("object"==ec(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,oc()?Reflect.construct(e,n||[],uc(t).constructor):e.apply(t,n))}(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&cc(t,e)}(e,t),n=e,(r=[{key:"buildCSSClass",value:function(){return"cv-chapter-bar-play-progress ".concat(ic(e,"buildCSSClass",this,3)([]))}},{key:"createEl",value:function(t,n,r){return ic(e,"createEl",this,3)([t,Object.assign(Object.assign({},n),{className:this.buildCSSClass()}),r])}},{key:"update",value:function(t){t>0&&t<1?this.addClass("cv-current"):this.removeClass("cv-current"),this.el_.style.width=100*t+"%"}}])&&nc(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getComponent("Component"));function sc(t){return sc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},sc(t)}function fc(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,pc(r.key),r)}}function pc(t){var e=function(t){if("object"!=sc(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=sc(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==sc(e)?e:e+""}function yc(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(yc=function(){return!!t})()}function hc(t,e,n,r){var o=dc(vc(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof o?function(t){return o.apply(n,t)}:o}function dc(){return dc="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=vc(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},dc.apply(null,arguments)}function vc(t){return vc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},vc(t)}function bc(t,e){return bc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},bc(t,e)}var mc=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=vc(e),function(t,e){if(e&&("object"==sc(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,yc()?Reflect.construct(e,n||[],vc(t).constructor):e.apply(t,n))}(this,e,[t,n])).playProgress=new lc(r.player_),r.addChild(r.playProgress),r.loadProgress=new tc(r.player_),r.addChild(r.loadProgress),r.update(),r.updateBuffered(0),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&bc(t,e)}(e,t),n=e,(r=[{key:"buildCSSClass",value:function(){return"cv-chapter-bar-item ".concat(hc(e,"buildCSSClass",this,3)([]))}},{key:"createEl",value:function(t,n,r){return hc(e,"createEl",this,3)([t,Object.assign(Object.assign({},n),{className:this.buildCSSClass()}),r])}},{key:"getCurrentTime",value:function(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()}},{key:"update",value:function(){var t=this.player_.duration()||3600,e=this.options_.endTime-this.options_.startTime;if(t!==this.duration_){var n=e/t;this.el_.style.width=100*n+"%";var r=this.options_.startTime/t;this.el_.style.left=100*r+"%",this.duration_=t}var o=this.getCurrentTime();o<this.options_.startTime?this.playProgress.update(0):o>this.options_.endTime?this.playProgress.update(1):this.playProgress.update((o-this.options_.startTime)/e)}},{key:"updateBuffered",value:function(t){var e=this.options_.endTime-this.options_.startTime;t<this.options_.startTime?this.loadProgress.update(0):t>this.options_.endTime?this.loadProgress.update(1):this.loadProgress.update((t-this.options_.startTime)/e)}}])&&fc(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getComponent("Component"));function gc(t){for(var e=t.buffered(),n=t.currentTime(),r=0,o=0;o<e.length;o++){var i=e.start(o),a=e.end(o);if(i<=n&&a>=n){r=a;break}}return r}function wc(t){return wc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wc(t)}function Oc(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Pc(r.key),r)}}function Pc(t){var e=function(t){if("object"!=wc(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=wc(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==wc(e)?e:e+""}function Sc(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Sc=function(){return!!t})()}function jc(t,e,n,r){var o=kc(_c(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof o?function(t){return o.apply(n,t)}:o}function kc(){return kc="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=_c(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},kc.apply(null,arguments)}function _c(t){return _c=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_c(t)}function Cc(t,e){return Cc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Cc(t,e)}var Ec=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,n){return e=_c(e),function(t,e){if(e&&("object"==wc(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Sc()?Reflect.construct(e,n||[],_c(t).constructor):e.apply(t,n))}(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Cc(t,e)}(e,t),n=e,(r=[{key:"buildCSSClass",value:function(){return"cv-chapter-bar-items ".concat(jc(e,"buildCSSClass",this,3)([]))}},{key:"createEl",value:function(t,n,r){return jc(e,"createEl",this,3)([t,Object.assign(Object.assign({},n),{className:this.buildCSSClass()}),r])}},{key:"update",value:function(){this.children_.forEach((function(t){t.update()}))}},{key:"updateBuffered",value:function(){var t=this;this.children_.forEach((function(e){e.updateBuffered(gc(t.player_))}))}}])&&Oc(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getComponent("Component"));function Tc(t){return Tc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Tc(t)}function xc(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Lc(r.key),r)}}function Lc(t){var e=function(t){if("object"!=Tc(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Tc(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Tc(e)?e:e+""}function Rc(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Rc=function(){return!!t})()}function Ic(t,e,n,r){var o=Dc(Bc(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof o?function(t){return o.apply(n,t)}:o}function Dc(){return Dc="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Bc(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Dc.apply(null,arguments)}function Bc(t){return Bc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Bc(t)}function Nc(t,e){return Nc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Nc(t,e)}var Mc=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=Bc(e),function(t,e){if(e&&("object"==Tc(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Rc()?Reflect.construct(e,n||[],Bc(t).constructor):e.apply(t,n))}(this,e,[t,n])).onDurationChange=r.onDurationChange.bind(r),r.createChapterItems=r.createChapterItems.bind(r),r.updateBuffered=r.updateBuffered.bind(r),W.useTrack(r.player_,"chapters",null,r.createChapterItems),r.player_.on("durationchange",r.onDurationChange),r.player_.on("progress",r.updateBuffered),r.createChapterItems(),r.update(),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Nc(t,e)}(e,t),n=e,(r=[{key:"dispose",value:function(){this.player_.off("durationchange",this.onDurationChange),this.player_.off("progress",this.updateBuffered),Ic(e,"dispose",this,3)([])}},{key:"createEl",value:function(){return o.Z.dom.createEl("div",{className:"vjs-progress-holder cv-chapter-seek-bar"},{"aria-label":this.localize("Progress Bar"),role:"progressbar"})}},{key:"onDurationChange",value:function(){this.createChapterItems(),this.update()}},{key:"update",value:function(){var t=Ic(e,"update",this,3)([]);return this.chapterBarItems&&this.chapterBarItems.update(),t}},{key:"updateBuffered",value:function(){this.chapterBarItems.updateBuffered()}},{key:"bindUpdateListener",value:function(t){var e=this,n=function(){e.createChapterItems(),e.updateBuffered()};t.addEventListener("cv:cuechange",n),this.player_.one("dispose",(function(){return t.removeEventListener("cv:cuechange",n)}))}},{key:"createChapterItems",value:function(t){var e,n;t&&(this.track_||this.bindUpdateListener(t),this.track_=t);var r=new Ec(this.player_);if((null===(n=null===(e=this.track_)||void 0===e?void 0:e.cues)||void 0===n?void 0:n.length)&&!this.options_.ignoreChapters)for(var o=0;o<this.track_.cues.length;o++){var i=this.track_.cues[o],a=i.startTime,u=i.endTime,c=this.player_.duration();c&&(o===this.track_.cues.length-1&&i.endTime<this.player_.duration()&&(u=this.player_.duration()),u>c&&(u=c));var l=new mc(this.player_,{startTime:a,endTime:u});if(r.addChild(l),c&&u===c)break}else r.addChild(new mc(this.player_,{startTime:0,endTime:this.player_.duration()||3600}));this.chapterBarItems&&this.removeChild(this.chapterBarItems),this.chapterBarItems=r,this.addChild(this.chapterBarItems)}}])&&xc(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getComponent("SeekBar"));function Ac(t){return Ac="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ac(t)}function Fc(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Zc(r.key),r)}}function Zc(t){var e=function(t){if("object"!=Ac(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Ac(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ac(e)?e:e+""}function Vc(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Vc=function(){return!!t})()}function zc(){return zc="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Uc(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},zc.apply(null,arguments)}function Uc(t){return Uc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Uc(t)}function Gc(t,e){return Gc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Gc(t,e)}Mc.prototype.options_={children:["playProgressBar"],barName:"playProgressBar"},o.Z.browser.IS_IOS||o.Z.browser.IS_ANDROID||Mc.prototype.options_.children.splice(1,0,"mouseTimeDisplay"),o.Z.registerComponent("ChapterSeekBar",Mc);var qc=o.Z.getComponent("ProgressControl"),Hc="seekBar",Wc=function(t){function e(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=function(t,e,n){return e=Uc(e),function(t,e){if(e&&("object"==Ac(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Vc()?Reflect.construct(e,n||[],Uc(t).constructor):e.apply(t,n))}(this,e,arguments)).seekBarName_=Hc,t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Gc(t,e)}(e,t),n=e,r=[{key:"setSeekBarName",value:function(t){this.seekBarName_=t}},{key:"getChild",value:function(t){return(null==t?void 0:t.toLowerCase())===Hc.toLowerCase()&&(t=this.seekBarName_),(n=e,r=this,"function"==typeof(o=zc(Uc(1&3?n.prototype:n),"getChild",r))?function(t){return o.apply(r,t)}:o)([t]);var n,r,o}}],r&&Fc(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(qc);function Qc(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;t=t<0?0:t;var n=Math.floor(t%60),r=Math.floor(t/60%60),o=Math.floor(t/3600),i=Math.floor(e/60%60),a=Math.floor(e/3600);return(isNaN(t)||t===1/0)&&(o=r=n="-"),(o=o>0||a>0?o+":":"")+(r=((o||i>=10)&&r<10?"0"+r:r)+":")+(n<10?"0"+n:n)}function Yc(t){return Yc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yc(t)}function $c(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Kc(r.key),r)}}function Kc(t){var e=function(t){if("object"!=Yc(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Yc(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Yc(e)?e:e+""}function Xc(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Xc=function(){return!!t})()}function Jc(){return Jc="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=tl(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Jc.apply(null,arguments)}function tl(t){return tl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},tl(t)}function el(t,e){return el=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},el(t,e)}Wc.prototype.options_={children:[]},o.Z.registerComponent("ProgressControl",Wc);var nl=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=tl(e),function(t,e){if(e&&("object"==Yc(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Xc()?Reflect.construct(e,n||[],tl(t).constructor):e.apply(t,n))}(this,e,[t,n])).hasCustomChapterText=!1,W.useTrack(r.player_,"chapters",!1,(function(t){r.track_=t})),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&el(t,e)}(e,t),n=e,r=[{key:"createEl",value:function(){var t,n,r,i=(t=e,n=this,"function"==typeof(r=Jc(tl(1&3?t.prototype:t),"createEl",n))?function(t){return r.apply(n,t)}:r)([]);return this.chapter_=o.Z.dom.createEl("div"),i.appendChild(this.chapter_),this.time_=o.Z.dom.createEl("div"),i.appendChild(this.time_),i}},{key:"updateTime",value:function(t){var e=this.player_.duration();if(o.Z.dom.textContent(this.time_,Qc(t,e)),this.track_&&!this.hasCustomChapterText){for(var n=0;n<this.track_.cues.length;n++){var r=this.track_.cues[n],i=r.endTime||e;if(r.startTime<=t&&i>=t)return void o.Z.dom.textContent(this.chapter_,r.text)}o.Z.dom.textContent(this.chapter_,"")}}},{key:"clearChapterContent",value:function(){o.Z.dom.textContent(this.chapter_,"")}},{key:"updateText",value:function(t){o.Z.dom.textContent(this.time_,t)}},{key:"setCustomChapterText",value:function(t){this.hasCustomChapterText=!!t,o.Z.dom.textContent(this.chapter_,null!=t?t:"")}}],r&&$c(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getComponent("TimeTooltip"));function rl(t){return rl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},rl(t)}function ol(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,il(r.key),r)}}function il(t){var e=function(t){if("object"!=rl(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=rl(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==rl(e)?e:e+""}function al(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(al=function(){return!!t})()}function ul(){return ul="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=cl(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},ul.apply(null,arguments)}function cl(t){return cl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},cl(t)}function ll(t,e){return ll=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ll(t,e)}o.Z.registerComponent("TimeTooltip",nl);var sl=function(t){function e(t,n){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,n){return e=cl(e),function(t,e){if(e&&("object"==rl(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,al()?Reflect.construct(e,n||[],cl(t).constructor):e.apply(t,n))}(this,e,[t,n])}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ll(t,e)}(e,t),n=e,r=[{key:"setTrack",value:function(t){this.track_=t}},{key:"createEl",value:function(){var t,n,r,i=(t=e,n=this,"function"==typeof(r=ul(cl(1&3?t.prototype:t),"createEl",n))?function(t){return r.apply(n,t)}:r)(["div",{className:"cv-thumbnail-display"}]);return this.img_=o.Z.dom.createEl("img"),i.appendChild(this.img_),i}},{key:"enable",value:function(){this.addClass("cv-thumbnail-display-enabled")}},{key:"disable",value:function(){this.removeClass("cv-thumbnail-display-enabled")}},{key:"parseImageLink",value:function(t){var e=t.indexOf("#");if(-1===e)return{src:t,w:0,h:0,x:0,y:0};var n=t.substr(0,e),r=t.substr(e+1);if("xywh="!==r.substr(0,5))return{src:t,w:0,h:0,x:0,y:0};var o=this.getScale(),i=r.substr(5).split(",");return{src:n,w:parseInt(i[2])*o,h:parseInt(i[3])*o,x:parseInt(i[0])*o,y:parseInt(i[1])*o}}},{key:"getScale",value:function(){var t=this.options_.scaleFactor,e=this.player_.whiteboardModePlugin().side;return this.player_.isFullscreen()&&"bottom"!==e&&(t*=2),t}},{key:"update",value:function(t){var e,n;if(null===(n=null===(e=this.track_)||void 0===e?void 0:e.cues)||void 0===n?void 0:n.length){for(var r,o=t,i=0;i<this.track_.cues.length;){var a=this.track_.cues[i];if(a.startTime<=o&&a.endTime>=o){r=this.parseImageLink(a.text);break}i++}if(null==r?void 0:r.src){this.enable();var u=r,c=u.src,l=u.w,s=u.h,f=u.x,p=u.y,y=this.getScale();this.img_.src=c,this.img_.style.left=-f+"px",this.img_.style.top=-p+"px",this.img_.style.transformOrigin="0 0",this.img_.style.transform="scale(".concat(y,")"),this.el_.style.width=l+"px",this.el_.style.height=s+"px"}else this.disable()}}}],r&&ol(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getComponent("Component"));function fl(t){return fl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fl(t)}function pl(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,yl(r.key),r)}}function yl(t){var e=function(t){if("object"!=fl(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=fl(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==fl(e)?e:e+""}function hl(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(hl=function(){return!!t})()}function dl(t){return dl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},dl(t)}function vl(t,e){return vl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},vl(t,e)}sl.prototype.options_={scaleFactor:1},o.Z.registerComponent("ThumbnailDisplay",sl);var bl=o.Z.getComponent("MouseTimeDisplay"),ml="cv-mouse-time-display-force-show",gl=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),r=function(t,e,n){return e=dl(e),function(t,e){if(e&&("object"==fl(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,hl()?Reflect.construct(e,n||[],dl(t).constructor):e.apply(t,n))}(this,e,[t,n]),W.useTrack(r.player_,"metadata","thumbnails",(function(t){r.getChild("ThumbnailDisplay").setTrack(t)})),r.update=r.update.bind(r),r.player_.on("durationchange",r.update),r.player_.one("dispose",(function(){r.player_.off("durationchange",r.update)})),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&vl(t,e)}(e,t),n=e,(r=[{key:"update",value:function(t,e){var n=this;this.requestAnimationFrame((function(){var r=n.getChild("TimeTooltip"),o=n.getChild("ThumbnailDisplay"),i=e*n.player_.duration(),a=n.player_.preventScrubbingPlugin(),u=n.player_.controlBar.getChild("progressControl").getChild(Qi),c=!1;a.isEnabled&&(c=i>a.furthestVisitedTime),c?(n.hide(),u.show(),Q(u.hide,1e3,!1,u)()):(n.show(),u&&u.hide(!0),o.update(i),r.updateTime(i));var l=n.el_.getBoundingClientRect();n.el_.style.marginLeft=-l.width/2+"px";var s=t.width*e;s<l.width/2?n.el_.style.left=l.width/2+"px":s>t.width-l.width/2?n.el_.style.left=t.width-l.width/2+"px":n.el_.style.left=t.width*e+"px"}))}},{key:"forceShow",value:function(){this.addClass(ml)}},{key:"removeForceShow",value:function(){this.removeClass(ml)}}])&&pl(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(bl);function wl(t){return wl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wl(t)}function Ol(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Pl(r.key),r)}}function Pl(t){var e=function(t){if("object"!=wl(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=wl(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==wl(e)?e:e+""}function Sl(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Sl=function(){return!!t})()}function jl(){return jl="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=kl(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},jl.apply(null,arguments)}function kl(t){return kl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},kl(t)}function _l(t,e){return _l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_l(t,e)}gl.prototype.options_={children:["ThumbnailDisplay","TimeTooltip"]},o.Z.registerComponent("MouseTimeDisplay",gl);var Cl=o.Z.getComponent("ChaptersTrackMenuItem"),El=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=kl(e),function(t,e){if(e&&("object"==wl(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Sl()?Reflect.construct(e,n||[],kl(t).constructor):e.apply(t,n))}(this,e,[t,n])).nonIconControl=!1,r.thumbnailDisplay=new sl(r.player_,{scaleFactor:.5}),r.el().insertBefore(r.thumbnailDisplay.el(),r.el().firstChild),W.useTrack(r.player_,"metadata","thumbnails",(function(t){r.addClass("cv-has-thumbnails"),r.thumbnailDisplay.setTrack(t),r.thumbnailDisplay.update(r.options_.cue.startTime)})),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_l(t,e)}(e,t),n=e,r=[{key:"update",value:function(){this.player_&&Cl.prototype.update.call(this)}},{key:"buildCSSClass",value:function(){return"vjs-menu-item cv-chapter-menu-item"}},{key:"createEl",value:function(t,n,r){return this.nonIconControl=!0,(o=e,i=this,"function"==typeof(a=jl(kl(1&3?o.prototype:o),"createEl",i))?function(t){return a.apply(i,t)}:a)(["li",Object.assign({className:this.buildCSSClass(),innerHTML:this.getInnerHTML(),tabIndex:-1},n),r]);var o,i,a}},{key:"getInnerHTML",value:function(){var t=this.player_.duration();return'<span class="vjs-menu-item-text cv-chapter-menu-item-text">'+"<p>".concat(this.localize(this.options_.label),"</p>")+"<p>(".concat(Qc(this.options_.cue.startTime,t),")</p>")+"</span>"}}],r&&Ol(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Cl);function Tl(t){return Tl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Tl(t)}function xl(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Ll(r.key),r)}}function Ll(t){var e=function(t){if("object"!=Tl(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Tl(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Tl(e)?e:e+""}function Rl(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Rl=function(){return!!t})()}function Il(t,e,n,r){var o=Dl(Bl(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof o?function(t){return o.apply(n,t)}:o}function Dl(){return Dl="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Bl(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Dl.apply(null,arguments)}function Bl(t){return Bl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Bl(t)}function Nl(t,e){return Nl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Nl(t,e)}var Ml=function(t){function e(t,n,r){var o;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(o=function(t,e,n){return e=Bl(e),function(t,e){if(e&&("object"==Tl(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Rl()?Reflect.construct(e,n||[],Bl(t).constructor):e.apply(t,n))}(this,e,[t,n,r])).alwaysCollapsed=!1,o.isCollapsed=!1,o.isCollabsible=!0,o.update=o.update.bind(o),o.player_.on("cv-whiteboard-change",o.update),o.player_.on("fullscreenchange",o.update),o.player_.on("dispose",(function(){o.player_.off("cv-whiteboard-change",o.update),o.player_.off("fullscreenchange",o.update)})),o}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Nl(t,e)}(e,t),n=e,(r=[{key:"buildCSSClass",value:function(){return"cv-chapters-button ".concat(Il(e,"buildCSSClass",this,3)([]))}},{key:"buildWrapperCSSClass",value:function(){return"cv-menu-big ".concat(Il(e,"buildWrapperCSSClass",this,3)([]))}},{key:"createItems",value:function(){var t=[];if(!this.track_)return t;var e=this.track_.cues;if(!e)return t;for(var n=0,r=e.length;n<r;n++){var o=e[n],i=new El(this.player_,{track:this.track_,cue:o});t.push(i)}return t}},{key:"setTrack",value:function(t){var n=this;if(Il(e,"setTrack",this,3)([t]),this.track_&&"chapters"===this.track_.kind){t.one("loadeddata",this.update);var r=function(){n.update(),n.player_.trigger("resizemenus")};t.on("cv:cuechange",r),this.player_.one("dispose",(function(){return t.off("cv:cueupdate",r)}))}}},{key:"update",value:function(t){Il(e,"update",this,3)([t])}},{key:"getCollabsibleName",value:function(){return"Chapters"}},{key:"getCollabsibleValue",value:function(){var t=this.track_.activeCues[0];return(null==t?void 0:t.text)||""}},{key:"showInCollabsibleMenu",value:function(){if(!this.track_)return!1;var t=this.track_.cues;return!(!t||!t.length)}},{key:"showCollapsibleMenu",value:function(){this.handleClick(null)}}])&&xl(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getComponent("ChaptersButton"));function Al(t){return Al="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Al(t)}function Fl(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Zl(r.key),r)}}function Zl(t){var e=function(t){if("object"!=Al(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Al(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Al(e)?e:e+""}function Vl(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Vl=function(){return!!t})()}function zl(){return zl="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Ul(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},zl.apply(null,arguments)}function Ul(t){return Ul=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ul(t)}function Gl(t,e){return Gl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Gl(t,e)}o.Z.registerComponent("ChaptersButton",Ml);var ql=o.Z.getComponent("OffTextTrackMenuItem"),Hl=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,n){return e=Ul(e),function(t,e){if(e&&("object"==Al(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Vl()?Reflect.construct(e,n||[],Ul(t).constructor):e.apply(t,n))}(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Gl(t,e)}(e,t),n=e,r=[{key:"handleClick",value:function(t){ql.prototype.handleClick.call(this,t),this.player_.trigger("cv:languageselected")}},{key:"createEl",value:function(t,n,r){return(o=e,i=this,"function"==typeof(a=zl(Ul(1&3?o.prototype:o),"createEl",i))?function(t){return a.apply(i,t)}:a)(["li",Object.assign(Object.assign({className:"vjs-menu-item",tabIndex:-1},n),{innerHTML:'<span class="vjs-menu-item-text">Off</span>'}),r]);var o,i,a}}],r&&Fl(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(ql);function Wl(t){return Wl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wl(t)}function Ql(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Yl(r.key),r)}}function Yl(t){var e=function(t){if("object"!=Wl(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Wl(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Wl(e)?e:e+""}function $l(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return($l=function(){return!!t})()}function Kl(t){return Kl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Kl(t)}function Xl(t,e){return Xl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Xl(t,e)}o.Z.registerComponent("OffTextTrackMenuItem",Hl);var Jl=o.Z.getComponent("TextTrackButton"),ts=o.Z.getComponent("TextTrackMenuItem"),es=o.Z.getComponent("OffTextTrackMenuItem"),ns=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,n){return e=Kl(e),function(t,e){if(e&&("object"==Wl(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,$l()?Reflect.construct(e,n||[],Kl(t).constructor):e.apply(t,n))}(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Xl(t,e)}(e,t),n=e,r=[{key:"createItems",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ts;this.label_&&(t="".concat(this.label_," off")),e.push(new es(this.player_,{kinds:this.kinds_,kind:this.kind_,label:t})),this.hideThreshold_+=1;var r=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(var o=0;o<r.length;o++){var i=r[o];if(this.kinds_.indexOf(i.kind)>-1){var a=new n(this.player_,{track:i,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});a.addClass("vjs-".concat(i.kind,"-menu-item")),e.push(a)}}return this.player().trigger("resizemenus"),e}}],r&&Ql(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Jl);function rs(t){return rs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},rs(t)}function os(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,is(r.key),r)}}function is(t){var e=function(t){if("object"!=rs(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=rs(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==rs(e)?e:e+""}function as(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(as=function(){return!!t})()}function us(t){return us=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},us(t)}function cs(t,e){return cs=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},cs(t,e)}o.Z.registerComponent("TextTrackButton",ns);var ls=o.Z.getComponent("SubsCapsMenuItem"),ss=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,n){return e=us(e),function(t,e){if(e&&("object"==rs(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,as()?Reflect.construct(e,n||[],us(t).constructor):e.apply(t,n))}(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&cs(t,e)}(e,t),n=e,(r=[{key:"handleClick",value:function(t){ls.prototype.handleClick.call(this,t),this.player_.trigger("cv:languageselected")}}])&&os(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(ls);function fs(t){return fs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fs(t)}function ps(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,ys(r.key),r)}}function ys(t){var e=function(t){if("object"!=fs(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=fs(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==fs(e)?e:e+""}function hs(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(hs=function(){return!!t})()}function ds(t){return ds=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ds(t)}function vs(t,e){return vs=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},vs(t,e)}var bs=function(t){function e(t){var n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var r={};r.track={player:t,kind:"subtitle",label:"Search Captions",selectable:!1,default:!1,mode:"disabled"},r.selectable=!1,r.name="SubtitleSearchMenuItem",(n=function(t,e,n){return e=ds(e),function(t,e){if(e&&("object"==fs(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,hs()?Reflect.construct(e,n||[],ds(t).constructor):e.apply(t,n))}(this,e,[t,r])).addClass("vjs-texttrack-settings"),n.addClass("cv-subtitle-search-menu-item"),n.controlText(", opens subtitle search"),n.toggleEnabled=n.toggleEnabled.bind(n);var o=n.player_.textTracks();return o.addEventListener("selectedlanguagechange",n.toggleEnabled),n.player_.one("dispose",(function(){o.removeEventListener("selectedlanguagechange",n.toggleEnabled)})),n.toggleEnabled(),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&vs(t,e)}(e,t),n=e,(r=[{key:"toggleEnabled",value:function(){var t;if(this.player_){var e=W.getCurrentTextTrack(this.player_);e?(null===(t=e.cues)||void 0===t?void 0:t.length)?this.removeClass("vjs-disabled"):(this.bindTrackEvents(e),this.addClass("vjs-disabled")):this.addClass("vjs-disabled")}}},{key:"bindTrackEvents",value:function(t){var e=this;t.removeEventListener("loadeddata",this.toggleEnabled),t.addEventListener("loadeddata",this.toggleEnabled),this.player_.one("dispose",(function(){t.removeEventListener("loadeddata",e.toggleEnabled)}))}},{key:"handleClick",value:function(){var t,e=this,n=W.getCurrentTextTrack(this.player_);(null===(t=null==n?void 0:n.cues)||void 0===t?void 0:t.length)&&this.requestAnimationFrame((function(){e.player_.getChild("collapserator").getChild("subtitleSearchButton").showCollapsibleMenu()}))}}])&&ps(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getComponent("TextTrackMenuItem"));function ms(t){return ms="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ms(t)}function gs(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,ws(r.key),r)}}function ws(t){var e=function(t){if("object"!=ms(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=ms(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ms(e)?e:e+""}function Os(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Os=function(){return!!t})()}function Ps(t){return Ps=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ps(t)}function Ss(t,e){return Ss=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ss(t,e)}var js=function(t){function e(t){var n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var r={};return r.track={player:t,kind:"subtitle",label:"Caption Text Size",selectable:!1,default:!1,mode:"disabled"},r.selectable=!1,r.name="SubtitleSizeMenuItem",(n=function(t,e,n){return e=Ps(e),function(t,e){if(e&&("object"==ms(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Os()?Reflect.construct(e,n||[],Ps(t).constructor):e.apply(t,n))}(this,e,[t,r])).addClass("vjs-texttrack-settings"),n.addClass("cv-divider-after-menu-item"),n.addClass("cv-subtitle-size-menu-item"),n.controlText(", opens subtitle size settings"),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ss(t,e)}(e,t),n=e,(r=[{key:"handleClick",value:function(){var t=this;this.requestAnimationFrame((function(){t.player_.getChild("collapserator").getChild("subtitleSizeButton").showCollapsibleMenu()}))}}])&&gs(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getComponent("TextTrackMenuItem"));function ks(t){return ks="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ks(t)}function _s(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Cs(r.key),r)}}function Cs(t){var e=function(t){if("object"!=ks(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=ks(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ks(e)?e:e+""}function Es(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Es=function(){return!!t})()}function Ts(){return Ts="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=xs(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Ts.apply(null,arguments)}function xs(t){return xs=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},xs(t)}function Ls(t,e){return Ls=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ls(t,e)}var Rs=o.Z.getComponent("TextTrackButton"),Is=o.Z.getComponent("SubsCapsButton"),Ds=function(t){function e(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=function(t,e,n){return e=xs(e),function(t,e){if(e&&("object"==ks(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Es()?Reflect.construct(e,n||[],xs(t).constructor):e.apply(t,n))}(this,e,arguments)).alwaysCollapsed=!1,t.isCollapsed=!1,t.isCollabsible=!0,t.className="cv-subs-caps-menu-button",t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ls(t,e)}(e,t),n=e,r=[{key:"buildWrapperCSSClass",value:function(){return"cv-menu-small cv-has-left-icons ".concat((t=e,n=this,"function"==typeof(r=Ts(xs(1&3?t.prototype:t),"buildWrapperCSSClass",n))?function(t){return r.apply(n,t)}:r)([]));var t,n,r}},{key:"createItems",value:function(){var t=[];return this.player_.options_.mobile||(t.push(new bs(this.player_)),t.push(new js(this.player_)),this.hideThreshold_=this.hideThreshold_+2),Rs.prototype.createItems.call(this,t,ss)}},{key:"getCollabsibleName",value:function(){return"Subtitles"}},{key:"getCollabsibleValue",value:function(){for(var t=this.player_.textTracks(),e=0;e<t.length;e++){var n=t[e];if(this.kinds_.indexOf(n.kind)>-1&&"showing"===n.mode)return n.label}return"Off"}},{key:"showInCollabsibleMenu",value:function(){for(var t=this.player_.textTracks(),e=0;e<t.length;e++){var n=t[e];if(this.kinds_.indexOf(n.kind)>-1)return!0}return!1}},{key:"showCollapsibleMenu",value:function(){Is.prototype.handleClick.apply(this)}}],r&&_s(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Is);function Bs(t){return Bs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bs(t)}function Ns(){Ns=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,n){return t[e]=n}}function s(t,e,n,r){var i=e&&e.prototype instanceof b?e:b,a=Object.create(i.prototype),u=new x(r||[]);return o(a,"_invoke",{value:_(t,n,u)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var p="suspendedStart",y="suspendedYield",h="executing",d="completed",v={};function b(){}function m(){}function g(){}var w={};l(w,a,(function(){return this}));var O=Object.getPrototypeOf,P=O&&O(O(L([])));P&&P!==n&&r.call(P,a)&&(w=P);var S=g.prototype=b.prototype=Object.create(w);function j(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function n(o,i,a,u){var c=f(t[o],t,i);if("throw"!==c.type){var l=c.arg,s=l.value;return s&&"object"==Bs(s)&&r.call(s,"__await")?e.resolve(s.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,u)}))}u(c.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function _(e,n,r){var o=p;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var u=r.delegate;if(u){var c=C(u,r);if(c){if(c===v)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=h;var l=f(e,n,r);if("normal"===l.type){if(o=r.done?d:y,l.arg===v)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=d,r.method="throw",r.arg=l.arg)}}}function C(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,C(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=f(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function x(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function L(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(Bs(e)+" is not iterable")}return m.prototype=g,o(S,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:m,configurable:!0}),m.displayName=l(g,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,l(t,c,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},j(k.prototype),l(k.prototype,u,(function(){return this})),e.AsyncIterator=k,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new k(s(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},j(S),l(S,c,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=L,x.prototype={constructor:x,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return u.type="throw",u.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),l=r.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),T(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;T(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:L(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}function Ms(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,As(r.key),r)}}function As(t){var e=function(t){if("object"!=Bs(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Bs(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Bs(e)?e:e+""}function Fs(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Fs=function(){return!!t})()}function Zs(t){return Zs=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Zs(t)}function Vs(t,e){return Vs=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Vs(t,e)}o.Z.registerComponent("SubsCapsButton",Ds);var zs="<span class='vjs-local-cache-indicator-icon' title='Streaming from ClickView Local Cache'>".concat(xr,"</span>"),Us=function(t){function e(t,n){var r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=Zs(e),function(t,e){if(e&&("object"==Bs(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Fs()?Reflect.construct(e,n||[],Zs(t).constructor):e.apply(t,n))}(this,e,[t,n])).qualityId=n.qualityId;var o=t.qualityLevels(),i=r.handleQualityChange.bind(r);return o.on("change",i),t.one("dispose",(function(){o.off("change",i)})),r.handleLocalCacheChange=r.handleLocalCacheChange.bind(r),r.player_.ready((function(){r.player_&&(r.player_.on("localcachechanged",r.handleLocalCacheChange),r.player_.one("dispose",(function(){var t;null===(t=r.player_)||void 0===t||t.off("localcachechanged",r.handleLocalCacheChange)})),r.handleLocalCacheChange())})),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Vs(t,e)}(e,t),n=e,(r=[{key:"handleLocalCacheChange",value:function(){return t=this,e=void 0,n=void 0,r=Ns().mark((function t(){var e,n;return Ns().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.player_.localCache(),t.next=3,e.getActiveLocalCache();case 3:if(null==(n=t.sent)?void 0:n.playbackProfile){t.next=9;break}return this.show(),this.enable(),this.setLabel(this.options_.label),t.abrupt("return");case 9:n.playbackProfile!==this.qualityId?this.disable():this.setLabel(this.options_.label+zs);case 10:case"end":return t.stop()}}),t,this)})),new(n||(n=Promise))((function(o,i){function a(t){try{c(r.next(t))}catch(t){i(t)}}function u(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,u)}c((r=r.apply(t,e||[])).next())}));var t,e,n,r}},{key:"setLabel",value:function(t){var e=this.$(".vjs-menu-item-text");e&&(e.innerHTML=t)}},{key:"buildCSSClass",value:function(){return"vjs-menu-item cv-quality-menu-item"}},{key:"handleClick",value:function(){for(var t=this.player_.qualityLevels(),e=0;e<t.length;e++){var n=t[e];n.enabled=n.id===this.qualityId}}},{key:"handleQualityChange",value:function(){if(this.player_){var t=this.player_.qualityLevels(),e=t[t.selectedIndex],n=e&&e.id===this.qualityId;n!==this.isSelected_&&this.selected(n)}}}])&&Ms(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getComponent("MenuItem"));function Gs(t){return Gs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gs(t)}function qs(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Hs(r.key),r)}}function Hs(t){var e=function(t){if("object"!=Gs(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Gs(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Gs(e)?e:e+""}function Ws(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Ws=function(){return!!t})()}function Qs(t,e,n,r){var o=Ys($s(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof o?function(t){return o.apply(n,t)}:o}function Ys(){return Ys="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=$s(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Ys.apply(null,arguments)}function $s(t){return $s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},$s(t)}function Ks(t,e){return Ks=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ks(t,e)}var Xs={144:"144p (Preview)",240:"240p",360:"360p",480:"480p",720:"720p",1080:"1080p"},Js=o.Z.getComponent("MenuButton"),tf=function(t){function e(t,n){var r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=$s(e),function(t,e){if(e&&("object"==Gs(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Ws()?Reflect.construct(e,n||[],$s(t).constructor):e.apply(t,n))}(this,e,[t,n])).alwaysCollapsed=!0,r.isCollapsed=!1,r.isCollabsible=!0,r.className="cv-quality-menu-button";var o=r.player_.qualityLevels(),i=r.update.bind(r);return o.on("addqualitylevel",i),o.on("removequalitylevel",i),t.one("dispose",(function(){o.removeEventListener("addqualitylevel",i),o.removeEventListener("removequalitylevel",i)})),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ks(t,e)}(e,t),n=e,(r=[{key:"buildCSSClass",value:function(){return"cv-quality-button ".concat(Qs(e,"buildCSSClass",this,3)([]))}},{key:"buildWrapperCSSClass",value:function(){return"cv-menu-small vjs-quality-button cv-has-left-icons ".concat(Qs(e,"buildWrapperCSSClass",this,3)([]))}},{key:"createItems",value:function(){var t=[],e=this.player_.qualityLevels();t.push(new _(this.player_,{label:"Quality"}));for(var n=0;n<e.length;n++){var r=e[n];if(r){var o=Xs[r.id];o&&t.push(new Us(this.player_,{qualityId:r.id,label:o,selectable:!0,multiSelectable:!1}))}}return t}},{key:"getCollabsibleName",value:function(){return"Quality"}},{key:"getCollabsibleValue",value:function(){var t=this.player_.qualityLevels(),e=t[t.selectedIndex];return e?Xs[e.id]:""}},{key:"showInCollabsibleMenu",value:function(){return!!this.player_.qualityLevels().length}},{key:"showCollapsibleMenu",value:function(){Js.prototype.handleClick.apply(this)}}])&&qs(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Js);function ef(t){return ef="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ef(t)}function nf(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,rf(r.key),r)}}function rf(t){var e=function(t){if("object"!=ef(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=ef(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ef(e)?e:e+""}function of(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(of=function(){return!!t})()}function af(){return af="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=uf(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},af.apply(null,arguments)}function uf(t){return uf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},uf(t)}function cf(t,e){return cf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},cf(t,e)}o.Z.registerComponent("QualityButton",tf);var lf=o.Z.getComponent("Menu"),sf=o.Z.getComponent("MenuButton"),ff=o.Z.getComponent("PlaybackRateMenuItem"),pf=o.Z.getComponent("PlaybackRateMenuButton"),yf=function(t){function e(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=function(t,e,n){return e=uf(e),function(t,e){if(e&&("object"==ef(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,of()?Reflect.construct(e,n||[],uf(t).constructor):e.apply(t,n))}(this,e,arguments)).alwaysCollapsed=!0,t.isCollapsed=!1,t.isCollabsible=!0,t.className="cv-playback-rate-menu-button",t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&cf(t,e)}(e,t),n=e,r=[{key:"createEl",value:function(){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(t=sf.prototype.createEl).apply.apply(t,[this].concat(n))}},{key:"buildWrapperCSSClass",value:function(){return"cv-menu-small cv-has-left-icons ".concat((t=e,n=this,"function"==typeof(r=af(uf(1&3?t.prototype:t),"buildWrapperCSSClass",n))?function(t){return r.apply(n,t)}:r)([]));var t,n,r}},{key:"createMenu",value:function(){var t=new lf(this.player(),{menuButton:this});t.addItem(new _(this.player_,{label:"Playback Speed"}));var e=this.playbackRates();if(e)for(var n=0;n<e.length;n++){var r=e[n]+"x";1===e[n]&&(r+=" (Normal)"),t.addItem(new ff(this.player(),{rate:r}))}return t}},{key:"handleClick",value:function(){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(t=sf.prototype.handleClick).apply.apply(t,[this].concat(n))}},{key:"updateLabel",value:function(){var t;this.setupLabelEl();for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(t=pf.prototype.updateLabel).apply.apply(t,[this].concat(n))}},{key:"setupLabelEl",value:function(){if(!this.labelEl_){var t=this.$("button");t&&(this.labelEl_=o.Z.dom.createEl("div",{className:"vjs-playback-rate-value",innerHTML:"1x"}),t.appendChild(this.labelEl_))}}},{key:"getCollabsibleName",value:function(){return"Playback Speed"}},{key:"getCollabsibleValue",value:function(){return this.player().playbackRate()+"x"}},{key:"showInCollabsibleMenu",value:function(){return!!this.playbackRates()}},{key:"showCollapsibleMenu",value:function(){this.handleClick(null)}}],r&&nf(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(pf);function hf(t){return hf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},hf(t)}function df(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,vf(r.key),r)}}function vf(t){var e=function(t){if("object"!=hf(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=hf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==hf(e)?e:e+""}function bf(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(bf=function(){return!!t})()}function mf(t){return mf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},mf(t)}function gf(t,e){return gf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},gf(t,e)}o.Z.registerComponent("PlaybackRateMenuButton",yf);var wf=o.Z.getComponent("TextTrackSettings"),Of={backgroundColor:"#000",backgroundOpacity:"1",color:"#FFF",edgeStyle:void 0,fontFamily:"proportionalSansSerif",fontPercent:1,textOpacity:"1",windowColor:"#000",windowOpacity:"0"},Pf={small:Of,medium:Object.assign(Object.assign({},Of),{fontPercent:1.5}),large:Object.assign(Object.assign({},Of),{fontPercent:2})},Sf=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,n){return e=mf(e),function(t,e){if(e&&("object"==hf(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,bf()?Reflect.construct(e,n||[],mf(t).constructor):e.apply(t,n))}(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&gf(t,e)}(e,t),n=e,(r=[{key:"setSizeSetting",value:function(t){var e=this;this.size_=t,this.player_.getChild("textTrackDisplay").updateDisplay();var n=this.player_.getChild("collapserator").getChild("subtitleSizeButton");this.player_.trigger("changesubtitlesize",this.size_),window.requestAnimationFrame((function(){n.update(),e.player_.trigger("resizemenus")}))}},{key:"getSizeSetting",value:function(){return this.size_||"small"}},{key:"getValues",value:function(){return Pf[this.size_]?Pf[this.size_]:Of}}])&&df(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(wf);function jf(t){return jf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},jf(t)}function kf(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,_f(r.key),r)}}function _f(t){var e=function(t){if("object"!=jf(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=jf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==jf(e)?e:e+""}function Cf(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Cf=function(){return!!t})()}function Ef(t,e,n,r){var o=Tf(xf(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof o?function(t){return o.apply(n,t)}:o}function Tf(){return Tf="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=xf(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Tf.apply(null,arguments)}function xf(t){return xf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},xf(t)}function Lf(t,e){return Lf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Lf(t,e)}o.Z.registerComponent("TextTrackSettings",Sf);var Rf=window.navigator&&window.navigator.userAgent||"",If=(/iPod/i.test(Rf),/Android/i.test(Rf),o.Z.getComponent("Player")),Df=function(t){function e(t,n){var r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=xf(e),function(t,e){if(e&&("object"==jf(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Cf()?Reflect.construct(e,n||[],xf(t).constructor):e.apply(t,n))}(this,e,[t,n]))._dataLoaded=!1,n.mobile&&r.addClass("cv-mobile-player");var o=function(){return r._dataLoaded=!0};return r.on("cv-playback-data-loaded",o),r.on("dispose",(function(){return r.off("cv-playback-data-loaded",o)})),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Lf(t,e)}(e,t),n=e,(r=[{key:"dataLoaded",value:function(t){var e=this;this._dataLoaded?t():(this.one("cv-playback-data-loaded",t),this.one("dispose",(function(){e.off("cv-playback-data-loaded",t)})))}},{key:"lock",value:function(t){this.callback_=t}},{key:"unlock",value:function(){delete this.callback_}},{key:"currentTime",value:function(t,n){var r=this;if("number"!=typeof t||!this.callback_||n)return Ef(e,"currentTime",this,3)([t]);this.callback_((function(){r.unlock(),r.currentTime(t)}))}},{key:"play",value:function(){var t=this;if(!this.callback_)return Ef(e,"play",this,3)([]);this.callback_((function(){t.unlock(),t.play()}))}},{key:"updateStyleEl_",value:function(){if(If.prototype.updateStyleEl_.call(this),this.options_.fluid){var t=this.el_.parentNode;if(t&&this.options_.setMaxHeight){var e=this.aspectRatio();if(void 0!==e&&"auto"!==e||(e=this.videoWidth()>0?this.videoWidth()+":"+this.videoHeight():"16:9"),this.player_.playerModePlugin().getMode()===La.Hover)return t.style.removeProperty("maxWidth"),void t.style.removeProperty("margin");var n=e.split(":"),r=+n[1]/+n[0];t.style.maxWidth=85/r+"vh",t.style.margin="0 auto"}}}},{key:"listenForUserActivity_",value:function(){var t=this;If.prototype.listenForUserActivity_.call(this);var e=this.getChild("collapserator");e.on("mouseenter",(function(){t.player().cache_.inactivityTimeout=t.player().options_.inactivityTimeout,t.player().options_.inactivityTimeout=0})),e.on("mouseleave",(function(){t.player().options_.inactivityTimeout=t.player().cache_.inactivityTimeout}))}}])&&kf(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(If);function Bf(t){return Bf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bf(t)}function Nf(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Mf(r.key),r)}}function Mf(t){var e=function(t){if("object"!=Bf(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Bf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Bf(e)?e:e+""}function Af(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Af=function(){return!!t})()}function Ff(t){return Ff=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ff(t)}function Zf(t,e){return Zf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Zf(t,e)}Df.prototype.options_=Object.assign(Object.assign({},If.prototype.options_),{setMaxHeight:!0}),o.Z.registerComponent("player",Df);var Vf=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=Ff(e),function(t,e){if(e&&("object"==Bf(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Af()?Reflect.construct(e,n||[],Ff(t).constructor):e.apply(t,n))}(this,e,[t,n])).player_.addClass("cv-disable-play-pause-feedback"),r.onFirstPlay=r.onFirstPlay.bind(r),r.player_.one("play",r.onFirstPlay),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Zf(t,e)}(e,t),n=e,(r=[{key:"dispose",value:function(){this.player_.off("play",this.onFirstPlay)}},{key:"onFirstPlay",value:function(){var t=this;window.setTimeout((function(){t.player_.isDisposed()||t.player_.removeClass("cv-disable-play-pause-feedback")}),500)}},{key:"createEl",value:function(){return o.Z.dom.createEl("div",{className:"cv-play-pause-feedback"})}}])&&Nf(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getComponent("Component"));function zf(t){return zf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zf(t)}function Uf(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Gf(r.key),r)}}function Gf(t){var e=function(t){if("object"!=zf(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=zf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==zf(e)?e:e+""}function qf(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(qf=function(){return!!t})()}function Hf(t){return Hf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Hf(t)}function Wf(t,e){return Wf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Wf(t,e)}o.Z.registerComponent("PlayPauseFeedback",Vf);var Qf=o.Z.getComponent("PlayToggle"),Yf=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,n){return e=Hf(e),function(t,e){if(e&&("object"==zf(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,qf()?Reflect.construct(e,n||[],Hf(t).constructor):e.apply(t,n))}(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Wf(t,e)}(e,t),n=e,(r=[{key:"handleClick",value:function(t){var e=this;Qf.prototype.handleClick.call(this,t),this.player_.addClass("cv-disable-play-pause-feedback"),this.timeoutId&&window.clearTimeout(this.timeoutId),this.timeoutId=window.setTimeout((function(){e.player_.removeClass("cv-disable-play-pause-feedback")}),500)}}])&&Uf(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Qf);function $f(t){return $f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$f(t)}function Kf(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Xf(r.key),r)}}function Xf(t){var e=function(t){if("object"!=$f(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=$f(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==$f(e)?e:e+""}function Jf(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Jf=function(){return!!t})()}function tp(t){return tp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},tp(t)}function ep(t,e){return ep=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ep(t,e)}o.Z.registerComponent("PlayToggle",Yf);var np=o.Z.getComponent("TextTrackDisplay"),rp=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,n){return e=tp(e),function(t,e){if(e&&("object"==$f(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Jf()?Reflect.construct(e,n||[],tp(t).constructor):e.apply(t,n))}(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ep(t,e)}(e,t),n=e,(r=[{key:"updateDisplayState",value:function(t){np.prototype.updateDisplayState.call(this,t);for(var e=this.player_.textTrackSettings.getValues(),n=t.activeCues,r=n.length;r--;){var o=n[r];if(o){var i=o.displayState;if(e.fontPercent&&1!==e.fontPercent){var a=.025*this.el().getBoundingClientRect().width*100/100;i.style.fontSize=a*e.fontPercent+"px"}}}}}])&&Kf(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(np);function op(t){return op="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},op(t)}function ip(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,ap(r.key),r)}}function ap(t){var e=function(t){if("object"!=op(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=op(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==op(e)?e:e+""}function up(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(up=function(){return!!t})()}function cp(t){return cp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},cp(t)}function lp(t,e){return lp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},lp(t,e)}o.Z.registerComponent("TextTrackDisplay",rp);var sp=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,n){return e=cp(e),function(t,e){if(e&&("object"==op(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,up()?Reflect.construct(e,n||[],cp(t).constructor):e.apply(t,n))}(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&lp(t,e)}(e,t),n=e,(r=[{key:"createEl",value:function(){return o.Z.dom.createEl("div",{className:"cv-control-bar-gradient-container",innerHTML:'<div class="cv-control-bar-gradient"></div>'})}}])&&ip(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getComponent("Component"));function fp(t){return fp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fp(t)}function pp(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,yp(r.key),r)}}function yp(t){var e=function(t){if("object"!=fp(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=fp(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==fp(e)?e:e+""}function hp(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(hp=function(){return!!t})()}function dp(t,e,n,r){var o=vp(bp(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof o?function(t){return o.apply(n,t)}:o}function vp(){return vp="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=bp(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},vp.apply(null,arguments)}function bp(t){return bp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},bp(t)}function mp(t,e){return mp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},mp(t,e)}o.Z.registerComponent("ControlBarGradient",sp);var gp=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=bp(e),function(t,e){if(e&&("object"==fp(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,hp()?Reflect.construct(e,n||[],bp(t).constructor):e.apply(t,n))}(this,e,[t,n])).options_=n,r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&mp(t,e)}(e,t),n=e,(r=[{key:"createEl",value:function(){var t=this.options_.title;if(!this.options_.seriesName)return dp(e,"createEl",this,3)(["h1",{innerHTML:t}]);var n=this.buildSeasonEpisodeString();return n?(t="<div class='cv-splash-series'>".concat(this.options_.seriesName.toUpperCase()," ").concat(n,"</div>")+t,dp(e,"createEl",this,3)(["h1",{innerHTML:t}])):(t="<div class='cv-splash-series'>".concat(this.options_.seriesName.toUpperCase(),"</div>")+t,dp(e,"createEl",this,3)(["h1",{innerHTML:t}]))}},{key:"buildSeasonEpisodeString",value:function(){if(!this.options_.seasonNumber||!this.options_.episodeNumber)return"";var t=this.padNumber(this.options_.seasonNumber,2),e=this.padNumber(this.options_.episodeNumber,2);return"S".concat(t," • E").concat(e)}},{key:"padNumber",value:function(t,e){var n=t.toString();if(n.length>=e)return n;for(e-=n.length;e>0;)n="0"+n,e--;return n}}])&&pp(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getComponent("Component"));function wp(t){return wp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wp(t)}function Op(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Pp(r.key),r)}}function Pp(t){var e=function(t){if("object"!=wp(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=wp(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==wp(e)?e:e+""}function Sp(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Sp=function(){return!!t})()}function jp(){return jp="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=kp(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},jp.apply(null,arguments)}function kp(t){return kp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},kp(t)}function _p(t,e){return _p=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_p(t,e)}var Cp=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=kp(e),function(t,e){if(e&&("object"==wp(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Sp()?Reflect.construct(e,n||[],kp(t).constructor):e.apply(t,n))}(this,e,[t,n])).options_=n,r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_p(t,e)}(e,t),n=e,r=[{key:"buildCSSClass",value:function(){return"cv-splash-rating ".concat((t=this.options_.ratingValue)?function(t){switch(!0){case t<32:return"cv-rating-purple";case t<48:return"cv-rating-green";case t<80:return"cv-rating-blue";case t<96:return"cv-rating-red";case t<128:return"cv-rating-pink";case t>=128:return"cv-rating-yellow";default:return""}}(t):"");var t}},{key:"createEl",value:function(t,n,r){return this.options_.ratingCode?(o=e,i=this,"function"==typeof(a=jp(kp(1&3?o.prototype:o),"createEl",i))?function(t){return a.apply(i,t)}:a)([t,Object.assign(Object.assign({},n),{className:this.buildCSSClass(),innerHTML:this.options_.ratingCode}),r]):null;var o,i,a}}],r&&Op(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getComponent("Component"));function Ep(t){return Ep="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ep(t)}function Tp(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,xp(r.key),r)}}function xp(t){var e=function(t){if("object"!=Ep(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Ep(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ep(e)?e:e+""}function Lp(t,e){if(e&&("object"==Ep(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Rp(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Rp=function(){return!!t})()}function Ip(t){return Ip=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ip(t)}function Dp(t,e){return Dp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Dp(t,e)}var Bp=function(t){function e(t,n){var r,o,i,a;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),o=this,a=[t,n],i=Ip(i=e),r=Lp(o,Rp()?Reflect.construct(i,a||[],Ip(o).constructor):i.apply(o,a)),n.embed?(r.addChild(new gp(t,n)),r.addChild(new Cp(t,n)),r):Lp(r,r)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Dp(t,e)}(e,t),n=e,(r=[{key:"createEl",value:function(){return o.Z.dom.createEl("div",{className:"cv-splash-metadata"})}}])&&Tp(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getComponent("Component"));function Np(t){return Np="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Np(t)}function Mp(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Ap(r.key),r)}}function Ap(t){var e=function(t){if("object"!=Np(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Np(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Np(e)?e:e+""}function Fp(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Fp=function(){return!!t})()}function Zp(t){return Zp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Zp(t)}function Vp(t,e){return Vp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Vp(t,e)}var zp=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=Zp(e),function(t,e){if(e&&("object"==Np(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Fp()?Reflect.construct(e,n||[],Zp(t).constructor):e.apply(t,n))}(this,e,[t,n])).addChild(new Bp(t,n)),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Vp(t,e)}(e,t),n=e,(r=[{key:"createEl",value:function(){var t="<div class='cv-splash-mask'></div>";return this.options_.embed&&(t+="<div class='cv-splash-logo'>".concat(mn,"</div>")),o.Z.dom.createEl("div",{className:"vjs-poster cv-embed-splash cv-embed-splash-black",tabIndex:-1,innerHTML:t})}},{key:"setSrc",value:function(t){var e="";t&&(e='url("'.concat(t,'")')),this.el_.style.backgroundImage=e}}])&&Mp(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getComponent("posterImage"));function Up(t){return Up="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Up(t)}function Gp(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,qp(r.key),r)}}function qp(t){var e=function(t){if("object"!=Up(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Up(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Up(e)?e:e+""}function Hp(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Hp=function(){return!!t})()}function Wp(t){return Wp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Wp(t)}function Qp(t,e){return Qp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Qp(t,e)}o.Z.registerComponent("posterImage",zp);var Yp=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=Wp(e),function(t,e){if(e&&("object"==Up(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Hp()?Reflect.construct(e,n||[],Wp(t).constructor):e.apply(t,n))}(this,e,[t,n])).el().prepend(r.getErrorImage()),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Qp(t,e)}(e,t),n=e,(r=[{key:"getErrorImage",value:function(){return o.Z.dom.createEl("div",{className:"cv-error-image",innerHTML:'\n <svg viewBox="0 0 301 185" xmlns="http://www.w3.org/2000/svg">\n <path d="M267.393 36.6514V167.906C267.393 168.182 267.169 168.406 266.893 168.406H32C31.7239 168.406 31.5 168.182 31.5 167.906V36.6514C31.5 36.3752 31.7239 36.1514 32 36.1514H80.5C80.7761 36.1514 81 36.3752 81 36.6514V57.7196C81 58.7622 82.0375 59.4868 83.0164 59.1279L95.7377 54.4634C95.9961 54.3687 96.2825 54.5006 96.3785 54.7585L102.094 70.1194C102.677 71.6866 105 71.2685 105 69.5964V48.4925C105 47.7632 104.475 47.1396 103.757 47.0146L94.2479 45.3609C93.9436 45.308 93.7596 44.9946 93.8616 44.7031L96.7376 36.4862C96.8077 36.2856 96.997 36.1514 97.2095 36.1514H266.893C267.169 36.1514 267.393 36.3752 267.393 36.6514Z" stroke="white"/>\n <path d="M163.296 101.777L149.437 90.1217C148.275 89.1441 146.5 89.9705 146.5 91.4894V113.664C146.5 115.141 148.191 115.98 149.367 115.087L163.226 104.569C164.139 103.876 164.173 102.515 163.296 101.777Z" stroke="white" stroke-linecap="round"/>\n <path d="M295.53 23.0783L277.524 26.2801L283.252 32.7192L274.855 38.9079L292.861 35.7061L287.133 29.2671L295.53 23.0783Z" stroke="white" stroke-linecap="round" stroke-linejoin="round"/>\n <path d="M268.06 2.91764L254.192 14.8403L262.401 17.4661L258.324 27.0679L272.192 15.1453L263.983 12.5194L268.06 2.91764Z" stroke="white" stroke-linecap="round" stroke-linejoin="round"/>\n </svg>\n '})}}])&&Gp(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getComponent("ErrorDisplay"));o.Z.registerComponent("ErrorDisplay",Yp);var $p=n(67453),Kp=n(54610);function Xp(t){return Xp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xp(t)}function Jp(){Jp=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,n){return t[e]=n}}function s(t,e,n,r){var i=e&&e.prototype instanceof b?e:b,a=Object.create(i.prototype),u=new x(r||[]);return o(a,"_invoke",{value:_(t,n,u)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var p="suspendedStart",y="suspendedYield",h="executing",d="completed",v={};function b(){}function m(){}function g(){}var w={};l(w,a,(function(){return this}));var O=Object.getPrototypeOf,P=O&&O(O(L([])));P&&P!==n&&r.call(P,a)&&(w=P);var S=g.prototype=b.prototype=Object.create(w);function j(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function n(o,i,a,u){var c=f(t[o],t,i);if("throw"!==c.type){var l=c.arg,s=l.value;return s&&"object"==Xp(s)&&r.call(s,"__await")?e.resolve(s.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,u)}))}u(c.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function _(e,n,r){var o=p;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var u=r.delegate;if(u){var c=C(u,r);if(c){if(c===v)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=h;var l=f(e,n,r);if("normal"===l.type){if(o=r.done?d:y,l.arg===v)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=d,r.method="throw",r.arg=l.arg)}}}function C(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,C(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=f(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function x(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function L(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(Xp(e)+" is not iterable")}return m.prototype=g,o(S,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:m,configurable:!0}),m.displayName=l(g,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,l(t,c,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},j(k.prototype),l(k.prototype,u,(function(){return this})),e.AsyncIterator=k,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new k(s(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},j(S),l(S,c,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=L,x.prototype={constructor:x,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return u.type="throw",u.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),l=r.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),T(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;T(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:L(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}function ty(t){return function(t){if(Array.isArray(t))return ey(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return ey(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ey(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ey(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function ny(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,ry(r.key),r)}}function ry(t){var e=function(t){if("object"!=Xp(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Xp(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Xp(e)?e:e+""}var oy,iy=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{c(r.next(t))}catch(t){i(t)}}function u(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,u)}c((r=r.apply(t,e||[])).next())}))},ay=o.Z.getComponent("Player"),uy=function(){return t=function t(e,n){var r=this;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.streamLogged=!1,this.options=o.Z.obj.merge({},t.options_,n),null===this.options.playerApi)throw new Error("PlayerApi required");this.initialize(),this.createEl(e),this.buildVideoJs(),this.options.splash&&this.setupSplash(this.options.splash),this.bindEventListeners(),this.setupSeekBar(),this.fetchConfig(),this.logStream=this.logStream.bind(this),this.player.ready((function(){r._configurePlugins(),r.options.setup&&r.options.setup(r.options,r.player),r.fetch().catch((function(t){return r.handleFetchError(t)}))}))},(e=[{key:"initialize",value:function(){}},{key:"_configurePlugins",value:function(){this.player.configureMenuDimensionsPlugin({mobile:this.options.mobile,overflowControls:this.options.overflowControls,seekBarName:this.getSeekBarName()}),this.player.progressReporterPlugin({onFlush:this.onFlushProgress=this.onFlushProgress.bind(this)}),this.player.persistVolumePlugin(),!this.options.mobile&&this.options.allowFullscreen&&this.player.fullscreenOnRotatePlugin(),this.player.touchControls(),this.options.getExternalLink&&this.player.openExternallyPlugin({getExternalLink:this.options.getExternalLink}),this.configurePlugins()}},{key:"configurePlugins",value:function(){}},{key:"onFlushProgress",value:function(t){var e;null===(e=this.analyticsService)||void 0===e||e.logVideoProgress(t)}},{key:"buildVideoJs",value:function(){return this.player=(0,o.Z)(this.el,this.getPlayerOptions())}},{key:"getInactivityTimeout",value:function(){if("number"==typeof this.options.inactivityTimeout)return this.options.inactivityTimeout;var t=500;return(this.options.mobile||o.Z.browser.IS_IOS||o.Z.browser.IS_ANDROID)&&(t=3e3),t}},{key:"getPlayerOptions",value:function(){var t=this,e=ay.prototype.options_.children;return e=e.filter((function(t){return"bigPlayButton"!==t&&"posterImage"!==t})),{controls:this.options.controls,fluid:!this.options.embed&&!this.options.mobile,fill:this.options.embed||this.options.mobile,inactivityTimeout:this.getInactivityTimeout(),controlBar:{children:["timeWrapper","progressControl"]},children:[].concat(ty(e),[{name:"collapserator",children:Jt.filter((function(e){return!("fullscreenToggle"===e&&!t.options.allowFullscreen)}))},"playPauseFeedback","controlBarGradient"]),userActions:{hotkeys:function(e){return function(t,e,n){var r=Pe()(t);("f"!==r||n.allowFullscreen)&&Te[r]&&(["space"].includes(r)&&(t.preventDefault(),t.stopPropagation()),Te[r](e,t))}(e,t.player,t.options)}},playbackRates:this.options.playbackRates,techOrder:["html5"],html5:{nativeTextTracks:!1},playsinline:!0,aspectRatio:this.options.aspectRatio,mobile:this.options.mobile,deferMenus:this.options.deferMenus,muted:this.options.muted,devicesConfig:this.options.devicesConfig}}},{key:"getPlaybackObject",value:function(){return iy(this,void 0,void 0,Jp().mark((function t(){var e,n,r=this;return Jp().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.options.offlinePlaybackObject){t.next=2;break}return t.abrupt("return",this.options.offlinePlaybackObject);case 2:if(e=this.options.fetch,void 0===this.options.fetch&&(e=function(t){var e="".concat(r.options.playerApi.origin,"/api/playback?viewKey=").concat(t);return we.get(e)}),this.options.viewKey){t.next=6;break}throw new Error("Please specify a viewKey or a fetch function");case 6:return t.next=8,e(this.options.viewKey);case 8:if(n=t.sent){t.next=11;break}throw new Error("Error fetching playback object");case 11:return t.abrupt("return",n);case 12:case"end":return t.stop()}}),t,this)})))}},{key:"setChaptersInternal",value:function(t,e){var n=W.getTrack(this.player,"chapters",null);n||(n=this.player.addTextTrack("chapters")),ty(n.cues.cues_).forEach((function(t){return n.removeCue(t)})),t.forEach((function(t){n.addCue({startTime:t.timestamp,endTime:t.endTimestamp,text:t.name})})),e&&n.trigger({type:"cv:cuechange",target:n}),n.trigger({type:"loadeddata",target:n})}},{key:"setChapters",value:function(t){this.setChaptersInternal(t,!0)}},{key:"setPlayerMode",value:function(t,e){this.player.playerModePlugin().setPlayerMode(t,e)}},{key:"setFavourite",value:function(t,e){this.player.favouritePlugin().setFavourite(t,e)}},{key:"fetch",value:function(){var t,e,n,r,o;return iy(this,void 0,void 0,Jp().mark((function i(){var a,u,c,l=this;return Jp().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,this.getPlaybackObject();case 2:if(a=i.sent,!this.isDisposed()){i.next=5;break}return i.abrupt("return");case 5:u="MasterClip"===a.mediaType,c=null===(t=a.additionalData)||void 0===t?void 0:t.clipData,(null===(n=null===(e=a.chapters)||void 0===e?void 0:e.list)||void 0===n?void 0:n.length)>0&&!u&&!c&&this.setChaptersInternal(a.chapters.list,!1),this.player.localCache({localCacheAddresses:null!==(r=a.localCacheAddresses)&&void 0!==r?r:[],enabled:null===(o=this.options.enableLocalCache)||void 0===o||o}),this.player.progressiveFiles({sources:a.files.progressive.map((function(t){return{id:t.profile,mimeType:t.mimeType,url:t.url}}))}),this.player.handleNetworkErrors({playerApi:this.options.playerApi,fileToken:a.files.fileToken}),a.subtitles.list.length>0&&a.subtitles.list.forEach((function(t){if("text/vtt"===t.mimeType){var e=l.player.addRemoteTextTrack({kind:"subtitles",src:t.url,language:t.language,label:t.label},!0);W.sanitizeTrack(e.track,l.player)}})),a.posterUrl&&this.player.poster($p.j.createUrl(a.posterUrl,{size:Kp.h2.Large})),this.setupSplash({title:a.title,posterUrl:a.posterUrl,episodeNumber:a.episodeNumber,ratingCode:a.ratingCode,seasonNumber:a.seasonNumber,seriesName:a.seriesName}),this.additionalSetup(a),this.handleAutoplay(a),this.options.startTime&&(this.player.currentTime(this.options.startTime),this.player.one("canplay",(function(){l.player.currentTime(l.options.startTime)}))),this.player.trigger("cv-playback-data-loaded",a);case 18:case"end":return i.stop()}}),i,this)})))}},{key:"handleFetchError",value:function(t){var e,n=t.message;t instanceof he&&(null===(e=t.response)||void 0===e?void 0:e.type)===Ee.PhysicallyChapteredVideo&&(n="Video cannot be played because it is either corrupt or damaged."),this.player.error(n),this.options.onError&&this.options.onError(t)}},{key:"fetchConfig",value:function(){return iy(this,void 0,void 0,Jp().mark((function t(){var e;return Jp().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(oy||this.options.fetch||this.options.offlinePlaybackObject)){t.next=2;break}return t.abrupt("return");case 2:return e="".concat(this.options.playerApi.origin,"/api/config"),t.next=5,we.get(e);case 5:if(oy=t.sent,!this.isDisposed()){t.next=8;break}return t.abrupt("return");case 8:this.trigger("config:loaded");case 9:case"end":return t.stop()}}),t,this)})))}},{key:"additionalSetup",value:function(t){var e,n=this;this.player.whiteboardModePlugin(),this.player.deferMenusPlugin();var r=this.options.enableLocalCache&&!!(null===(e=t.localCacheAddresses)||void 0===e?void 0:e.length);oy?this.setupAnalyticsService(t,r):this.one("config:loaded",(function(){return n.setupAnalyticsService(t,r)})),this.analyticsService||!this.isAnalyticsEnabled()?this.setupAnalyticsDependentPlugins(t):this.one("analytics:loaded",(function(){return n.setupAnalyticsDependentPlugins(t)}))}},{key:"setupAnalyticsService",value:function(t,e){this.options.eventLogging&&(this.analyticsService=new ce({collectionApiUrls:oy.collectionApi.urls,collectionApiClientId:oy.collectionApi.clientId,productVersion:"1.30.0-rc.0",videoId:t.videoId,mediaId:t.mediaId,userId:t.viewerId,shareId:t.shareId,customerId:t.viewerCustomerId,mediaType:t.mediaType,playerType:this.getAnalyticsPlayerType(),isEmbedded:this.options.embed,isUsingLocalCache:e,additionalAnalyticsData:this.getAdditionalAnalyticsData(t),regionName:t.instanceRegion||this.options.sharerInstanceRegion||xe.M.CvApSoutheast1}),this.on("timeupdate",this.logStream),this.trigger("analytics:loaded"))}},{key:"setupAnalyticsDependentPlugins",value:function(t){var e,n,r,o;this.player.persistSubtitleSettingsPlugin({showSubtitles:null===(e=t.settings)||void 0===e?void 0:e.showSubtitles,subtitleSize:null===(n=t.settings)||void 0===n?void 0:n.playbackSubtitleSizeDefault,analyticsService:this.analyticsService}),this.player.persistQualitySettingsPlugin({playbackProfile:null===(r=t.settings)||void 0===r?void 0:r.playbackProfile,playbackProfileLocalCache:null===(o=t.settings)||void 0===o?void 0:o.playbackProfileLocalCache,analyticsService:this.analyticsService}),this.player.persistPlaybackRatePlugin({analyticsService:this.analyticsService})}},{key:"getAdditionalAnalyticsData",value:function(t){return{}}},{key:"isAnalyticsEnabled",value:function(){return!this.options.fetch&&!this.options.offlinePlaybackObject&&this.options.eventLogging}},{key:"handleAutoplay",value:function(t){var e=this;this.options.autoplay&&this.player.ready((function(){e.player.play().catch((function(){e.isDisposed()||e.showSplash()}))}))}},{key:"logStream",value:function(){this.analyticsService&&(this.player.currentTime()<3||this.streamLogged||(this.analyticsService.logStream(),this.streamLogged=!0,this.off("timeupdate",this.logStream)))}},{key:"getAnalyticsPlayerType",value:function(){return"player"}},{key:"createEl",value:function(t){var e;"string"==typeof t?(t=function(t){return 0===t.indexOf("#")?t.slice(1):t}(t),e=o.Z.dom.$("#"+t)):e=t;var n="video-js";return this.getPlayerClassName()&&(n+=" ".concat(this.getPlayerClassName())),this.el=o.Z.dom.createEl("video",{},{class:n}),e.appendChild(this.el),this.el}},{key:"getPlayerClassName",value:function(){return""}},{key:"on",value:function(t,e){this.player.on(t,e)}},{key:"one",value:function(t,e){this.player.one(t,e)}},{key:"off",value:function(t,e){this.player.off(t,e)}},{key:"trigger",value:function(t,e){return this.player.trigger(t,e)}},{key:"dispose",value:function(){this.player.dispose()}},{key:"ready",value:function(t){this.player.ready(t)}},{key:"isDisposed",value:function(){return this.player.isDisposed()}},{key:"play",value:function(){this.player.play()}},{key:"pause",value:function(){this.player.pause()}},{key:"isPaused",value:function(){return this.player.paused()}},{key:"currentTime",value:function(t){return this.player.currentTime(t)}},{key:"muted",value:function(t){return this.player.muted(t)}},{key:"duration",value:function(){return this.player.duration()}},{key:"isFullscreen",value:function(){return this.player.isFullscreen()}},{key:"requestFullscreen",value:function(){this.player.requestFullscreen()}},{key:"exitFullscreen",value:function(){this.player.exitFullscreen()}},{key:"playbackRate",value:function(t){return this.player.playbackRate(t)}},{key:"quality",value:function(t){for(var e=this.player.qualityLevels(),n=0;n<e.length;n++){var r=e[n];if(t)r.enabled=r.id===t.toString();else if(r.enabled)return r.id}}},{key:"subtitles",value:function(t){for(var e=this.player.textTracks(),n=0;n<e.length;n++){var r=e[n];if(void 0===t){if("showing"===r.mode)return r.label}else r.label===t?r.mode="showing":r.mode="disabled"}}},{key:"bindEventListeners",value:function(){var t=this,e=function(t){return t.preventDefault()};if(this.showSplash=this.showSplash.bind(this),this.hideSplash=this.hideSplash.bind(this),this.player.on("ended",this.showSplash),this.player.on("play",this.hideSplash),this.player.tech(!0).on("contextmenu",e),this.player.one("dispose",(function(){t.off("ended",t.showSplash),t.off("play",t.hideSplash),t.player.tech(!0).off("contextmenu",e)})),this.options.hotkeyElQuerySelector){var n=o.Z.dom.$(this.options.hotkeyElQuerySelector);n&&(this.player.on(n,"keydown",this.player.handleKeyDown),this.player.one("dispose",(function(){t.player.off(n,"keydown",t.player.handleKeyDown)})))}}},{key:"setupSeekBar",value:function(){var t=this.getSeekBarName(),e=this.player.controlBar.getChild("progressControl");e.addChild(t,this.getSeekBarOptions()),e.setSeekBarName(t)}},{key:"setupSplash",value:function(t){this._splashAdded||(this._splashAdded=!0,this.player.addChild("posterImage",Object.assign({embed:this.options.embed},t)),this.player.addChild("bigPlayButton"),this.options.autoplay?this.hideSplash():this.showSplash())}},{key:"showSplash",value:function(){this.player.hasStarted(!1),this.player.getChild("posterImage").show(),this.player.getChild("bigPlayButton").show()}},{key:"hideSplash",value:function(){this.player.getChild("posterImage").hide(),this.player.getChild("bigPlayButton").hide()}},{key:"getSeekBarOptions",value:function(){return{}}},{key:"getSeekBarName",value:function(){return"ChapterSeekBar"}}])&&ny(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function cy(t){return cy="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},cy(t)}function ly(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,sy(r.key),r)}}function sy(t){var e=function(t){if("object"!=cy(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=cy(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==cy(e)?e:e+""}function fy(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(fy=function(){return!!t})()}function py(){return py="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=yy(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},py.apply(null,arguments)}function yy(t){return yy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},yy(t)}function hy(t,e){return hy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},hy(t,e)}uy.options_={viewKey:null,controls:!0,playbackRates:[.25,.5,.75,1,1.25,1.5,1.75,2],playerApi:new URL("http://localhost:52000"),enableLocalCache:!0,eventLogging:!0,allowFullscreen:!0};var dy=function(t){function e(t,n){var r;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),r=function(t,e,n){return e=yy(e),function(t,e){if(e&&("object"==cy(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,fy()?Reflect.construct(e,n||[],yy(t).constructor):e.apply(t,n))}(this,e,[t]),void 0===n.startTime)throw Error("Invalid clip start");if(void 0===n.endTime)throw Error("Invalid clip end");if(n.startTime>n.endTime)throw Error("Clip start cannot be greater than clip end");return r._clipStart=parseFloat(n.startTime.toPrecision(4)),r._clipEnd=parseFloat(n.endTime.toPrecision(4)),r.playerEndedFn=r.player.ended.bind(t),r.playerDurationFn=r.player.duration.bind(t),r.playerCurrentTimeFn=r.player.currentTime.bind(t),r.playerbufferedFn=r.player.buffered.bind(t),r.player.ended=r.ended.bind(r),r.player.duration=r.duration.bind(r),r.player.currentTime=r.currentTime.bind(r),r.player.buffered=r.buffered.bind(r),r.initialize(),r.player.ready((function(){r.player.trigger("durationchange")})),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&hy(t,e)}(e,t),n=e,r=[{key:"clipStart",get:function(){var t=this.playerDurationFn();return this._clipStart>t?t:this._clipStart}},{key:"clipEnd",get:function(){var t=this.playerDurationFn();return t<=0?this._clipEnd:this._clipEnd>t?t:this._clipEnd}},{key:"dispose",value:function(){var t,n,r;this.player.off("timeupdate",this.onTimeUpdate),this.player.off("play",this.onPlay),this.player.ended=this.playerEndedFn,this.player.duration=this.playerDurationFn,this.player.currentTime=this.playerCurrentTimeFn,this.player.buffered=this.playerbufferedFn,this.player.trigger("durationchange"),(t=e,n=this,"function"==typeof(r=py(yy(1&3?t.prototype:t),"dispose",n))?function(t){return r.apply(n,t)}:r)([])}},{key:"initialize",value:function(){this.onTimeUpdate=this.onTimeUpdate.bind(this),this.onPlay=this.onPlay.bind(this),this.player.on("timeupdate",this.onTimeUpdate),this.player.on("play",this.onPlay)}},{key:"onPlay",value:function(){this._isEnded&&this.player.currentTime(0)}},{key:"onTimeUpdate",value:function(){var t=this.getCurrentTime(!1);t>this.clipEnd?this._isEnded||(this.player.pause(),this.player.trigger("ended"),this._isEnded=!0):(this._isEnded=!1,t<this.clipStart-10&&this.playerCurrentTimeFn(this.clipStart,!0))}},{key:"ended",value:function(){return this.getCurrentTime(!1)>this.clipEnd}},{key:"duration",value:function(t){return t&&t>0&&(this.playerDurationFn()?console.info("The duration of the player has already been set. This is a no-op."):this.playerDurationFn(t)),this.clipEnd-this.clipStart}},{key:"currentTime",value:function(t){if("number"!=typeof t)return this.getCurrentTime(!0);for(var e=t+this.clipStart,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];this.playerCurrentTimeFn(e,r)}},{key:"getCurrentTime",value:function(t){var e=this.playerCurrentTimeFn(),n=0;return e>=this.clipStart&&(n=e-this.clipStart),this.player.getCache().currentTime=n,t?n:e}},{key:"buffered",value:function(){for(var t=this.playerbufferedFn(),e=[],n=0;n<t.length;n++)e[n]=[Math.max(0,t.start(n)-this.clipStart),Math.min(Math.max(0,t.end(n)-this.clipStart),this.player.duration())];return o.Z.createTimeRanges(e)}}],r&&ly(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getPlugin("plugin"));function vy(t){return vy="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vy(t)}function by(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,my(r.key),r)}}function my(t){var e=function(t){if("object"!=vy(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=vy(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==vy(e)?e:e+""}function gy(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(gy=function(){return!!t})()}function wy(){return wy="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Oy(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},wy.apply(null,arguments)}function Oy(t){return Oy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Oy(t)}function Py(t,e){return Py=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Py(t,e)}o.Z.registerPlugin("clipPlugin",dy);var Sy=function(t){function e(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=function(t,e,n){return e=Oy(e),function(t,e){if(e&&("object"==vy(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,gy()?Reflect.construct(e,n||[],Oy(t).constructor):e.apply(t,n))}(this,e,arguments)).alwaysCollapsed=!1,t.isCollapsed=!1,t.isCollabsible=!0,t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Py(t,e)}(e,t),n=e,r=[{key:"buildCSSClass",value:function(){return"cv-create-clip-button"}},{key:"getCollabsibleName",value:function(){return this.controlText_}},{key:"getCollabsibleValue",value:function(){return""}},{key:"showInCollabsibleMenu",value:function(){return!0}},{key:"showCollapsibleMenu",value:function(){var t,n,r;(t=e,n=this,"function"==typeof(r=wy(Oy(1&3?t.prototype:t),"handleClick",n))?function(t){return r.apply(n,t)}:r)([null])}}],r&&by(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getComponent("Button"));function jy(t){return jy="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},jy(t)}function ky(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,_y(r.key),r)}}function _y(t){var e=function(t){if("object"!=jy(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=jy(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==jy(e)?e:e+""}function Cy(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Cy=function(){return!!t})()}function Ey(t){return Ey=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ey(t)}function Ty(t,e){return Ty=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ty(t,e)}Sy.prototype.controlText_="Create Clip",o.Z.registerComponent("CreateClipButton",Sy);var xy=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=Ey(e),function(t,e){if(e&&("object"==jy(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Cy()?Reflect.construct(e,n||[],Ey(t).constructor):e.apply(t,n))}(this,e,[t,n])).options=n,t.ready((function(){return r.onReady()})),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ty(t,e)}(e,t),n=e,(r=[{key:"onReady",value:function(){var t,e=this.player.getChild("collapserator"),n=null===(t=null==e?void 0:e.children())||void 0===t?void 0:t.findIndex((function(t){return"CustomControlSpacer"===t.name()}));n&&-1!==n&&e.addChild("CreateClipButton",{clickHandler:this.options.onClick},n+1)}}])&&ky(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getPlugin("plugin"));function Ly(t){return Ly="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ly(t)}function Ry(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Iy(r.key),r)}}function Iy(t){var e=function(t){if("object"!=Ly(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Ly(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ly(e)?e:e+""}function Dy(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Dy=function(){return!!t})()}function By(t){return By=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},By(t)}function Ny(t,e){return Ny=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ny(t,e)}o.Z.registerPlugin("createClipButtonPlugin",xy);var My=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,n){return e=By(e),function(t,e){if(e&&("object"==Ly(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Dy()?Reflect.construct(e,n||[],By(t).constructor):e.apply(t,n))}(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ny(t,e)}(e,t),n=e,(r=[{key:"handlePictureInPictureEnabledChange",value:function(){this.enable()}}])&&Ry(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getComponent("PictureInPictureToggle"));function Ay(t){return Ay="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ay(t)}function Fy(){Fy=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,n){return t[e]=n}}function s(t,e,n,r){var i=e&&e.prototype instanceof b?e:b,a=Object.create(i.prototype),u=new x(r||[]);return o(a,"_invoke",{value:_(t,n,u)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var p="suspendedStart",y="suspendedYield",h="executing",d="completed",v={};function b(){}function m(){}function g(){}var w={};l(w,a,(function(){return this}));var O=Object.getPrototypeOf,P=O&&O(O(L([])));P&&P!==n&&r.call(P,a)&&(w=P);var S=g.prototype=b.prototype=Object.create(w);function j(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function n(o,i,a,u){var c=f(t[o],t,i);if("throw"!==c.type){var l=c.arg,s=l.value;return s&&"object"==Ay(s)&&r.call(s,"__await")?e.resolve(s.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,u)}))}u(c.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function _(e,n,r){var o=p;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var u=r.delegate;if(u){var c=C(u,r);if(c){if(c===v)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=h;var l=f(e,n,r);if("normal"===l.type){if(o=r.done?d:y,l.arg===v)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=d,r.method="throw",r.arg=l.arg)}}}function C(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,C(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=f(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function x(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function L(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(Ay(e)+" is not iterable")}return m.prototype=g,o(S,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:m,configurable:!0}),m.displayName=l(g,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,l(t,c,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},j(k.prototype),l(k.prototype,u,(function(){return this})),e.AsyncIterator=k,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new k(s(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},j(S),l(S,c,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=L,x.prototype={constructor:x,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return u.type="throw",u.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),l=r.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),T(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;T(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:L(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}function Zy(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Vy(r.key),r)}}function Vy(t){var e=function(t){if("object"!=Ay(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Ay(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ay(e)?e:e+""}function zy(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(zy=function(){return!!t})()}function Uy(){return Uy="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Gy(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Uy.apply(null,arguments)}function Gy(t){return Gy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Gy(t)}function qy(t,e){return qy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},qy(t,e)}o.Z.registerComponent("PictureInPictureToggle",My);var Hy=o.Z.getComponent("PlayToggle"),Wy=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=Gy(e),function(t,e){if(e&&("object"==Ay(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,zy()?Reflect.construct(e,n||[],Gy(t).constructor):e.apply(t,n))}(this,e,[t,n])).pictureInPictureEnabled=!1,r.options=n,r.bindFunctions(),t.ready((function(){return r.onReady()})),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&qy(t,e)}(e,t),n=e,r=[{key:"bindFunctions",value:function(){this.requestPictureInPicture=this.requestPictureInPicture.bind(this),this.exitPictureInPicture=this.exitPictureInPicture.bind(this),this.onPlayerResize=this.onPlayerResize.bind(this),this.playerRequestPictureInPictureFn=this.player.requestPictureInPicture,this.playerExitPictureInPictureFn=this.player.exitPictureInPicture,this.player.requestPictureInPicture=this.requestPictureInPicture,this.player.exitPictureInPicture=this.exitPictureInPicture}},{key:"onReady",value:function(){var t=this.getToggleParentComponent(),e=null==t?void 0:t.getChild("pictureInPictureToggle");this.toggle=e}},{key:"enablePictureInPicture",value:function(){var t=this;if(this.player.options_.fluid&&!this.pictureInPictureEnabled){var e=this.getToggleParentComponent();if(e){this.pictureInPictureEnabled=!0;var n=e.children().findIndex((function(t){var e;return"fullscreentoggle"===(null===(e=t.name())||void 0===e?void 0:e.toLowerCase())}));-1===n&&(n=e.children().length-1),e.addChild("pictureInPictureToggle",{},n);var r=e.getChild("pictureInPictureToggle");null==r||r.enable(),this.player.on("playerresize",this.onPlayerResize),this.player.on("dispose",(function(){var e;null===(e=t.player)||void 0===e||e.off("playerresize",t.onPlayerResize)}))}}}},{key:"disablePictureInPicture",value:function(){if(this.pictureInPictureEnabled){this.pictureInPictureEnabled=!1;var t=this.getToggleParentComponent(),e=null==t?void 0:t.getChild("pictureInPictureToggle");e&&t.removeChild(e),this.player.off("playerresize",this.onPlayerResize)}}},{key:"togglePictureInPicture",value:function(t){if(t!==this.player.isInPictureInPicture()){var e=t?"enterpictureinpicture":"leavepictureinpicture";this.player.isInPictureInPicture(t),this.player.trigger(e),t?this.addPipStyles():this.removePipStyles()}}},{key:"onPlayerResize",value:function(){var t,e;if(!this.player.isInPictureInPicture()){var n=this.player.el().getBoundingClientRect();0!==n.width&&(n.width<800?null===(t=this.toggle)||void 0===t||t.hide():null===(e=this.toggle)||void 0===e||e.show())}}},{key:"addPipStyles",value:function(){this.player.addClass("cv-picture-in-picture"),this.playToggle=new Hy(this.player),this.playToggle.addClass("cv-pip-play-toggle"),this.player.addChild(this.playToggle),this.player.paused()?this.playToggle.handlePause():this.playToggle.handlePlay()}},{key:"removePipStyles",value:function(){this.player.removeClass("cv-picture-in-picture"),this.player.removeChild(this.playToggle),delete this.playToggle}},{key:"requestPictureInPicture",value:function(){var t;this.pictureInPictureEnabled&&(this.togglePictureInPicture(!0),"function"==typeof(null===(t=this.options)||void 0===t?void 0:t.onRequestPictureInPicture)&&this.options.onRequestPictureInPicture(!0))}},{key:"exitPictureInPicture",value:function(){return t=this,e=void 0,n=void 0,r=Fy().mark((function t(){return Fy().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.togglePictureInPicture(!1),this.options.onRequestPictureInPicture(!1),this.removePipStyles();case 3:case"end":return t.stop()}}),t,this)})),new(n||(n=Promise))((function(o,i){function a(t){try{c(r.next(t))}catch(t){i(t)}}function u(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,u)}c((r=r.apply(t,e||[])).next())}));var t,e,n,r}},{key:"getToggleParentComponent",value:function(){return this.player.getChild("collapserator")}},{key:"dispose",value:function(){var t,n,r;this.player.requestPictureInPicture=this.playerRequestPictureInPictureFn,this.player.exitPictureInPicture=this.playerExitPictureInPictureFn,(t=e,n=this,"function"==typeof(r=Uy(Gy(1&3?t.prototype:t),"dispose",n))?function(t){return r.apply(n,t)}:r)([])}}],r&&Zy(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getPlugin("plugin"));function Qy(t){return Qy="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qy(t)}function Yy(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,$y(r.key),r)}}function $y(t){var e=function(t){if("object"!=Qy(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Qy(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Qy(e)?e:e+""}o.Z.registerPlugin("pictureInPicture",Wy);var Ky=new(function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.listeners={}},e=[{key:"subscribe",value:function(t,e){this.registerListener(t,e)}},{key:"subscribeOnce",value:function(t,e){this.registerListener(t,e,1)}},{key:"unsubscribe",value:function(t,e){this.deregisterListener(t,e)}},{key:"trigger",value:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];this.triggerCallbacks(t,n)}},{key:"registerListener",value:function(t,e,n){var r;if("string"!=typeof t)throw new Error("Event name must be a string");if("function"!=typeof e)throw new Error("Event callback must be a function");if(n&&"number"!=typeof n)throw new Error("Execution limit must be a number or undefined");this.listeners[t]=null!==(r=this.listeners[t])&&void 0!==r?r:[],this.listeners[t].push({callback:e,executionLimit:n})}},{key:"deregisterListener",value:function(t,e){var n;if("string"!=typeof t)throw new Error("Event name must be a string");if(e&&"function"!=typeof e)throw new Error("Event callback must be a function");if(e){var r=null===(n=this.listeners[t])||void 0===n?void 0:n.findIndex((function(t){return t.callback===e}));"number"==typeof r&&-1!==r&&(this.listeners[t].splice(r,1),0===this.listeners[t].length&&delete this.listeners[t])}else this.listeners[t]=[]}},{key:"triggerCallbacks",value:function(t){for(var e=this,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];if(this.listeners[t]){var i=[];this.listeners[t].forEach((function(t){var e,n;"number"==typeof t.executionLimit&&(t.executionCount=null!==(n=t.executionCount)&&void 0!==n?n:0,t.executionCount++,t.executionCount===t.executionLimit&&i.push(t.callback)),(e=t.callback).apply.apply(e,[null].concat(r))})),i.length&&i.forEach((function(n){return e.deregisterListener(t,n)}))}}}],e&&Yy(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}());function Xy(t){return Xy="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xy(t)}function Jy(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,th(r.key),r)}}function th(t){var e=function(t){if("object"!=Xy(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Xy(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Xy(e)?e:e+""}function eh(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(eh=function(){return!!t})()}function nh(t,e,n,r){var o=rh(oh(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof o?function(t){return o.apply(n,t)}:o}function rh(){return rh="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=oh(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},rh.apply(null,arguments)}function oh(t){return oh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},oh(t)}function ih(t,e){return ih=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ih(t,e)}var ah=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=oh(e),function(t,e){if(e&&("object"==Xy(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,eh()?Reflect.construct(e,n||[],oh(t).constructor):e.apply(t,n))}(this,e,[t,n])).hasBuffered=!1,r.hasPlayed=!1,r.eventsService=Ky,r.pointOfInterest=n.pointOfInterest,r.onMouseOver=r.onMouseOver.bind(r),r.onMouseLeave=r.onMouseLeave.bind(r),r.onGlancePointOfInterestMouseEnter=r.onGlancePointOfInterestMouseEnter.bind(r),r.onGlancePointOfInterestMouseLeave=r.onGlancePointOfInterestMouseLeave.bind(r),r.initialize(),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ih(t,e)}(e,t),n=e,(r=[{key:"initialize",value:function(){this.setPosition(),this.bindListeners()}},{key:"buildCSSClass",value:function(){return"cv-point-of-interest-indicator ".concat(nh(e,"buildCSSClass",this,3)([]))}},{key:"createEl",value:function(t,n,r){return nh(e,"createEl",this,3)([t,Object.assign(Object.assign({},n),{className:this.buildCSSClass()}),r])}},{key:"bindListeners",value:function(){this.on("mouseover",this.onMouseOver),this.on("mouseleave",this.onMouseLeave),this.eventsService.subscribe("glance:poi:mouseover",this.onGlancePointOfInterestMouseEnter),this.eventsService.subscribe("glance:poi:mouseleave",this.onGlancePointOfInterestMouseLeave)}},{key:"dispose",value:function(){this.eventsService.unsubscribe("glance:poi:mouseover",this.onGlancePointOfInterestMouseEnter),this.eventsService.unsubscribe("glance:poi:mouseleave",this.onGlancePointOfInterestMouseLeave)}},{key:"getPointOfInterestTime",value:function(){return this.pointOfInterest.startTime}},{key:"setPosition",value:function(){var t=this.player().duration();this.el_.style.left=this.getPointOfInterestTime()/t*100+"%"}},{key:"updateBuffered",value:function(t){var e=this.getPointOfInterestTime()<=t;if(e!==this.hasBuffered){this.hasBuffered=e;var n="cv-point-of-interest-indicator-buffered";this.hasBuffered?this.addClass(n):this.removeClass(n)}}},{key:"updatePlaybackProgress",value:function(t){var e=this.getPointOfInterestTime()<=t;if(e!==this.hasPlayed){this.hasPlayed=e;var n="cv-point-of-interest-indicator-played";e?this.addClass(n):this.removeClass(n)}}},{key:"toggleVisibility",value:function(t){var e="cv-point-of-interest-indicator-hidden";t?this.removeClass(e):this.addClass(e)}},{key:"onMouseOver",value:function(){this.setTimeTooltipText(),this.eventsService.trigger("player:poi:mouseover",this.pointOfInterest)}},{key:"onMouseLeave",value:function(){this.clearTimeTooltipText(),this.eventsService.trigger("player:poi:mouseleave")}},{key:"onGlancePointOfInterestMouseEnter",value:function(t){t.id===this.pointOfInterest.id&&(this.addClass("cv-point-of-interest-indicator-highlight"),this.setTimeTooltipTime(),this.setTimeTooltipText(),this.positionMouseTimeDisplay(),this.showMouseTimeDisplay())}},{key:"onGlancePointOfInterestMouseLeave",value:function(){this.removeClass("cv-point-of-interest-indicator-highlight"),this.hideMouseTimeDisplay()}},{key:"setTimeTooltipText",value:function(){var t;null===(t=this.getTimeTooltip())||void 0===t||t.setCustomChapterText(this.pointOfInterest.description)}},{key:"clearTimeTooltipText",value:function(){var t;null===(t=this.getTimeTooltip())||void 0===t||t.setCustomChapterText()}},{key:"setTimeTooltipTime",value:function(){var t=this.getTimeTooltip();null==t||t.updateTime(this.getPointOfInterestTime())}},{key:"positionMouseTimeDisplay",value:function(){var t,e,n=null===(t=this.getSeekBar())||void 0===t?void 0:t.el();if(n){var r=o.Z.dom.findPosition(n),i=this.getPointOfInterestTime()/this.player().duration();null===(e=this.getMouseTimeDisplay())||void 0===e||e.update(r,i)}}},{key:"showMouseTimeDisplay",value:function(){var t;null===(t=this.getMouseTimeDisplay())||void 0===t||t.forceShow()}},{key:"hideMouseTimeDisplay",value:function(){var t;null===(t=this.getMouseTimeDisplay())||void 0===t||t.removeForceShow()}},{key:"getSeekBar",value:function(){var t;return null===(t=this.player().controlBar.getChild("ProgressControl"))||void 0===t?void 0:t.getChild("SeekBar")}},{key:"getMouseTimeDisplay",value:function(){var t;return null===(t=this.getSeekBar())||void 0===t?void 0:t.getChild("MouseTimeDisplay")}},{key:"getTimeTooltip",value:function(){var t;return null===(t=this.getMouseTimeDisplay())||void 0===t?void 0:t.getChild("TimeTooltip")}}])&&Jy(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getComponent("Component"));function uh(t){return uh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},uh(t)}function ch(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,lh(r.key),r)}}function lh(t){var e=function(t){if("object"!=uh(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=uh(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==uh(e)?e:e+""}function sh(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(sh=function(){return!!t})()}function fh(){return fh="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=ph(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},fh.apply(null,arguments)}function ph(t){return ph=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ph(t)}function yh(t,e){return yh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},yh(t,e)}var hh=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=ph(e),function(t,e){if(e&&("object"==uh(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,sh()?Reflect.construct(e,n||[],ph(t).constructor):e.apply(t,n))}(this,e,[t,n])).pointsOfInterestVisible=n.pointsOfInterestVisible,r.toggle(r.pointsOfInterestVisible),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&yh(t,e)}(e,t),n=e,r=[{key:"handleToggle",value:function(){this.toggle(!this.pointsOfInterestVisible)}},{key:"toggle",value:function(t){t?this.toggleOn():this.toggleOff()}},{key:"toggleOn",value:function(){o.Z.dom.addClass(this.toggleEl,"on"),o.Z.dom.setAttribute(this.toggleEl,"aria-checked","true"),this.pointsOfInterestVisible=!0,this.player().pointsOfInterestPlugin().togglePointsOfInterest(this.pointsOfInterestVisible)}},{key:"toggleOff",value:function(){o.Z.dom.removeClass(this.toggleEl,"on"),o.Z.dom.setAttribute(this.toggleEl,"aria-checked","false"),this.pointsOfInterestVisible=!1,this.player().pointsOfInterestPlugin().togglePointsOfInterest(this.pointsOfInterestVisible)}},{key:"handleClick",value:function(t){t.stopImmediatePropagation()}},{key:"createEl",value:function(t,n,r){this.handlerBound||(this.handleToggle=this.handleToggle.bind(this),this.handlerBound=!0),this.toggleEl&&this.toggleEl.removeEventListener("click",this.handleToggle),this.toggleEl=o.Z.dom.createEl("div",{className:"custom-toggle custom-toggle-info toggle-option float-end",innerHTML:'<span class="handle"></span></div>'}),o.Z.dom.setAttribute(this.toggleEl,"id","poi-toggle"),o.Z.dom.setAttribute(this.toggleEl,"role","switch"),this.toggleEl.addEventListener("click",this.handleToggle);var i,a,u,c=(i=e,a=this,"function"==typeof(u=fh(ph(1&3?i.prototype:i),"createEl",a))?function(t){return u.apply(a,t)}:u)([t,{className:"vjs-menu-item cv-cog-menu-item cv-poi-toggle",innerHTML:'\n <label for="poi-toggle" class="vjs-menu-item-text">Points of Interest</label>\n <span class="cv-toggle-container"></span>'},r]);return c.children[1].appendChild(this.toggleEl),c}}],r&&ch(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getComponent("MenuItem"));function dh(t){return dh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},dh(t)}function vh(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,bh(r.key),r)}}function bh(t){var e=function(t){if("object"!=dh(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=dh(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==dh(e)?e:e+""}function mh(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(mh=function(){return!!t})()}function gh(t){return gh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},gh(t)}function wh(t,e){return wh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},wh(t,e)}o.Z.registerComponent("PointsOfInterestMenuItem",hh);var Oh,Ph=o.Z.getPlugin("plugin"),Sh="cvplayer-points-of-interest",jh=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=gh(e),function(t,e){if(e&&("object"==dh(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,mh()?Reflect.construct(e,n||[],gh(t).constructor):e.apply(t,n))}(this,e,[t])).pointOfInterestIndicators=[],r.enabled=!0,r.pointsOfInterest=null==n?void 0:n.pointsOfInterest,r.initialize=r.initialize.bind(r),r.updateBuffered=r.updateBuffered.bind(r),r.updatePlaybackProgress=r.updatePlaybackProgress.bind(r),r.player.one("loadedmetadata",(function(){return r.player.ready(r.initialize)})),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&wh(t,e)}(e,t),n=e,(r=[{key:"initialize",value:function(){this.pointsOfInterest&&(Ze()&&"false"===Ve(Sh)&&(this.enabled=!1),this.setupTrack(),this.createPointOfInterestIndicators(),this.addMenuItem(),this.bindListeners())}},{key:"bindListeners",value:function(){var t=this;this.player.on("progress",this.updateBuffered),this.player.on("timeupdate",this.updatePlaybackProgress),this.player.on("dispose",(function(){var e,n;null===(e=t.player)||void 0===e||e.off("progress",t.updateBuffered),null===(n=t.player)||void 0===n||n.off("timeupdate",t.updatePlaybackProgress)}))}},{key:"togglePointsOfInterest",value:function(t){ze(Sh,t.toString()),this.pointOfInterestIndicators.forEach((function(e){return e.toggleVisibility(t)}))}},{key:"setupTrack",value:function(){var t=this.player.addTextTrack("metadata","pointsofinterest");this.pointsOfInterest.forEach((function(e){t.addCue({startTime:e.startTime,endTime:e.endTime,text:e.description})})),t.trigger({type:"loadeddata",target:t})}},{key:"createPointOfInterestIndicators",value:function(){var t,e=this,n=null===(t=this.player.controlBar.getChild("ProgressControl"))||void 0===t?void 0:t.getChild("SeekBar");this.pointsOfInterest.forEach((function(t){var r=new ah(e.player,{pointOfInterest:t});e.pointOfInterestIndicators.push(r),n.addChild(r)}))}},{key:"addMenuItem",value:function(){var t;(null===(t=this.player.getChild("collapserator"))||void 0===t?void 0:t.getChild("cogButton")).addItem({index:0,ctor:hh,name:"PointsOfInterestMenuItem",options:{pointsOfInterestVisible:this.enabled}})}},{key:"updateBuffered",value:function(){var t=this;this.pointOfInterestIndicators.forEach((function(e){return e.updateBuffered(gc(t.player))}))}},{key:"updatePlaybackProgress",value:function(){var t=this;this.pointOfInterestIndicators.forEach((function(e){return e.updatePlaybackProgress(t.player.currentTime())}))}}])&&vh(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Ph);function kh(t){return kh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},kh(t)}function _h(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Ch(r.key),r)}}function Ch(t){var e=function(t){if("object"!=kh(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=kh(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==kh(e)?e:e+""}function Eh(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Eh=function(){return!!t})()}function Th(t){return Th=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Th(t)}function xh(t,e){return xh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},xh(t,e)}o.Z.registerPlugin("pointsOfInterestPlugin",jh),function(t){t.None="None",t.Complete="Complete",t.Incomplete="Incomplete"}(Oh||(Oh={}));var Lh=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=Th(e),function(t,e){if(e&&("object"==kh(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Eh()?Reflect.construct(e,n||[],Th(t).constructor):e.apply(t,n))}(this,e,[t,n])).update(),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&xh(t,e)}(e,t),n=e,r=[{key:"update",value:function(){this.options_.activityStatus===Oh.Complete?this.addClass("cv-activity-completed"):this.removeClass("cv-activity-completed")}},{key:"handleClick",value:function(){if(this.options_.activityStatus=this.getToggledActivityStatus(),this.update(),this.options_.clickHandler){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];this.options_.clickHandler.call(this,e)}}},{key:"buildCSSClass",value:function(){return"cv-activity-status-button"}},{key:"getToggledActivityStatus",value:function(){return this.options_.activityStatus===Oh.None||this.options_.activityStatus===Oh.Incomplete?Oh.Complete:this.options_.activityStatus===Oh.Complete?Oh.Incomplete:void 0}}],r&&_h(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getComponent("Button"));function Rh(t){return Rh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Rh(t)}function Ih(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Dh(r.key),r)}}function Dh(t){var e=function(t){if("object"!=Rh(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Rh(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Rh(e)?e:e+""}function Bh(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Bh=function(){return!!t})()}function Nh(t){return Nh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Nh(t)}function Mh(t,e){return Mh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Mh(t,e)}Lh.prototype.controlText_="Complete";var Ah=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,n){return e=Nh(e),function(t,e){if(e&&("object"==Rh(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Bh()?Reflect.construct(e,n||[],Nh(t).constructor):e.apply(t,n))}(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Mh(t,e)}(e,t),n=e,(r=[{key:"setActivityStatus",value:function(t,e){var n=this;t!==this.activityStatus&&(this.activityStatus=t,this.onToggleStatus=e,this.player.ready((function(){n.renderActivityStatusButton()})))}},{key:"renderActivityStatusButton",value:function(){this.button&&this.player.removeChild(this.button),this.button=new Lh(this.player,{activityStatus:this.activityStatus,clickHandler:this.onToggleStatus}),this.player.addChild(this.button)}}])&&Ih(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getPlugin("plugin"));function Fh(t){return Fh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fh(t)}function Zh(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Vh(r.key),r)}}function Vh(t){var e=function(t){if("object"!=Fh(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Fh(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Fh(e)?e:e+""}function zh(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(zh=function(){return!!t})()}function Uh(t,e,n,r){var o=Gh(qh(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof o?function(t){return o.apply(n,t)}:o}function Gh(){return Gh="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=qh(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Gh.apply(null,arguments)}function qh(t){return qh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},qh(t)}function Hh(t,e){return Hh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Hh(t,e)}o.Z.registerPlugin("activityStatusPlugin",Ah);var Wh=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=qh(e),function(t,e){if(e&&("object"==Fh(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,zh()?Reflect.construct(e,n||[],qh(t).constructor):e.apply(t,n))}(this,e,[t,n])).initialize(),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Hh(t,e)}(e,t),n=e,(r=[{key:"initialize",value:function(){this.setPosition()}},{key:"buildCSSClass",value:function(){return"cv-range-indicator ".concat(Uh(e,"buildCSSClass",this,3)([]))}},{key:"createEl",value:function(t,n,r){return Uh(e,"createEl",this,3)([t,Object.assign(Object.assign({},n),{className:this.buildCSSClass()}),r])}},{key:"setPosition",value:function(){var t=this.player().duration();this.el_.style.left=this.options_.time/t*100+"%"}}])&&Zh(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getComponent("Component"));function Qh(t){return Qh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qh(t)}function Yh(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,$h(r.key),r)}}function $h(t){var e=function(t){if("object"!=Qh(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Qh(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Qh(e)?e:e+""}function Kh(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Kh=function(){return!!t})()}function Xh(t,e,n,r){var o=Jh(td(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof o?function(t){return o.apply(n,t)}:o}function Jh(){return Jh="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=td(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Jh.apply(null,arguments)}function td(t){return td=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},td(t)}function ed(t,e){return ed=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ed(t,e)}var nd=function(t){function e(t,n){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,n){return e=td(e),function(t,e){if(e&&("object"==Qh(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Kh()?Reflect.construct(e,n||[],td(t).constructor):e.apply(t,n))}(this,e,[t,n])}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ed(t,e)}(e,t),n=e,(r=[{key:"buildCSSClass",value:function(){return"cv-replay-view-button ".concat(Xh(e,"buildCSSClass",this,3)([]))}},{key:"createEl",value:function(t,n,r){return Xh(e,"createEl",this,3)([t,Object.assign(Object.assign({},n),{innerHTML:'<span class="'.concat(this.options_.iconClassName,'"></span><span>').concat(this.options_.label,"</span>"),className:this.buildCSSClass()}),r])}},{key:"handleClick",value:function(){this.options_.onPress()}}])&&Yh(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getComponent("ClickableComponent"));function rd(t){return rd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},rd(t)}function od(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,id(r.key),r)}}function id(t){var e=function(t){if("object"!=rd(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=rd(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==rd(e)?e:e+""}function ad(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(ad=function(){return!!t})()}function ud(t,e,n,r){var o=cd(ld(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof o?function(t){return o.apply(n,t)}:o}function cd(){return cd="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=ld(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},cd.apply(null,arguments)}function ld(t){return ld=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ld(t)}function sd(t,e){return sd=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},sd(t,e)}var fd=function(t){function e(t,n){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,n){return e=ld(e),function(t,e){if(e&&("object"==rd(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,ad()?Reflect.construct(e,n||[],ld(t).constructor):e.apply(t,n))}(this,e,[t,n])}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&sd(t,e)}(e,t),n=e,(r=[{key:"buildCSSClass",value:function(){return"cv-replay-view ".concat(ud(e,"buildCSSClass",this,3)([]))}},{key:"createEl",value:function(t,n,r){var i=ud(e,"createEl",this,3)([t,Object.assign(Object.assign({},n),{className:this.buildCSSClass()}),r]),a=o.Z.dom.createEl("h5",{innerHTML:this.localize("This clip has finished"),className:"cv-replay-heading"}),u=o.Z.dom.createEl("div",{className:"cv-button-container"}),c=new nd(this.player_,{label:this.localize("Replay clip"),iconClassName:"cv-replay-icon",onPress:this.options_.onReplayPress}),l=new nd(this.player_,{label:this.localize("Continue watching"),iconClassName:"cv-continue-icon",onPress:this.options_.onContinuePress});return i.appendChild(a),i.appendChild(u),u.appendChild(c.el()),u.appendChild(l.el()),i}}])&&od(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getComponent("Component"));function pd(t){return pd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pd(t)}function yd(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,hd(r.key),r)}}function hd(t){var e=function(t){if("object"!=pd(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=pd(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==pd(e)?e:e+""}function dd(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(dd=function(){return!!t})()}function vd(){return vd="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=bd(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},vd.apply(null,arguments)}function bd(t){return bd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},bd(t)}function md(t,e){return md=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},md(t,e)}var gd=function(t){function e(t,n){var r;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=bd(e),function(t,e){if(e&&("object"==pd(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,dd()?Reflect.construct(e,n||[],bd(t).constructor):e.apply(t,n))}(this,e,[t,n])).startTime=parseFloat(n.startTime.toPrecision(4)),r.endTime=parseFloat(n.endTime.toPrecision(4)),r.dismissed=!1,r.startTime>r.endTime)throw Error("Range start cannot be greater than range end");return r.bindFunctions(),r.initialize(),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&md(t,e)}(e,t),n=e,r=[{key:"bindFunctions",value:function(){this.onReady=this.onReady.bind(this),this.onTimeUpdateOrSeeked=this.onTimeUpdateOrSeeked.bind(this),this.onReplayPress=this.onReplayPress.bind(this),this.onContinuePress=this.onContinuePress.bind(this)}},{key:"initialize",value:function(){var t=this;this.player.one("loadedmetadata",(function(){return t.player.ready(t.onReady)})),this.player.on("timeupdate",this.onTimeUpdateOrSeeked),this.player.on("seeked",this.onTimeUpdateOrSeeked)}},{key:"onReady",value:function(){this.addCssClasses(),this.showRangeIndicators(),this.addMaskToProgressBar()}},{key:"onTimeUpdateOrSeeked",value:function(){if(!this.dismissed){var t=this.player.currentTime();if(!(t<this.startTime))return t>this.endTime?(this.showReplayView(),this.disablePlayToggle(),this.player.pause(),void this.player.currentTime(this.endTime)):void 0;this.player.currentTime(this.startTime)}}},{key:"onReplayPress",value:function(){this.player.currentTime(this.startTime),this.player.play(),this.hideReplayView(),this.enablePlayToggle()}},{key:"onContinuePress",value:function(){this.dismissed=!0,this.player.play(),this.hideRangeIndicators(),this.removeMaskFromProgressBar(),this.hideReplayView(),this.enablePlayToggle(),this.removeCssClasses()}},{key:"showRangeIndicators",value:function(){var t,e=null===(t=this.player.controlBar.getChild("ProgressControl"))||void 0===t?void 0:t.getChild("SeekBar");this.startTimeIndicator||(this.startTimeIndicator=new Wh(this.player,{time:this.startTime}),null==e||e.addChild(this.startTimeIndicator)),this.endTimeIndicator||(this.endTimeIndicator=new Wh(this.player,{time:this.endTime}),null==e||e.addChild(this.endTimeIndicator))}},{key:"hideRangeIndicators",value:function(){var t,e;null===(t=this.startTimeIndicator)||void 0===t||t.hide(),null===(e=this.endTimeIndicator)||void 0===e||e.hide()}},{key:"addMaskToProgressBar",value:function(){var t,e=null===(t=this.player.controlBar.getChild("ProgressControl"))||void 0===t?void 0:t.getChild("SeekBar"),n=null==e?void 0:e.el().getElementsByClassName("cv-chapter-bar-items");if(n&&n.length){var r=n[0],o=this.player.duration(),i=this.startTime/o*100,a=100-this.endTime/o*100;r.style.clipPath="inset(".concat(-5,"em ").concat(a,"% ").concat(-5,"em ").concat(i,"%)")}}},{key:"removeMaskFromProgressBar",value:function(){var t,e=null===(t=this.player.controlBar.getChild("ProgressControl"))||void 0===t?void 0:t.getChild("SeekBar"),n=null==e?void 0:e.el().getElementsByClassName("cv-chapter-bar-items");n&&n.length&&(n[0].style.clipPath="")}},{key:"showReplayView",value:function(){this.replayView||(this.replayView=new fd(this.player,{onContinuePress:this.onContinuePress,onReplayPress:this.onReplayPress}),this.player.addChild(this.replayView)),this.replayView.show()}},{key:"hideReplayView",value:function(){var t;null===(t=this.replayView)||void 0===t||t.hide()}},{key:"getPlayToggle",value:function(){var t=this.player.getChild("collapserator");return null==t?void 0:t.getChild("PlayToggle")}},{key:"enablePlayToggle",value:function(){var t=this.getPlayToggle();t&&t.enable()}},{key:"disablePlayToggle",value:function(){var t=this.getPlayToggle();t&&t.disable()}},{key:"addCssClasses",value:function(){this.player.addClass("cv-range-indicator-plugin")}},{key:"removeCssClasses",value:function(){this.player.removeClass("cv-range-indicator-plugin")}},{key:"dispose",value:function(){var t,n,r,o,i,a;this.removeCssClasses(),this.player.off("timeupdate",this.onTimeUpdateOrSeeked),this.player.off("seeked",this.onTimeUpdateOrSeeked),null===(t=this.startTimeIndicator)||void 0===t||t.dispose(),null===(n=this.endTimeIndicator)||void 0===n||n.dispose(),null===(r=this.replayView)||void 0===r||r.dispose(),(o=e,i=this,"function"==typeof(a=vd(bd(1&3?o.prototype:o),"dispose",i))?function(t){return a.apply(i,t)}:a)([])}}],r&&yd(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getPlugin("plugin"));function wd(t){return wd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wd(t)}function Od(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Pd(r.key),r)}}function Pd(t){var e=function(t){if("object"!=wd(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=wd(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==wd(e)?e:e+""}function Sd(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Sd=function(){return!!t})()}function jd(t,e,n,r){var o=kd(_d(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof o?function(t){return o.apply(n,t)}:o}function kd(){return kd="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=_d(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},kd.apply(null,arguments)}function _d(t){return _d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_d(t)}function Cd(t,e){return Cd=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Cd(t,e)}o.Z.registerPlugin("rangeIndicatorPlugin",gd);var Ed=o.Z.getComponent("MenuButton"),Td="cv-theatre-mode-button",xd=function(t){function e(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=function(t,e,n){return e=_d(e),function(t,e){if(e&&("object"==wd(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Sd()?Reflect.construct(e,n||[],_d(t).constructor):e.apply(t,n))}(this,e,arguments)).alwaysCollapsed=!1,t.isCollapsed=!1,t.isCollabsible=!0,t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Cd(t,e)}(e,t),n=e,(r=[{key:"getCollabsibleName",value:function(){return this.controlText_}},{key:"getCollabsibleValue",value:function(){return""}},{key:"showInCollabsibleMenu",value:function(){return!(window.innerWidth<992)}},{key:"showCollapsibleMenu",value:function(){jd(e,"handleClick",this,3)([null])}},{key:"buildCSSClass",value:function(){return"cv-default-mode-button ".concat(jd(e,"buildCSSClass",this,3)([]))}},{key:"buildWrapperCSSClass",value:function(){return"cv-menu-big ".concat(jd(e,"buildWrapperCSSClass",this,3)([]))}},{key:"handleClick",value:function(){this.player_.theatreModePlugin().toggleTheatreMode()}}])&&Od(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Ed);function Ld(t){return Ld="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ld(t)}function Rd(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Id(r.key),r)}}function Id(t){var e=function(t){if("object"!=Ld(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Ld(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ld(e)?e:e+""}function Dd(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Dd=function(){return!!t})()}function Bd(){return Bd="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Nd(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Bd.apply(null,arguments)}function Nd(t){return Nd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Nd(t)}function Md(t,e){return Md=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Md(t,e)}xd.prototype.controlText_="Theatre Mode",o.Z.registerComponent("theatreModeButton",xd);var Ad=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=Nd(e),function(t,e){if(e&&("object"==Ld(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Dd()?Reflect.construct(e,n||[],Nd(t).constructor):e.apply(t,n))}(this,e,[t,n])).options=n,r.bindListeners(),t.ready((function(){return r.onReady()})),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Md(t,e)}(e,t),n=e,r=[{key:"bindListeners",value:function(){this.onResize=this.onResize.bind(this),this.onFullscreenChange=this.onFullscreenChange.bind(this),this.player.on("playerresize",this.onResize),this.player.on("fullscreenchange",this.onFullscreenChange)}},{key:"onReady",value:function(){var t;if(this.options&&!(window.innerWidth<992)&&this.getCollapserator()){this.button=this.createButton();var e=this.options.theatreMode;e&&(null===(t=this.button)||void 0===t||t.addClass(Td),this.options.onRequestTheatreMode(e))}}},{key:"dispose",value:function(){var t,n,r;this.player.off("playerresize",this.onResize),this.player.off("fullscreenchange",this.onFullscreenChange),(t=e,n=this,"function"==typeof(r=Bd(Nd(1&3?t.prototype:t),"dispose",n))?function(t){return r.apply(n,t)}:r)([])}},{key:"toggleTheatreMode",value:function(t){var e;if(this.options){var n=this.options.theatreMode,r=void 0!==t?t:!n;if(this.options.onRequestTheatreMode(r),this.button)return r?this.button.addClass(Td):null===(e=this.button)||void 0===e||e.removeClass(Td),this.options.theatreMode=r,r}}},{key:"onResize",value:function(){var t,e;window.innerWidth<992?(null===(t=this.button)||void 0===t||t.hide(),this.options.theatreMode&&this.options.onRequestTheatreMode(!1)):this.player.isFullscreen()||(this.button||(this.button=this.createButton()),null===(e=this.button)||void 0===e||e.show())}},{key:"createButton",value:function(){var t=this.getCollapserator();return(null==t?void 0:t.getChild("theatreModeButton"))||t.addChild("theatreModeButton",{},t.children_.length-3),null==t?void 0:t.getChild("theatreModeButton")}},{key:"onFullscreenChange",value:function(){var t,e;this.player.isFullscreen()?null===(t=this.button)||void 0===t||t.hide():null===(e=this.button)||void 0===e||e.show()}},{key:"getCollapserator",value:function(){return this.player.getChild("collapserator")}}],r&&Rd(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getPlugin("plugin"));o.Z.registerPlugin("theatreModePlugin",Ad);var Fd=function(){var t,e,n;return null!==(n=null===(e=null===(t=window.crypto)||void 0===t?void 0:t.randomUUID)||void 0===e?void 0:e.call(t))&&void 0!==n?n:Math.random().toString()};function Zd(t){return Zd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zd(t)}function Vd(){Vd=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,n){return t[e]=n}}function s(t,e,n,r){var i=e&&e.prototype instanceof b?e:b,a=Object.create(i.prototype),u=new x(r||[]);return o(a,"_invoke",{value:_(t,n,u)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var p="suspendedStart",y="suspendedYield",h="executing",d="completed",v={};function b(){}function m(){}function g(){}var w={};l(w,a,(function(){return this}));var O=Object.getPrototypeOf,P=O&&O(O(L([])));P&&P!==n&&r.call(P,a)&&(w=P);var S=g.prototype=b.prototype=Object.create(w);function j(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function n(o,i,a,u){var c=f(t[o],t,i);if("throw"!==c.type){var l=c.arg,s=l.value;return s&&"object"==Zd(s)&&r.call(s,"__await")?e.resolve(s.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,u)}))}u(c.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function _(e,n,r){var o=p;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var u=r.delegate;if(u){var c=C(u,r);if(c){if(c===v)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=h;var l=f(e,n,r);if("normal"===l.type){if(o=r.done?d:y,l.arg===v)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=d,r.method="throw",r.arg=l.arg)}}}function C(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,C(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=f(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function x(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function L(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(Zd(e)+" is not iterable")}return m.prototype=g,o(S,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:m,configurable:!0}),m.displayName=l(g,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,l(t,c,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},j(k.prototype),l(k.prototype,u,(function(){return this})),e.AsyncIterator=k,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new k(s(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},j(S),l(S,c,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=L,x.prototype={constructor:x,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return u.type="throw",u.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),l=r.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),T(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;T(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:L(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}function zd(t){return function(t){if(Array.isArray(t))return Ud(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return Ud(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ud(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ud(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Gd(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,qd(r.key),r)}}function qd(t){var e=function(t){if("object"!=Zd(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Zd(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Zd(e)?e:e+""}function Hd(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Hd=function(){return!!t})()}function Wd(t,e,n,r){var o=Qd(Yd(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof o?function(t){return o.apply(n,t)}:o}function Qd(){return Qd="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Yd(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Qd.apply(null,arguments)}function Yd(t){return Yd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Yd(t)}function $d(t,e){return $d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},$d(t,e)}var Kd,Xd,Jd=function(t){function e(t,n){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,n){return e=Yd(e),function(t,e){if(e&&("object"==Zd(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Hd()?Reflect.construct(e,n||[],Yd(t).constructor):e.apply(t,n))}(this,e,[t,n])}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&$d(t,e)}(e,t),n=e,(r=[{key:"getPlayerOptions",value:function(){var t,n=Wd(e,"getPlayerOptions",this,3)([]);return(null===(t=n.devicesConfig)||void 0===t?void 0:t.canUserCastToDevices)?Object.assign(Object.assign({},n),{techOrder:["devices"].concat(zd(n.techOrder)),devices:{instanceId:Fd()}}):n}},{key:"configurePlugins",value:function(){var t;try{this.options.onClickCreateClip&&this.player.createClipButtonPlugin({onClick:this.options.onClickCreateClip}),this.options.onRequestPictureInPicture&&this.player.pictureInPicture({onRequestPictureInPicture:this.options.onRequestPictureInPicture}),(null===(t=this.options.pointsOfInterest)||void 0===t?void 0:t.length)&&this.player.pointsOfInterestPlugin({pointsOfInterest:this.options.pointsOfInterest})}catch(t){console.log("failed to register plugins",t)}}},{key:"setNextVideo",value:function(t,e,n){this.player.nextVideoPlugin&&this.player.nextVideoPlugin().setNextVideo(t,e,n)}},{key:"enablePictureInPicture",value:function(){var t=this.player.pictureInPicture();t&&t.enablePictureInPicture()}},{key:"disablePictureInPicture",value:function(){var t=this.player.pictureInPicture();t&&t.disablePictureInPicture()}},{key:"togglePictureInPicture",value:function(t){var e=this.player.pictureInPicture();e&&e.togglePictureInPicture(t)}},{key:"toggleTheatreMode",value:function(t){var e=this.player.theatreModePlugin();e&&e.toggleTheatreMode(t)}},{key:"additionalSetup",value:function(t){var n,r,o,i,a,u=this,c=Object.create(null,{additionalSetup:{get:function(){return Wd(e,"additionalSetup",u,1)}}});return r=this,o=void 0,i=void 0,a=Vd().mark((function e(){var r;return Vd().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(c.additionalSetup.call(this,t),this.options.showResources&&t.resources&&this.player.resourcesPlugin&&this.player.resourcesPlugin({resources:t.resources.list,imageCdnUrl:this.options.imageCdnUrl}),this.options.onRequestTheatreMode&&this.options.allowTheatreMode&&this.player.theatreModePlugin&&this.player.theatreModePlugin({onRequestTheatreMode:this.options.onRequestTheatreMode,theatreMode:this.options.theatreMode}),"MasterClip"!==t.mediaType){e.next=8;break}if(null!==(r=t.additionalData)){e.next=7;break}throw Error("Invalid clip data");case 7:this.player.clipPlugin({startTime:r.startTime,endTime:r.endTime});case 8:if(!(null===(n=this.options.devicesConfig)||void 0===n?void 0:n.canUserCastToDevices)){e.next=12;break}if(this.player.devicesPlugin){e.next=11;break}return e.abrupt("return");case 11:this.player.devicesPlugin(Object.assign(Object.assign({},this.options.devicesConfig),{userId:parseInt(t.viewerId),title:t.title,analyticsService:this.analyticsService}));case 12:"MasterVideo"===t.mediaType&&this.options.startTime&&this.options.endTime&&this.player.rangeIndicatorPlugin({startTime:this.options.startTime,endTime:this.options.endTime});case 13:case"end":return e.stop()}}),e,this)})),new(i||(i=Promise))((function(t,e){function n(t){try{c(a.next(t))}catch(t){e(t)}}function u(t){try{c(a.throw(t))}catch(t){e(t)}}function c(e){var r;e.done?t(e.value):(r=e.value,r instanceof i?r:new i((function(t){t(r)}))).then(n,u)}c((a=a.apply(r,o||[])).next())}))}},{key:"setActivityStatus",value:function(t,e){this.player.activityStatusPlugin().setActivityStatus(t,e)}},{key:"addTranscript",value:function(t){return W.getTrack(this.player,"metadata","transcript",t)?null:this.player.addTextTrack("metadata","transcript",t)}},{key:"useCurrentTranscript",value:function(t,e){return W.useTrack(this.player,"metadata","transcript",t,e)}}])&&Gd(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(uy),tv=n(33937);function ev(t){return ev="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ev(t)}function nv(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,rv(r.key),r)}}function rv(t){var e=function(t){if("object"!=ev(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=ev(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ev(e)?e:e+""}!function(t){t.AppleTv="apple-tv",t.Vivi="vivi"}(Kd||(Kd={})),function(t){t.Available="available",t.Offline="offline",t.Busy="busy"}(Xd||(Xd={}));var ov=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this[Symbol.toStringTag]=e[Symbol.toStringTag],this.innerPromise=e,this.onTimeout=n,this.bindFunctions()}return e=t,r=[{key:"reject",value:function(e){return new t(Promise.reject(e))}},{key:"fromPromise",value:function(e){return new t(e)}}],(n=[{key:"bindFunctions",value:function(){this.timeout=this.timeout.bind(this),this.then=this.then.bind(this),this.catch=this.catch.bind(this),this.finally=this.finally.bind(this)}},{key:"timeout",value:function(t){var e=this;return new Promise((function(n,r){e.then(n).catch(r).finally((function(){return clearTimeout(o)}));var o=setTimeout((function(){var t;null===(t=e.onTimeout)||void 0===t||t.call(e),r(new Error("Promise timed out"))}),t)}))}},{key:"then",value:function(t,e){return this.innerPromise.then(t,e)}},{key:"catch",value:function(t){return this.innerPromise.catch(t)}},{key:"finally",value:function(t){return this.innerPromise.finally(t)}}])&&nv(e.prototype,n),r&&nv(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n,r}();function iv(t){return iv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},iv(t)}function av(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function uv(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,lv(r.key),r)}}function cv(t,e,n){return e&&uv(t.prototype,e),n&&uv(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function lv(t){var e=function(t){if("object"!=iv(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=iv(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==iv(e)?e:e+""}Symbol.toStringTag;var sv=function(){return cv((function t(){av(this,t),this.callbacks=[],this.predicates=[],this.controller=new AbortController,this.signal=this.controller.signal,this.trigger=this.trigger.bind(this),this.on=this.on.bind(this),this.one=this.one.bind(this),this.off=this.off.bind(this),this.dispose=this.dispose.bind(this),this.isDisposed=this.isDisposed.bind(this)}),[{key:"trigger",value:function(t){var e=this;this.callbacks.forEach((function(n,r){var o=e.predicates[r];o&&!o(t)||n(t)}))}},{key:"on",value:function(t){var e=this;this.isDisposed()&&console.warn("This EventChannel instance been disposed - this is a no-op");var n=this.callbacks.length;this.callbacks[n]=t,this.predicates[n]=function(){return!0};var r=function(){e.off(t)};return{off:r,filter:function(t){return e.predicates[n]=t,r}}}},{key:"one",value:function(){var t,e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){return!0};return this.isDisposed()?ov.reject(new Error("This EventChannel instance has been disposed")):new ov(new Promise((function(r,o){t=e.on((function(n){e.signal.removeEventListener("abort",i),t(),r(n)})).filter(n);var i=function(){t(),o(new Error("Aborted while waiting for message"))};e.signal.addEventListener("abort",i,{once:!0})})),(function(){t()}))}},{key:"off",value:function(t){var e=this.callbacks.indexOf(t);-1!==e&&(this.callbacks.splice(e,1),this.predicates.splice(e,1))}},{key:"dispose",value:function(){this.callbacks.length=0,this.predicates.length=0,this.controller.abort()}},{key:"isDisposed",value:function(){return this.signal.aborted}}])}(),fv=function(){return cv((function t(){av(this,t),this.channels={},this.trigger=this.trigger.bind(this),this.on=this.on.bind(this),this.one=this.one.bind(this),this.off=this.off.bind(this),this.dispose=this.dispose.bind(this),this.getChannel=this.getChannel.bind(this)}),[{key:"trigger",value:function(t,e){this.getChannel(t).trigger(e)}},{key:"on",value:function(t,e){return this.getChannel(t).on(e)}},{key:"one",value:function(t,e){return this.getChannel(t).one(e)}},{key:"off",value:function(t,e){this.getChannel(t).off(e)}},{key:"dispose",value:function(){this.trigger("dispose",pv.void),Object.values(this.channels).forEach((function(t){return t.dispose()})),this.channels={}}},{key:"getChannel",value:function(t){return this.channels[t]||(this.channels[t]=new sv),this.channels[t]}}])}(),pv={void:void 0};function yv(t){return yv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yv(t)}function hv(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,dv(r.key),r)}}function dv(t){var e=function(t){if("object"!=yv(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=yv(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==yv(e)?e:e+""}var vv,bv,mv,gv=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.bindFunctions()},(e=[{key:"bindFunctions",value:function(){this.schedule=this.schedule.bind(this),this.every=this.every.bind(this),this.trigger=this.trigger.bind(this),this.start=this.start.bind(this),this.stop=this.stop.bind(this)}},{key:"schedule",value:function(t){return this.task=t,this}},{key:"every",value:function(t){return this.intervalInMilliseconds=t,this}},{key:"trigger",value:function(){var t;return null===(t=this.task)||void 0===t||t.call(this,this),this}},{key:"start",value:function(){var t=this;return this.intervalId||(this.intervalId=setInterval((function(){return t.trigger()}),this.intervalInMilliseconds)),this}},{key:"stop",value:function(){return this.intervalId&&(clearInterval(this.intervalId),this.intervalId=void 0),this}}])&&hv(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}(),wv=function(t,e){return t._lastModified||(t._lastModified={}),new Proxy(t,{set:function(n,r,o,i){var a=t._lastModified[r.toString()];return!!(a&&Date.now()<a+e)||Reflect.set(n,r,o,i)}})},Ov=function(t){return t._lastModified||(t._lastModified={}),new Proxy(t,{set:function(e,n,r,o){return t._lastModified[n.toString()]=Date.now(),Reflect.set(e,n,r,o)}})};function Pv(t){return Pv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pv(t)}function Sv(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,kv(r.key),r)}}function jv(t,e,n){return e&&Sv(t.prototype,e),n&&Sv(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function kv(t){var e=function(t){if("object"!=Pv(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Pv(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Pv(e)?e:e+""}!function(t){t[t.Offline=0]="Offline",t[t.Online=1]="Online",t[t.Locked=2]="Locked",t[t.Suspended=3]="Suspended"}(vv||(vv={})),function(t){t[t.PlaybackStatusChange=0]="PlaybackStatusChange",t[t.PositionChange=1]="PositionChange"}(bv||(bv={})),function(t){t.Begin="BEGIN",t.Play="PLAY",t.Pause="PAUSE",t.Load="LOAD",t.Scan="SCAN",t.Stop="STOP"}(mv||(mv={}));var _v=jv((function t(e,n){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.title=e,this.device=n,this.locked=!1,this.position=0,this.playbackStatus=mv.Load,this.debounced=wv(this,2e3),Ov(this)}));function Cv(t){return Cv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Cv(t)}function Ev(){Ev=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,n){return t[e]=n}}function s(t,e,n,r){var i=e&&e.prototype instanceof b?e:b,a=Object.create(i.prototype),u=new x(r||[]);return o(a,"_invoke",{value:_(t,n,u)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var p="suspendedStart",y="suspendedYield",h="executing",d="completed",v={};function b(){}function m(){}function g(){}var w={};l(w,a,(function(){return this}));var O=Object.getPrototypeOf,P=O&&O(O(L([])));P&&P!==n&&r.call(P,a)&&(w=P);var S=g.prototype=b.prototype=Object.create(w);function j(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function n(o,i,a,u){var c=f(t[o],t,i);if("throw"!==c.type){var l=c.arg,s=l.value;return s&&"object"==Cv(s)&&r.call(s,"__await")?e.resolve(s.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,u)}))}u(c.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function _(e,n,r){var o=p;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var u=r.delegate;if(u){var c=C(u,r);if(c){if(c===v)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=h;var l=f(e,n,r);if("normal"===l.type){if(o=r.done?d:y,l.arg===v)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=d,r.method="throw",r.arg=l.arg)}}}function C(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,C(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=f(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function x(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function L(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(Cv(e)+" is not iterable")}return m.prototype=g,o(S,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:m,configurable:!0}),m.displayName=l(g,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,l(t,c,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},j(k.prototype),l(k.prototype,u,(function(){return this})),e.AsyncIterator=k,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new k(s(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},j(S),l(S,c,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=L,x.prototype={constructor:x,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return u.type="throw",u.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),l=r.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),T(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;T(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:L(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}function Tv(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,xv(r.key),r)}}function xv(t){var e=function(t){if("object"!=Cv(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Cv(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Cv(e)?e:e+""}function Lv(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Lv=function(){return!!t})()}function Rv(){return Rv="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Iv(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Rv.apply(null,arguments)}function Iv(t){return Iv=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Iv(t)}function Dv(t,e){return Dv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Dv(t,e)}var Bv=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=Iv(e),function(t,e){if(e&&("object"==Cv(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Lv()?Reflect.construct(e,n||[],Iv(t).constructor):e.apply(t,n))}(this,e)).client=t,r.localState=new _v(n.title,n.device),r.bindFunctions(),r.initialize(),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Dv(t,e)}(e,t),n=e,r=[{key:"bindFunctions",value:function(){this.initialize=this.initialize.bind(this),this.dispose=this.dispose.bind(this),this.handleDisconnected=this.handleDisconnected.bind(this),this.handleAllVideoMessages=this.handleAllVideoMessages.bind(this),this.handlePlaybackChange=this.handlePlaybackChange.bind(this),this.handlePositionChange=this.handlePositionChange.bind(this),this.loadSource=this.loadSource.bind(this),this.play=this.play.bind(this),this.pause=this.pause.bind(this),this.seek=this.seek.bind(this),this.setVolume=this.setVolume.bind(this),this.isPlaying=this.isPlaying.bind(this),this.getPosition=this.getPosition.bind(this),this.getDuration=this.getDuration.bind(this),this.getVolume=this.getVolume.bind(this)}},{key:"initialize",value:function(){this.client.on("dispose",this.dispose),this.client.on("disconnected",this.handleDisconnected),this.client.on("message",this.handleAllVideoMessages)}},{key:"dispose",value:function(){var t,n,r;this.client.off("dispose",this.dispose),this.client.off("disconnected",this.handleDisconnected),this.client.off("message",this.handleAllVideoMessages),this.client.stop(this.getDevice().id).catch((function(t){return console.error(t)})),(t=e,n=this,"function"==typeof(r=Rv(Iv(1&3?t.prototype:t),"dispose",n))?function(t){return r.apply(n,t)}:r)([])}},{key:"handleDisconnected",value:function(){this.trigger("error",new Error("The connection to the Apple TV has been lost and cannot be recovered"))}},{key:"handleAllVideoMessages",value:function(t){if(t.deviceId===this.getDevice().id){var e=this.localState.debounced;switch(t.event){case bv.PlaybackStatusChange:this.handlePlaybackChange(e,t);break;case bv.PositionChange:this.handlePositionChange(e,t)}}}},{key:"handlePlaybackChange",value:function(t,e){t.playbackStatus!==e.params.playbackStatus&&(t.playbackStatus=e.params.playbackStatus,this.trigger("playingchange",pv.void),t.playbackStatus===mv.Stop&&this.dispose())}},{key:"handlePositionChange",value:function(t,e){t.position!==e.params.position&&(t.position=e.params.position,this.trigger("positionchange",pv.void))}},{key:"loadSource",value:function(){return t=this,e=void 0,n=void 0,r=Ev().mark((function t(){return Ev().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,!this.localState.locked){t.next=3;break}return t.abrupt("return");case 3:return t.next=5,this.client.lock(this.getDevice().id);case 5:return this.localState.locked=!0,t.next=8,this.client.loadVideo(this.getDevice().id);case 8:this.trigger("sourceloaded",pv.void),t.next=15;break;case 11:t.prev=11,t.t0=t.catch(0),console.error(t.t0),this.trigger("error",new Error("Could not load video on Apple TV device"));case 15:case"end":return t.stop()}}),t,this,[[0,11]])})),new(n||(n=Promise))((function(o,i){function a(t){try{c(r.next(t))}catch(t){i(t)}}function u(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,u)}c((r=r.apply(t,e||[])).next())}));var t,e,n,r}},{key:"play",value:function(){this.localState.locked&&this.localState.playbackStatus!==mv.Play&&(this.localState.playbackStatus=mv.Play,this.client.play(this.getDevice().id),this.trigger("playingchange",pv.void))}},{key:"pause",value:function(){this.localState.locked&&this.localState.playbackStatus!==mv.Pause&&(this.localState.playbackStatus=mv.Pause,this.client.pause(this.getDevice().id),this.trigger("playingchange",pv.void))}},{key:"seek",value:function(t){this.localState.locked&&this.localState.position!==t&&(this.localState.position=t,this.client.seek(this.getDevice().id,t),this.trigger("positionchange",pv.void))}},{key:"setVolume",value:function(){console.info("Setting the volume is not supported on Apple TV")}},{key:"setMuted",value:function(){console.info("Muting is not supported on Apple TV")}},{key:"setSubtitles",value:function(){console.info("Subtitles are not supported on Apple TV")}},{key:"isPlaying",value:function(){return this.localState.playbackStatus===mv.Play||this.localState.playbackStatus===mv.Begin||this.localState.playbackStatus===mv.Load}},{key:"isPlaybackFinished",value:function(){return this.localState.playbackStatus===mv.Stop}},{key:"getPosition",value:function(){return this.localState.position}},{key:"getDuration",value:function(){}},{key:"getVolume",value:function(){return 1}},{key:"getMuted",value:function(){return!1}},{key:"getSubtitles",value:function(){}},{key:"getDevice",value:function(){return this.localState.device}},{key:"getTitle",value:function(){return this.localState.title}}],r&&Tv(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(fv);function Nv(t){return Nv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nv(t)}function Mv(){Mv=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,n){return t[e]=n}}function s(t,e,n,r){var i=e&&e.prototype instanceof b?e:b,a=Object.create(i.prototype),u=new x(r||[]);return o(a,"_invoke",{value:_(t,n,u)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var p="suspendedStart",y="suspendedYield",h="executing",d="completed",v={};function b(){}function m(){}function g(){}var w={};l(w,a,(function(){return this}));var O=Object.getPrototypeOf,P=O&&O(O(L([])));P&&P!==n&&r.call(P,a)&&(w=P);var S=g.prototype=b.prototype=Object.create(w);function j(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function n(o,i,a,u){var c=f(t[o],t,i);if("throw"!==c.type){var l=c.arg,s=l.value;return s&&"object"==Nv(s)&&r.call(s,"__await")?e.resolve(s.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,u)}))}u(c.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function _(e,n,r){var o=p;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var u=r.delegate;if(u){var c=C(u,r);if(c){if(c===v)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=h;var l=f(e,n,r);if("normal"===l.type){if(o=r.done?d:y,l.arg===v)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=d,r.method="throw",r.arg=l.arg)}}}function C(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,C(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=f(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function x(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function L(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(Nv(e)+" is not iterable")}return m.prototype=g,o(S,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:m,configurable:!0}),m.displayName=l(g,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,l(t,c,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},j(k.prototype),l(k.prototype,u,(function(){return this})),e.AsyncIterator=k,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new k(s(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},j(S),l(S,c,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=L,x.prototype={constructor:x,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return u.type="throw",u.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),l=r.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),T(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;T(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:L(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}function Av(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Fv(r.key),r)}}function Fv(t){var e=function(t){if("object"!=Nv(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Nv(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Nv(e)?e:e+""}function Zv(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Zv=function(){return!!t})()}function Vv(){return Vv="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=zv(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Vv.apply(null,arguments)}function zv(t){return zv=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},zv(t)}function Uv(t,e){return Uv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Uv(t,e)}var Gv,qv,Hv,Wv=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{c(r.next(t))}catch(t){i(t)}}function u(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,u)}c((r=r.apply(t,e||[])).next())}))};!function(t){t.DeviceList="DeviceList",t.DeviceStateChange="DeviceStateChange",t.Paired="Paired",t.Unpaired="Unpaired",t.PlayStatusChange="PlayStatusChange",t.TimeSync="TimeSync"}(Gv||(Gv={})),function(t){t.Command="Command",t.Pair="Pair",t.Unpair="Unpair",t.RenameDevice="Renamedevice",t.Subscribe="Subscribe",t.Lock="Lock"}(qv||(qv={})),function(t){t[t.Connecting=0]="Connecting",t[t.Connected=1]="Connected",t[t.Reconnecting=2]="Reconnecting",t[t.Disconnected=4]="Disconnected"}(Hv||(Hv={}));var Qv=function(t){function e(t){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=function(t,e,n){return e=zv(e),function(t,e){if(e&&("object"==Nv(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Zv()?Reflect.construct(e,n||[],zv(t).constructor):e.apply(t,n))}(this,e)).options=t,n.accessToken=void 0,n.devices=[],n.heartbeat=new gv,n.bindFunctions(),n.initialize(),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Uv(t,e)}(e,t),n=e,r=[{key:"bindFunctions",value:function(){this.initialize=this.initialize.bind(this),this.connect=this.connect.bind(this),this.subscribe=this.subscribe.bind(this),this.tryFixConnection=this.tryFixConnection.bind(this),this.invoke=this.invoke.bind(this),this.invokeDebounced=Q(this.invoke,500,!0),this.handleDeviceList=this.handleDeviceList.bind(this),this.handleDeviceStateChange=this.handleDeviceStateChange.bind(this),this.handleDevicePaired=this.handleDevicePaired.bind(this),this.handleDeviceUnpaired=this.handleDeviceUnpaired.bind(this),this.handlePlayStatusChange=this.handlePlayStatusChange.bind(this),this.handleTimeSync=this.handleTimeSync.bind(this),this.dispose=this.dispose.bind(this),this.canCastToDevice=this.canCastToDevice.bind(this),this.getDevices=this.getDevices.bind(this),this.startCastSession=this.startCastSession.bind(this),this.lock=this.lock.bind(this),this.loadVideo=this.loadVideo.bind(this),this.play=this.play.bind(this),this.pause=this.pause.bind(this),this.seek=this.seek.bind(this),this.stop=this.stop.bind(this),this.pair=this.pair.bind(this),this.unpair=this.unpair.bind(this),this.renameDevice=this.renameDevice.bind(this)}},{key:"initialize",value:function(){return Wv(this,void 0,void 0,Mv().mark((function t(){return Mv().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.options.fetchAccessToken();case 3:return this.accessToken=t.sent,this.connection=(0,tv.OB)(this.accessToken.host,{logging:!1}),this.hubProxy=this.connection.createHubProxy("DeviceUserHub"),this.hubProxy.on(Gv.DeviceList,this.handleDeviceList),this.hubProxy.on(Gv.DeviceStateChange,this.handleDeviceStateChange),this.hubProxy.on(Gv.Paired,this.handleDevicePaired),this.hubProxy.on(Gv.Unpaired,this.handleDeviceUnpaired),this.hubProxy.on(Gv.PlayStatusChange,this.handlePlayStatusChange),this.hubProxy.on(Gv.TimeSync,this.handleTimeSync),t.next=14,this.connect();case 14:return t.next=16,this.subscribe(this.accessToken.token);case 16:this.heartbeat.schedule(this.tryFixConnection).every(5e3).start(),t.next=23;break;case 19:t.prev=19,t.t0=t.catch(0),console.error(t.t0),this.trigger("error",new Error("Could not connect to Online API"));case 23:case"end":return t.stop()}}),t,this,[[0,19]])})))}},{key:"connect",value:function(){return Wv(this,void 0,void 0,Mv().mark((function t(){var e=this;return Mv().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t,n){e.connection.start({jsonp:!1,withCredentials:!1}).done((function(){return t()})).fail((function(){return n(new Error("Could not connect to SignalR hub"))}))})));case 1:case"end":return t.stop()}}),t)})))}},{key:"subscribe",value:function(t){return Wv(this,void 0,void 0,Mv().mark((function e(){return Mv().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.invoke(qv.Subscribe,t);case 2:if(e.sent){e.next=5;break}throw new Error("The subscription request was rejected by Online API");case 5:case"end":return e.stop()}}),e,this)})))}},{key:"tryFixConnection",value:function(){return Wv(this,void 0,void 0,Mv().mark((function t(){return Mv().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.connection.state===Hv.Disconnected){t.next=2;break}return t.abrupt("return");case 2:return t.prev=2,this.heartbeat.stop(),t.next=6,this.options.fetchAccessToken();case 6:return this.accessToken=t.sent,t.next=9,this.connect();case 9:return t.next=11,this.subscribe(this.accessToken.token);case 11:t.next=17;break;case 13:t.prev=13,t.t0=t.catch(2),console.warn(t.t0),console.warn("Could not reconnect to Online API");case 17:return t.prev=17,this.heartbeat.start(),t.finish(17);case 20:case"end":return t.stop()}}),t,this,[[2,13,17,20]])})))}},{key:"invoke",value:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return Wv(this,void 0,void 0,Mv().mark((function e(){var r,o=this;return Mv().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=new Promise((function(e,r){var i,a;(null===(a=o.hubProxy)||void 0===a?void 0:(i=a).invoke.apply(i,[t].concat(n))).done(e).fail(r)})),e.abrupt("return",ov.fromPromise(r).timeout(2e4));case 2:case"end":return e.stop()}}),e)})))}},{key:"handleDeviceList",value:function(t){this.devices=t.filter((function(t){return"vivi"!==t.type})).map(e.convertToGenericDevice),this.trigger("deviceschange",pv.void)}},{key:"handleDeviceStateChange",value:function(t){var n=this.devices.findIndex((function(e){return e.id===t.deviceId}));n>=0&&(this.devices[n]=e.convertToGenericDevice(t),this.trigger("deviceschange",pv.void))}},{key:"handleDevicePaired",value:function(t){"vivi"!==t.type&&(this.devices.push(e.convertToGenericDevice(t)),this.trigger("deviceschange",pv.void))}},{key:"handleDeviceUnpaired",value:function(t){this.devices=this.devices.filter((function(e){return e.id!==t})),this.trigger("deviceschange",pv.void)}},{key:"handlePlayStatusChange",value:function(t,e){this.trigger("message",{event:bv.PlaybackStatusChange,deviceId:t,params:{playbackStatus:e.commandType}})}},{key:"handleTimeSync",value:function(t,e){this.trigger("message",{event:bv.PositionChange,deviceId:t,params:{position:e}})}},{key:"dispose",value:function(){var t,n,r;this.hubProxy.off(Gv.DeviceList,this.handleDeviceList),this.hubProxy.off(Gv.DeviceStateChange,this.handleDeviceStateChange),this.hubProxy.off(Gv.Paired,this.handleDevicePaired),this.hubProxy.off(Gv.Unpaired,this.handleDeviceUnpaired),this.hubProxy.off(Gv.PlayStatusChange,this.handlePlayStatusChange),this.hubProxy.off(Gv.TimeSync,this.handleTimeSync),this.hubProxy.connection.stop(!1,!0),this.heartbeat.stop(),(t=e,n=this,"function"==typeof(r=Vv(zv(1&3?t.prototype:t),"dispose",n))?function(t){return r.apply(n,t)}:r)([])}},{key:"canCastToDevice",value:function(t){return t===Kd.AppleTv}},{key:"getDevices",value:function(){return this.devices}},{key:"startCastSession",value:function(t){return new Bv(this,t)}},{key:"lock",value:function(t){var e;return Wv(this,void 0,void 0,Mv().mark((function n(){return Mv().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,this.invoke(qv.Lock,t,this.options.userId,null!==(e=this.options.username)&&void 0!==e?e:"");case 2:if(n.sent){n.next=5;break}throw new Error("Could not lock device");case 5:case"end":return n.stop()}}),n,this)})))}},{key:"loadVideo",value:function(t){return Wv(this,void 0,void 0,Mv().mark((function e(){return Mv().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.options.trackingCode){e.next=2;break}throw new Error("Tracking code must be provided to cast videos");case 2:return e.next=4,this.invoke(qv.Command,{DeviceId:t,CommandType:mv.Play,Data:this.options.trackingCode});case 4:case"end":return e.stop()}}),e,this)})))}},{key:"play",value:function(t){return Wv(this,void 0,void 0,Mv().mark((function e(){return Mv().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.invoke(qv.Command,{DeviceId:t,CommandType:mv.Play});case 2:case"end":return e.stop()}}),e,this)})))}},{key:"pause",value:function(t){return Wv(this,void 0,void 0,Mv().mark((function e(){return Mv().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.invoke(qv.Command,{DeviceId:t,CommandType:mv.Pause});case 2:case"end":return e.stop()}}),e,this)})))}},{key:"seek",value:function(t,e){this.invokeDebounced(qv.Command,{DeviceId:t,CommandType:mv.Play,Params:"1,".concat(Math.trunc(e))})}},{key:"stop",value:function(t){return Wv(this,void 0,void 0,Mv().mark((function e(){return Mv().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.invoke(qv.Command,{DeviceId:t,CommandType:mv.Stop});case 2:case"end":return e.stop()}}),e,this)})))}},{key:"pair",value:function(t){return Wv(this,void 0,void 0,Mv().mark((function e(){var n;return Mv().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.invoke(qv.Pair,t);case 2:if(n=e.sent){e.next=5;break}throw new Error("Could not pair device");case 5:return e.abrupt("return",n);case 6:case"end":return e.stop()}}),e,this)})))}},{key:"unpair",value:function(t){return Wv(this,void 0,void 0,Mv().mark((function e(){return Mv().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.invoke(qv.Unpair,t);case 2:case"end":return e.stop()}}),e,this)})))}},{key:"renameDevice",value:function(t){var e=t.deviceId,n=t.deviceName;return Wv(this,void 0,void 0,Mv().mark((function t(){return Mv().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.invoke(qv.RenameDevice,e,n);case 2:if(t.sent){t.next=5;break}throw new Error("Could not rename device");case 5:case"end":return t.stop()}}),t,this)})))}}],o=[{key:"convertToGenericDeviceStatus",value:function(t){switch(t){case vv.Online:return Xd.Available;case vv.Locked:return Xd.Busy;case vv.Suspended:case vv.Offline:return Xd.Offline}}},{key:"convertToGenericDevice",value:function(t){return{id:t.deviceId,name:t.name,type:Kd.AppleTv,status:e.convertToGenericDeviceStatus(t.status)}}}],r&&Av(n.prototype,r),o&&Av(n,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o}(fv);function Yv(t){return Yv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yv(t)}function $v(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Kv(r.key),r)}}function Kv(t){var e=function(t){if("object"!=Yv(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Yv(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Yv(e)?e:e+""}var Xv={reconnectIntervalInMilliseconds:3e3,heartbeatEnabled:!1,heartbeatIntervalInMillseconds:1e4,heartbeatMessage:""},Jv=function(){return t=function t(e){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Xv;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.bindFunctions(),this.url=e,this.options=Object.assign(Object.assign({},Xv),r),this.webSocket=this.connect(),this.heartbeat=(new gv).schedule((function(){return n.send(n.options.heartbeatMessage)})).every(this.options.heartbeatIntervalInMillseconds)},(e=[{key:"bindFunctions",value:function(){this.cleanup=this.cleanup.bind(this),this.handleOpen=this.handleOpen.bind(this),this.handleMessage=this.handleMessage.bind(this),this.handleClose=this.handleClose.bind(this),this.handleError=this.handleError.bind(this),this.connect=this.connect.bind(this),this.send=this.send.bind(this),this.dipose=this.dipose.bind(this)}},{key:"cleanup",value:function(){this.heartbeat.stop(),this.webSocket.removeEventListener("error",this.handleError),this.webSocket.removeEventListener("message",this.handleMessage),this.webSocket.removeEventListener("open",this.handleOpen),this.webSocket.removeEventListener("close",this.handleClose)}},{key:"handleOpen",value:function(t){var e;null===(e=this.onOpen)||void 0===e||e.call(this,t),this.options.heartbeatEnabled&&this.heartbeat.start()}},{key:"handleMessage",value:function(t){var e;null===(e=this.onMessage)||void 0===e||e.call(this,t)}},{key:"handleClose",value:function(t){var e,n=this;null===(e=this.onClose)||void 0===e||e.call(this,t),this.cleanup(),setTimeout((function(){n.webSocket=n.connect()}),this.options.reconnectIntervalInMilliseconds)}},{key:"handleError",value:function(t){var e;null===(e=this.onError)||void 0===e||e.call(this,t),this.handleClose()}},{key:"connect",value:function(){var t=new WebSocket(this.url);return t.addEventListener("open",this.handleOpen),t.addEventListener("message",this.handleMessage),t.addEventListener("close",this.handleClose),t.addEventListener("error",this.handleError),t}},{key:"send",value:function(t){this.webSocket.send(t)}},{key:"dipose",value:function(){this.cleanup(),this.webSocket.close()}}])&&$v(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function tb(t){return tb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},tb(t)}function eb(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,nb(r.key),r)}}function nb(t){var e=function(t){if("object"!=tb(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=tb(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==tb(e)?e:e+""}var rb,ob=function(){return t=function t(e,n){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._timerStartedAt=0,this.position=0,this.duration=void 0,this.playing=!1,this.mute=!1,this.videoSource="",this.subtitleSource="",this.subtitles=!1,this.volume=0,this.title=e,this.device=n,this.ready=!1,this.playbackFinished=!1,this.debounced=wv(this,2e3),Ov(this)},(e=[{key:"position",get:function(){return this._position+this.getTimerDurationInSeconds()},set:function(t){this._position=t,this.restartTimer()}},{key:"playing",get:function(){return this._playing},set:function(t){this._playing=t,t?this.restartTimer():(this._position+=this.getTimerDurationInSeconds(),this.stopTimer())}},{key:"restartTimer",value:function(){this._timerStartedAt=Date.now()}},{key:"stopTimer",value:function(){this._timerStartedAt=0}},{key:"getTimerDurationInSeconds",value:function(){return this._timerStartedAt?(Date.now()-this._timerStartedAt)/1e3:0}}])&&eb(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function ib(t){return ib="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ib(t)}function ab(){ab=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,n){return t[e]=n}}function s(t,e,n,r){var i=e&&e.prototype instanceof b?e:b,a=Object.create(i.prototype),u=new x(r||[]);return o(a,"_invoke",{value:_(t,n,u)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var p="suspendedStart",y="suspendedYield",h="executing",d="completed",v={};function b(){}function m(){}function g(){}var w={};l(w,a,(function(){return this}));var O=Object.getPrototypeOf,P=O&&O(O(L([])));P&&P!==n&&r.call(P,a)&&(w=P);var S=g.prototype=b.prototype=Object.create(w);function j(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function n(o,i,a,u){var c=f(t[o],t,i);if("throw"!==c.type){var l=c.arg,s=l.value;return s&&"object"==ib(s)&&r.call(s,"__await")?e.resolve(s.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,u)}))}u(c.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function _(e,n,r){var o=p;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var u=r.delegate;if(u){var c=C(u,r);if(c){if(c===v)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=h;var l=f(e,n,r);if("normal"===l.type){if(o=r.done?d:y,l.arg===v)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=d,r.method="throw",r.arg=l.arg)}}}function C(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,C(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=f(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function x(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function L(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(ib(e)+" is not iterable")}return m.prototype=g,o(S,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:m,configurable:!0}),m.displayName=l(g,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,l(t,c,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},j(k.prototype),l(k.prototype,u,(function(){return this})),e.AsyncIterator=k,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new k(s(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},j(S),l(S,c,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=L,x.prototype={constructor:x,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return u.type="throw",u.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),l=r.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),T(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;T(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:L(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}function ub(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,cb(r.key),r)}}function cb(t){var e=function(t){if("object"!=ib(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=ib(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ib(e)?e:e+""}function lb(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(lb=function(){return!!t})()}function sb(){return sb="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=fb(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},sb.apply(null,arguments)}function fb(t){return fb=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},fb(t)}function pb(t,e){return pb=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},pb(t,e)}!function(t){t.Update="update",t.Volume="volume",t.Playing="playing",t.Paused="paused",t.NewChapter="new_chapter",t.Stopped="stopped",t.Ready="ready",t.Mute="mute",t.Finished="finished",t.Subtitles="subtitles"}(rb||(rb={}));var yb=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{c(r.next(t))}catch(t){i(t)}}function u(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,u)}c((r=r.apply(t,e||[])).next())}))},hb=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=fb(e),function(t,e){if(e&&("object"==ib(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,lb()?Reflect.construct(e,n||[],fb(t).constructor):e.apply(t,n))}(this,e)).client=t,r.localState=new ob(n.title,n.device),r.bindFunctions(),r.initialize(),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&pb(t,e)}(e,t),n=e,r=[{key:"bindFunctions",value:function(){this.initialize=this.initialize.bind(this),this.dispose=this.dispose.bind(this),this.handleClientConnected=this.handleClientConnected.bind(this),this.handleDisconnectMessage=this.handleDisconnectMessage.bind(this),this.handleAllVideoMessages=this.handleAllVideoMessages.bind(this),this.handleUpdateMessage=this.handleUpdateMessage.bind(this),this.handleVolumeMessage=this.handleVolumeMessage.bind(this),this.handlePlayingMessage=this.handlePlayingMessage.bind(this),this.handlePausedMessage=this.handlePausedMessage.bind(this),this.handleFinishedMessage=this.handleFinishedMessage.bind(this),this.handleNewChapterMessage=this.handleNewChapterMessage.bind(this),this.handleStoppedMessage=this.handleStoppedMessage.bind(this),this.loadSource=this.loadSource.bind(this),this.play=this.play.bind(this),this.pause=this.pause.bind(this),this.seek=this.seek.bind(this),this.setVolume=this.setVolume.bind(this),this.isPlaying=this.isPlaying.bind(this),this.getPosition=this.getPosition.bind(this),this.getDuration=this.getDuration.bind(this),this.getVolume=this.getVolume.bind(this)}},{key:"initialize",value:function(){var t=this;this.client.on("dispose",this.dispose),this.client.on("connected",this.handleClientConnected),this.client.on("message",this.handleDisconnectMessage).filter((function(e){return e.source===t.getDevice().id&&"disconnect"===e.message.type})),this.client.on("message",this.handleAllVideoMessages).filter((function(e){return e.source===t.getDevice().id&&"video_event"===e.message.type}))}},{key:"dispose",value:function(){var t,n,r;this.client.off("dispose",this.dispose),this.client.off("connected",this.handleClientConnected),this.client.off("message",this.handleDisconnectMessage),this.client.off("message",this.handleAllVideoMessages),this.client.stop(this.getDevice().id).catch((function(t){return console.error(t)})),(t=e,n=this,"function"==typeof(r=sb(fb(1&3?t.prototype:t),"dispose",n))?function(t){return r.apply(n,t)}:r)([])}},{key:"handleClientConnected",value:function(){return yb(this,void 0,void 0,ab().mark((function t(){return ab().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.client.joinRoom(this.getDevice().id);case 3:t.next=8;break;case 5:t.prev=5,t.t0=t.catch(0),this.trigger("error",t.t0);case 8:case"end":return t.stop()}}),t,this,[[0,5]])})))}},{key:"handleDisconnectMessage",value:function(){this.dispose()}},{key:"handleAllVideoMessages",value:function(t){var e=this.localState.debounced,n=t.message.payload.params||{};switch(t.message.payload.event){case rb.Update:this.handleUpdateMessage(e,n);break;case rb.NewChapter:this.handleNewChapterMessage(e,n);break;case rb.Volume:this.handleVolumeMessage(e,n);break;case rb.Playing:this.handlePlayingMessage(e);break;case rb.Paused:this.handlePausedMessage(e);break;case rb.Finished:this.handleFinishedMessage(e);break;case rb.Stopped:this.handleStoppedMessage()}}},{key:"handleUpdateMessage",value:function(t,e){t.duration!==e.duration&&(t.duration=e.duration,this.trigger("durationchange",pv.void)),t.position!==e.position&&(t.position=e.position,this.trigger("positionchange",pv.void)),t.subtitles!==e.subtitles&&(t.subtitles=e.subtitles,this.trigger("subtitleschange",pv.void))}},{key:"handleVolumeMessage",value:function(t,e){t.volume!==e.level&&(t.volume=e.level,t.mute=0===e.level,this.trigger("volumechange",pv.void))}},{key:"handlePlayingMessage",value:function(t){!0!==t.playing&&(t.playing=!0,t.playbackFinished=!1,this.trigger("playingchange",pv.void))}},{key:"handlePausedMessage",value:function(t){!1!==t.playing&&(t.playing=!1,this.trigger("playingchange",pv.void))}},{key:"handleFinishedMessage",value:function(t){!0!==t.playbackFinished&&(t.playing=!1,t.playbackFinished=!0,this.trigger("playingchange",pv.void))}},{key:"handleNewChapterMessage",value:function(t,e){var n,r=(null!==(n=e.queue)&&void 0!==n?n:[]).find((function(e){return e.url===t.videoSource}));if(!r)return console.info("The device is no longer playing the source we loaded - disposing the session"),void this.dispose();t.subtitleSource!==r.suburl&&(t.subtitleSource=r.suburl,this.trigger("subtitleschange",pv.void))}},{key:"handleStoppedMessage",value:function(){this.dispose()}},{key:"loadSource",value:function(t,e){return yb(this,void 0,void 0,ab().mark((function n(){var r,o;return ab().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(this.localState.videoSource!==t||this.localState.subtitleSource!==e){n.next=2;break}return n.abrupt("return");case 2:return n.prev=2,r=this.getDevice().id,o=this.getPosition(),this.localState.videoSource=t,this.localState.subtitleSource=e,this.localState.ready=!1,n.next=10,this.client.joinRoom(r);case 10:return n.next=12,this.client.loadQueue({title:this.getTitle(),roomId:r,videoSource:t,subtitleSource:e});case 12:this.localState.ready=!0,this.trigger("sourceloaded",pv.void),o>0&&this.seek(o),e&&this.setSubtitles(e),n.next=22;break;case 18:n.prev=18,n.t0=n.catch(2),console.error(n.t0),this.trigger("error",new Error("Could not load video on Vivi device"));case 22:case"end":return n.stop()}}),n,this,[[2,18]])})))}},{key:"play",value:function(){this.localState.ready&&!0!==this.localState.playing&&(this.localState.playing=!0,this.client.play(this.getDevice().id),this.trigger("playingchange",pv.void))}},{key:"pause",value:function(){this.localState.ready&&!1!==this.localState.playing&&(this.localState.playing=!1,this.client.pause(this.getDevice().id),this.trigger("playingchange",pv.void))}},{key:"seek",value:function(t){this.localState.ready&&this.localState.position!==t&&(this.localState.position=t,this.client.seek(this.getDevice().id,t),this.trigger("positionchange",pv.void))}},{key:"setVolume",value:function(t){this.localState.ready&&this.localState.volume!==t&&(this.localState.volume=t,this.client.setVolume(this.getDevice().id,t),this.trigger("volumechange",pv.void))}},{key:"setMuted",value:function(t){this.localState.ready&&this.localState.mute!==t&&(this.localState.mute=t,this.client.setMuted(this.getDevice().id,t),this.trigger("volumechange",pv.void))}},{key:"setSubtitles",value:function(t){return yb(this,void 0,void 0,ab().mark((function e(){var n;return ab().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.localState.ready){e.next=2;break}return e.abrupt("return");case 2:if(!t){e.next=5;break}return e.next=5,this.loadSource(this.localState.videoSource,t);case 5:n=!!t,this.localState.subtitles!==n&&(this.localState.subtitles=n,this.client.setSubtitles(this.getDevice().id,n),this.trigger("subtitleschange",pv.void));case 7:case"end":return e.stop()}}),e,this)})))}},{key:"isPlaying",value:function(){return this.localState.playing}},{key:"isPlaybackFinished",value:function(){return this.localState.playbackFinished}},{key:"getPosition",value:function(){return this.localState.position}},{key:"getDuration",value:function(){return this.localState.duration}},{key:"getVolume",value:function(){return this.localState.volume}},{key:"getMuted",value:function(){return this.localState.mute}},{key:"getSubtitles",value:function(){if(this.localState.subtitles)return this.localState.subtitleSource}},{key:"getDevice",value:function(){return this.localState.device}},{key:"getTitle",value:function(){return this.localState.title}}],r&&ub(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(fv);function db(t){return db="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},db(t)}function vb(){vb=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,n){return t[e]=n}}function s(t,e,n,r){var i=e&&e.prototype instanceof b?e:b,a=Object.create(i.prototype),u=new x(r||[]);return o(a,"_invoke",{value:_(t,n,u)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var p="suspendedStart",y="suspendedYield",h="executing",d="completed",v={};function b(){}function m(){}function g(){}var w={};l(w,a,(function(){return this}));var O=Object.getPrototypeOf,P=O&&O(O(L([])));P&&P!==n&&r.call(P,a)&&(w=P);var S=g.prototype=b.prototype=Object.create(w);function j(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function n(o,i,a,u){var c=f(t[o],t,i);if("throw"!==c.type){var l=c.arg,s=l.value;return s&&"object"==db(s)&&r.call(s,"__await")?e.resolve(s.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,u)}))}u(c.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function _(e,n,r){var o=p;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var u=r.delegate;if(u){var c=C(u,r);if(c){if(c===v)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=h;var l=f(e,n,r);if("normal"===l.type){if(o=r.done?d:y,l.arg===v)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=d,r.method="throw",r.arg=l.arg)}}}function C(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,C(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=f(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function x(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function L(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(db(e)+" is not iterable")}return m.prototype=g,o(S,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:m,configurable:!0}),m.displayName=l(g,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,l(t,c,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},j(k.prototype),l(k.prototype,u,(function(){return this})),e.AsyncIterator=k,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new k(s(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},j(S),l(S,c,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=L,x.prototype={constructor:x,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return u.type="throw",u.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),l=r.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),T(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;T(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:L(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}function bb(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,mb(r.key),r)}}function mb(t){var e=function(t){if("object"!=db(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=db(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==db(e)?e:e+""}function gb(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(gb=function(){return!!t})()}function wb(){return wb="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Ob(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},wb.apply(null,arguments)}function Ob(t){return Ob=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ob(t)}function Pb(t,e){return Pb=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Pb(t,e)}var Sb=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{c(r.next(t))}catch(t){i(t)}}function u(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,u)}c((r=r.apply(t,e||[])).next())}))},jb=1e4,kb=function(t){function e(t){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=function(t,e,n){return e=Ob(e),function(t,e){if(e&&("object"==db(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,gb()?Reflect.construct(e,n||[],Ob(t).constructor):e.apply(t,n))}(this,e)).options=t,n.accessToken="",n.devices=[],n.devicesFingerprint="",n.deviceDiscovery=new gv,n.bindFunctions(),n.initialize(),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Pb(t,e)}(e,t),n=e,r=[{key:"bindFunctions",value:function(){this.initialize=this.initialize.bind(this),this.sendMessage=this.sendMessage.bind(this),this.sendMessageDebounced=Q(this.sendMessage,500,!0),this.beginDeviceDiscovery=this.beginDeviceDiscovery.bind(this),this.dispose=this.dispose.bind(this),this.canCastToDevice=this.canCastToDevice.bind(this),this.getDevices=this.getDevices.bind(this),this.startCastSession=this.startCastSession.bind(this),this.authenticateWithVivi=this.authenticateWithVivi.bind(this),this.getRoomList=this.getRoomList.bind(this),this.joinRoom=this.joinRoom.bind(this),this.query=this.query.bind(this),this.loadQueue=this.loadQueue.bind(this),this.play=this.play.bind(this),this.pause=this.pause.bind(this),this.stop=this.stop.bind(this),this.seek=this.seek.bind(this),this.setVolume=this.setVolume.bind(this),this.setMuted=this.setMuted.bind(this),this.setSubtitles=this.setSubtitles.bind(this)}},{key:"initialize",value:function(){var t=this;this.webSocket=new Jv(this.options.url),this.webSocket.onMessage=function(e){return t.trigger("message",JSON.parse(e.data))},this.webSocket.onOpen=function(){return Sb(t,void 0,void 0,vb().mark((function t(){return vb().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.options.fetchAccessToken();case 3:return this.accessToken=t.sent,t.next=6,this.authenticateWithVivi();case 6:this.beginDeviceDiscovery(),this.trigger("connected",pv.void),t.next=14;break;case 10:t.prev=10,t.t0=t.catch(0),console.error(t.t0),this.trigger("error",new Error("Could not connect to Vivi"));case 14:case"end":return t.stop()}}),t,this,[[0,10]])})))}}},{key:"sendMessage",value:function(t){var e;null===(e=this.webSocket)||void 0===e||e.send(JSON.stringify(t))}},{key:"beginDeviceDiscovery",value:function(){var t=this;this.deviceDiscovery.every(1e4).schedule((function(){return Sb(t,void 0,void 0,vb().mark((function t(){var n,r,o,i;return vb().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.getRoomList();case 3:if(n=t.sent,(r=e.calculateFingerprint(n))!==this.devicesFingerprint){t.next=7;break}return t.abrupt("return");case 7:o=new Set(n.map((function(t){var e;return null!==(e=t.organisation)&&void 0!==e?e:""}))).size,i=new Set(n.map((function(t){var e;return null!==(e=t.location)&&void 0!==e?e:""}))).size,this.devices=n.map((function(t){return{id:t.id,name:t.name,schoolName:o>1?t.organisation:"",description:i>1?t.location:"",type:Kd.Vivi,status:Xd.Available}})),this.devicesFingerprint=r,this.trigger("deviceschange",pv.void),t.next=17;break;case 14:t.prev=14,t.t0=t.catch(0),console.warn(t.t0);case 17:case"end":return t.stop()}}),t,this,[[0,14]])})))})).trigger().start()}},{key:"dispose",value:function(){var t,n,r,o;this.deviceDiscovery.stop(),null===(t=this.webSocket)||void 0===t||t.dipose(),(n=e,r=this,"function"==typeof(o=wb(Ob(1&3?n.prototype:n),"dispose",r))?function(t){return o.apply(r,t)}:o)([])}},{key:"canCastToDevice",value:function(t){return t===Kd.Vivi}},{key:"getDevices",value:function(){return this.devices}},{key:"startCastSession",value:function(t){return new hb(this,t)}},{key:"authenticateWithVivi",value:function(){return Sb(this,void 0,void 0,vb().mark((function t(){return vb().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.sendMessage({destination:"relay",message:{token:this.accessToken,type:"identify_video_api"}}),t.next=3,this.one("message",(function(t){return"video_api_identified"===t.message.type})).timeout(jb).catch((function(){throw new Error("Failed to authenticate with Vivi")}));case 3:case"end":return t.stop()}}),t,this)})))}},{key:"getRoomList",value:function(){return Sb(this,void 0,void 0,vb().mark((function t(){var e;return vb().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.sendMessage({destination:"relay",message:{type:"video_api_rooms"}}),t.next=3,this.one("message",(function(t){return"video_api_rooms"===t.message.type})).timeout(jb).catch((function(){throw new Error("Failed to fetch rooms")}));case 3:return e=t.sent,t.abrupt("return",e.message.rooms||[]);case 5:case"end":return t.stop()}}),t,this)})))}},{key:"joinRoom",value:function(t){return Sb(this,void 0,void 0,vb().mark((function e(){return vb().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.sendMessage({destination:"relay",message:{destination_type:"box",new_destination:t,token:this.accessToken,type:"connect"}}),e.next=3,this.one("message",(function(e){return e.source===t&&"connect"===e.message.type||"error"===e.message.type&&"already_connected"===e.message.error_type||void 0})).timeout(jb).catch((function(){throw new Error("Failed to join room")}));case 3:case"end":return e.stop()}}),e,this)})))}},{key:"query",value:function(t){return Sb(this,void 0,void 0,vb().mark((function n(){var r;return vb().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r=e.createAckId(),this.sendMessage({destination:t,message:{type:"message_with_ack",ack_id:r,name:"query"}}),n.next=4,this.one("message",(function(t){return t.message.ack_id===r})).timeout(jb).catch((function(){throw new Error("Failed to fetch query")}));case 4:return n.abrupt("return",n.sent);case 5:case"end":return n.stop()}}),n,this)})))}},{key:"loadQueue",value:function(t){var n=t.roomId,r=t.title,o=t.videoSource,i=t.subtitleSource;return Sb(this,void 0,void 0,vb().mark((function t(){return vb().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.sendMessage({destination:n,message:{type:"message_with_ack",ack_id:e.createAckId(),name:"queue_load",payload:{urls:[{title:r,url:o,suburl:i}]}}}),t.next=3,this.one("message",(function(t){var e;return t.source===n&&"ready"===(null===(e=t.message.payload)||void 0===e?void 0:e.event)})).timeout(jb).catch((function(){throw new Error("Failed to load media")}));case 3:case"end":return t.stop()}}),t,this)})))}},{key:"play",value:function(t){return Sb(this,void 0,void 0,vb().mark((function e(){return vb().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.sendMessage({destination:t,message:{type:"message",name:"video_play",payload:{}}}),e.next=3,this.one("message",(function(e){var n;return e.source===t&&"playing"===(null===(n=e.message.payload)||void 0===n?void 0:n.event)})).timeout(jb).catch((function(){throw new Error("Failed to play video")}));case 3:case"end":return e.stop()}}),e,this)})))}},{key:"pause",value:function(t){return Sb(this,void 0,void 0,vb().mark((function e(){return vb().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.sendMessage({destination:t,message:{type:"message",name:"video_pause"}}),e.next=3,this.one("message",(function(e){var n;return e.source===t&&"paused"===(null===(n=e.message.payload)||void 0===n?void 0:n.event)})).timeout(jb).catch((function(){throw new Error("Failed to pause video")}));case 3:case"end":return e.stop()}}),e,this)})))}},{key:"stop",value:function(t){return Sb(this,void 0,void 0,vb().mark((function e(){return vb().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.sendMessage({destination:t,message:{type:"message",name:"video_stop"}}),e.next=3,this.one("message",(function(e){var n;return e.source===t&&"stopped"===(null===(n=e.message.payload)||void 0===n?void 0:n.event)})).timeout(jb).catch((function(){throw new Error("Failed to stop video")}));case 3:case"end":return e.stop()}}),e,this)})))}},{key:"seek",value:function(t,e){return Sb(this,void 0,void 0,vb().mark((function n(){return vb().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!this.sendMessageDebounced({destination:t,message:{type:"message",name:"video_seek",payload:{position:e}}})){n.next=4;break}return n.next=4,this.one("message",(function(e){var n;return e.source===t&&"playing"===(null===(n=e.message.payload)||void 0===n?void 0:n.event)})).timeout(jb).catch((function(){throw new Error("Failed to seek video")}));case 4:case"end":return n.stop()}}),n,this)})))}},{key:"setVolume",value:function(t,e){return Sb(this,void 0,void 0,vb().mark((function n(){return vb().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!this.sendMessageDebounced({destination:t,message:{type:"message",name:"set_volume",payload:{volume:e}}})){n.next=4;break}return n.next=4,this.one("message",(function(e){var n;return e.source===t&&"volume"===(null===(n=e.message.payload)||void 0===n?void 0:n.event)})).timeout(jb).catch((function(){throw new Error("Failed to set volume")}));case 4:case"end":return n.stop()}}),n,this)})))}},{key:"setMuted",value:function(t,e){return Sb(this,void 0,void 0,vb().mark((function n(){return vb().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return this.sendMessage({destination:t,message:{type:"message",name:"set_mute",payload:{mute:e}}}),n.next=3,this.one("message",(function(e){var n;return e.source===t&&"mute"===(null===(n=e.message.payload)||void 0===n?void 0:n.event)})).timeout(jb).catch((function(){throw new Error("Failed to set mute")}));case 3:case"end":return n.stop()}}),n,this)})))}},{key:"setSubtitles",value:function(t,n){return Sb(this,void 0,void 0,vb().mark((function r(){var o;return vb().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return o=e.createAckId(),this.sendMessage({destination:t,message:{type:"message_with_ack",ack_id:o,name:"set_subtitles",payload:{subtitles:n}}}),r.next=4,this.one("message",(function(e){var n;return e.source===t&&"subtitles"===(null===(n=e.message.payload)||void 0===n?void 0:n.event)})).timeout(jb).catch((function(){throw new Error("Failed to set subtitles")}));case 4:case"end":return r.stop()}}),r,this)})))}}],o=[{key:"createAckId",value:function(){return Fd()}},{key:"calculateFingerprint",value:function(t){return t.map((function(t){return t.id})).sort().join(",")}}],r&&bb(n.prototype,r),o&&bb(n,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o}(fv);function _b(t){return _b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_b(t)}function Cb(t){return function(t){if(Array.isArray(t))return Eb(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return Eb(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Eb(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Eb(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Tb(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,xb(r.key),r)}}function xb(t){var e=function(t){if("object"!=_b(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=_b(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==_b(e)?e:e+""}function Lb(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Lb=function(){return!!t})()}function Rb(){return Rb="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Ib(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Rb.apply(null,arguments)}function Ib(t){return Ib=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ib(t)}function Db(t,e){return Db=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Db(t,e)}var Bb=function(t){function e(t){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=function(t,e,n){return e=Ib(e),function(t,e){if(e&&("object"==_b(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Lb()?Reflect.construct(e,n||[],Ib(t).constructor):e.apply(t,n))}(this,e)).instanceId=t,n.clients=[],n.bindFunctions(),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Db(t,e)}(e,t),n=e,r=[{key:"bindFunctions",value:function(){this.addClient=this.addClient.bind(this),this.hasInstanceOfClient=this.hasInstanceOfClient.bind(this),this.startCastSession=this.startCastSession.bind(this),this.gatherAndPublishDevices=this.gatherAndPublishDevices.bind(this),this.dispose=this.dispose.bind(this)}},{key:"addClient",value:function(t){var e=this;t.on("deviceschange",this.gatherAndPublishDevices),t.on("error",(function(t){return e.trigger("error",t)})),this.clients.push(t)}},{key:"hasInstanceOfClient",value:function(t){return this.clients.some((function(e){return e instanceof t}))}},{key:"startCastSession",value:function(t){var e=this;if(this.castSession){if(this.castSession.getDevice().id===t.device.id)return void console.info("A session with device ".concat(t.device.id," already exists - this is a no-op"));this.castSession.dispose()}var n=this.clients.find((function(e){return e.canCastToDevice(t.device.type)}));n&&(this.castSession=n.startCastSession(t),this.castSession.on("error",(function(t){e.castSession.dispose(),e.trigger("error",t)})),this.castSession.on("dispose",(function(){e.castSession=void 0,e.trigger("castsessionchange",void 0)})),this.trigger("castsessionchange",this.castSession))}},{key:"getCastSession",value:function(){return this.castSession}},{key:"gatherAndPublishDevices",value:function(){var t=this.clients.map((function(t){return t.getDevices()})).reduce((function(t,e){return[].concat(Cb(t),Cb(e))}),[]);this.trigger("deviceschange",t)}},{key:"dispose",value:function(){var t,n,r,o;null===(t=this.castSession)||void 0===t||t.dispose(),this.clients.forEach((function(t){return t.dispose()})),this.castSession=void 0,this.clients=[],(n=e,r=this,"function"==typeof(o=Rb(Ib(1&3?n.prototype:n),"dispose",r))?function(t){return o.apply(r,t)}:o)([])}}],o=[{key:"getOrCreateInstance",value:function(t){if(!t)throw new Error("instanceId is required");return this.instances[t]||(this.instances[t]=new e(t)),this.instances[t]}},{key:"disposeAndRemoveInstance",value:function(t){t.dispose(),delete this.instances[t.instanceId]}},{key:"isActive",value:function(){return Object.keys(this.instances).length>0}}],r&&Tb(n.prototype,r),o&&Tb(n,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o}(fv);function Nb(t){return Nb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nb(t)}function Mb(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Ab(r.key),r)}}function Ab(t){var e=function(t){if("object"!=Nb(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Nb(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Nb(e)?e:e+""}function Fb(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Fb=function(){return!!t})()}function Zb(t,e,n,r){var o=Vb(zb(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof o?function(t){return o.apply(n,t)}:o}function Vb(){return Vb="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=zb(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Vb.apply(null,arguments)}function zb(t){return zb=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},zb(t)}function Ub(t,e){return Ub=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ub(t,e)}Bb.instances={};var Gb=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=zb(e),function(t,e){if(e&&("object"==Nb(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Fb()?Reflect.construct(e,n||[],zb(t).constructor):e.apply(t,n))}(this,e,[t,n])).isVisible=r.isVisible.bind(r),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ub(t,e)}(e,t),n=e,(r=[{key:"createEl",value:function(){var t,n;return Zb(e,"createEl",this,3)(["li",{className:"vjs-menu-item cv-device-menu-item",innerHTML:'\n <div class="cv-device-menu-item-body">\n <span class="cv-device-icon '.concat({vivi:"cv-vivi-icon","apple-tv":"cv-apple-icon"}[this.options_.type],'"></span>\n <div>\n <span class="vjs-menu-item-text">').concat(this.options_.label,'</span>\n <span class="vjs-menu-item-text cv-device-truncated-text">').concat(null!==(t=this.options_.schoolName)&&void 0!==t?t:"",'</span>\n <span class="vjs-menu-item-text cv-device-truncated-text cv-device-description">').concat(null!==(n=this.options_.description)&&void 0!==n?n:"","</span>\n </div>\n </div>\n ")}])}},{key:"handleClick",value:function(){this.options_.onClick()}},{key:"show",value:function(){Zb(e,"show",this,3)([])}},{key:"hide",value:function(){Zb(e,"hide",this,3)([])}},{key:"isVisible",value:function(){return!Zb(e,"hasClass",this,3)(["vjs-hidden"])}}])&&Mb(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getComponent("MenuItem"));function qb(t){return qb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qb(t)}function Hb(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Wb(r.key),r)}}function Wb(t){var e=function(t){if("object"!=qb(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=qb(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==qb(e)?e:e+""}function Qb(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Qb=function(){return!!t})()}function Yb(t){return Yb=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Yb(t)}function $b(t,e){return $b=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},$b(t,e)}var Kb=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,n){return e=Yb(e),function(t,e){if(e&&("object"==qb(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Qb()?Reflect.construct(e,n||[],Yb(t).constructor):e.apply(t,n))}(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&$b(t,e)}(e,t),n=e,(r=[{key:"createEl",value:function(){var t=fu.apply(this),e=this.contentEl_;return this.contentWrapper=o.Z.dom.createEl("div",{className:"vjs-menu-content"}),t.className="vjs-menu cv-devices-menu",e.className="cv-devices-menu-item-list",t.removeChild(e),t.appendChild(this.contentWrapper),this.contentWrapper.appendChild(e),this.simpleBar=new lu.Z(e,{autoHide:!1}),t}},{key:"addCta",value:function(t){this.ctaElement?console.warn("CTA has already been added to the menu - this is a no-op"):(this.ctaElement=t.el(),this.contentWrapper.prepend(this.ctaElement),this.el().classList.add("has-cta"))}},{key:"removeCta",value:function(){this.ctaElement&&(this.contentWrapper.removeChild(this.ctaElement),this.el().classList.remove("has-cta"))}}])&&Hb(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getComponent("Menu"));o.Z.registerComponent("DevicesMenu",Kb);var Xb=n(44645);function Jb(t){return Jb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Jb(t)}function tm(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function em(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,rm(r.key),r)}}function nm(t,e,n){return e&&em(t.prototype,e),n&&em(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function rm(t){var e=function(t){if("object"!=Jb(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Jb(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Jb(e)?e:e+""}function om(t,e,n){return e=um(e),function(t,e){if(e&&("object"==Jb(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,im()?Reflect.construct(e,n||[],um(t).constructor):e.apply(t,n))}function im(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(im=function(){return!!t})()}function am(){return am="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=um(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},am.apply(null,arguments)}function um(t){return um=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},um(t)}function cm(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&lm(t,e)}function lm(t,e){return lm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},lm(t,e)}var sm=function(t){function e(t,n){return tm(this,e),om(this,e,[t,n])}return cm(e,t),nm(e,[{key:"dispose",value:function(){var t,n,r,o=this;setImmediate((function(){var t;null===(t=o.root)||void 0===t||t.unmount()})),(t=e,n=this,"function"==typeof(r=am(um(1&3?t.prototype:t),"dispose",n))?function(t){return r.apply(n,t)}:r)([])}}])}(o.Z.getComponent("Component")),fm={tagName:"div"};function pm(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:fm;if(!t)throw new Error("componentCtor is required");var n=function(n){function r(){return tm(this,r),om(this,r,arguments)}return cm(r,n),nm(r,[{key:"createEl",value:function(){var n=o.Z.dom.createEl(e.tagName,e.properties,e.attributes),r=(0,Xb.s)(n);return r.render(t(this.player_,this.options_)),this.root=r,n}}])}(sm);return n}function ym(t){var e=t.inactiveIntegrations,n=t.canUserManageIntegrations,o=t.player,i=t.onDismiss,a=t.onInstall,u=t.onLearnMore,c=t.onContactSupport;if(0===e.length)return r.createElement(r.Fragment,null);var l,s=function(t){return o.localize(t)},f=function(t){return-1!==e.indexOf(t)};return l=f(Kd.AppleTv)&&f(Kd.Vivi)?"vivi_and_apple_tv":f(Kd.Vivi)?"vivi":"apple_tv",r.createElement("div",{className:"cv-devices-cta",tabIndex:-1},r.createElement(hm,{context:l,localize:s,onDismiss:function(){return i(l)}}),r.createElement(dm,{context:l}),r.createElement(vm,{context:l,canUserManageIntegrations:n,localize:s,onContactSupport:function(){return c(l)},onInstall:function(){return a(l)},onLearnMore:function(){return u(l)}}))}function hm(t){var e=t.context,n=t.localize,o=t.onDismiss;return r.createElement("div",{className:"cv-devices-cta-header"},r.createElement("span",{className:"cv-devices-badge"},n("New")),r.createElement("span",{className:"cv-devices-title"},"vivi_and_apple_tv"===e&&n("Cast to Vivi and Apple TV"),"vivi"===e&&n("Cast to Vivi"),"apple_tv"===e&&n("Cast to Apple TV")),r.createElement("span",{className:"cv-devices-close",onClick:o},r.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",fill:"white",d:"M11.9588 10.6413L16.3612 6.34478C16.7361 5.97191 17.3439 5.97191 17.7188 6.34478C18.0937 6.71764 18.0937 7.32218 17.7188 7.69505L13.3165 11.9916L17.7188 16.3701C18.0937 16.7429 18.0937 17.3475 17.7188 17.7203C17.3439 18.0932 16.7361 18.0932 16.3612 17.7203L11.9588 13.3419L7.63882 17.7203C7.26392 18.0932 6.65608 18.0932 6.28118 17.7203C5.90627 17.3475 5.90627 16.7429 6.28118 16.3701L10.6012 11.9916L6.28118 7.62993C5.90627 7.25706 5.90627 6.65252 6.28118 6.27965C6.65608 5.90678 7.26392 5.90678 7.63882 6.27965L11.9588 10.6413Z"}))))}function dm(t){var e=t.context,n="vivi_and_apple_tv"===e?"bg-vivi-and-apple":"vivi"===e?"bg-vivi":"bg-apple";return r.createElement("div",{className:"cv-devices-cta-body ".concat(n)},("vivi_and_apple_tv"===e||"apple_tv"===e)&&r.createElement("div",{className:"cv-devices-icon-container"},r.createElement("span",{className:"cv-devices-icon apple"})),("vivi_and_apple_tv"===e||"vivi"===e)&&r.createElement("div",{className:"cv-devices-icon-container"},r.createElement("span",{className:"cv-devices-icon vivi"})))}function vm(t){var e=t.context,n=t.canUserManageIntegrations,o=t.localize,i=t.onInstall,a=t.onLearnMore,u=t.onContactSupport;return n?r.createElement("div",{className:"cv-devices-cta-footer"},r.createElement("span",null,"vivi_and_apple_tv"===e&&o("Discover our new device integrations to make presenting in the classroom easy!"),"vivi"===e&&o("Discover our new Vivi integration."),"apple_tv"===e&&o("Discover our new Apple TV integration.")),r.createElement("br",null),r.createElement("span",{className:"cv-devices-link",onClick:i},o("Click here to install"))):r.createElement("div",{className:"cv-devices-cta-footer"},r.createElement("span",null,"vivi_and_apple_tv"===e&&o("Cast to Vivi and Apple TV is now available! Please contact "),"vivi"===e&&o("Cast to Vivi is now available! Please contact "),"apple_tv"===e&&o("Cast to Apple TV is now available! Please contact ")),r.createElement("span",{className:"cv-devices-link",onClick:u},"ClickView Support"),r.createElement("span",null,"vivi_and_apple_tv"===e&&o(" or your administrator to set up Apple TV and Vivi."),"vivi"===e&&o(" or your administrator to set up Vivi."),"apple_tv"===e&&o(" or your administrator to set up Apple TV.")),r.createElement("br",null),r.createElement("span",{className:"cv-devices-link",onClick:a},"Learn more"))}function bm(t){return bm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bm(t)}function mm(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,gm(r.key),r)}}function gm(t){var e=function(t){if("object"!=bm(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=bm(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==bm(e)?e:e+""}function wm(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(wm=function(){return!!t})()}function Om(t,e,n,r){var o=Pm(Sm(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof o?function(t){return o.apply(n,t)}:o}function Pm(){return Pm="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Sm(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Pm.apply(null,arguments)}function Sm(t){return Sm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Sm(t)}function jm(t,e){return jm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},jm(t,e)}o.Z.registerComponent("DevicesCta",pm((function(t,e){return r.createElement(ym,Object.assign({player:t},e))}),{properties:{className:"cv-devices-cta-wrapper"}}));var km=o.Z.getComponent("DevicesCta"),_m=o.Z.getComponent("MenuButton"),Cm=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=Sm(e),function(t,e){if(e&&("object"==bm(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,wm()?Reflect.construct(e,n||[],Sm(t).constructor):e.apply(t,n))}(this,e,[t,n])).alwaysCollapsed=!1,r.isCollapsed=!1,r.isCollabsible=!0,r.className="cv-devices-menu-button",r.searchText="",r.devices=[],r.castSession=void 0,r.bindFunctions(),r.bindEventListeners(),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&jm(t,e)}(e,t),n=e,r=[{key:"bindFunctions",value:function(){this.bindEventListeners=this.bindEventListeners.bind(this),this.setDevices=this.setDevices.bind(this),this.setCastSession=this.setCastSession.bind(this),this.setSearchText=this.setSearchText.bind(this),this.getDeviceMenuItems=this.getDeviceMenuItems.bind(this),this.showNotificationBadge=this.showNotificationBadge.bind(this),this.hideNotificationBadge=this.hideNotificationBadge.bind(this),this.render=this.render.bind(this),this.removeMenuItems=this.removeMenuItems.bind(this),this.addMenuItemsForDevices=this.addMenuItemsForDevices.bind(this),this.shouldShowSearchInput=this.shouldShowSearchInput.bind(this),this.toggleSearchInput=this.toggleSearchInput.bind(this),this.toggleDeviceMenuItems=this.toggleDeviceMenuItems.bind(this),this.toggleEmptyStatePlaceholder=this.toggleEmptyStatePlaceholder.bind(this)}},{key:"bindEventListeners",value:function(){var t=this,e=this.$("button"),n=function(e){t.menu.handleBlur(e)};e.addEventListener("blur",n),this.one("dispose",(function(){var r;e.removeEventListener("blur",n),null===(r=t.cta)||void 0===r||r.dispose()}))}},{key:"createEl",value:function(){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(t=_m.prototype.createEl).apply.apply(t,[this].concat(n))}},{key:"buildWrapperCSSClass",value:function(){return"cv-menu-small cv-devices-button ".concat(Om(e,"buildWrapperCSSClass",this,3)([]))}},{key:"createMenu",value:function(){var t=this,e=new Kb(this.player_,{menuButton:this});if(!this.options_.ctaOptions.hasBeenDismissed&&this.options_.ctaOptions.inactiveIntegrations.length>0){var n=this.options_.ctaOptions,r=n.onDismiss,o=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}(n,["onDismiss"]);this.cta=new km(this.player(),Object.assign(Object.assign({},o),{onDismiss:function(n){t.hideNotificationBadge(),e.removeCta(),r(n)}})),this.showNotificationBadge(),e.addCta(this.cta)}return this.createItems().forEach((function(t){return e.addItem(t)})),e}},{key:"createItems",value:function(){var t=this,e=[];return this.headingItem=new _(this.player_,{label:this.localize("Select a device"),selectable:!1}),this.searchInputItem=new ct(this.player_,{menuButton:this,search:function(e){return t.setSearchText(e)},className:"cv-devices-search-input"}),this.emptyPlaceholder=new lt(this.player_,{label:"No devices found",selected:!1,selectable:!1,multiSelectable:!1}),this.headingItem.show(),this.searchInputItem.hide(),this.emptyPlaceholder.show(),e.push(this.headingItem,this.searchInputItem,this.emptyPlaceholder),e}},{key:"pressButton",value:function(){var t;Om(e,"pressButton",this,3)([]),this.shouldShowSearchInput()&&(null===(t=this.searchInputItem)||void 0===t||t.focus())}},{key:"setDevices",value:function(t){this.devices=t,this.render()}},{key:"setCastSession",value:function(t){this.castSession=t,this.render()}},{key:"setSearchText",value:function(t){this.searchText=t,this.render()}},{key:"getDeviceMenuItems",value:function(){return this.menu.children_.filter((function(t){return t instanceof Gb}))}},{key:"showNotificationBadge",value:function(){this.addClass("notification-badge")}},{key:"hideNotificationBadge",value:function(){this.removeClass("notification-badge")}},{key:"render",value:function(){this.removeMenuItems(this.getDeviceMenuItems()),this.addMenuItemsForDevices(this.devices),this.toggleSearchInput(),this.toggleDeviceMenuItems(),this.toggleEmptyStatePlaceholder()}},{key:"removeMenuItems",value:function(t){var e=this;t.forEach((function(t){e.menu.removeChild(t),t.dispose()}))}},{key:"addMenuItemsForDevices",value:function(t){var e=this;t.sort((function(t,e){var n,r,o,i,a="".concat(t.type).concat(null!==(n=t.schoolName)&&void 0!==n?n:"").concat(null!==(r=t.description)&&void 0!==r?r:"").concat(t.name),u="".concat(e.type).concat(null!==(o=e.schoolName)&&void 0!==o?o:"").concat(null!==(i=e.description)&&void 0!==i?i:"").concat(e.name);return a.localeCompare(u)})).forEach((function(t){var n=new Gb(e.player(),{id:t.id,label:t.name,schoolName:t.schoolName,description:t.description,selected:!1,multiSelectable:!1,selectable:!0,available:t.status===Xd.Available,type:t.type,onClick:function(){e.options_.onDeviceMenuItemClick(n,t)}});e.menu.addItem(n)}))}},{key:"shouldShowSearchInput",value:function(){return this.getDeviceMenuItems().length>=20}},{key:"toggleSearchInput",value:function(){this.shouldShowSearchInput()?(this.searchInputItem.show(),this.menu.addClass("vertical-fill")):(this.searchInputItem.hide(),this.menu.removeClass("vertical-fill"))}},{key:"toggleDeviceMenuItems",value:function(){var t=this,e=this.getDeviceMenuItems(),n=this.shouldShowSearchInput(),r=this.searchText.toLowerCase();e.forEach((function(e){var o,i,a,u=t.devices.find((function(t){return t.id===e.options_.id}));if(u){var c=u.status===Xd.Available,l=u.id===(null===(o=t.castSession)||void 0===o?void 0:o.getDevice().id),s=!n||-1!=="".concat(u.name," ").concat(null!==(i=u.schoolName)&&void 0!==i?i:""," ").concat(null!==(a=u.description)&&void 0!==a?a:"").trim().toLowerCase().indexOf(r);c?e.enable():e.disable(),s?e.show():e.hide(),l?e.selected(!0):e.selected(!1)}}))}},{key:"toggleEmptyStatePlaceholder",value:function(){var t=this.getDeviceMenuItems();t.filter((function(t){return t.isVisible()})).length?this.emptyPlaceholder.hide():this.emptyPlaceholder.show(),t.length?this.emptyPlaceholder.setLabel(this.localize("No matching results")):this.emptyPlaceholder.setLabel(this.localize("No devices found"))}},{key:"getCollabsibleName",value:function(){return this.controlText_}},{key:"getCollabsibleValue",value:function(){var t,e;return null!==(e=null===(t=this.castSession)||void 0===t?void 0:t.getDevice().name)&&void 0!==e?e:" "}},{key:"showInCollabsibleMenu",value:function(){return!0}},{key:"showCollapsibleMenu",value:function(){this.handleClick()}},{key:"handleClick",value:function(){Om(e,"handleClick",this,3)([null]),this.options_.onClick()}}],r&&mm(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(_m);function Em(t){return Em="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Em(t)}function Tm(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,xm(r.key),r)}}function xm(t){var e=function(t){if("object"!=Em(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Em(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Em(e)?e:e+""}function Lm(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Lm=function(){return!!t})()}function Rm(){return Rm="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Im(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Rm.apply(null,arguments)}function Im(t){return Im=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Im(t)}function Dm(t,e){return Dm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Dm(t,e)}Cm.prototype.controlText_="Devices",o.Z.registerComponent("DevicesButton",Cm);var Bm=function(t){function e(t){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,n){return e=Im(e),function(t,e){if(e&&("object"==Em(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Lm()?Reflect.construct(e,n||[],Im(t).constructor):e.apply(t,n))}(this,e,[null,t])}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Dm(t,e)}(e,t),n=e,r=[{key:"createEl",value:function(){return(t=e,n=this,"function"==typeof(r=Rm(Im(1&3?t.prototype:t),"createEl",n))?function(t){return r.apply(n,t)}:r)(["div",{className:"cv-devices-tech"}]);var t,n,r}},{key:"setPoster",value:function(t){this.poster=t,this.update()}},{key:"setDevice",value:function(t){this.device=t,this.update()}},{key:"update",value:function(){var t,e,n,r,o=this;this.el_.innerHTML='\n <div class="cv-devices-content">\n <p>'.concat(this.localize("Currently playing on"),'</p>\n <h2><span class="cv-device-icon ').concat({vivi:"cv-vivi-icon","apple-tv":"cv-apple-icon"}[null!==(e=null===(t=this.device)||void 0===t?void 0:t.type)&&void 0!==e?e:Kd.Vivi],'"></span>').concat(null!==(r=null===(n=this.device)||void 0===n?void 0:n.name)&&void 0!==r?r:"",'</h2>\n </div>\n <div class="cv-devices-background" style="background-image: url(').concat(this.poster,')"></div>\n ');var i=document.createElement("button"),a=function(t){t.stopPropagation(),o.options_.onStopCasting()};i.onclick=a,i.ontouchstart=a,i.className="stop-casting-button",i.innerHTML=this.localize("Stop casting"),this.el_.querySelector(".cv-devices-content").appendChild(i)}},{key:"play",value:function(){}}],r&&Tm(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getComponent("Component"));function Nm(t){return Nm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nm(t)}function Mm(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Am(r.key),r)}}function Am(t){var e=function(t){if("object"!=Nm(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Nm(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Nm(e)?e:e+""}function Fm(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Fm=function(){return!!t})()}function Zm(t,e,n,r){var o=Vm(zm(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof o?function(t){return o.apply(n,t)}:o}function Vm(){return Vm="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=zm(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Vm.apply(null,arguments)}function zm(t){return zm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},zm(t)}function Um(t,e){return Um=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Um(t,e)}var Gm=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=zm(e),function(t,e){if(e&&("object"==Nm(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Fm()?Reflect.construct(e,n||[],zm(t).constructor):e.apply(t,n))}(this,e,[t,n])).featuresVolumeControl=!0,r.featuresPlaybackRate=!1,r.movingMediaElementInDOM=!1,r.featuresFullscreenResize=!0,r.featuresTimeupdateEvents=!0,r.featuresProgressEvents=!1,r.featuresNativeTextTracks=!1,r.featuresNativeAudioTracks=!1,r.featuresNativeVideoTracks=!1,r.featuresMuteControl=!0,r.featuresSourceset=!1,r.videojsPlayer=(0,o.Z)(r.options_.playerId),r.bindFunctions(),r.bindEventListeners(),r.ready((function(){r.setSource(r.options_.source)})),r.triggerReady(),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Um(t,e)}(e,t),n=e,r=[{key:"bindFunctions",value:function(){this.bindEventListeners=this.bindEventListeners.bind(this),this.onTextTrackChanged=this.onTextTrackChanged.bind(this),this.getSelectedTextTrack=this.getSelectedTextTrack.bind(this),this.setSelectedTextTrack=this.setSelectedTextTrack.bind(this),this.showUI=this.showUI.bind(this),this.hideUI=this.hideUI.bind(this),this.dispose=this.dispose.bind(this),this.setSource=this.setSource.bind(this),this.getCastSession=this.getCastSession.bind(this)}},{key:"bindEventListeners",value:function(){var t=this,e=this.getCastSession();e&&(this.textTracks().on("change",this.onTextTrackChanged),this.videojsPlayer.one("ended",(function(){e.dispose()})),e.on("durationchange",(function(){t.trigger("durationchange")})),e.on("dispose",(function(){t.trigger("ended"),t.hideUI()})),e.on("playingchange",(function(){e.isPlaying()?(t.trigger("play"),t.trigger("playing")):t.trigger("pause")})),e.on("volumechange",(function(){t.trigger("volumechange")})),e.on("sourceloaded",(function(){t.trigger("loadeddata")})),e.on("subtitleschange",(function(){t.setSelectedTextTrack(e.getSubtitles())})))}},{key:"onTextTrackChanged",value:function(){var t,e=this.getSelectedTextTrack();null===(t=this.getCastSession())||void 0===t||t.setSubtitles(null==e?void 0:e.src)}},{key:"getSelectedTextTrack",value:function(){return W.findTrackByPredicate(this.videojsPlayer.player_,(function(t){return"showing"===t.mode&&!!t.src}))}},{key:"setSelectedTextTrack",value:function(t){W.forEachTrack(this.videojsPlayer.player_,(function(e){e.src===t?e.mode="showing":e.mode="hidden"}))}},{key:"showUI",value:function(t){this.ui&&(this.ui.setPoster(this.options_.poster),this.ui.setDevice(t),this.ui.show())}},{key:"hideUI",value:function(){var t;null===(t=this.ui)||void 0===t||t.hide()}},{key:"dispose",value:function(){this.textTracks().off("change",this.onTextTrackChanged);var t=this.getCastSession();t&&t.dispose(),Zm(e,"cleanupAutoTextTracks",this,3)([]),Zm(e,"dispose",this,3)([])}},{key:"createEl",value:function(){var t=this;return this.ui=this.ui||new Bm({onStopCasting:function(){var e;null===(e=t.getCastSession())||void 0===e||e.dispose()}}),this.ui.el()}},{key:"setSource",value:function(t){var e=this.getCastSession();if(e){this.showUI(e.getDevice()),this.trigger("loadstart");var n=this.getSelectedTextTrack();e.loadSource(t.src,null==n?void 0:n.src)}}},{key:"addRemoteTextTrack",value:function(t){return Zm(e,"addRemoteTextTrack",this,3)([t,!0])}},{key:"getCastSession",value:function(){var t;return Bb.getOrCreateInstance(null!==(t=this.options_.instanceId)&&void 0!==t?t:"").getCastSession()}},{key:"play",value:function(){var t;null===(t=this.getCastSession())||void 0===t||t.play()}},{key:"pause",value:function(){var t;null===(t=this.getCastSession())||void 0===t||t.pause()}},{key:"paused",value:function(){var t;return!1===(null===(t=this.getCastSession())||void 0===t?void 0:t.isPlaying())}},{key:"ended",value:function(){var t,e;return null!==(e=null===(t=this.getCastSession())||void 0===t?void 0:t.isPlaybackFinished())&&void 0!==e&&e}},{key:"setCurrentTime",value:function(t){var e;null===(e=this.getCastSession())||void 0===e||e.seek(null!=t?t:0)}},{key:"currentTime",value:function(){var t,e;return null!==(e=null===(t=this.getCastSession())||void 0===t?void 0:t.getPosition())&&void 0!==e?e:0}},{key:"duration",value:function(){var t,e;return null!==(e=null===(t=this.getCastSession())||void 0===t?void 0:t.getDuration())&&void 0!==e?e:this.videojsPlayer.duration()}},{key:"volume",value:function(){var t,e;return null!==(e=null===(t=this.getCastSession())||void 0===t?void 0:t.getVolume())&&void 0!==e?e:1}},{key:"setVolume",value:function(t){var e;null===(e=this.getCastSession())||void 0===e||e.setVolume(t)}},{key:"muted",value:function(){var t,e;return null!==(e=null===(t=this.getCastSession())||void 0===t?void 0:t.getMuted())&&void 0!==e&&e}},{key:"setMuted",value:function(t){var e;null===(e=this.getCastSession())||void 0===e||e.setMuted(t)}},{key:"buffered",value:function(){}},{key:"seekable",value:function(){return o.Z.createTimeRanges(0,this.duration())}},{key:"playbackRate",value:function(){return 1}},{key:"readyState",value:function(){return 4}},{key:"controls",value:function(){return!1}},{key:"playsinline",value:function(){return!0}},{key:"supportsFullScreen",value:function(){return!0}},{key:"setAutoplay",value:function(){}},{key:"preload",value:function(){}},{key:"load",value:function(){}},{key:"setPlaybackRate",value:function(){}}],i=[{key:"canPlayType",value:function(){return""}},{key:"canPlaySource",value:function(t,e){var n;return!!Bb.getOrCreateInstance(null!==(n=null==e?void 0:e.instanceId)&&void 0!==n?n:"").getCastSession()}},{key:"isSupported",value:function(){return Bb.isActive()}}],r&&Mm(n.prototype,r),i&&Mm(n,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,i}(o.Z.getComponent("Tech"));function qm(t){return qm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qm(t)}function Hm(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Wm(r.key),r)}}function Wm(t){var e=function(t){if("object"!=qm(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=qm(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==qm(e)?e:e+""}function Qm(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Qm=function(){return!!t})()}function Ym(){return Ym="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=$m(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Ym.apply(null,arguments)}function $m(t){return $m=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},$m(t)}function Km(t,e){return Km=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Km(t,e)}o.Z.registerTech("devices",Gm);var Xm=function(t){function e(t,n){var r,o,i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=$m(e),function(t,e){if(e&&("object"==qm(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Qm()?Reflect.construct(e,n||[],$m(t).constructor):e.apply(t,n))}(this,e,[t,n])).options=n,r.instanceId=null!==(i=null===(o=r.player.options_.devices)||void 0===o?void 0:o.instanceId)&&void 0!==i?i:"",r.bindFunctions(),r.initialize(),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Km(t,e)}(e,t),n=e,r=[{key:"bindFunctions",value:function(){this.initialize=this.initialize.bind(this),this.onReady=this.onReady.bind(this),this.onDevicesChanged=this.onDevicesChanged.bind(this),this.onCastSessionChanged=this.onCastSessionChanged.bind(this),this.onDevicesError=this.onDevicesError.bind(this),this.addViviClient=this.addViviClient.bind(this),this.addAppleTvClient=this.addAppleTvClient.bind(this),this.reloadTech=this.reloadTech.bind(this),this.getSessionManager=this.getSessionManager.bind(this),this.dispose=this.dispose.bind(this)}},{key:"initialize",value:function(){this.player.ready(this.onReady)}},{key:"onReady",value:function(){var t=this,e=this.player.getChild("collapserator"),n=null==e?void 0:e.children().findIndex((function(t){return"CustomControlSpacer"===t.name()})),r=null==e?void 0:e.children().findIndex((function(t){return"OpenExternallyButton"===t.name()})),o=Math.max(n,r)+1,i=this.getSessionManager();if(e&&n&&-1!==n&&i){i.on("deviceschange",this.onDevicesChanged),i.on("castsessionchange",this.onCastSessionChanged),i.on("error",this.onDevicesError);var a=this.options.ctaOptions,u=this.options.vivi,c=[];this.options.appleTv.enabled||c.push(Kd.AppleTv),u.enabled&&u.accountConnected||c.push(Kd.Vivi);var l={onClick:function(){t.addViviClient(i),t.addAppleTvClient(i)},onDeviceMenuItemClick:function(e,n){var r;i.startCastSession({device:n,title:t.options.title}),null===(r=t.options.analyticsService)||void 0===r||r.logUserAction(n,{actionType:ne.Vw.Select,workflowPhase:ne.eu.Complete,descriptor:ne.UX.ChangeDevice,entity:ne.py.Device,eventVersion:ne.eq.V3})},ctaOptions:Object.assign(Object.assign({},a),{inactiveIntegrations:c})};this.devicesButton=e.addChild("DevicesButton",l,o)}}},{key:"onDevicesChanged",value:function(t){var e;null===(e=this.devicesButton)||void 0===e||e.setDevices(t)}},{key:"onCastSessionChanged",value:function(t){var e;null===(e=this.devicesButton)||void 0===e||e.setCastSession(t),this.reloadTech(),t?(this.player.addClass("cv-device-casting"),this.player.addClass("cv-device-".concat(t.getDevice().type)),this.player.isFullscreen()&&this.player.exitFullscreen()):(this.player.removeClass("cv-device-casting"),this.player.removeClass("cv-device-".concat(Kd.AppleTv)),this.player.removeClass("cv-device-".concat(Kd.Vivi)))}},{key:"onDevicesError",value:function(t){this.player.error(t.message),this.player.pause()}},{key:"addViviClient",value:function(t){if(this.options.vivi.enabled&&this.options.vivi.accountConnected&&this.options.vivi.apiUrl&&!t.hasInstanceOfClient(kb)){var e=new kb({url:this.options.vivi.apiUrl,fetchAccessToken:this.options.vivi.fetchAccessToken});t.addClient(e)}}},{key:"addAppleTvClient",value:function(t){if(this.options.appleTv.enabled&&this.options.trackingCode&&this.options.userId&&!t.hasInstanceOfClient(Qv)){var e=new Qv({fetchAccessToken:this.options.appleTv.fetchAccessToken,trackingCode:this.options.trackingCode,userId:this.options.userId});t.addClient(e)}}},{key:"reloadTech",value:function(){var t=this.player,e=t.currentSources(),n=t.volume(),r=t.muted(),o=t.currentTime(),i=t.paused();t.src(e),t.one("playing",(function(){t.volume(n),t.muted(r),t.currentTime(o),i?t.pause():t.play()}))}},{key:"getSessionManager",value:function(){if(this.instanceId)return Bb.getOrCreateInstance(this.instanceId)}},{key:"dispose",value:function(){var t,n,r,o=this.getSessionManager();o&&(o.off("deviceschange",this.onDevicesChanged),o.off("castsessionchange",this.onCastSessionChanged),o.off("error",this.onDevicesError),Bb.disposeAndRemoveInstance(o),(t=e,n=this,"function"==typeof(r=Ym($m(1&3?t.prototype:t),"dispose",n))?function(t){return r.apply(n,t)}:r)([]))}}],r&&Hm(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getPlugin("plugin"));function Jm(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function tg(t){var e,n,o,i=r.useRef(t.player.duration()-t.player.currentTime()),a=(n=r.useState(i.current),o=2,function(t){if(Array.isArray(t))return t}(n)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,u=[],c=!0,l=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(u.push(r.value),u.length!==e);c=!0);}catch(t){l=!0,o=t}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}(n,o)||function(t,e){if(t){if("string"==typeof t)return Jm(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Jm(t,e):void 0}}(n,o)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),u=a[0],c=a[1];function l(){var e=t.player.duration()-t.player.currentTime();c(e),e>i.current&&(i.current=e)}if(r.useEffect((function(){return t.player.on("timeupdate",l),function(){t.player.off("timeupdate",l)}}),[]),!t.nextVideo||!t.onPlayNext)return r.createElement(r.Fragment,null);var s=Math.ceil(u),f=1===s?"second":"seconds";return r.createElement(r.Fragment,null,r.createElement("div",{className:"cv-up-next-container"},r.createElement("div",{className:"cv-cancel-up-next cursor-pointer",role:"button",onClick:t.onCancel},"×"),r.createElement("div",{className:"cv-up-next-heading"},"Up next in ",s," ",f,":"),r.createElement("div",{className:"cv-up-next-image cursor-pointer",onClick:t.onPlayNext,style:{backgroundImage:"url(".concat(null===(e=t.nextVideo)||void 0===e?void 0:e.thumbnailUrl,")")}}),r.createElement("div",{className:"cv-up-next-title"},t.nextVideo.name)))}function eg(t){return eg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},eg(t)}function ng(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,rg(r.key),r)}}function rg(t){var e=function(t){if("object"!=eg(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=eg(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==eg(e)?e:e+""}function og(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(og=function(){return!!t})()}function ig(){return ig="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=ag(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},ig.apply(null,arguments)}function ag(t){return ag=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ag(t)}function ug(t,e){return ug=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ug(t,e)}o.Z.registerPlugin("devicesPlugin",Xm),o.Z.registerComponent("UpNext",pm((function(t,e){return r.createElement(tg,Object.assign({player:t},e))})));var cg=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=ag(e),function(t,e){if(e&&("object"==eg(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,og()?Reflect.construct(e,n||[],ag(t).constructor):e.apply(t,n))}(this,e,[t,n])).playNext=t.nextVideoPlugin().getShouldPlayNext(),r.toggle(r.playNext),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ug(t,e)}(e,t),n=e,r=[{key:"handleToggle",value:function(){this.toggle(!this.playNext)}},{key:"toggle",value:function(t){t?this.toggleOn():this.toggleOff()}},{key:"toggleOn",value:function(){this.playNext=!0,o.Z.dom.addClass(this.toggleEl,"on"),this.player_.nextVideoPlugin().setShouldPlayNext(this.playNext,!0)}},{key:"toggleOff",value:function(){this.playNext=!1,o.Z.dom.removeClass(this.toggleEl,"on"),this.player_.nextVideoPlugin().setShouldPlayNext(this.playNext,!0)}},{key:"handleClick",value:function(t){t.stopImmediatePropagation()}},{key:"createEl",value:function(t,n,r){this.handlerBound||(this.handleToggle=this.handleToggle.bind(this),this.handlerBound=!0),this.toggleEl&&this.toggleEl.removeEventListener("click",this.handleToggle),this.toggleEl=o.Z.dom.createEl("div",{className:"custom-toggle custom-toggle-info toggle-option float-end",innerHTML:'<span class="handle"></span></div>'}),this.toggleEl.addEventListener("click",this.handleToggle);var i,a,u,c=(i=e,a=this,"function"==typeof(u=ig(ag(1&3?i.prototype:i),"createEl",a))?function(t){return u.apply(a,t)}:u)([t,{className:"vjs-menu-item cv-cog-menu-item cv-play-next-toggle",innerHTML:'\n <span class="vjs-menu-item-text">Play next video</span>\n <span class="cv-toggle-container"></span>'},r]);return c.children[1].appendChild(this.toggleEl),c}}],r&&ng(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getComponent("MenuItem"));function lg(t){return lg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},lg(t)}function sg(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,fg(r.key),r)}}function fg(t){var e=function(t){if("object"!=lg(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=lg(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==lg(e)?e:e+""}function pg(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(pg=function(){return!!t})()}function yg(){return yg="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=hg(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},yg.apply(null,arguments)}function hg(t){return hg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},hg(t)}function dg(t,e){return dg=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},dg(t,e)}o.Z.registerComponent("NextVideoMenuItem",cg);var vg="cv-persisttest",bg="cv-play-next-video",mg=o.Z.getPlugin("plugin"),gg=(o.Z.getComponent("MenuItem"),o.Z.getComponent("NextVideoMenuItem")),wg=function(t){function e(t){var n;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=function(t,e,n){return e=hg(e),function(t,e){if(e&&("object"==lg(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,pg()?Reflect.construct(e,n||[],hg(t).constructor):e.apply(t,n))}(this,e,[t])).setShouldPlayNext=n.setShouldPlayNext.bind(n),n.getShouldPlayNext=n.getShouldPlayNext.bind(n),n.getChapterTrack=n.getChapterTrack.bind(n),n.onTimeUpdate=n.onTimeUpdate.bind(n),n.hasLocalStorage=n.testHasLocalStorage(),n.shouldPlayNextVideo=!1,n.hasLocalStorage){var r=window.localStorage.getItem(bg);n.shouldPlayNextVideo="true"===r}return t.ready((function(){n.initialize()})),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&dg(t,e)}(e,t),n=e,r=[{key:"initialize",value:function(){this.player.isDisposed()||this.bindListeners()}},{key:"getChapterTrack",value:function(){return W.getTrack(this.player,"chapters",null)}},{key:"setNextVideo",value:function(t,e,n){var r;this.nextVideo=t,this.callback=n,e&&this.setShouldPlayNext(!0),(null===(r=this.player.getChild("collapserator"))||void 0===r?void 0:r.getChild("cogButton")).addItem({index:0,ctor:gg,name:"NextVideoMenuItem"})}},{key:"getShouldPlayNext",value:function(){return this.shouldPlayNextVideo}},{key:"setShouldPlayNext",value:function(t,e){this.shouldPlayNextVideo=t,this.hasLocalStorage&&e&&window.localStorage.setItem(bg,t.toString())}},{key:"bindListeners",value:function(){this.player.on("timeupdate",this.onTimeUpdate)}},{key:"dispose",value:function(){var t,n,r;this.player.off("timeupdate",this.onTimeUpdate),this.hideUpNext(),(t=e,n=this,"function"==typeof(r=yg(hg(1&3?t.prototype:t),"dispose",n))?function(t){return r.apply(n,t)}:r)([])}},{key:"onTimeUpdate",value:function(){var t,e;if(!this.player.pictureInPicture||!this.player.isInPictureInPicture())if(this.getShouldPlayNext()){if(this.player.ended())return this.callback(),void this.hideUpNext();if(!(this.player.duration()<=0||this.upNextRendered&&this.player.currentTime()>this.upNextTimepoint)){var n=this.getChapterTrack(),r=(null===(t=null==n?void 0:n.activeCues)||void 0===t?void 0:t.length)&&n.activeCues[0];"credits"===(null===(e=null==r?void 0:r.text)||void 0===e?void 0:e.toLowerCase())||this.player.currentTime()>=this.player.duration()-5?this.showUpNext():this.hideUpNext()}}else this.hideUpNext()}},{key:"showUpNext",value:function(){var t=this;this.upNextRendered||(this.upNextRendered=!0,this.upNextTimepoint=this.player.currentTime(),this.player.addChild("UpNext",{nextVideo:this.nextVideo,onPlayNext:this.callback,onCancel:function(){t.hideUpNext(),t.setShouldPlayNext(!1)}}))}},{key:"hideUpNext",value:function(){if(this.upNextRendered){this.upNextRendered=!1,this.upNextTimepoint=null;var t=this.player.getChild("UpNext");t&&(this.player.removeChild(t),t.dispose())}}},{key:"testHasLocalStorage",value:function(){try{return window.localStorage.setItem(vg,"persistPlayNext"),window.localStorage.removeItem(vg),!0}catch(t){return!1}}}],r&&sg(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(mg);o.Z.registerPlugin("nextVideoPlugin",wg);var Og=n(39202),Pg=n(49985),Sg=n(28825),jg=n(11607),kg=n(86073),_g=n(1164),Cg=n(45778),Eg=n(87611);var Tg={width:200,resizeType:Kp.Nq.Cover};function xg(t){var e;return Cg.G.isResource(t)?t.metadata.type===_g.L.Pdf||(null===(e=t.pdf)||void 0===e?void 0:e.url)?Kp.__.Pdf:Kp.__.Thumbnails:Kp.__.Link}function Lg(t){var e,n,o,i=null,a=0;Cg.G.isResource(t.resource)&&(i=t.resource.metadata,a=null!==(o=null===(n=null===(e=t.resource.thumbnail)||void 0===e?void 0:e.metadata)||void 0===n?void 0:n.rotation)&&void 0!==o?o:0);var u=function(t,e){var n,r,o,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Tg,a=xg(e);if("thumbnail"in e&&(null===(n=e.thumbnail)||void 0===n?void 0:n.url))return $p.j.createUrl(null===(r=e.thumbnail)||void 0===r?void 0:r.url,Object.assign({},i));var u=kg._.safeUrlConcat(t,"/v1/previews");return Cg.G.isResource(e)?a===Kp.__.Pdf?e.metadata.type===_g.L.Pdf?$p.j.createResourceImage(u,e.url,Object.assign({},i)):$p.j.createResourceImage(u,null===(o=e.pdf)||void 0===o?void 0:o.url,Object.assign({},i)):e.metadata.type!==_g.L.Zip?$p.j.createUrl(e.url,{size:Kp.h2.Medium,resizeType:Kp.Nq.Cover}):"/images/zip-resource.png":$p.j.createResourceImage(u,e.url,Object.assign({},i))}(t.imageCdnUrl,t.resource,t.dynamicRatioImageOptions);return r.createElement(Eg.Z,{data:u,imageType:xg(t.resource),imageStyle:{transform:"rotate(".concat(a,"deg)")},alt:t.resource.name,errorFallbackImageSrc:t.imageErrorFallbackUrl,errorFallbackImageClassName:"Xy4zX",imageClassName:(null==i?void 0:i.type)===_g.L.Image?"".concat("z4O5p"," ").concat("FFgf3"):"",preload:t.preloadImage,preventLoad:!t.preloadImage})}var Rg=n(83914),Ig=n(26117),Dg=n(26354),Bg=n(52999),Ng=n(71063),Mg=n(4594),Ag=n(79967),Fg=n(35223);function Zg(t){var e,n,o,i,a=null;"metadata"in t.data&&(a=t.data.metadata);var u=Cg.G.isType(t.data,Mg.E.Resource);return r.createElement(r.Fragment,null,r.createElement("div",{className:"OnJDH"},r.createElement("div",{className:"CIFy7"},r.createElement("div",{className:function(e){var n,r="\n d-flex flex-column align-items-center justify-content-end rounded-3 h-100\n position-relative ".concat(function(t){switch(t){case"atom-guide":return"X39wU";case"student-activity":return"X9pMl";case"teacher-pack":return"_tdVE";case"additional-materials":return"qRVUo";default:return"_18JaV"}}(e)," ").concat("oUZPD");return(null===(n=t.theme)||void 0===n?void 0:n.containerClass)?r+=" ".concat(t.theme.containerClass):r+=" pt-3 px-3",t.applyHoverState&&(r+=" ".concat("xRYhX")),r}(null==a?void 0:a.resourceType)},"above"===t.titlePosition&&r.createElement(Dg.u,{title:t.data.name},r.createElement("h3",{className:"text-center text-break h5 mb-3 ".concat("g5NWS")},r.createElement("span",{className:"clamp-1"},t.data.name))),r.createElement("div",{className:"\n ".concat(null!==(n=null===(e=t.theme)||void 0===e?void 0:e.thumbnailContainerClass)&&void 0!==n?n:""," w-75 overflow-hidden \n ").concat("EDiGi"," ").concat("above"===t.titlePosition?"e9ejn":""," \n ").concat("I9E5O","\n ")},r.createElement(Lg,{resource:t.data,imageCdnUrl:t.imageCdnUrl,imageErrorFallbackUrl:t.imageErrorFallbackUrl,preloadImage:t.preloadImage})),u&&t.onClickDownload&&"normal"===t.actionBehaviour&&r.createElement("div",{className:"jzGAm"},r.createElement(jg.L,{onClick:function(e){return t.onClickDownload(e,t.data)},className:"".concat("fbb_e"," d-flex align-items-center justify-content-center")},r.createElement(Rg.x,{svgName:Fg.vn.Download}))),!t.hideTypeBadge&&u&&r.createElement(Bg.y,{typeId:Mg.E.Resource})))),"below"===t.titlePosition&&r.createElement("div",{className:"mt-1 ".concat("Cpjs3")},Cg.G.isType(t.data,Mg.E.Resource)&&!!(null===(i=null===(o=t.data)||void 0===o?void 0:o.metadata)||void 0===i?void 0:i.resourceType)&&r.createElement(Ig.m,null,function(t){switch(t){case"additional-materials":return"Additional Materials";case"atom-guide":return"ATOM Guide";case"teacher-pack":return"Teacher Pack";case"student-activity":return"Student Activity";default:return"N/A"}}(t.data.metadata.resourceType)),r.createElement("h3",{className:"h6 clamp-2"},t.data.name)))}function Vg(t){return Vg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vg(t)}function zg(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Ug(r.key),r)}}function Ug(t){var e=function(t){if("object"!=Vg(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Vg(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Vg(e)?e:e+""}function Gg(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Gg=function(){return!!t})()}function qg(){return qg="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Hg(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},qg.apply(null,arguments)}function Hg(t){return Hg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Hg(t)}function Wg(t,e){return Wg=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Wg(t,e)}function Qg(t){return r.createElement("div",{className:"cv-resource-item"},r.createElement(Zg,{data:t.resource,imageCdnUrl:t.imageCdnUrl,titlePosition:"above",hideTypeBadge:!0}))}Zg.defaultProps={preloadImage:!0,actionBehaviour:"normal"},r.memo((function(t){var e,n,o,i,a=(e=t.data,n=t.actionBehaviour,i=(0,Ag.k)(),"public"===n||!i.xs&&!i.sm&&"resource"===e.type&&"metadata"in e&&(e.metadata.type===_g.L.Image||(e.metadata.type===_g.L.Pdf?!!e.url:!!(null===(o=e.pdf)||void 0===o?void 0:o.url)))),u=Object.assign(Object.assign({},t.analyticsData),t.data),c=Object.assign(Object.assign({},t.analyticsOptions),{actionType:ne.Vw.Click,entity:t.data.typeId===Mg.E.Resource?ne.py.Resource:ne.py.Link});function l(){Pg.k.logUserAction(u,c)}var s,f=Object.assign(Object.assign({},t),{applyHoverState:a||!!t.data.url});return r.createElement("div",{className:"px-1 flex-shrink-0 ".concat("tqUFn"," ").concat("play-page"===t.location?"V2RwX":"o7j7p"," ").concat(Ng.M.RESOURCE_ITEM_SELECTOR)},(s="d-block no-decoration","link"===t.data.type?r.createElement("a",{href:t.data.url,target:"_blank",className:s,onClick:l},r.createElement(Zg,Object.assign({},f))):a?"public"===t.actionBehaviour?r.createElement("div",{className:"".concat(s," cursor-pointer d-inline"),onClick:function(){l(),Og.C$.trigger(t.getAppLink(t.data))}},r.createElement(Zg,Object.assign({},f))):r.createElement(Sg.F,{appLink:t.getAppLink(t.data),className:s,analyticsData:u,analyticsOptions:c},r.createElement(Zg,Object.assign({},f))):t.data.url?r.createElement("a",{href:t.data.url,className:s,onClick:l},r.createElement(Zg,Object.assign({},f))):r.createElement("div",{className:s},r.createElement(Zg,Object.assign({},f)))))}));var Yg=pm((function(t,e){return r.createElement(Qg,Object.assign({},e))})),$g=function(t){function e(t,n){var r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),r=function(t,e,n){return e=Hg(e),function(t,e){if(e&&("object"==Vg(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Gg()?Reflect.construct(e,n||[],Hg(t).constructor):e.apply(t,n))}(this,e,[t,n]);var o=new Yg(t,{resource:n.resource,imageCdnUrl:n.imageCdnUrl});return r.addChild(o),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Wg(t,e)}(e,t),n=e,r=[{key:"createEl",value:function(t){var n,r,o,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=arguments.length>2?arguments[2]:void 0;return(n=e,r=this,"function"==typeof(o=qg(Hg(1&3?n.prototype:n),"createEl",r))?function(t){return o.apply(r,t)}:o)([t,Object.assign(Object.assign({},i),{className:"".concat(i.className," cv-resource-menu-item")}),a])}},{key:"handleClick",value:function(t){t.stopImmediatePropagation(),this.options_.downloadResource(this.options_.resource)}}],r&&zg(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getComponent("MenuItem"));function Kg(t){return Kg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Kg(t)}function Xg(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Jg(r.key),r)}}function Jg(t){var e=function(t){if("object"!=Kg(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Kg(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Kg(e)?e:e+""}function tw(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(tw=function(){return!!t})()}function ew(t,e,n,r){var o=nw(rw(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof o?function(t){return o.apply(n,t)}:o}function nw(){return nw="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=rw(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},nw.apply(null,arguments)}function rw(t){return rw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},rw(t)}function ow(t,e){return ow=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ow(t,e)}var iw=function(t){function e(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=function(t,e,n){return e=rw(e),function(t,e){if(e&&("object"==Kg(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,tw()?Reflect.construct(e,n||[],rw(t).constructor):e.apply(t,n))}(this,e,arguments)).alwaysCollapsed=!1,t.isCollapsed=!1,t.isCollabsible=!0,t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ow(t,e)}(e,t),n=e,(r=[{key:"buildWrapperCSSClass",value:function(){return"cv-menu-small cv-resources-button-wrapper ".concat(ew(e,"buildWrapperCSSClass",this,3)([]))}},{key:"buildCSSClass",value:function(){return"cv-resources-button ".concat(ew(e,"buildCSSClass",this,3)([]))}},{key:"update",value:function(){ew(e,"update",this,3)([])}},{key:"createItems",value:function(){var t=this,e=[];return e.push(new _(this.player_,{label:"Resources"})),this.options_.resources.forEach((function(n){var r=new $g(t.player(),{resource:n,imageCdnUrl:t.options_.imageCdnUrl,downloadResource:function(e){return t.downloadResource(e)},label:n.name});e.push(r)})),e}},{key:"downloadResource",value:function(t){"link"!==t.type?this.getDownloadIframe().src=t.url:Og.Ab.PageLoad(t.url,!0)}},{key:"getDownloadIframe",value:function(){return this.downloadIframe||(this.downloadIframe=o.Z.dom.createEl("iframe"),this.downloadIframe.style.display="none",o.Z.dom.appendContent(o.Z.dom.$("body"),this.downloadIframe)),this.downloadIframe}},{key:"getCollabsibleName",value:function(){return this.controlText_}},{key:"getCollabsibleValue",value:function(){return""}},{key:"showInCollabsibleMenu",value:function(){return!0}},{key:"showCollapsibleMenu",value:function(){ew(e,"handleClick",this,3)([null])}}])&&Xg(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getComponent("MenuButton"));function aw(t){return aw="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},aw(t)}function uw(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,cw(r.key),r)}}function cw(t){var e=function(t){if("object"!=aw(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=aw(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==aw(e)?e:e+""}function lw(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(lw=function(){return!!t})()}function sw(t){return sw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},sw(t)}function fw(t,e){return fw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},fw(t,e)}iw.prototype.controlText_="Resources",o.Z.registerComponent("ResourcesButton",iw);var pw=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=sw(e),function(t,e){if(e&&("object"==aw(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,lw()?Reflect.construct(e,n||[],sw(t).constructor):e.apply(t,n))}(this,e,[t,n])).options=n,t.ready((function(){return r.onReady()})),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&fw(t,e)}(e,t),n=e,(r=[{key:"onReady",value:function(){if(this.options.resources.length){var t=this.player.getChild("collapserator");t.addChild("ResourcesButton",{resources:this.options.resources,imageCdnUrl:this.options.imageCdnUrl},t.children_.length-4)}}}])&&uw(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(o.Z.getPlugin("plugin"));o.Z.registerPlugin("resourcesPlugin",pw);var yw=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n};function hw(t){var e=t.className,n=void 0===e?"":e,o=t.playerApi,i=t.onReady,a=t.onDispose,u=yw(t,["className","playerApi","onReady","onDispose"]),c=r.useRef(null);return r.useEffect((function(){if(c){var t=new Jd(c.current,Object.assign(Object.assign({},u),{playerApi:o}));return i&&t.ready((function(){i(function(t){return new Proxy(t,{get:function(t,e,n){if("off"===e||!t.isDisposed())return Reflect.get(t,e,n)}})}(t))})),a&&t.one("dispose",a),function(){null==t||t.dispose()}}}),[t.viewKey]),r.createElement("div",{ref:c,className:n})}},2096:(t,e,n)=>{"use strict";n.d(e,{Z:()=>r});const r={tagList:"Zw6d9",badgeBase:"irnbf",disabled:"jlL1c",partialTag:"too_N",removeBadge:"_9FVm",removeBadgeText:"nhoAA",close:"X9joI"}},58421:()=>{}}]);