@clickview/lite 0.35.1 → 0.35.2-dev.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundles.json +2 -2
- package/dist/css/{1980-lite-3c1d9a0bd8.chunk.css → 1201-lite-c31c094e0b.chunk.css} +1 -1
- package/dist/css/1426-lite-840995aa62.chunk.css +26 -0
- package/dist/css/{6702-lite-7caa0be777.chunk.css → 1461-lite-8a6d9f8005.chunk.css} +1 -1
- package/dist/css/{6822-lite-2c4dbd6721.chunk.css → 1514-lite-b377d8aad7.chunk.css} +1 -1
- package/dist/css/{5611-lite-0ad79a4f81.chunk.css → 1519-lite-8818fa8d4c.chunk.css} +1 -1
- package/dist/css/{9622-lite-23f29cce3d.chunk.css → 1688-lite-cbde295a12.chunk.css} +1 -1
- package/dist/css/1805-lite-971ea2bd5a.chunk.css +5 -0
- package/dist/css/{1820-lite-e06465f5de.chunk.css → 1820-lite-983fc2b64e.chunk.css} +1 -1
- package/dist/css/{6154-lite-9de6d937cb.chunk.css → 2408-lite-d788a06bf3.chunk.css} +1 -1
- package/dist/css/{7564-lite-d60de6c7e1.chunk.css → 2469-lite-7a8e220d2f.chunk.css} +1 -1
- package/dist/css/{9522-lite-3c1d9a0bd8.chunk.css → 2651-lite-c31c094e0b.chunk.css} +1 -1
- package/dist/css/{9869-lite-baa5f27c85.chunk.css → 2703-lite-c11aaae4be.chunk.css} +6 -3
- package/dist/css/2819-lite-1ebce7bdcf.chunk.css +6 -0
- package/dist/css/{4373-lite-70e0bc4a9c.chunk.css → 3311-lite-8f53694323.chunk.css} +1 -1
- package/dist/css/{7286-lite-871baa523e.chunk.css → 3401-lite-0b8496b169.chunk.css} +2 -2
- package/dist/css/{817-lite-d4b875a3bb.chunk.css → 4210-lite-5f2e12e28a.chunk.css} +1 -1
- package/dist/css/{3755-lite-0da0cc9d62.chunk.css → 4463-lite-b9b1686d14.chunk.css} +1 -1
- package/dist/css/{6957-lite-d486456f1e.chunk.css → 4546-lite-3d08e5e8c2.chunk.css} +1 -1
- package/dist/css/{5151-lite-d4ae59eb2d.chunk.css → 4728-lite-be5b495f2e.chunk.css} +1 -1
- package/dist/css/487-lite-96ad0f943f.chunk.css +5 -0
- package/dist/css/{8095-lite-814daf86d6.chunk.css → 4956-lite-12f53a63d0.chunk.css} +1 -1
- package/dist/css/{4405-lite-d4ae59eb2d.chunk.css → 5127-lite-be5b495f2e.chunk.css} +1 -1
- package/dist/css/{275-lite-4f19640eb7.chunk.css → 5306-lite-40a1dcaba5.chunk.css} +1 -1
- package/dist/css/536-lite-b8b24bff42.chunk.css +29 -0
- package/dist/css/5379-lite-b9ce6d4999.chunk.css +29 -0
- package/dist/css/5442-lite-5b422a19e4.chunk.css +4 -0
- package/dist/css/{5659-lite-0ad79a4f81.chunk.css → 5965-lite-8818fa8d4c.chunk.css} +1 -1
- package/dist/css/{1366-lite-69969922c3.chunk.css → 6683-lite-bfbd8a654d.chunk.css} +1 -1
- package/dist/css/6746-lite-cbacfd109f.chunk.css +1 -0
- package/dist/css/7167-lite-e7bc934b47.chunk.css +5 -0
- package/dist/css/7178-lite-d470e2a870.chunk.css +3 -0
- package/dist/css/{9714-lite-ac0b76a84c.chunk.css → 757-lite-649ce0643d.chunk.css} +1 -1
- package/dist/css/{5555-lite-0ad79a4f81.chunk.css → 763-lite-8818fa8d4c.chunk.css} +1 -1
- package/dist/css/{7701-lite-6d26cc737a.chunk.css → 7679-lite-66e1f0dc57.chunk.css} +1 -0
- package/dist/css/{1944-lite-6cd5066b84.chunk.css → 7726-lite-25438ca851.chunk.css} +1 -0
- package/dist/css/7791-lite-afbd54454d.chunk.css +7 -0
- package/dist/css/7864-lite-eaa787cfb2.chunk.css +3 -0
- package/dist/css/7877-lite-753ceb57d9.chunk.css +7 -0
- package/dist/css/8296-lite-1e63b6b5d8.chunk.css +6 -0
- package/dist/css/{5171-lite-67352d5f48.chunk.css → 8364-lite-8c45fd1bcc.chunk.css} +1 -1
- package/dist/css/{6076-lite-26ebfc882b.chunk.css → 8469-lite-bc1a27e4da.chunk.css} +1 -1
- package/dist/css/{1781-lite-62db879d64.chunk.css → 8541-lite-0f6c636afb.chunk.css} +1 -1
- package/dist/css/{3987-lite-26ebfc882b.chunk.css → 9133-lite-bc1a27e4da.chunk.css} +1 -1
- package/dist/css/9230-lite-5010e72da6.chunk.css +4 -0
- package/dist/css/{3446-lite-1b1ec87a28.chunk.css → 9251-lite-3c8ef33419.chunk.css} +2 -2
- package/dist/css/{7164-lite-4424261809.chunk.css → 9516-lite-4751b1e0aa.chunk.css} +5 -5
- package/dist/css/{4145-lite-10dcae6491.chunk.css → 9704-lite-60ead9f8df.chunk.css} +1 -1
- package/dist/css/{519-lite-e5eb6a5c45.chunk.css → 9719-lite-f28f11cc5a.chunk.css} +2 -1
- package/dist/css/{7484-lite-bef9094c58.chunk.css → 9871-lite-71a39d9bb3.chunk.css} +1 -1
- package/dist/css/{lite-app-df99273901.css → lite-app-ddb4f64bbb.css} +7 -7
- package/dist/languages/en.json +1 -1
- package/dist/scripts/{1980-535747e896-lite.chunk.js → 1201-c93ac8a29a-lite.chunk.js} +1 -1
- package/dist/scripts/1285-d2e1267792-lite.chunk.js +1 -0
- package/dist/scripts/{1316-6f10b36512-lite.chunk.js → 1316-a4f3ec3b20-lite.chunk.js} +1 -1
- package/dist/scripts/1426-94857a953c-lite.chunk.js +2 -0
- package/dist/scripts/{6702-d96686b5d6-lite.chunk.js → 1461-f7e964ae21-lite.chunk.js} +1 -1
- package/dist/scripts/{6822-35fc1ff6f9-lite.chunk.js → 1514-c423b48155-lite.chunk.js} +1 -1
- package/dist/scripts/{1518-eaabe78385-lite.chunk.js → 1518-bed0a6528c-lite.chunk.js} +1 -1
- package/dist/scripts/{5611-d521edcea1-lite.chunk.js → 1519-5df8482b24-lite.chunk.js} +1 -1
- package/dist/scripts/1672-9ae25f79a6-lite.chunk.js +2 -0
- package/dist/scripts/{9622-365c5b0e22-lite.chunk.js → 1688-ca1a2a9f04-lite.chunk.js} +1 -1
- package/dist/scripts/1805-05413695af-lite.chunk.js +2 -0
- package/dist/scripts/1820-e2042d77dd-lite.chunk.js +1 -0
- package/dist/scripts/{1863-e2e84114ee-lite.chunk.js → 1863-0c5334f2c2-lite.chunk.js} +1 -1
- package/dist/scripts/1913-fef63b944b-lite.chunk.js +1 -0
- package/dist/scripts/1919-7860ed3158-lite.chunk.js +1 -0
- package/dist/scripts/209-f1187b4df2-lite.chunk.js +1 -0
- package/dist/scripts/{2118-4e769f5020-lite.chunk.js → 2118-7741e69919-lite.chunk.js} +1 -1
- package/dist/scripts/214-4053c37c3f-lite.chunk.js +1 -0
- package/dist/scripts/2188-0278da007c-lite.chunk.js +1 -0
- package/dist/scripts/2208-1799924a6a-lite.chunk.js +1 -0
- package/dist/scripts/2251-519ee9915e-lite.chunk.js +1 -0
- package/dist/scripts/2269-aa5750345e-lite.chunk.js +1 -0
- package/dist/scripts/2279-d09cf05062-lite.chunk.js +1 -0
- package/dist/scripts/{2318-a0fc0fe177-lite.chunk.js → 2318-0eb533e9f6-lite.chunk.js} +1 -1
- package/dist/scripts/{6154-05e9ba5525-lite.chunk.js → 2408-04112a0ed3-lite.chunk.js} +1 -1
- package/dist/scripts/{7564-b42d4f59a6-lite.chunk.js → 2469-436887b1ed-lite.chunk.js} +1 -1
- package/dist/scripts/{9522-f6a3bf5aa5-lite.chunk.js → 2651-1323807150-lite.chunk.js} +1 -1
- package/dist/scripts/2703-b8b40c84ef-lite.chunk.js +2 -0
- package/dist/scripts/2819-a949173a2e-lite.chunk.js +2 -0
- package/dist/scripts/3012-cd7060bdc9-lite.chunk.js +1 -0
- package/dist/scripts/{3020-923bf44c9b-lite.chunk.js → 3020-b05e9ea141-lite.chunk.js} +1 -1
- package/dist/scripts/3154-eb045d3ab6-lite.chunk.js +1 -0
- package/dist/scripts/3311-808538c9c6-lite.chunk.js +1 -0
- package/dist/scripts/3401-4f2a173341-lite.chunk.js +1 -0
- package/dist/scripts/{3645-30ba602f0c-lite.chunk.js → 3645-d1313ec6dc-lite.chunk.js} +1 -1
- package/dist/scripts/{3667-c9a9052d61-lite.chunk.js → 3667-6ce2b5b14a-lite.chunk.js} +1 -1
- package/dist/scripts/3962-3738b0a52e-lite.chunk.js +1 -0
- package/dist/scripts/407-1e3ffc6e32-lite.chunk.js +2 -0
- package/dist/scripts/4210-dcf489c86f-lite.chunk.js +1 -0
- package/dist/scripts/4441-372ecffa04-lite.chunk.js +2 -0
- package/dist/scripts/{3755-6ed23bfa7a-lite.chunk.js → 4463-7a07bc54f0-lite.chunk.js} +1 -1
- package/dist/scripts/4537-34124b109e-lite.chunk.js +1 -0
- package/dist/scripts/4546-a3452a1fd5-lite.chunk.js +1 -0
- package/dist/scripts/4632-450e2f3cf2-lite.chunk.js +1 -0
- package/dist/scripts/{4690-57efd6540e-lite.chunk.js → 4690-a714a10250-lite.chunk.js} +1 -1
- package/dist/scripts/{5151-28b95c9098-lite.chunk.js → 4728-8837108457-lite.chunk.js} +1 -1
- package/dist/scripts/487-55f69c7d70-lite.chunk.js +2 -0
- package/dist/scripts/{8095-c6901b0fa6-lite.chunk.js → 4956-b0840f1cfa-lite.chunk.js} +1 -1
- package/dist/scripts/5177-ea01e21af3-lite.chunk.js +2 -0
- package/dist/scripts/528-8cfebb9254-lite.chunk.js +1 -0
- package/dist/scripts/5306-b25542939f-lite.chunk.js +1 -0
- package/dist/scripts/536-7c7970277a-lite.chunk.js +2 -0
- package/dist/scripts/5379-95b5e191fe-lite.chunk.js +1 -0
- package/dist/scripts/5442-82e8147edc-lite.chunk.js +2 -0
- package/dist/scripts/5940-875bf13577-lite.chunk.js +1 -0
- package/dist/scripts/{5555-e227390cc4-lite.chunk.js → 5965-ba2cf10fc0-lite.chunk.js} +1 -1
- package/dist/scripts/5974-9d5df057b3-lite.chunk.js +1 -0
- package/dist/scripts/6086-642813efbe-lite.chunk.js +2 -0
- package/dist/scripts/{6274-f3769a7518-lite.chunk.js → 6274-7545674bdd-lite.chunk.js} +1 -1
- package/dist/scripts/6290-b8e7be07c0-lite.chunk.js +1 -0
- package/dist/scripts/6347-5fa92cd82e-lite.chunk.js +1 -0
- package/dist/scripts/{6368-632bb31d55-lite.chunk.js → 6368-91be19eabb-lite.chunk.js} +1 -1
- package/dist/scripts/{6433-7b2bd48f40-lite.chunk.js → 6433-8a473c7c44-lite.chunk.js} +2 -2
- package/dist/scripts/{6572-02f3301356-lite.chunk.js → 6572-d500d16bea-lite.chunk.js} +1 -1
- package/dist/scripts/6683-6a53507e03-lite.chunk.js +2 -0
- package/dist/scripts/6746-a32d22602e-lite.chunk.js +1 -0
- package/dist/scripts/689-165a5a700c-lite.chunk.js +1 -0
- package/dist/scripts/6891-8f643cb84b-lite.chunk.js +1 -0
- package/dist/scripts/6930-91a3463106-lite.chunk.js +1 -0
- package/dist/scripts/{6998-309a16b24e-lite.chunk.js → 6998-43af06b2d9-lite.chunk.js} +1 -1
- package/dist/scripts/7052-aeeed6bc6d-lite.chunk.js +2 -0
- package/dist/scripts/7052-aeeed6bc6d-lite.chunk.js.LICENSE.txt +1 -0
- package/dist/scripts/{7056-6d3a7715c8-lite.chunk.js → 7056-b2c401e297-lite.chunk.js} +1 -1
- package/dist/scripts/7112-02e4fa8fd1-lite.chunk.js +2 -0
- package/dist/scripts/7112-02e4fa8fd1-lite.chunk.js.LICENSE.txt +1 -0
- package/dist/scripts/7115-0b2f29dca8-lite.chunk.js +1 -0
- package/dist/scripts/714-bb31ad5ca8-lite.chunk.js +1 -0
- package/dist/scripts/7167-9a5391a56e-lite.chunk.js +1 -0
- package/dist/scripts/7178-d9ec32d7d3-lite.chunk.js +1 -0
- package/dist/scripts/{7293-9edf8dab3b-lite.chunk.js → 7293-026c162545-lite.chunk.js} +1 -1
- package/dist/scripts/757-67c0765021-lite.chunk.js +1 -0
- package/dist/scripts/763-beed241551-lite.chunk.js +1 -0
- package/dist/scripts/{7701-d1233778f2-lite.chunk.js → 7679-0155d80ba4-lite.chunk.js} +1 -1
- package/dist/scripts/{7703-5b15c739bd-lite.chunk.js → 7703-2cc80445d8-lite.chunk.js} +1 -1
- package/dist/scripts/7726-6d5241cf36-lite.chunk.js +1 -0
- package/dist/scripts/7791-45cbec4cb9-lite.chunk.js +2 -0
- package/dist/scripts/7791-45cbec4cb9-lite.chunk.js.LICENSE.txt +1 -0
- package/dist/scripts/{7855-4598a122c5-lite.chunk.js → 7855-f51632f802-lite.chunk.js} +1 -1
- package/dist/scripts/7864-eb01ccb48c-lite.chunk.js +2 -0
- package/dist/scripts/7864-eb01ccb48c-lite.chunk.js.LICENSE.txt +1 -0
- package/dist/scripts/7877-b7427a8fc3-lite.chunk.js +2 -0
- package/dist/scripts/7877-b7427a8fc3-lite.chunk.js.LICENSE.txt +1 -0
- package/dist/scripts/{8046-82f07ecfc6-lite.chunk.js → 8046-55ad30beea-lite.chunk.js} +1 -1
- package/dist/scripts/8296-61fbedf389-lite.chunk.js +2 -0
- package/dist/scripts/8296-61fbedf389-lite.chunk.js.LICENSE.txt +1 -0
- package/dist/scripts/{8323-ca8e0d6371-lite.chunk.js → 8323-5d423659d5-lite.chunk.js} +1 -1
- package/dist/scripts/8323-5d423659d5-lite.chunk.js.LICENSE.txt +1 -0
- package/dist/scripts/{5171-8572a352e6-lite.chunk.js → 8364-7054d36da8-lite.chunk.js} +1 -1
- package/dist/scripts/8466-627dcf6218-lite.chunk.js +1 -0
- package/dist/scripts/{3987-8a8da439f0-lite.chunk.js → 8469-c872f52295-lite.chunk.js} +1 -1
- package/dist/scripts/{1781-a04e438477-lite.chunk.js → 8541-e93ccc1e65-lite.chunk.js} +1 -1
- package/dist/scripts/{8771-4530cc4e58-lite.chunk.js → 8771-fdb379457c-lite.chunk.js} +1 -1
- package/dist/scripts/8834-bb079c32a4-lite.chunk.js +1 -0
- package/dist/scripts/{8873-e305e24d04-lite.chunk.js → 8873-514feb8faa-lite.chunk.js} +1 -1
- package/dist/scripts/8905-7e47ba1360-lite.chunk.js +1 -0
- package/dist/scripts/{9016-236a5997d4-lite.chunk.js → 9016-68a0088483-lite.chunk.js} +1 -1
- package/dist/scripts/9118-43d2bf9226-lite.chunk.js +1 -0
- package/dist/scripts/{6076-d0ab857b36-lite.chunk.js → 9133-d324adda28-lite.chunk.js} +1 -1
- package/dist/scripts/{9151-a4b1b99c42-lite.chunk.js → 9151-97d4bda2a9-lite.chunk.js} +1 -1
- package/dist/scripts/{9226-8d25ca41f8-lite.chunk.js → 9226-81363cd855-lite.chunk.js} +1 -1
- package/dist/scripts/9230-b5f75f4b25-lite.chunk.js +2 -0
- package/dist/scripts/9230-b5f75f4b25-lite.chunk.js.LICENSE.txt +1 -0
- package/dist/scripts/{3446-f8a4d517dd-lite.chunk.js → 9251-c959bef104-lite.chunk.js} +1 -1
- package/dist/scripts/{1517-b1cad166ec-lite.chunk.js → 9433-17de94d578-lite.chunk.js} +1 -1
- package/dist/scripts/{9478-6f19948322-lite.chunk.js → 9478-48fd914e48-lite.chunk.js} +2 -2
- package/dist/scripts/9478-48fd914e48-lite.chunk.js.LICENSE.txt +1 -0
- package/dist/scripts/9516-c47539c35b-lite.chunk.js +1 -0
- package/dist/scripts/9657-50adfc790f-lite.chunk.js +1 -0
- package/dist/scripts/{4145-8a549f2fd1-lite.chunk.js → 9704-a3a54ec316-lite.chunk.js} +1 -1
- package/dist/scripts/9719-c890a68331-lite.chunk.js +2 -0
- package/dist/scripts/9719-c890a68331-lite.chunk.js.LICENSE.txt +1 -0
- package/dist/scripts/{7484-f15261951b-lite.chunk.js → 9871-239c33690a-lite.chunk.js} +1 -1
- package/dist/scripts/{9894-1e493082b6-lite.chunk.js → 9894-0e66baa841-lite.chunk.js} +1 -1
- package/dist/scripts/9894-0e66baa841-lite.chunk.js.LICENSE.txt +1 -0
- package/dist/scripts/993-51d56e4686-lite.chunk.js +2 -0
- package/dist/scripts/993-51d56e4686-lite.chunk.js.LICENSE.txt +1 -0
- package/dist/scripts/bundle-0846da5fd2.min.js +2 -0
- package/package.json +4 -3
- package/dist/css/109-lite-e638e5617a.chunk.css +0 -3
- package/dist/css/7178-lite-b4e4346f43.chunk.css +0 -3
- package/dist/css/8329-lite-1f86f27b10.chunk.css +0 -3
- package/dist/css/8978-lite-aa21368531.chunk.css +0 -3
- package/dist/scripts/109-c94f9ee532-lite.chunk.js +0 -1
- package/dist/scripts/1285-2d3299c556-lite.chunk.js +0 -1
- package/dist/scripts/1366-9085be8f1d-lite.chunk.js +0 -2
- package/dist/scripts/1672-18d6a86a04-lite.chunk.js +0 -2
- package/dist/scripts/1820-d34eefdad4-lite.chunk.js +0 -1
- package/dist/scripts/1913-00de345658-lite.chunk.js +0 -1
- package/dist/scripts/1944-23f4b400c6-lite.chunk.js +0 -1
- package/dist/scripts/209-d5def5db16-lite.chunk.js +0 -1
- package/dist/scripts/2208-c345263710-lite.chunk.js +0 -1
- package/dist/scripts/2269-48415bbc64-lite.chunk.js +0 -1
- package/dist/scripts/2279-02a72d36ec-lite.chunk.js +0 -1
- package/dist/scripts/2608-5af270eedf-lite.chunk.js +0 -1
- package/dist/scripts/2743-deafaa1681-lite.chunk.js +0 -1
- package/dist/scripts/275-ba99531836-lite.chunk.js +0 -1
- package/dist/scripts/3012-cc96ee5265-lite.chunk.js +0 -1
- package/dist/scripts/3154-539a352006-lite.chunk.js +0 -1
- package/dist/scripts/3371-bb9a674c07-lite.chunk.js +0 -1
- package/dist/scripts/3488-dd8581e604-lite.chunk.js +0 -2
- package/dist/scripts/3706-482b7bb8d2-lite.chunk.js +0 -2
- package/dist/scripts/3865-f7e73fec9c-lite.chunk.js +0 -1
- package/dist/scripts/3962-3dcedae047-lite.chunk.js +0 -1
- package/dist/scripts/4373-388f025686-lite.chunk.js +0 -1
- package/dist/scripts/4417-1ef8363302-lite.chunk.js +0 -1
- package/dist/scripts/4441-d12cc318db-lite.chunk.js +0 -2
- package/dist/scripts/4537-6383a3ea11-lite.chunk.js +0 -1
- package/dist/scripts/4632-ac71090d0d-lite.chunk.js +0 -1
- package/dist/scripts/519-4140367219-lite.chunk.js +0 -1
- package/dist/scripts/528-9a6deb93d3-lite.chunk.js +0 -1
- package/dist/scripts/5659-176b355d0b-lite.chunk.js +0 -1
- package/dist/scripts/5974-8af9af8fae-lite.chunk.js +0 -1
- package/dist/scripts/6290-337e7cf0ba-lite.chunk.js +0 -1
- package/dist/scripts/6609-433a3003e6-lite.chunk.js +0 -1
- package/dist/scripts/689-30388920c3-lite.chunk.js +0 -1
- package/dist/scripts/6930-9f739d475b-lite.chunk.js +0 -1
- package/dist/scripts/6957-691d6fbdc7-lite.chunk.js +0 -1
- package/dist/scripts/7052-ff6e30ba46-lite.chunk.js +0 -2
- package/dist/scripts/7112-25e9780c3f-lite.chunk.js +0 -2
- package/dist/scripts/7115-c73692fe3a-lite.chunk.js +0 -1
- package/dist/scripts/714-02e02b6b62-lite.chunk.js +0 -1
- package/dist/scripts/7164-6489adf352-lite.chunk.js +0 -1
- package/dist/scripts/7178-3c36d6ca9f-lite.chunk.js +0 -1
- package/dist/scripts/7286-96e1818fd0-lite.chunk.js +0 -1
- package/dist/scripts/817-fc0acd6208-lite.chunk.js +0 -1
- package/dist/scripts/8329-db3ca45cb6-lite.chunk.js +0 -2
- package/dist/scripts/8367-6946446a01-lite.chunk.js +0 -1
- package/dist/scripts/8466-2c58de04c4-lite.chunk.js +0 -1
- package/dist/scripts/8564-3183d8595c-lite.chunk.js +0 -1
- package/dist/scripts/8905-039126dc2f-lite.chunk.js +0 -1
- package/dist/scripts/8978-2cb6319c36-lite.chunk.js +0 -2
- package/dist/scripts/9118-53bed185a5-lite.chunk.js +0 -1
- package/dist/scripts/9581-41cb8eba5b-lite.chunk.js +0 -1
- package/dist/scripts/9714-f8d16adc4e-lite.chunk.js +0 -1
- package/dist/scripts/9869-87a902e2d1-lite.chunk.js +0 -2
- package/dist/scripts/bundle-efcc879242.min.js +0 -2
- /package/dist/css/{2743-lite-ab01f5dc3b.chunk.css → 1919-lite-ab01f5dc3b.chunk.css} +0 -0
- /package/dist/css/{3706-lite-8601f9a468.chunk.css → 5177-lite-8601f9a468.chunk.css} +0 -0
- /package/dist/css/{8367-lite-a3507f7491.chunk.css → 5940-lite-a3507f7491.chunk.css} +0 -0
- /package/dist/css/{3865-lite-a288188c68.chunk.css → 6891-lite-a288188c68.chunk.css} +0 -0
- /package/dist/css/{6609-lite-08c053955f.chunk.css → 9657-lite-08c053955f.chunk.css} +0 -0
- /package/dist/scripts/{1366-9085be8f1d-lite.chunk.js.LICENSE.txt → 1426-94857a953c-lite.chunk.js.LICENSE.txt} +0 -0
- /package/dist/scripts/{1672-18d6a86a04-lite.chunk.js.LICENSE.txt → 1672-9ae25f79a6-lite.chunk.js.LICENSE.txt} +0 -0
- /package/dist/scripts/{1725-2eb898f9e6-lite.chunk.js → 1725-0e284a32f3-lite.chunk.js} +0 -0
- /package/dist/scripts/{1750-dd4c1bf3fc-lite.chunk.js → 1750-82cf9361fb-lite.chunk.js} +0 -0
- /package/dist/scripts/{2118-4e769f5020-lite.chunk.js.LICENSE.txt → 1805-05413695af-lite.chunk.js.LICENSE.txt} +0 -0
- /package/dist/scripts/{1830-6aba57235d-lite.chunk.js → 1830-95f21db5dc-lite.chunk.js} +0 -0
- /package/dist/scripts/{1891-c0e59b8132-lite.chunk.js → 1891-dd253c3378-lite.chunk.js} +0 -0
- /package/dist/scripts/{3488-dd8581e604-lite.chunk.js.LICENSE.txt → 2118-7741e69919-lite.chunk.js.LICENSE.txt} +0 -0
- /package/dist/scripts/{3645-30ba602f0c-lite.chunk.js.LICENSE.txt → 2703-b8b40c84ef-lite.chunk.js.LICENSE.txt} +0 -0
- /package/dist/scripts/{2767-5df93b7c43-lite.chunk.js → 2767-299f58bb17-lite.chunk.js} +0 -0
- /package/dist/scripts/{3667-c9a9052d61-lite.chunk.js.LICENSE.txt → 2819-a949173a2e-lite.chunk.js.LICENSE.txt} +0 -0
- /package/dist/scripts/{3108-ae911e3d71-lite.chunk.js → 3108-86d4c73e29-lite.chunk.js} +0 -0
- /package/dist/scripts/{3171-663aa64cae-lite.chunk.js → 3171-9eda288c67-lite.chunk.js} +0 -0
- /package/dist/scripts/{3468-4d7076a979-lite.chunk.js → 3468-8926a9db70-lite.chunk.js} +0 -0
- /package/dist/scripts/{3706-482b7bb8d2-lite.chunk.js.LICENSE.txt → 3645-d1313ec6dc-lite.chunk.js.LICENSE.txt} +0 -0
- /package/dist/scripts/{4441-d12cc318db-lite.chunk.js.LICENSE.txt → 3667-6ce2b5b14a-lite.chunk.js.LICENSE.txt} +0 -0
- /package/dist/scripts/{389-e7037a0807-lite.chunk.js → 389-2ab260e7d2-lite.chunk.js} +0 -0
- /package/dist/scripts/{6433-7b2bd48f40-lite.chunk.js.LICENSE.txt → 407-1e3ffc6e32-lite.chunk.js.LICENSE.txt} +0 -0
- /package/dist/scripts/{4182-2de6622588-lite.chunk.js → 4182-6869dfda31-lite.chunk.js} +0 -0
- /package/dist/scripts/{7052-ff6e30ba46-lite.chunk.js.LICENSE.txt → 4441-372ecffa04-lite.chunk.js.LICENSE.txt} +0 -0
- /package/dist/scripts/{4541-c08f765eab-lite.chunk.js → 4541-9ad274071e-lite.chunk.js} +0 -0
- /package/dist/scripts/{4617-3f998d9b1e-lite.chunk.js → 4617-940157b232-lite.chunk.js} +0 -0
- /package/dist/scripts/{482-8139ae4723-lite.chunk.js → 482-c9fd7b68d3-lite.chunk.js} +0 -0
- /package/dist/scripts/{7112-25e9780c3f-lite.chunk.js.LICENSE.txt → 487-55f69c7d70-lite.chunk.js.LICENSE.txt} +0 -0
- /package/dist/scripts/{8323-ca8e0d6371-lite.chunk.js.LICENSE.txt → 5177-ea01e21af3-lite.chunk.js.LICENSE.txt} +0 -0
- /package/dist/scripts/{5229-7329bd81e6-lite.chunk.js → 5229-fed729d13a-lite.chunk.js} +0 -0
- /package/dist/scripts/{8329-db3ca45cb6-lite.chunk.js.LICENSE.txt → 536-7c7970277a-lite.chunk.js.LICENSE.txt} +0 -0
- /package/dist/scripts/{5385-f53e603625-lite.chunk.js → 5385-2719aaaf84-lite.chunk.js} +0 -0
- /package/dist/scripts/{8978-2cb6319c36-lite.chunk.js.LICENSE.txt → 5442-82e8147edc-lite.chunk.js.LICENSE.txt} +0 -0
- /package/dist/scripts/{5595-5ee4c1c5ed-lite.chunk.js → 5595-ed6e8d9ca0-lite.chunk.js} +0 -0
- /package/dist/scripts/{5606-2596d38d1b-lite.chunk.js → 5606-68f1afd060-lite.chunk.js} +0 -0
- /package/dist/scripts/{5877-0acd7d3124-lite.chunk.js → 5877-1dc9ca4f2d-lite.chunk.js} +0 -0
- /package/dist/scripts/{6057-a8b9812431-lite.chunk.js → 6057-3c43af21b1-lite.chunk.js} +0 -0
- /package/dist/scripts/{9478-6f19948322-lite.chunk.js.LICENSE.txt → 6086-642813efbe-lite.chunk.js.LICENSE.txt} +0 -0
- /package/dist/scripts/{9869-87a902e2d1-lite.chunk.js.LICENSE.txt → 6433-8a473c7c44-lite.chunk.js.LICENSE.txt} +0 -0
- /package/dist/scripts/{6450-1b69ecb4d2-lite.chunk.js → 6450-0bde4cef33-lite.chunk.js} +0 -0
- /package/dist/scripts/{6465-7a63bc80b6-lite.chunk.js → 6465-5b42f81416-lite.chunk.js} +0 -0
- /package/dist/scripts/{6480-3e17c41241-lite.chunk.js → 6480-93ab348bf1-lite.chunk.js} +0 -0
- /package/dist/scripts/{9894-1e493082b6-lite.chunk.js.LICENSE.txt → 6683-6a53507e03-lite.chunk.js.LICENSE.txt} +0 -0
- /package/dist/scripts/{6689-ec5171ba5f-lite.chunk.js → 6689-65a1b86bb2-lite.chunk.js} +0 -0
- /package/dist/scripts/{6863-5dbc85c4b9-lite.chunk.js → 6863-d4f402b72e-lite.chunk.js} +0 -0
- /package/dist/scripts/{7128-87b101d7b7-lite.chunk.js → 7128-bb219eed51-lite.chunk.js} +0 -0
- /package/dist/scripts/{7172-7dadcbf10c-lite.chunk.js → 7172-7710a90e85-lite.chunk.js} +0 -0
- /package/dist/scripts/{7338-e0306c666f-lite.chunk.js → 7338-a5d6a68d8e-lite.chunk.js} +0 -0
- /package/dist/scripts/{7432-ed0fdcb18c-lite.chunk.js → 7432-87ce1798ff-lite.chunk.js} +0 -0
- /package/dist/scripts/{7708-966b540945-lite.chunk.js → 7708-b642cddc03-lite.chunk.js} +0 -0
- /package/dist/scripts/{7715-b21edc60f0-lite.chunk.js → 7715-4f575c978b-lite.chunk.js} +0 -0
- /package/dist/scripts/{7925-c8cd8aace8-lite.chunk.js → 7925-29ca2fc37a-lite.chunk.js} +0 -0
- /package/dist/scripts/{8025-1982900b56-lite.chunk.js → 8025-0ef8f041ea-lite.chunk.js} +0 -0
- /package/dist/scripts/{8236-10fe50cf1f-lite.chunk.js → 8236-057a7f40db-lite.chunk.js} +0 -0
- /package/dist/scripts/{8830-16c2fd1319-lite.chunk.js → 8830-122c8ae807-lite.chunk.js} +0 -0
- /package/dist/scripts/{9016-236a5997d4-lite.chunk.js.LICENSE.txt → 9016-68a0088483-lite.chunk.js.LICENSE.txt} +0 -0
- /package/dist/scripts/{9060-aea36d49b0-lite.chunk.js → 9060-c035711b40-lite.chunk.js} +0 -0
- /package/dist/scripts/{9455-283f477332-lite.chunk.js → 9455-c80c14ea98-lite.chunk.js} +0 -0
- /package/dist/scripts/{9674-25ccc9ee52-lite.chunk.js → 9674-f5e66f8c06-lite.chunk.js} +0 -0
- /package/dist/scripts/{9843-d084ed32bf-lite.chunk.js → 9843-07f0304cc4-lite.chunk.js} +0 -0
- /package/dist/scripts/{bundle-efcc879242.min.js.LICENSE.txt → bundle-0846da5fd2.min.js.LICENSE.txt} +0 -0
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! For license information please see 3706-482b7bb8d2-lite.chunk.js.LICENSE.txt */
|
|
2
|
-
"use strict";(self.webpackChunk_clickview_lite=self.webpackChunk_clickview_lite||[]).push([[3706],{73758:(t,e,n)=>{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)}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,o(r.key),r)}}function o(t){var e=function(t,e){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=r(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==r(e)?e:String(e)}n.d(e,{n:()=>a});var a=new(function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.listeners={}}var e,n;return e=t,n=[{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),i=1;i<n;i++)r[i-1]=arguments[i];if(this.listeners[t]){var o=[];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&&o.push(t.callback)),(e=t.callback).apply.apply(e,[null].concat(r))})),o.length&&o.forEach((function(n){return e.deregisterListener(t,n)}))}}}],n&&i(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}())},26733:(t,e,n)=>{n.d(e,{s:()=>P,R:()=>S});var r=n(32735),i=n(39202),o=n(97395),a=n(49985),s=n(65858),c=n(36848),u=n(78276),l=n(76177),f=n(71063),h=n(54610),p=n(4594),d=n(1164),y=n(79967),v=n(67453);const b={imageStyle:"I9E5O",item:"tqUFn",background:"s1dNr",thumbnailContainer:"EDiGi",teacherPack:"_tdVE",text:"g5NWS",hoverState:"xRYhX",atomGuide:"X39wU",studentActivity:"X9pMl",additionalMaterials:"qRVUo",userUploaded:"_18JaV",imageTypeResource:"KYtZL"};var g={width:200,resizeType:h.Nq.Cover};function m(t,e){var n,r,i;if("thumbnail"in e&&(null===(n=e.thumbnail)||void 0===n?void 0:n.url))return v.j.createUrl(null===(r=e.thumbnail)||void 0===r?void 0:r.url,Object.assign({},g));var a=o._.safeUrlConcat(t,"/v1/previews");return"metadata"in e?e.metadata.type===d.L.Pdf?v.j.createResourceImage(a,e.url,g):e.metadata.type===d.L.Image?v.j.createUrl(e.url,{size:h.h2.Medium,resizeType:h.Nq.Cover}):(null===(i=e.pdf)||void 0===i?void 0:i.url)?v.j.createResourceImage(a,e.pdf.url,g):(e.metadata.type,d.L.Zip,"/images/zip-resource.png"):v.j.createResourceImage(a,e.url,Object.assign({},g))}function w(t){var e;return"metadata"in t?t.metadata.type===d.L.Pdf?h.__.Pdf:t.metadata.type===d.L.Image?h.__.Thumbnails:(null===(e=t.pdf)||void 0===e?void 0:e.url)?h.__.Pdf:(t.metadata.type,d.L.Zip,h.__.Thumbnails):h.__.Link}function P(t){var e,n,i,o,a,c,f,h=null,p=0;"metadata"in t.data&&(h=t.data.metadata,p=null!==(i=null===(n=null===(e=t.data.thumbnail)||void 0===e?void 0:e.metadata)||void 0===n?void 0:n.rotation)&&void 0!==i?i:0);var y="".concat(null!==(a=null===(o=t.theme)||void 0===o?void 0:o.containerClass)&&void 0!==a?a:""," pt-3 px-3 rounded-3 d-flex flex-column align-items-center")+" justify-content-end ".concat(function(t){switch(t){case"atom-guide":return b.atomGuide;case"student-activity":return b.studentActivity;case"teacher-pack":return b.teacherPack;case"additional-materials":return b.additionalMaterials;default:return b.userUploaded}}(null==h?void 0:h.resourceType)," ").concat(b.background," ").concat(t.applyHoverState?b.hoverState:""," ");return r.createElement("div",{className:y},!t.hideHeading&&r.createElement(l.u,{title:t.data.name},r.createElement("h3",{className:"text-center text-break h5 mb-3 ".concat(b.text)},r.createElement("span",{className:"clamp-1"},t.data.name))),r.createElement("div",{className:"".concat(null!==(f=null===(c=t.theme)||void 0===c?void 0:c.thumbnailContainerClass)&&void 0!==f?f:""," w-75 overflow-hidden ").concat(b.thumbnailContainer," ").concat(b.imageStyle)},r.createElement(u.Z,{data:m(t.imageCdnUrl,t.data),imageType:w(t.data),imageStyle:{transform:"rotate(".concat(p,"deg)")},alt:t.data.name,analyticsOptions:{location:s.LZ.SlidingListItem},errorFallbackImageSrc:t.imageErrorFallbackUrl,imageClassName:(null==h?void 0:h.type)===d.L.Image?"".concat(b.imageTypeResource," ").concat(b.imageStyle):"",preload:t.preloadImage,preventLoad:!t.preloadImage})))}P.defaultProps={preloadImage:!0,actionBehaviour:"normal"};var S=r.memo((function(t){var e,n,o,u,l=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 i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}(t,[]),h=(e=t.data,n=t.actionBehaviour,u=(0,y.k)(),"public"===n||!u.xs&&!u.sm&&"resource"===e.type&&"metadata"in e&&(e.metadata.type===d.L.Image||(e.metadata.type===d.L.Pdf?!!e.url:!!(null===(o=e.pdf)||void 0===o?void 0:o.url)))),v=Object.assign(Object.assign({},t.analyticsData),t.data),g=Object.assign(Object.assign({},t.analyticsOptions),{actionType:s.Vw.Click,entity:t.data.typeId===p.E.Resource?s.py.Resource:s.py.Link});function m(){a.k.logUserAction(v,g)}var w,S=!!t.data.url;return l.applyHoverState=h||S,r.createElement("div",{className:"pt-1 px-1 flex-shrink-0 ".concat(b.item," ").concat(f.M.RESOURCE_ITEM_SELECTOR)},(w="d-block no-decoration","link"===t.data.type?r.createElement("a",{href:t.data.url,target:"_blank",className:w,onClick:m},r.createElement(P,Object.assign({},l))):h?"public"===t.actionBehaviour?r.createElement("div",{className:"".concat(w," cursor-pointer d-inline"),onClick:function(){m(),i.C$.trigger(t.getAppLink(t.data))}},r.createElement(P,Object.assign({},l))):r.createElement(c.F,{appLink:t.getAppLink(t.data),className:w,analyticsData:v,analyticsOptions:g},r.createElement(P,Object.assign({},l))):S?r.createElement("a",{href:t.data.url,className:w,onClick:m},r.createElement(P,Object.assign({},l))):r.createElement("div",{className:w},r.createElement(P,Object.assign({},l)))))}))},6274:(t,e,n)=>{n.r(e),n.d(e,{ClickViewPlayer:()=>Tr});var r=n(32735),i=n(51482),o=(n(16852),n(93861));function a(t){return a="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},a(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,c(r.key),r)}}function c(t){var e=function(t,e){if("object"!=a(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=a(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==a(e)?e:String(e)}function u(){return u="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=f(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},u.apply(this,arguments)}function l(t,e){return l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},l(t,e)}function f(t){return f=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},f(t)}var h=function(t){!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)}(c,t);var e,n,r,i,o=(r=c,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=f(r);if(i){var n=f(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===a(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)}(this,t)});function c(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,c),(t=o.apply(this,arguments)).alwaysCollapsed=!1,t.isCollapsed=!1,t.isCollabsible=!0,t}return e=c,(n=[{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(){u(f(c.prototype),"handleClick",this).call(this,null)}}])&&s(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),c}(o.Z.getComponent("Button"));function p(t){return p="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},p(t)}function d(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,e){if("object"!=p(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=p(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==p(e)?e:String(e)}function v(t,e){return v=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},v(t,e)}function b(t){return b=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},b(t)}h.prototype.controlText_="Create Clip",o.Z.registerComponent("CreateClipButton",h);var g=function(t){!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&&v(t,e)}(a,t);var e,n,r,i,o=(r=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=b(r);if(i){var n=b(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===p(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)}(this,t)});function a(t,e){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),(n=o.call(this,t,e)).options=e,t.ready((function(){return n.onReady()})),n}return e=a,(n=[{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)}}])&&d(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(o.Z.getPlugin("plugin"));function m(t){return m="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},m(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,P(r.key),r)}}function P(t){var e=function(t,e){if("object"!=m(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=m(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==m(e)?e:String(e)}function S(t,e){return S=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},S(t,e)}function k(t){return k=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},k(t)}o.Z.registerPlugin("createClipButtonPlugin",g);var O=function(t){!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&&S(t,e)}(a,t);var e,n,r,i,o=(r=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=k(r);if(i){var n=k(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===m(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)}(this,t)});function a(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),o.apply(this,arguments)}return e=a,(n=[{key:"handlePictureInPictureEnabledChange",value:function(){this.enable()}}])&&w(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(o.Z.getComponent("PictureInPictureToggle"));function j(t){return j="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},j(t)}function E(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,C(r.key),r)}}function C(t){var e=function(t,e){if("object"!=j(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=j(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==j(e)?e:String(e)}function x(){return x="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=_(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},x.apply(this,arguments)}function T(t,e){return T=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},T(t,e)}function _(t){return _=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_(t)}o.Z.registerComponent("PictureInPictureToggle",O);var I=o.Z.getComponent("PlayToggle"),R=function(t){!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)}(a,t);var e,n,r,i,o=(r=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=_(r);if(i){var n=_(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===j(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)}(this,t)});function a(t,e){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),(n=o.call(this,t,e)).pictureInPictureEnabled=!1,n.options=e,n.bindFunctions(),n}return e=a,(n=[{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:"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(){if(!this.player.isInPictureInPicture()){var t=this.player.el().getBoundingClientRect();0!==t.width&&(t.width<800?this.disablePictureInPicture():this.enablePictureInPicture())}}},{key:"addPipStyles",value:function(){this.player.addClass("cv-picture-in-picture"),this.playToggle=new I(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(){this.togglePictureInPicture(!1),this.options.onRequestPictureInPicture(!1),this.removePipStyles()}},{key:"getToggleParentComponent",value:function(){return this.player.getChild("collapserator")}},{key:"dispose",value:function(){this.player.requestPictureInPicture=this.playerRequestPictureInPictureFn,this.player.exitPictureInPicture=this.playerExitPictureInPictureFn,x(_(a.prototype),"dispose",this).call(this)}}])&&E(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(o.Z.getPlugin("plugin"));o.Z.registerPlugin("pictureInPicture",R);var L=n(23035),D=n(42892),M=n(73758);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 A(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,V(r.key),r)}}function V(t){var e=function(t,e){if("object"!=N(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=N(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==N(e)?e:String(e)}function F(){return F="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=G(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},F.apply(this,arguments)}function B(t,e){return B=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},B(t,e)}function U(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function G(t){return G=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},G(t)}var Z=function(t){!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)}(s,t);var e,n,r,i,a=(r=s,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=G(r);if(i){var n=G(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return 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 U(t)}(this,t)});function s(t,e){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s),(n=a.call(this,t,e)).hasBuffered=!1,n.hasPlayed=!1,n.eventsService=M.n,n.pointOfInterest=e.pointOfInterest,n.onMouseOver=n.onMouseOver.bind(U(n)),n.onMouseLeave=n.onMouseLeave.bind(U(n)),n.onGlancePointOfInterestMouseEnter=n.onGlancePointOfInterestMouseEnter.bind(U(n)),n.onGlancePointOfInterestMouseLeave=n.onGlancePointOfInterestMouseLeave.bind(U(n)),n.initialize(),n}return e=s,(n=[{key:"initialize",value:function(){this.setPosition(),this.bindListeners()}},{key:"buildCSSClass",value:function(){return"cv-point-of-interest-indicator ".concat(F(G(s.prototype),"buildCSSClass",this).call(this))}},{key:"createEl",value:function(t,e,n){return F(G(s.prototype),"createEl",this).call(this,t,Object.assign(Object.assign({},e),{className:this.buildCSSClass()}),n)}},{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")}}])&&A(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),s}(o.Z.getComponent("Component"));function z(t){return z="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},z(t)}function q(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,e){if("object"!=z(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=z(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==z(e)?e:String(e)}function Y(){return Y="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=$(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},Y.apply(this,arguments)}function W(t,e){return W=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},W(t,e)}function $(t){return $=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},$(t)}var Q=function(t){!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&&W(t,e)}(s,t);var e,n,r,i,a=(r=s,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=$(r);if(i){var n=$(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===z(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)}(this,t)});function s(t,e){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s),(n=a.call(this,t,e)).pointsOfInterestVisible=e.pointsOfInterestVisible,n.toggle(n.pointsOfInterestVisible),n}return e=s,(n=[{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"),this.pointsOfInterestVisible=!0,this.player().pointsOfInterestPlugin().togglePointsOfInterest(this.pointsOfInterestVisible)}},{key:"toggleOff",value:function(){o.Z.dom.removeClass(this.toggleEl,"on"),this.pointsOfInterestVisible=!1,this.player().pointsOfInterestPlugin().togglePointsOfInterest(this.pointsOfInterestVisible)}},{key:"handleClick",value:function(t){t.stopImmediatePropagation()}},{key:"createEl",value:function(t,e,n){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 toggle-option float-end",innerHTML:'<span class="handle"></span></div>'}),this.toggleEl.addEventListener("click",this.handleToggle);var r=Y($(s.prototype),"createEl",this).call(this,t,{className:"vjs-menu-item cv-cog-menu-item",innerHTML:'\n <span class="vjs-menu-item-text">Points of Interest</span>\n <span class="cv-toggle-container"></span>'},n);return r.children[1].appendChild(this.toggleEl),r}}])&&q(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),s}(o.Z.getComponent("MenuItem"));function X(t){return X="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},X(t)}function J(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,K(r.key),r)}}function K(t){var e=function(t,e){if("object"!=X(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=X(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==X(e)?e:String(e)}function tt(t,e){return tt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},tt(t,e)}function et(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function nt(t){return nt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},nt(t)}o.Z.registerComponent("PointsOfInterestMenuItem",Q);var rt=o.Z.getPlugin("plugin"),it="cvplayer-points-of-interest",ot=function(t){!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&&tt(t,e)}(a,t);var e,n,r,i,o=(r=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=nt(r);if(i){var n=nt(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===X(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return et(t)}(this,t)});function a(t,e){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),(n=o.call(this,t)).pointOfInterestIndicators=[],n.enabled=!0,n.pointsOfInterest=null==e?void 0:e.pointsOfInterest,n.initialize=n.initialize.bind(et(n)),n.updateBuffered=n.updateBuffered.bind(et(n)),n.updatePlaybackProgress=n.updatePlaybackProgress.bind(et(n)),n.player.one("loadedmetadata",(function(){return n.player.ready(n.initialize)})),n}return e=a,(n=[{key:"initialize",value:function(){this.pointsOfInterest&&(D.S.hasLocalStorage()&&"false"===D.S.get(it)&&(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){D.S.set(it,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 Z(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:Q,name:"PointsOfInterestMenuItem",options:{pointsOfInterestVisible:this.enabled}})}},{key:"updateBuffered",value:function(){var t=this;this.pointOfInterestIndicators.forEach((function(e){return e.updateBuffered((0,L.b)(t.player))}))}},{key:"updatePlaybackProgress",value:function(){var t=this;this.pointOfInterestIndicators.forEach((function(e){return e.updatePlaybackProgress(t.player.currentTime())}))}}])&&J(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(rt);o.Z.registerPlugin("pointsOfInterestPlugin",ot),n(93262);var at,st=n(65858),ct=n(33937);function ut(t){var e="function"==typeof Map?new Map:void 0;return ut=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 lt(t,arguments,pt(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),ht(n,t)},ut(t)}function lt(t,e,n){return lt=ft()?Reflect.construct.bind():function(t,e,n){var r=[null];r.push.apply(r,e);var i=new(Function.bind.apply(t,r));return n&&ht(i,n.prototype),i},lt.apply(null,arguments)}function ft(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function ht(t,e){return ht=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ht(t,e)}function pt(t){return pt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},pt(t)}function dt(t){return dt="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},dt(t)}function yt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function vt(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 bt(t,e,n){return e&&vt(t.prototype,e),n&&vt(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function gt(t){var e=function(t,e){if("object"!=dt(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=dt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==dt(e)?e:String(e)}!function(t){t.AppleTv="apple-tv",t.Vivi="vivi"}(at||(at={}));var mt,wt,Pt,St=function(){function t(){yt(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)}return bt(t,[{key:"trigger",value:function(t){var e=this;this.callbacks.forEach((function(n,r){var i=e.predicates[r];i&&!i(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()?kt.reject(new Error("This EventChannel instance has been disposed")):new kt((function(r,i){t=e.on((function(n){e.signal.removeEventListener("abort",o),t(),r(n)})).filter(n);var o=function(){t(),i(new Error("Aborted while waiting for message"))};e.signal.addEventListener("abort",o,{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}}]),t}(),kt=function(t){!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&&ht(t,e)}(i,t);var e,n,r=(e=i,n=ft(),function(){var t,r=pt(e);if(n){var i=pt(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return function(t,e){if(e&&("object"===dt(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)}(this,t)});function i(t,e){var n;return yt(this,i),(n=r.call(this,t)).onTimeout=e,n.bindFunctions(),n}return bt(i,[{key:"bindFunctions",value:function(){this.timeout=this.timeout.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(i)}));var i=setTimeout((function(){var t;null===(t=e.onTimeout)||void 0===t||t.call(e),r(new Error("Promise timed out"))}),t)}))}}],[{key:"reject",value:function(t){return new i((function(e,n){return n(t)}))}}]),i}(ut(Promise)),Ot=function(){function t(){yt(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)}return bt(t,[{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",jt.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 St),this.channels[t]}}]),t}(),jt={void:void 0},Et=n(95569),Ct=function(t,e){return t._lastModified||(t._lastModified={}),new Proxy(t,{set:function(n,r,i,o){var a=t._lastModified[r.toString()];return!!(a&&Date.now()<a+e)||Reflect.set(n,r,i,o)}})},xt=function(t){return t._lastModified||(t._lastModified={}),new Proxy(t,{set:function(e,n,r,i){return t._lastModified[n.toString()]=Date.now(),Reflect.set(e,n,r,i)}})};function Tt(t){return Tt="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},Tt(t)}function _t(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 It(t,e,n){return e&&_t(t.prototype,e),n&&_t(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Rt(t){var e=function(t,e){if("object"!=Tt(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Tt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Tt(e)?e:String(e)}!function(t){t[t.Offline=0]="Offline",t[t.Online=1]="Online",t[t.Locked=2]="Locked",t[t.Suspended=3]="Suspended"}(mt||(mt={})),function(t){t[t.PlaybackStatusChange=0]="PlaybackStatusChange",t[t.PositionChange=1]="PositionChange"}(wt||(wt={})),function(t){t.Begin="BEGIN",t.Play="PLAY",t.Pause="PAUSE",t.Load="LOAD",t.Scan="SCAN",t.Stop="STOP"}(Pt||(Pt={}));var Lt=It((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=Pt.Load,this.debounced=Ct(this,2e3),xt(this)}));function Dt(t){return Dt="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},Dt(t)}function Mt(){Mt=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var o=e&&e.prototype instanceof b?e:b,a=Object.create(o.prototype),s=new _(r||[]);return i(a,"_invoke",{value:E(t,n,s)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var h="suspendedStart",p="suspendedYield",d="executing",y="completed",v={};function b(){}function g(){}function m(){}var w={};u(w,a,(function(){return this}));var P=Object.getPrototypeOf,S=P&&P(P(I([])));S&&S!==n&&r.call(S,a)&&(w=S);var k=m.prototype=b.prototype=Object.create(w);function O(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function j(t,e){function n(i,o,a,s){var c=f(t[i],t,o);if("throw"!==c.type){var u=c.arg,l=u.value;return l&&"object"==Dt(l)&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(l).then((function(t){u.value=t,a(u)}),(function(t){return n("throw",t,a,s)}))}s(c.arg)}var o;i(this,"_invoke",{value:function(t,r){function i(){return new e((function(e,i){n(t,r,e,i)}))}return o=o?o.then(i,i):i()}})}function E(e,n,r){var i=h;return function(o,a){if(i===d)throw new Error("Generator is already running");if(i===y){if("throw"===o)throw a;return{value:t,done:!0}}for(r.method=o,r.arg=a;;){var s=r.delegate;if(s){var c=C(s,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(i===h)throw i=y,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=d;var u=f(e,n,r);if("normal"===u.type){if(i=r.done?y:p,u.arg===v)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(i=y,r.method="throw",r.arg=u.arg)}}}function C(e,n){var r=n.method,i=e.iterator[r];if(i===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 o=f(i,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,v;var a=o.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 x(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 _(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function I(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 i=-1,o=function n(){for(;++i<e.length;)if(r.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}throw new TypeError(Dt(e)+" is not iterable")}return g.prototype=m,i(k,"constructor",{value:m,configurable:!0}),i(m,"constructor",{value:g,configurable:!0}),g.displayName=u(m,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,u(t,c,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},O(j.prototype),u(j.prototype,s,(function(){return this})),e.AsyncIterator=j,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var a=new j(l(t,n,r,i),o);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},O(k),u(k,c,"Generator"),u(k,a,(function(){return this})),u(k,"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=I,_.prototype={constructor:_,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 i(r,i){return s.type="throw",s.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),u=r.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.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 i=r.arg;T(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:I(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}function Nt(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,At(r.key),r)}}function At(t){var e=function(t,e){if("object"!=Dt(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Dt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Dt(e)?e:String(e)}function Vt(){return Vt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Bt(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},Vt.apply(this,arguments)}function Ft(t,e){return Ft=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ft(t,e)}function Bt(t){return Bt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Bt(t)}var Ut=function(t){!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&&Ft(t,e)}(a,t);var e,n,r,i,o=(r=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Bt(r);if(i){var n=Bt(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Dt(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)}(this,t)});function a(t,e){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),(n=o.call(this)).client=t,n.localState=new Lt(e.title,e.device),n.bindFunctions(),n.initialize(),n}return e=a,(n=[{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(){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)})),Vt(Bt(a.prototype),"dispose",this).call(this)}},{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 wt.PlaybackStatusChange:this.handlePlaybackChange(e,t);break;case wt.PositionChange:this.handlePositionChange(e,t)}}}},{key:"handlePlaybackChange",value:function(t,e){t.playbackStatus!==e.params.playbackStatus&&(t.playbackStatus=e.params.playbackStatus,this.trigger("playingchange",jt.void),t.playbackStatus===Pt.Stop&&this.dispose())}},{key:"handlePositionChange",value:function(t,e){t.position!==e.params.position&&(t.position=e.params.position,this.trigger("positionchange",jt.void))}},{key:"loadSource",value:function(){return t=this,e=void 0,n=void 0,r=Mt().mark((function t(){return Mt().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",jt.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(i,o){function a(t){try{c(r.next(t))}catch(t){o(t)}}function s(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}c((r=r.apply(t,e||[])).next())}));var t,e,n,r}},{key:"play",value:function(){this.localState.locked&&this.localState.playbackStatus!==Pt.Play&&(this.localState.playbackStatus=Pt.Play,this.client.play(this.getDevice().id),this.trigger("playingchange",jt.void))}},{key:"pause",value:function(){this.localState.locked&&this.localState.playbackStatus!==Pt.Pause&&(this.localState.playbackStatus=Pt.Pause,this.client.pause(this.getDevice().id),this.trigger("playingchange",jt.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",jt.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===Pt.Play||this.localState.playbackStatus===Pt.Begin||this.localState.playbackStatus===Pt.Load}},{key:"isPlaybackFinished",value:function(){return this.localState.playbackStatus===Pt.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}}])&&Nt(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(Ot);function Gt(t){return Gt="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},Gt(t)}function Zt(){Zt=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var o=e&&e.prototype instanceof b?e:b,a=Object.create(o.prototype),s=new _(r||[]);return i(a,"_invoke",{value:E(t,n,s)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var h="suspendedStart",p="suspendedYield",d="executing",y="completed",v={};function b(){}function g(){}function m(){}var w={};u(w,a,(function(){return this}));var P=Object.getPrototypeOf,S=P&&P(P(I([])));S&&S!==n&&r.call(S,a)&&(w=S);var k=m.prototype=b.prototype=Object.create(w);function O(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function j(t,e){function n(i,o,a,s){var c=f(t[i],t,o);if("throw"!==c.type){var u=c.arg,l=u.value;return l&&"object"==Gt(l)&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(l).then((function(t){u.value=t,a(u)}),(function(t){return n("throw",t,a,s)}))}s(c.arg)}var o;i(this,"_invoke",{value:function(t,r){function i(){return new e((function(e,i){n(t,r,e,i)}))}return o=o?o.then(i,i):i()}})}function E(e,n,r){var i=h;return function(o,a){if(i===d)throw new Error("Generator is already running");if(i===y){if("throw"===o)throw a;return{value:t,done:!0}}for(r.method=o,r.arg=a;;){var s=r.delegate;if(s){var c=C(s,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(i===h)throw i=y,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=d;var u=f(e,n,r);if("normal"===u.type){if(i=r.done?y:p,u.arg===v)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(i=y,r.method="throw",r.arg=u.arg)}}}function C(e,n){var r=n.method,i=e.iterator[r];if(i===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 o=f(i,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,v;var a=o.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 x(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 _(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function I(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 i=-1,o=function n(){for(;++i<e.length;)if(r.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}throw new TypeError(Gt(e)+" is not iterable")}return g.prototype=m,i(k,"constructor",{value:m,configurable:!0}),i(m,"constructor",{value:g,configurable:!0}),g.displayName=u(m,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,u(t,c,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},O(j.prototype),u(j.prototype,s,(function(){return this})),e.AsyncIterator=j,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var a=new j(l(t,n,r,i),o);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},O(k),u(k,c,"Generator"),u(k,a,(function(){return this})),u(k,"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=I,_.prototype={constructor:_,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 i(r,i){return s.type="throw",s.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),u=r.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.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 i=r.arg;T(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:I(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}function zt(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,e){if("object"!=Gt(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Gt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Gt(e)?e:String(e)}function Ht(){return Ht="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Wt(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},Ht.apply(this,arguments)}function Yt(t,e){return Yt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Yt(t,e)}function Wt(t){return Wt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Wt(t)}var $t,Qt=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{c(r.next(t))}catch(t){o(t)}}function s(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}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"}($t||($t={}));var Xt=function(t){!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&&Yt(t,e)}(s,t);var e,n,r,i,o,a=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Wt(i);if(o){var n=Wt(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Gt(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)}(this,t)});function s(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s),(e=a.call(this)).options=t,e.accessToken="",e.devices=[],e.bindFunctions(),e.initialize(),e}return e=s,n=[{key:"bindFunctions",value:function(){this.initialize=this.initialize.bind(this),this.invoke=this.invoke.bind(this),this.invokeDebounced=(0,Et.Ds)(this.invoke,500,!0),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.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)}},{key:"initialize",value:function(){var t=this;this.connection=(0,ct.OB)(this.options.url.toString(),{logging:!1}),this.hubProxy=this.connection.createHubProxy("DeviceUserHub"),this.hubProxy.on($t.DeviceList,this.handleDeviceList),this.hubProxy.on($t.DeviceStateChange,this.handleDeviceStateChange),this.hubProxy.on($t.Paired,this.handleDevicePaired),this.hubProxy.on($t.Paired,this.handleDeviceUnpaired),this.hubProxy.on($t.PlayStatusChange,this.handlePlayStatusChange),this.hubProxy.on($t.TimeSync,this.handleTimeSync),this.connection.start({jsonp:!1,withCredentials:!1}).done((function(){return Qt(t,void 0,void 0,Zt().mark((function t(){return Zt().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.invoke("Subscribe",this.accessToken);case 6:if(t.sent){t.next=9;break}throw new Error("The subscription request was rejected by Online API");case 9:this.trigger("connected",jt.void),t.next=16;break;case 12:t.prev=12,t.t0=t.catch(0),console.error(t.t0),this.trigger("error",new Error("Could not subscribe to Online API"));case 16:case"end":return t.stop()}}),t,this,[[0,12]])})))})).fail((function(){t.trigger("error",new Error("Could not connect to Online API"))})),this.connection.disconnected((function(){return t.trigger("disconnected",jt.void)}))}},{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];var i;return Qt(this,void 0,void 0,Zt().mark((function e(){var r;return Zt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,null===(i=this.hubProxy)||void 0===i?void 0:(r=i).invoke.apply(r,[t].concat(n));case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})))}},{key:"dispose",value:function(){this.hubProxy.off($t.DeviceList,this.handleDeviceList),this.hubProxy.off($t.DeviceStateChange,this.handleDeviceStateChange),this.hubProxy.off($t.Paired,this.handleDevicePaired),this.hubProxy.off($t.Paired,this.handleDeviceUnpaired),this.hubProxy.off($t.PlayStatusChange,this.handlePlayStatusChange),this.hubProxy.off($t.TimeSync,this.handleTimeSync),this.hubProxy.connection.stop(!1,!0),Ht(Wt(s.prototype),"dispose",this).call(this)}},{key:"canCastToDevice",value:function(t){return t===at.AppleTv}},{key:"getDevices",value:function(){return this.devices}},{key:"startCastSession",value:function(t){return new Ut(this,t)}},{key:"lock",value:function(t){return Qt(this,void 0,void 0,Zt().mark((function e(){return Zt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.invoke("lock",t,this.options.userId,this.options.username);case 2:if(e.sent){e.next=5;break}throw new Error("Could not lock device");case 5:case"end":return e.stop()}}),e,this)})))}},{key:"loadVideo",value:function(t){return Qt(this,void 0,void 0,Zt().mark((function e(){return Zt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.invoke("command",{DeviceId:t,CommandType:Pt.Play,Data:this.options.trackingCode});case 2:case"end":return e.stop()}}),e,this)})))}},{key:"play",value:function(t){return Qt(this,void 0,void 0,Zt().mark((function e(){return Zt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.invoke("command",{DeviceId:t,CommandType:Pt.Play});case 2:case"end":return e.stop()}}),e,this)})))}},{key:"pause",value:function(t){return Qt(this,void 0,void 0,Zt().mark((function e(){return Zt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.invoke("command",{DeviceId:t,CommandType:Pt.Pause});case 2:case"end":return e.stop()}}),e,this)})))}},{key:"seek",value:function(t,e){this.invokeDebounced("command",{DeviceId:t,CommandType:Pt.Play,Params:"1,".concat(Math.trunc(e))})}},{key:"stop",value:function(t){return Qt(this,void 0,void 0,Zt().mark((function e(){return Zt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.invoke("command",{DeviceId:t,CommandType:Pt.Stop});case 2:case"end":return e.stop()}}),e,this)})))}},{key:"handleDeviceList",value:function(t){this.devices=t.map(s.convertToGenericDevice),this.trigger("deviceschange",jt.void)}},{key:"handleDeviceStateChange",value:function(t){var e=this.devices.findIndex((function(e){return e.id===t.deviceId}));e>=0&&(this.devices[e]=s.convertToGenericDevice(t),this.trigger("deviceschange",jt.void))}},{key:"handleDevicePaired",value:function(t){this.devices.push(s.convertToGenericDevice(t)),this.trigger("deviceschange",jt.void)}},{key:"handleDeviceUnpaired",value:function(t){this.devices=this.devices.filter((function(e){return e.id!==t})),this.trigger("deviceschange",jt.void)}},{key:"handlePlayStatusChange",value:function(t,e){this.trigger("message",{event:wt.PlaybackStatusChange,deviceId:t,params:{playbackStatus:e.commandType}})}},{key:"handleTimeSync",value:function(t,e){this.trigger("message",{event:wt.PositionChange,deviceId:t,params:{position:e}})}}],r=[{key:"convertToGenericDevice",value:function(t){return{id:t.deviceId,name:t.name,type:at.AppleTv,available:t.status===mt.Online}}}],n&&zt(e.prototype,n),r&&zt(e,r),Object.defineProperty(e,"prototype",{writable:!1}),s}(Ot);function Jt(t){return Jt="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},Jt(t)}function Kt(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,te(r.key),r)}}function te(t){var e=function(t,e){if("object"!=Jt(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Jt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Jt(e)?e:String(e)}var ee=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.bindFunctions()}var e,n;return e=t,(n=[{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}}])&&Kt(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function ne(t){return ne="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},ne(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,e){if("object"!=ne(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=ne(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ne(e)?e:String(e)}var oe={reconnectIntervalInMilliseconds:3e3,heartbeatEnabled:!1,heartbeatIntervalInMillseconds:1e4,heartbeatMessage:""},ae=function(){function t(e){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:oe;!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({},oe),r),this.webSocket=this.connect(),this.heartbeat=(new ee).schedule((function(){return n.send(n.options.heartbeatMessage)})).every(this.options.heartbeatIntervalInMillseconds)}var e,n;return e=t,(n=[{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()}}])&&re(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),se=function(){var t,e;return null!==(e=null===(t=window.crypto)||void 0===t?void 0:t.randomUUID())&&void 0!==e?e:Math.random().toString()};function ce(t){return ce="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},ce(t)}function ue(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,le(r.key),r)}}function le(t){var e=function(t,e){if("object"!=ce(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=ce(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ce(e)?e:String(e)}var fe,he=function(){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=Ct(this,2e3),xt(this)}var e,n;return e=t,(n=[{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}}])&&ue(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function pe(t){return pe="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},pe(t)}function de(){de=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var o=e&&e.prototype instanceof b?e:b,a=Object.create(o.prototype),s=new _(r||[]);return i(a,"_invoke",{value:E(t,n,s)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var h="suspendedStart",p="suspendedYield",d="executing",y="completed",v={};function b(){}function g(){}function m(){}var w={};u(w,a,(function(){return this}));var P=Object.getPrototypeOf,S=P&&P(P(I([])));S&&S!==n&&r.call(S,a)&&(w=S);var k=m.prototype=b.prototype=Object.create(w);function O(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function j(t,e){function n(i,o,a,s){var c=f(t[i],t,o);if("throw"!==c.type){var u=c.arg,l=u.value;return l&&"object"==pe(l)&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(l).then((function(t){u.value=t,a(u)}),(function(t){return n("throw",t,a,s)}))}s(c.arg)}var o;i(this,"_invoke",{value:function(t,r){function i(){return new e((function(e,i){n(t,r,e,i)}))}return o=o?o.then(i,i):i()}})}function E(e,n,r){var i=h;return function(o,a){if(i===d)throw new Error("Generator is already running");if(i===y){if("throw"===o)throw a;return{value:t,done:!0}}for(r.method=o,r.arg=a;;){var s=r.delegate;if(s){var c=C(s,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(i===h)throw i=y,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=d;var u=f(e,n,r);if("normal"===u.type){if(i=r.done?y:p,u.arg===v)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(i=y,r.method="throw",r.arg=u.arg)}}}function C(e,n){var r=n.method,i=e.iterator[r];if(i===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 o=f(i,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,v;var a=o.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 x(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 _(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function I(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 i=-1,o=function n(){for(;++i<e.length;)if(r.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}throw new TypeError(pe(e)+" is not iterable")}return g.prototype=m,i(k,"constructor",{value:m,configurable:!0}),i(m,"constructor",{value:g,configurable:!0}),g.displayName=u(m,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,u(t,c,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},O(j.prototype),u(j.prototype,s,(function(){return this})),e.AsyncIterator=j,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var a=new j(l(t,n,r,i),o);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},O(k),u(k,c,"Generator"),u(k,a,(function(){return this})),u(k,"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=I,_.prototype={constructor:_,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 i(r,i){return s.type="throw",s.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),u=r.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.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 i=r.arg;T(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:I(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}function ye(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,ve(r.key),r)}}function ve(t){var e=function(t,e){if("object"!=pe(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=pe(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==pe(e)?e:String(e)}function be(){return be="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=me(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},be.apply(this,arguments)}function ge(t,e){return ge=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ge(t,e)}function me(t){return me=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},me(t)}!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"}(fe||(fe={}));var we=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{c(r.next(t))}catch(t){o(t)}}function s(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}c((r=r.apply(t,e||[])).next())}))},Pe=function(t){!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&&ge(t,e)}(a,t);var e,n,r,i,o=(r=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=me(r);if(i){var n=me(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===pe(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)}(this,t)});function a(t,e){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),(n=o.call(this)).client=t,n.localState=new he(e.title,e.device),n.bindFunctions(),n.initialize(),n}return e=a,(n=[{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(){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)})),be(me(a.prototype),"dispose",this).call(this)}},{key:"handleClientConnected",value:function(){return we(this,void 0,void 0,de().mark((function t(){return de().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 fe.Update:this.handleUpdateMessage(e,n);break;case fe.NewChapter:this.handleNewChapterMessage(e,n);break;case fe.Volume:this.handleVolumeMessage(e,n);break;case fe.Playing:this.handlePlayingMessage(e);break;case fe.Paused:this.handlePausedMessage(e);break;case fe.Finished:this.handleFinishedMessage(e);break;case fe.Stopped:this.handleStoppedMessage()}}},{key:"handleUpdateMessage",value:function(t,e){t.duration!==e.duration&&(t.duration=e.duration,this.trigger("durationchange",jt.void)),t.position!==e.position&&(t.position=e.position,this.trigger("positionchange",jt.void)),t.subtitles!==e.subtitles&&(t.subtitles=e.subtitles,this.trigger("subtitleschange",jt.void))}},{key:"handleVolumeMessage",value:function(t,e){t.volume!==e.level&&(t.volume=e.level,t.mute=0===e.level,this.trigger("volumechange",jt.void))}},{key:"handlePlayingMessage",value:function(t){!0!==t.playing&&(t.playing=!0,t.playbackFinished=!1,this.trigger("playingchange",jt.void))}},{key:"handlePausedMessage",value:function(t){!1!==t.playing&&(t.playing=!1,this.trigger("playingchange",jt.void))}},{key:"handleFinishedMessage",value:function(t){!0!==t.playbackFinished&&(t.playing=!1,t.playbackFinished=!0,this.trigger("playingchange",jt.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",jt.void))}},{key:"handleStoppedMessage",value:function(){this.dispose()}},{key:"loadSource",value:function(t,e){return we(this,void 0,void 0,de().mark((function n(){var r,i;return de().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,i=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",jt.void),i>0&&this.client.seek(r,i),n.next=21;break;case 17:n.prev=17,n.t0=n.catch(2),console.error(n.t0),this.trigger("error",new Error("Could not load video on Vivi device"));case 21:case"end":return n.stop()}}),n,this,[[2,17]])})))}},{key:"play",value:function(){this.localState.ready&&!0!==this.localState.playing&&(this.localState.playing=!0,this.client.play(this.getDevice().id),this.trigger("playingchange",jt.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",jt.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",jt.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",jt.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",jt.void))}},{key:"setSubtitles",value:function(t){return we(this,void 0,void 0,de().mark((function e(){var n;return de().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",jt.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}}])&&ye(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(Ot);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 ke(){ke=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var o=e&&e.prototype instanceof b?e:b,a=Object.create(o.prototype),s=new _(r||[]);return i(a,"_invoke",{value:E(t,n,s)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var h="suspendedStart",p="suspendedYield",d="executing",y="completed",v={};function b(){}function g(){}function m(){}var w={};u(w,a,(function(){return this}));var P=Object.getPrototypeOf,S=P&&P(P(I([])));S&&S!==n&&r.call(S,a)&&(w=S);var k=m.prototype=b.prototype=Object.create(w);function O(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function j(t,e){function n(i,o,a,s){var c=f(t[i],t,o);if("throw"!==c.type){var u=c.arg,l=u.value;return l&&"object"==Se(l)&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(l).then((function(t){u.value=t,a(u)}),(function(t){return n("throw",t,a,s)}))}s(c.arg)}var o;i(this,"_invoke",{value:function(t,r){function i(){return new e((function(e,i){n(t,r,e,i)}))}return o=o?o.then(i,i):i()}})}function E(e,n,r){var i=h;return function(o,a){if(i===d)throw new Error("Generator is already running");if(i===y){if("throw"===o)throw a;return{value:t,done:!0}}for(r.method=o,r.arg=a;;){var s=r.delegate;if(s){var c=C(s,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(i===h)throw i=y,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=d;var u=f(e,n,r);if("normal"===u.type){if(i=r.done?y:p,u.arg===v)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(i=y,r.method="throw",r.arg=u.arg)}}}function C(e,n){var r=n.method,i=e.iterator[r];if(i===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 o=f(i,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,v;var a=o.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 x(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 _(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function I(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 i=-1,o=function n(){for(;++i<e.length;)if(r.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}throw new TypeError(Se(e)+" is not iterable")}return g.prototype=m,i(k,"constructor",{value:m,configurable:!0}),i(m,"constructor",{value:g,configurable:!0}),g.displayName=u(m,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,u(t,c,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},O(j.prototype),u(j.prototype,s,(function(){return this})),e.AsyncIterator=j,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var a=new j(l(t,n,r,i),o);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},O(k),u(k,c,"Generator"),u(k,a,(function(){return this})),u(k,"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=I,_.prototype={constructor:_,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 i(r,i){return s.type="throw",s.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),u=r.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.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 i=r.arg;T(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:I(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}function Oe(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,je(r.key),r)}}function je(t){var e=function(t,e){if("object"!=Se(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Se(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Se(e)?e:String(e)}function Ee(){return Ee="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=xe(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},Ee.apply(this,arguments)}function Ce(t,e){return Ce=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ce(t,e)}function xe(t){return xe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},xe(t)}var Te=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{c(r.next(t))}catch(t){o(t)}}function s(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}c((r=r.apply(t,e||[])).next())}))},_e=1e4,Ie=function(t){!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&&Ce(t,e)}(s,t);var e,n,r,i,o,a=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=xe(i);if(o){var n=xe(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Se(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)}(this,t)});function s(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s),(e=a.call(this)).options=t,e.accessToken="",e.devices=[],e.devicesFingerprint="",e.deviceDiscovery=new ee,e.bindFunctions(),e.initialize(),e}return e=s,r=[{key:"createAckId",value:function(){return se()}},{key:"calculateFingerprint",value:function(t){return t.map((function(t){return t.id})).sort().join(",")}}],(n=[{key:"bindFunctions",value:function(){this.initialize=this.initialize.bind(this),this.sendMessage=this.sendMessage.bind(this),this.sendMessageDebounced=(0,Et.Ds)(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 ae(this.options.url.toString()),this.webSocket.onMessage=function(e){return t.trigger("message",JSON.parse(e.data))},this.webSocket.onOpen=function(){return Te(t,void 0,void 0,ke().mark((function t(){return ke().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",jt.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 Te(t,void 0,void 0,ke().mark((function t(){var e,n;return ke().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.getRoomList();case 3:if(e=t.sent,(n=s.calculateFingerprint(e))!==this.devicesFingerprint){t.next=7;break}return t.abrupt("return");case 7:this.devices=e.map((function(t){return{id:t.id,name:t.name,type:at.Vivi,available:!0}})),this.devicesFingerprint=n,this.trigger("deviceschange",jt.void),t.next=15;break;case 12:t.prev=12,t.t0=t.catch(0),console.warn(t.t0);case 15:case"end":return t.stop()}}),t,this,[[0,12]])})))})).trigger().start()}},{key:"dispose",value:function(){var t;this.deviceDiscovery.stop(),null===(t=this.webSocket)||void 0===t||t.dipose(),Ee(xe(s.prototype),"dispose",this).call(this)}},{key:"canCastToDevice",value:function(t){return t===at.Vivi}},{key:"getDevices",value:function(){return this.devices}},{key:"startCastSession",value:function(t){return new Pe(this,t)}},{key:"authenticateWithVivi",value:function(){return Te(this,void 0,void 0,ke().mark((function t(){return ke().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(_e).catch((function(){throw new Error("Failed to authenticate with Vivi")}));case 3:case"end":return t.stop()}}),t,this)})))}},{key:"getRoomList",value:function(){return Te(this,void 0,void 0,ke().mark((function t(){var e;return ke().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(_e).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 Te(this,void 0,void 0,ke().mark((function e(){return ke().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(_e).catch((function(){throw new Error("Failed to join room")}));case 3:case"end":return e.stop()}}),e,this)})))}},{key:"query",value:function(t){return Te(this,void 0,void 0,ke().mark((function e(){var n;return ke().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=s.createAckId(),this.sendMessage({destination:t,message:{type:"message_with_ack",ack_id:n,name:"query"}}),e.next=4,this.one("message",(function(t){return t.message.ack_id===n})).timeout(_e).catch((function(){throw new Error("Failed to fetch query")}));case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}}),e,this)})))}},{key:"loadQueue",value:function(t){var e=t.roomId,n=t.title,r=t.videoSource,i=t.subtitleSource;return Te(this,void 0,void 0,ke().mark((function t(){return ke().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.sendMessage({destination:e,message:{type:"message_with_ack",ack_id:s.createAckId(),name:"queue_load",payload:{urls:[{title:n,url:r,suburl:i}]}}}),t.next=3,this.one("message",(function(t){var n;return t.source===e&&"ready"===(null===(n=t.message.payload)||void 0===n?void 0:n.event)})).timeout(_e).catch((function(){throw new Error("Failed to load media")}));case 3:case"end":return t.stop()}}),t,this)})))}},{key:"play",value:function(t){return Te(this,void 0,void 0,ke().mark((function e(){return ke().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(_e).catch((function(){throw new Error("Failed to play video")}));case 3:case"end":return e.stop()}}),e,this)})))}},{key:"pause",value:function(t){return Te(this,void 0,void 0,ke().mark((function e(){return ke().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(_e).catch((function(){throw new Error("Failed to pause video")}));case 3:case"end":return e.stop()}}),e,this)})))}},{key:"stop",value:function(t){return Te(this,void 0,void 0,ke().mark((function e(){return ke().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(_e).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 Te(this,void 0,void 0,ke().mark((function n(){return ke().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(_e).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 Te(this,void 0,void 0,ke().mark((function n(){return ke().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(_e).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 Te(this,void 0,void 0,ke().mark((function n(){return ke().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(_e).catch((function(){throw new Error("Failed to set mute")}));case 3:case"end":return n.stop()}}),n,this)})))}},{key:"setSubtitles",value:function(t,e){return Te(this,void 0,void 0,ke().mark((function n(){var r;return ke().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r=s.createAckId(),this.sendMessage({destination:t,message:{type:"message_with_ack",ack_id:r,name:"set_subtitles",payload:{subtitles:e}}}),n.next=4,this.one("message",(function(e){return e.source===t&&e.message.ack_id===r})).timeout(_e).catch((function(){throw new Error("Failed to set subtitles")}));case 4:case"end":return n.stop()}}),n,this)})))}}])&&Oe(e.prototype,n),r&&Oe(e,r),Object.defineProperty(e,"prototype",{writable:!1}),s}(Ot);function Re(t){return Re="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},Re(t)}function Le(t){return function(t){if(Array.isArray(t))return De(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 De(t,e);var n=Object.prototype.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)?De(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 De(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Me(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,Ne(r.key),r)}}function Ne(t){var e=function(t,e){if("object"!=Re(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Re(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Re(e)?e:String(e)}function Ae(){return Ae="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Fe(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},Ae.apply(this,arguments)}function Ve(t,e){return Ve=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ve(t,e)}function Fe(t){return Fe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Fe(t)}var Be=function(t){!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&&Ve(t,e)}(s,t);var e,n,r,i,o,a=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Fe(i);if(o){var n=Fe(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Re(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)}(this,t)});function s(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s),(e=a.call(this)).instanceId=t,e.clients=[],e.bindFunctions(),e}return e=s,r=[{key:"getOrCreateInstance",value:function(t){if(!t)throw new Error("instanceId is required");return this.instances[t]||(this.instances[t]=new s(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}}],(n=[{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(Le(t),Le(e))}),[]);this.trigger("deviceschange",t)}},{key:"dispose",value:function(){var t;null===(t=this.castSession)||void 0===t||t.dispose(),this.clients.forEach((function(t){return t.dispose()})),this.castSession=void 0,this.clients=[],Ae(Fe(s.prototype),"dispose",this).call(this)}}])&&Me(e.prototype,n),r&&Me(e,r),Object.defineProperty(e,"prototype",{writable:!1}),s}(Ot);Be.instances={};var Ue=n(30050),Ge=n(98115);function Ze(t){return Ze="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},Ze(t)}function ze(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,e){if("object"!=Ze(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Ze(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ze(e)?e:String(e)}function He(){return He="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=$e(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},He.apply(this,arguments)}function Ye(t,e){return Ye=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ye(t,e)}function We(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function $e(t){return $e=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},$e(t)}var Qe=function(t){!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)}(a,t);var e,n,r,i,o=(r=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=$e(r);if(i){var n=$e(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Ze(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return We(t)}(this,t)});function a(t,e){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),(n=o.call(this,t,e)).isVisible=n.isVisible.bind(We(n)),n}return e=a,(n=[{key:"createEl",value:function(){return He($e(a.prototype),"createEl",this).call(this,"li",{className:"vjs-menu-item cv-device-menu-item",innerHTML:'\n <span class="cv-device-icon '.concat({vivi:"cv-vivi-icon","apple-tv":"cv-apple-icon"}[this.options_.type],'"></span>\n <span class="vjs-menu-item-text">').concat(this.options_.label,"</span>\n ")})}},{key:"handleClick",value:function(){this.options_.onClick()}},{key:"show",value:function(){He($e(a.prototype),"show",this).call(this)}},{key:"hide",value:function(){He($e(a.prototype),"hide",this).call(this)}},{key:"isVisible",value:function(){return!He($e(a.prototype),"hasClass",this).call(this,"vjs-hidden")}}])&&ze(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(o.Z.getComponent("MenuItem"));function Xe(t){return Xe="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},Xe(t)}function Je(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,Ke(r.key),r)}}function Ke(t){var e=function(t,e){if("object"!=Xe(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Xe(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Xe(e)?e:String(e)}function tn(){return tn="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=nn(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},tn.apply(this,arguments)}function en(t,e){return en=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},en(t,e)}function nn(t){return nn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},nn(t)}var rn=o.Z.getComponent("MenuButton"),on=function(t){!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&&en(t,e)}(a,t);var e,n,r,i,o=(r=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=nn(r);if(i){var n=nn(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Xe(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)}(this,t)});function a(t,e){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),(n=o.call(this,t,e)).alwaysCollapsed=!1,n.isCollapsed=!1,n.isCollabsible=!0,n.className="cv-devices-menu-button",n.searchText="",n.devices=[],n.castSession=void 0,n.bindFunctions(),n.bindEventListeners(),n}return e=a,n=[{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.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(){e.removeEventListener("blur",n)}))}},{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=rn.prototype.createEl).apply.apply(t,[this].concat(n))}},{key:"buildWrapperCSSClass",value:function(){return"cv-menu-small cv-devices-button ".concat(tn(nn(a.prototype),"buildWrapperCSSClass",this).call(this))}},{key:"createItems",value:function(){var t=this,e=[];return this.headingItem=new Ue.Z(this.player_,{label:this.localize("Select a device"),selectable:!1}),this.searchInputItem=new Ge.Z(this.player_,{menuButton:this,search:function(e){return t.setSearchText(e)},className:"cv-devices-search-input"}),this.emptyPlaceholder=new Ge.C(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;tn(nn(a.prototype),"pressButton",this).call(this),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 Qe}))}},{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){return"".concat(t.type,"-").concat(t.name).localeCompare("".concat(e.type,"-").concat(e.name))})).forEach((function(t){var n=new Qe(e.player(),{id:t.id,label:t.name,selected:!1,multiSelectable:!1,selectable:!0,available:t.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.headingItem.hide(),this.searchInputItem.show(),this.menu.addClass("vertical-fill")):(this.headingItem.show(),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 i,o=t.devices.find((function(t){return t.id===e.options_.id}));if(o){var a=o.available,s=!n||-1!==o.name.toLowerCase().indexOf(r),c=o.id===(null===(i=t.castSession)||void 0===i?void 0:i.getDevice().id);a?e.enable():e.disable(),s?e.show():e.hide(),c?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(){tn(nn(a.prototype),"handleClick",this).call(this,null),this.options_.onClick()}}],n&&Je(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(rn);on.prototype.controlText_="Devices",o.Z.registerComponent("DevicesButton",on);var an=n(10463);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 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,un(r.key),r)}}function un(t){var e=function(t,e){if("object"!=sn(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=sn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==sn(e)?e:String(e)}function ln(){return ln="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=hn(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},ln.apply(this,arguments)}function fn(t,e){return fn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},fn(t,e)}function hn(t){return hn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},hn(t)}var pn=function(t){!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&&fn(t,e)}(a,t);var e,n,r,i,o=(r=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=hn(r);if(i){var n=hn(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(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)}(this,t)});function a(t){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),o.call(this,null,t)}return e=a,(n=[{key:"createEl",value:function(){return ln(hn(a.prototype),"createEl",this).call(this,"div",{className:"cv-devices-tech"})}},{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,i=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:at.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 o=document.createElement("button"),a=function(t){t.stopPropagation(),i.options_.onStopCasting()};o.onclick=a,o.ontouchstart=a,o.className="stop-casting-button",o.innerHTML=this.localize("Stop casting"),this.el_.querySelector(".cv-devices-content").appendChild(o)}},{key:"play",value:function(){}}])&&cn(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(o.Z.getComponent("Component"));function dn(t){return dn="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},dn(t)}function yn(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,vn(r.key),r)}}function vn(t){var e=function(t,e){if("object"!=dn(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=dn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==dn(e)?e:String(e)}function bn(){return bn="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=mn(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},bn.apply(this,arguments)}function gn(t,e){return gn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},gn(t,e)}function mn(t){return mn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},mn(t)}var wn=function(t){!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&&gn(t,e)}(c,t);var e,n,r,i,a,s=(i=c,a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=mn(i);if(a){var n=mn(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===dn(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)}(this,t)});function c(t,e){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,c),(n=s.call(this,t,e)).featuresVolumeControl=!0,n.featuresPlaybackRate=!1,n.movingMediaElementInDOM=!1,n.featuresFullscreenResize=!0,n.featuresTimeupdateEvents=!0,n.featuresProgressEvents=!1,n.featuresNativeTextTracks=!1,n.featuresNativeAudioTracks=!1,n.featuresNativeVideoTracks=!1,n.featuresMuteControl=!0,n.featuresSourceset=!1,n.videojsPlayer=(0,o.Z)(n.options_.playerId),n.bindFunctions(),n.bindEventListeners(),n.ready((function(){n.setSource(n.options_.source)})),n.triggerReady(),n}return e=c,r=[{key:"canPlayType",value:function(){return""}},{key:"canPlaySource",value:function(t,e){var n;return!!Be.getOrCreateInstance(null!==(n=null==e?void 0:e.instanceId)&&void 0!==n?n:"").getCastSession()}},{key:"isSupported",value:function(){return Be.isActive()}}],(n=[{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 an.O.findTrackByPredicate(this.videojsPlayer.player_,(function(t){return"showing"===t.mode&&!!t.src}))}},{key:"setSelectedTextTrack",value:function(t){an.O.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(),bn(mn(c.prototype),"cleanupAutoTextTracks",this).call(this),bn(mn(c.prototype),"dispose",this).call(this)}},{key:"createEl",value:function(){var t=this;return this.ui=this.ui||new pn({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 bn(mn(c.prototype),"addRemoteTextTrack",this).call(this,t,!0)}},{key:"getCastSession",value:function(){var t;return Be.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(){}}])&&yn(e.prototype,n),r&&yn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),c}(o.Z.getComponent("Tech"));function Pn(t){return Pn="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},Pn(t)}function Sn(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,kn(r.key),r)}}function kn(t){var e=function(t,e){if("object"!=Pn(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Pn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Pn(e)?e:String(e)}function On(){return On="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=En(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},On.apply(this,arguments)}function jn(t,e){return jn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},jn(t,e)}function En(t){return En=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},En(t)}o.Z.registerTech("devices",wn);var Cn=function(t){!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)}(a,t);var e,n,r,i,o=(r=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=En(r);if(i){var n=En(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Pn(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)}(this,t)});function a(t,e){var n,r,i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),(n=o.call(this,t,e)).options=e,n.instanceId=null!==(i=null===(r=n.player.options_.devices)||void 0===r?void 0:r.instanceId)&&void 0!==i?i:"",n.bindFunctions(),n.initialize(),n}return e=a,(n=[{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=this.getSessionManager();if(e&&n&&-1!==n&&r){r.on("deviceschange",this.onDevicesChanged),r.on("castsessionchange",this.onCastSessionChanged),r.on("error",this.onDevicesError);var i={onClick:function(){t.addViviClient(r),t.addAppleTvClient(r)},onDeviceMenuItemClick:function(e,n){var i;r.startCastSession({device:n,title:t.options.title}),null===(i=t.options.analyticsService)||void 0===i||i.logUserAction({device:n},{actionType:st.Vw.Play,workflowPhase:st.eu.Complete,descriptor:st.UX.CastToDevice})}};this.devicesButton=e.addChild("DevicesButton",i,n+1)}}},{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(at.AppleTv)),this.player.removeClass("cv-device-".concat(at.Vivi)))}},{key:"onDevicesError",value:function(t){this.player.error(t.message),this.player.pause()}},{key:"addViviClient",value:function(t){if(this.options.viviEnabled&&this.options.viviApi&&this.options.fetchViviAccessToken&&!t.hasInstanceOfClient(Ie)){var e=new Ie({url:this.options.viviApi,fetchAccessToken:this.options.fetchViviAccessToken});t.addClient(e)}}},{key:"addAppleTvClient",value:function(t){if(this.options.appleTvEnabled&&this.options.onlineApi&&this.options.fetchOnlineApiAccessToken&&this.options.trackingCode&&this.options.userId&&!t.hasInstanceOfClient(Xt)){var e=new Xt({url:this.options.onlineApi,fetchAccessToken:this.options.fetchOnlineApiAccessToken,trackingCode:this.options.trackingCode,userId:this.options.userId,username:""});t.addClient(e)}}},{key:"reloadTech",value:function(){var t=this.player,e=t.currentSources(),n=t.volume(),r=t.muted(),i=t.currentTime(),o=t.paused();t.src(e),t.one("playing",(function(){t.volume(n),t.muted(r),t.currentTime(i),o?t.pause():t.play()}))}},{key:"getSessionManager",value:function(){if(this.instanceId)return Be.getOrCreateInstance(this.instanceId)}},{key:"dispose",value:function(){var t=this.getSessionManager();t&&(t.off("deviceschange",this.onDevicesChanged),t.off("castsessionchange",this.onCastSessionChanged),t.off("error",this.onDevicesError),Be.disposeAndRemoveInstance(t),On(En(a.prototype),"dispose",this).call(this))}}])&&Sn(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(o.Z.getPlugin("plugin"));function xn(t){return xn="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},xn(t)}function Tn(){Tn=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var o=e&&e.prototype instanceof b?e:b,a=Object.create(o.prototype),s=new _(r||[]);return i(a,"_invoke",{value:E(t,n,s)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var h="suspendedStart",p="suspendedYield",d="executing",y="completed",v={};function b(){}function g(){}function m(){}var w={};u(w,a,(function(){return this}));var P=Object.getPrototypeOf,S=P&&P(P(I([])));S&&S!==n&&r.call(S,a)&&(w=S);var k=m.prototype=b.prototype=Object.create(w);function O(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function j(t,e){function n(i,o,a,s){var c=f(t[i],t,o);if("throw"!==c.type){var u=c.arg,l=u.value;return l&&"object"==xn(l)&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(l).then((function(t){u.value=t,a(u)}),(function(t){return n("throw",t,a,s)}))}s(c.arg)}var o;i(this,"_invoke",{value:function(t,r){function i(){return new e((function(e,i){n(t,r,e,i)}))}return o=o?o.then(i,i):i()}})}function E(e,n,r){var i=h;return function(o,a){if(i===d)throw new Error("Generator is already running");if(i===y){if("throw"===o)throw a;return{value:t,done:!0}}for(r.method=o,r.arg=a;;){var s=r.delegate;if(s){var c=C(s,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(i===h)throw i=y,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=d;var u=f(e,n,r);if("normal"===u.type){if(i=r.done?y:p,u.arg===v)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(i=y,r.method="throw",r.arg=u.arg)}}}function C(e,n){var r=n.method,i=e.iterator[r];if(i===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 o=f(i,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,v;var a=o.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 x(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 _(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function I(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 i=-1,o=function n(){for(;++i<e.length;)if(r.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}throw new TypeError(xn(e)+" is not iterable")}return g.prototype=m,i(k,"constructor",{value:m,configurable:!0}),i(m,"constructor",{value:g,configurable:!0}),g.displayName=u(m,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,u(t,c,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},O(j.prototype),u(j.prototype,s,(function(){return this})),e.AsyncIterator=j,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var a=new j(l(t,n,r,i),o);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},O(k),u(k,c,"Generator"),u(k,a,(function(){return this})),u(k,"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=I,_.prototype={constructor:_,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 i(r,i){return s.type="throw",s.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),u=r.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.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 i=r.arg;T(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:I(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}function _n(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function In(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,Rn(r.key),r)}}function Rn(t){var e=function(t,e){if("object"!=xn(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=xn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==xn(e)?e:String(e)}function Ln(){return Ln="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Mn(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},Ln.apply(this,arguments)}function Dn(t,e){return Dn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Dn(t,e)}function Mn(t){return Mn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Mn(t)}o.Z.registerPlugin("devicesPlugin",Cn);var Nn=function(t){!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&&Dn(t,e)}(a,t);var e,n,r,i,o=(r=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Mn(r);if(i){var n=Mn(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===xn(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)}(this,t)});function a(t,e){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),o.call(this,t,e)}return e=a,(n=[{key:"getPlayerOptions",value:function(){var t,e=Ln(Mn(a.prototype),"getPlayerOptions",this).call(this);return this.areDevicesEnabled()?Object.assign(Object.assign({},e),{techOrder:["devices"].concat((t=e.techOrder,function(t){if(Array.isArray(t))return _n(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 _n(t,e);var n=Object.prototype.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)?_n(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.")}())),devices:{instanceId:se()}}):e}},{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:"additionalSetup",value:function(t){var e,n,r,i,o,s,c,u,l,f,h,p=this,d=Object.create(null,{additionalSetup:{get:function(){return Ln(Mn(a.prototype),"additionalSetup",p)}}});return u=this,l=void 0,f=void 0,h=Tn().mark((function a(){var u;return Tn().wrap((function(a){for(;;)switch(a.prev=a.next){case 0:if(d.additionalSetup.call(this,t),this.options.showResources&&t.resources&&this.player.resourcesPlugin&&this.player.resourcesPlugin({resources:t.resources.list,imageCdnUrl:this.options.imageCdnUrl}),"MasterClip"!==t.mediaType){a.next=7;break}if(null!==(u=t.additionalData)){a.next=6;break}throw Error("Invalid clip data");case 6:this.player.clipPlugin({startTime:u.startTime,endTime:u.endTime});case 7:this.areDevicesEnabled()&&this.player.devicesPlugin({viviEnabled:null===(e=this.options.devicesConfig)||void 0===e?void 0:e.viviEnabled,viviApi:null===(n=this.options.devicesConfig)||void 0===n?void 0:n.viviApi,fetchViviAccessToken:null===(r=this.options.devicesConfig)||void 0===r?void 0:r.fetchViviAccessToken,appleTvEnabled:null===(i=this.options.devicesConfig)||void 0===i?void 0:i.appleTvEnabled,onlineApi:null===(o=this.options.devicesConfig)||void 0===o?void 0:o.onlineApi,fetchOnlineApiAccessToken:null===(s=this.options.devicesConfig)||void 0===s?void 0:s.fetchOnlineApiAccessToken,trackingCode:null===(c=this.options.devicesConfig)||void 0===c?void 0:c.trackingCode,userId:parseInt(t.viewerId),title:t.title,analyticsService:this.analyticsService});case 8:case"end":return a.stop()}}),a,this)})),new(f||(f=Promise))((function(t,e){function n(t){try{i(h.next(t))}catch(t){e(t)}}function r(t){try{i(h.throw(t))}catch(t){e(t)}}function i(e){var i;e.done?t(e.value):(i=e.value,i instanceof f?i:new f((function(t){t(i)}))).then(n,r)}i((h=h.apply(u,l||[])).next())}))}},{key:"setActivityStatus",value:function(t,e){this.player.activityStatusPlugin().setActivityStatus(t,e)}}])&&In(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(i.r),An=n(63816),Vn=n(14735);function Fn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Bn(t){var e,n,i,o=r.useRef(t.player.duration()-t.player.currentTime()),a=(n=r.useState(o.current),i=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,i,o,a,s=[],c=!0,u=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(s.push(r.value),s.length!==e);c=!0);}catch(t){u=!0,i=t}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(n,i)||function(t,e){if(t){if("string"==typeof t)return Fn(t,e);var n=Object.prototype.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)?Fn(t,e):void 0}}(n,i)||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.")}()),s=a[0],c=a[1];function u(){var e=t.player.duration()-t.player.currentTime();c(e),e>o.current&&(o.current=e)}if(r.useEffect((function(){return t.player.on("timeupdate",u),function(){t.player.off("timeupdate",u)}}),[]),!t.nextVideo||!t.onPlayNext)return r.createElement(r.Fragment,null);var l=Math.ceil(s),f=1===l?"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 ",l," ",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 Un(t){return Un="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},Un(t)}function Gn(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,Zn(r.key),r)}}function Zn(t){var e=function(t,e){if("object"!=Un(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Un(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Un(e)?e:String(e)}function zn(){return zn="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Hn(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},zn.apply(this,arguments)}function qn(t,e){return qn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},qn(t,e)}function Hn(t){return Hn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Hn(t)}o.Z.registerComponent("UpNext",(0,Vn.Z)((function(t,e){return r.createElement(Bn,Object.assign({player:t},e))})));var Yn=function(t){!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)}(s,t);var e,n,r,i,a=(r=s,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Hn(r);if(i){var n=Hn(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Un(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)}(this,t)});function s(t,e){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s),(n=a.call(this,t,e)).playNext=t.nextVideoPlugin().getShouldPlayNext(),n.toggle(n.playNext),n}return e=s,(n=[{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,e,n){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 toggle-option float-end",innerHTML:'<span class="handle"></span></div>'}),this.toggleEl.addEventListener("click",this.handleToggle);var r=zn(Hn(s.prototype),"createEl",this).call(this,t,{className:"vjs-menu-item cv-cog-menu-item",innerHTML:'\n <span class="vjs-menu-item-text">Play next video</span>\n <span class="cv-toggle-container"></span>'},n);return r.children[1].appendChild(this.toggleEl),r}}])&&Gn(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),s}(o.Z.getComponent("MenuItem"));function Wn(t){return Wn="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},Wn(t)}function $n(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,Qn(r.key),r)}}function Qn(t){var e=function(t,e){if("object"!=Wn(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Wn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Wn(e)?e:String(e)}function Xn(){return Xn="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=tr(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},Xn.apply(this,arguments)}function Jn(t,e){return Jn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Jn(t,e)}function Kn(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function tr(t){return tr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},tr(t)}o.Z.registerComponent("NextVideoMenuItem",Yn);var er="cv-persisttest",nr="cv-play-next-video",rr=o.Z.getPlugin("plugin"),ir=(o.Z.getComponent("MenuItem"),o.Z.getComponent("NextVideoMenuItem")),or=function(t){!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)}(a,t);var e,n,r,i,o=(r=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=tr(r);if(i){var n=tr(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Wn(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Kn(t)}(this,t)});function a(t){var e;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),(e=o.call(this,t)).setShouldPlayNext=e.setShouldPlayNext.bind(Kn(e)),e.getShouldPlayNext=e.getShouldPlayNext.bind(Kn(e)),e.getChapterTrack=e.getChapterTrack.bind(Kn(e)),e.onTimeUpdate=e.onTimeUpdate.bind(Kn(e)),e.hasLocalStorage=e.testHasLocalStorage(),e.shouldPlayNextVideo=!1,e.hasLocalStorage){var n=window.localStorage.getItem(nr);e.shouldPlayNextVideo="true"===n}return t.ready((function(){e.initialize()})),e}return e=a,(n=[{key:"initialize",value:function(){this.player.isDisposed()||this.bindListeners()}},{key:"getChapterTrack",value:function(){return an.O.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:ir,name:"NextVideoMenuItem"})}},{key:"getShouldPlayNext",value:function(){return this.shouldPlayNextVideo}},{key:"setShouldPlayNext",value:function(t,e){this.shouldPlayNextVideo=t,this.hasLocalStorage&&e&&window.localStorage.setItem(nr,t.toString())}},{key:"bindListeners",value:function(){this.player.on("timeupdate",this.onTimeUpdate)}},{key:"dispose",value:function(){this.player.off("timeupdate",this.onTimeUpdate),this.hideUpNext(),Xn(tr(a.prototype),"dispose",this).call(this)}},{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(er,"persistPlayNext"),window.localStorage.removeItem(er),!0}catch(t){return!1}}}])&&$n(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(rr);o.Z.registerPlugin("nextVideoPlugin",or);var ar=n(26733);function sr(t){return sr="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},sr(t)}function cr(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,ur(r.key),r)}}function ur(t){var e=function(t,e){if("object"!=sr(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=sr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==sr(e)?e:String(e)}function lr(t,e){return lr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},lr(t,e)}function fr(t){return fr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},fr(t)}function hr(t){return r.createElement("div",{className:"cv-resource-item"},r.createElement(ar.s,{data:t.resource,imageCdnUrl:t.imageCdnUrl}))}var pr=(0,Vn.Z)((function(t,e){return r.createElement(hr,Object.assign({},e))})),dr=function(t){!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&&lr(t,e)}(s,t);var e,n,r,i,a=(r=s,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=fr(r);if(i){var n=fr(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===sr(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)}(this,t)});function s(t,e){var n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s),n=a.call(this,t,e);var r=new pr(t,{resource:e.resource,imageCdnUrl:e.imageCdnUrl});return n.addChild(r),n}return e=s,(n=[{key:"createEl",value:function(){return o.Z.dom.createEl("div")}},{key:"handleClick",value:function(t){t.stopImmediatePropagation(),this.options_.downloadResource(this.options_.resource)}}])&&cr(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),s}(o.Z.getComponent("ClickableComponent"));function yr(t){return yr="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},yr(t)}function vr(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,e){if("object"!=yr(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=yr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==yr(e)?e:String(e)}function gr(){return gr="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=wr(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},gr.apply(this,arguments)}function mr(t,e){return mr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},mr(t,e)}function wr(t){return wr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},wr(t)}var Pr=function(t){!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&&mr(t,e)}(s,t);var e,n,r,i,a=(r=s,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=wr(r);if(i){var n=wr(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===yr(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)}(this,t)});function s(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s),(t=a.apply(this,arguments)).alwaysCollapsed=!1,t.isCollapsed=!1,t.isCollabsible=!0,t}return e=s,(n=[{key:"buildWrapperCSSClass",value:function(){return"cv-menu-small ".concat(gr(wr(s.prototype),"buildWrapperCSSClass",this).call(this))}},{key:"buildCSSClass",value:function(){return"cv-resources-button ".concat(gr(wr(s.prototype),"buildCSSClass",this).call(this))}},{key:"update",value:function(){gr(wr(s.prototype),"update",this).call(this)}},{key:"createMenu",value:function(){return this.options_.title="Resources",gr(wr(s.prototype),"createMenu",this).call(this)}},{key:"createItems",value:function(){var t=this,e=[];return this.options_.resources.forEach((function(n){var r=new dr(t.player(),{resource:n,imageCdnUrl:t.options_.imageCdnUrl,downloadResource:function(e){return t.downloadResource(e)}});e.push(r)})),e}},{key:"downloadResource",value:function(t){this.getDownloadIframe().src=t.url}},{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(){gr(wr(s.prototype),"handleClick",this).call(this,null)}}])&&vr(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),s}(o.Z.getComponent("MenuButton"));function Sr(t){return Sr="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},Sr(t)}function kr(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,Or(r.key),r)}}function Or(t){var e=function(t,e){if("object"!=Sr(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=Sr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Sr(e)?e:String(e)}function jr(t,e){return jr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},jr(t,e)}function Er(t){return Er=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Er(t)}Pr.prototype.controlText_="Resources",o.Z.registerComponent("ResourcesButton",Pr);var Cr=function(t){!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&&jr(t,e)}(a,t);var e,n,r,i,o=(r=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Er(r);if(i){var n=Er(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Sr(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)}(this,t)});function a(t,e){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),(n=o.call(this,t,e)).options=e,t.ready((function(){return n.onReady()})),n}return e=a,(n=[{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-3)}}}])&&kr(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(o.Z.getPlugin("plugin"));o.Z.registerPlugin("resourcesPlugin",Cr);var xr=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 i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};function Tr(t){var e=t.className,n=void 0===e?"":e,i=t.playerApi,o=t.onReady,a=t.onDispose,s=xr(t,["className","playerApi","onReady","onDispose"]),c=r.useRef();return r.useEffect((function(){if(c){var t=new Nn(c.current,Object.assign(Object.assign({},s),{playerApi:i}));return o&&t.ready((function(){o((0,An.G)(t))})),a&&t.one("dispose",a),function(){null==t||t.dispose()}}}),[t.viewKey]),r.createElement("div",{ref:c,className:n})}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_clickview_lite=self.webpackChunk_clickview_lite||[]).push([[3865],{17808:(e,t,a)=>{a.d(t,{Q:()=>l});var n=a(32735),i=a(20455),r=a(95339),s=a(67445);function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,n=new Array(t);a<t;a++)n[a]=e[a];return n}function l(e){var t,a,l=(t=n.useState(null),a=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var n,i,r,s,o=[],l=!0,c=!1;try{if(r=(a=a.call(e)).next,0===t){if(Object(a)!==a)return;l=!1}else for(;!(l=(n=r.call(a)).done)&&(o.push(n.value),o.length!==t);l=!0);}catch(e){c=!0,i=e}finally{try{if(!l&&null!=a.return&&(s=a.return(),Object(s)!==s))return}finally{if(c)throw i}}return o}}(t,a)||function(e,t){if(e){if("string"==typeof e)return o(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);return"Object"===a&&e.constructor&&(a=e.constructor.name),"Map"===a||"Set"===a?Array.from(e):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?o(e,t):void 0}}(t,a)||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.")}()),c=l[0],d=l[1],u=(0,i.Dy)((0,i.VT)(i.we,{activationConstraint:{distance:10}}),(0,i.VT)(i.Lg,{coordinateGetter:s.is}));return e.disabled?n.createElement(n.Fragment,null,e.children):n.createElement(i.LB,{sensors:u,collisionDetection:i.pE,onDragStart:function(t){var a;d(t.active.id),null===(a=e.onSortStart)||void 0===a||a.call(e,t)},onDragEnd:function(t){d(null),e.onSortEnd(t)},modifiers:e.vertical?[r.DL]:[]},n.createElement(s.Fo,{items:e.ids,strategy:e.vertical?s.qw:s.U2},e.children),n.createElement(i.y9,{dropAnimation:e.dropAnimation},c?e.getDragOverlay(c):null))}l.defaultProps={dropAnimation:{duration:250,easing:"ease"},vertical:!0}},1287:(e,t,a)=>{a.d(t,{W:()=>s});var n=a(32735),i=a(67445),r=a(17592);function s(e){var t=(0,i.nB)({id:e.id}),a=t.setNodeRef,s=t.transform,o=t.transition,l=t.isSorting,c=t.listeners,d=t.attributes,u=t.activeIndex,m=t.overIndex,v=t.index,p={transform:r.ux.Transform.toString(s),transition:o,touchAction:"none",position:"relative"};l&&v===u&&(p.visibility="hidden");var g=e.childComponent,f=function(e,t,a){return t!==e?null:a>t?"down":a<t?"up":null}(v,u,m);return n.createElement(g,Object.assign({},e.childProps,{ref:a,style:p,dragListeners:c,dragAttributes:d,dragDirection:f}))}},85784:(e,t,a)=>{a.d(t,{Q:()=>o});var n=a(32735),i=a(79014),r=a(83657),s=a(51365);function o(e){var t=n.useContext(s.M);if(!i.q.isFunction(t))return n.createElement(n.Fragment,null);var a=t(e.video,{analyticsData:e.analyticsData,analyticsOptions:e.analyticsOptions});return n.createElement(r.e,{actions:a,className:"float-end mt-n1",actionsDropdownClassName:"btn btn-link ms-1"})}},70872:(e,t,a)=>{a.d(t,{u:()=>l});var n=a(32735),i=a(65858),r=a(36848),s=a(38647),o=a(31908);function l(e){var t,a,l,c=o.M.getCanBeConsumed(e.video).canNavigate,d=o.M.getTitle(e.video),u=Object.assign(Object.assign({},e.analyticsData),{id:null===(t=e.video)||void 0===t?void 0:t.id,name:null===(a=e.video)||void 0===a?void 0:a.name}),m=Object.assign(Object.assign({},e.analyticsOptions),{actionType:i.Vw.Click,descriptor:i._S.Title}),v=e.textClassName||"m-0 text-truncate mb-n1 pb-1 align-middle ".concat("md"===e.size?"h4":"h6");return n.createElement(r.F,{className:e.linkClassName,appLink:c?e.appLink:null,analyticsOptions:m,analyticsData:u},n.createElement("h5",{className:v,title:null!==(l=e.video.name)&&void 0!==l?l:""},d,n.createElement(s.m,{size:e.size,video:e.video,yearGroups:e.yearGroups})))}},51365:(e,t,a)=>{a.d(t,{M:()=>n});var n=a(32735).createContext(null)},81514:(e,t,a)=>{a.d(t,{V:()=>r});var n=a(86764),i=a(3747);function r(){var e=(0,i.a)(n.r.XS),t=(0,i.a)(n.r.SM),a=(0,i.a)(n.r.MD),r=(0,i.a)(n.r.LG),s=(0,i.a)(n.r.XL),o=(0,i.a)(n.r.XXL),l=n.r.LG;return e&&(l=n.r.XS),t&&(l=n.r.SM),a&&(l=n.r.MD),r&&(l=n.r.LG),s&&(l=n.r.XL),o&&(l=n.r.XXL),l}},73514:(e,t,a)=>{a.r(t),a.d(t,{MoviesAndTvView:()=>J});var n=a(32735),i=a(23481),r=a(81886),s=a(20354),o=a(75896),l=a(28400),c=a(65858),d=a(98364),u=a(83345),m=a(25663),v=a(16714),p=a(12754),g=a(78479),f=a(42308),h=a(22902),y=a(15311),b=a(98758),T=a(21366),A=a(23232),E=a(76177),L=a(35223),S="moviesAndTv.dashboardEmptyState",C=i.T.encloseNamespace(S);function k(e){var t,a,r=(null===(t=e.dashboard)||void 0===t?void 0:t.status)===b.GL.Archived;return n.createElement(A.u,null,n.createElement(A.u.Image,{src:e.imageUrl,altText:C("info")}),n.createElement(A.u.Heading,null,n.createElement(u.x,{namespace:S,phrase:"heading"})),n.createElement(A.u.Info,null,n.createElement(u.x,{namespace:S,phrase:"info"})),n.createElement(E.u,{title:r?i.T.getPhrase(S,"archivedCtaTooltip"):"",spanHack:!0},n.createElement(A.u.Cta,{text:i.T.getPhrase(S,"add"),appLink:null===(a=e.addWidgetApplink)||void 0===a?void 0:a.call(e),className:"btn btn-dark",icon:L.vn.Plus,disabled:r})))}const w={icon:"Kmx7z",title:"Hw1qq"};var x="moviesAndTv.dashboard";function I(e){var t,a=o.m.sortBy(null===(t=e.dashboard)||void 0===t?void 0:t.widgets,"index"),r=(0,h.T)().hasPermissions,s=(0,y.r)().hasProduct,l=r(v.C.StudentExperience),c=r(v.C.Exchange)&&s(p.x.Exchange),A=e.isReadonly?a:a.filter((function(e){return e.templateId!==g.f.HeroBannerSmall&&e.widgetId!==f.z.Blurb||c}));function E(t,a,n){var i=T.S.getWidgetParams(a,n,T.S.getDashboardTargetType(e.dashboard));return e.getWidgetContentRequest(t,i)}var L=e.isReadonly&&!(null==A?void 0:A.length);return n.createElement("div",{className:"px-4"},e.showPreviewingBanner&&n.createElement("div",{className:"rounded p-2 bg-light-blue mt-3 text-center fw-semibold text-blue"},n.createElement(d.V,{emoji:"🔎"},n.createElement(u.x,{namespace:x,phrase:"banner"}))),n.createElement("div",{className:"d-flex align-items-center"},n.createElement("div",{style:{backgroundImage:"url(".concat(e.moviesAndTvIconUrl,")")},className:"".concat(w.icon)}),n.createElement("h1",{className:"h2 ".concat(w.title)},i.T.getPhrase(x,"heading"))),n.createElement("hr",{className:"mt-2"}),A.map((function(t,a){return n.createElement(m.L,{key:t.id,id:t.id,imageCdnUrl:e.imageCdnUrl,resourceThumbnailFallbackImageUrl:e.resourceThumbnailFallbackImageUrl,getContentRequest:E,audiences:e.audiences,name:t.name,description:t.description,templateId:t.templateId,metadata:t.metadata,presentation:e.presentation,setFavourite:e.setFavourite,canFavourite:e.canFavourite,appLinks:e.widgetAppLinks,isScrollToTargetWidget:(null==e?void 0:e.scrollToWidgetId)===t.id,widgetTypeId:t.widgetId,yearGroups:e.yearGroups,curriculum:e.curriculum,getCurriculumLinksRequest:e.getCurriculumLinksRequest,lazyLoad:e.lazyLoad,dashboardTarget:b.ku.MoviesAndTv,widgetIndex:a,showVideoGuidance:!l,hasPermissions:e.hasPermissions,hasLocalPermissions:e.hasLocalPermissions})})),L&&n.createElement(k,{dashboard:e.dashboard,isReadonly:e.isReadonly,imageUrl:e.emptyImageUrl,addWidgetApplink:e.widgetAppLinks.widgetWizard}))}var O=a(17475),P=a(183),N=a(21750),D=a(39151),M=a(80889),F=a(31949),R=a(97037),U=a(79612),j=a(37802),B=a(67753),V=a(99742),H=a(14070),W=a(97291),_=a(82817),q=a(7179),G=a(23737),z=a(30241),X=a(56017),$=a(33192),Q=a(82431),Y=i.T.encloseNamespace("moviesAndTV.moviesAndTV"),Z={rating:function(e,t){return{application:W.O.SEARCH,action:H.e.Search.HOME,params:{moviesAndTv:!0,rating:O.S.getFrontendParamValue([o.m.first(t),e])}}},classification:function(e){return{application:W.O.SUBJECT,action:H.e.Subjects.CLASSIFICATION,args:[null==e?void 0:e.id,l.m.slugify(null==e?void 0:e.name)],params:{mtv:!0}}},videoType:function(e,t){return B.W.getAppLink(e,{moviesAndTv:!0,context:P.Q.Widget,contextId:t})},series:function(e){return Q.j.getSeriesAppLink(e,{mtv:!0})},playlist:function(e){return{application:W.O.PLAYLISTS,action:H.e.Playlists.PLAYLIST,args:[e.id,l.m.slugify(e.name)],params:{mtv:!0}}},company:function(e){return{application:W.O.MOVIES_AND_TV,action:H.e.MoviesAndTv.COMPANY_DASHBOARD,args:[e.id,l.m.slugify(e.name)]}}};function J(e){var t,a,i=(0,h.T)(),o=i.hasPermissions,l=i.hasLocalPermissions,d=(0,j.r)(null),u=d.hasNewMoviesAndTv,m=d.isLoadingSettings,p=s.a.useBasicFetch(D.L.config()),g=s.a.useBasicFetch(F.N.currentUser()),f=(0,R.c)(c.LZ.ExpandableVideoThumbnail),y=f.setFavourite,T=f.canFavourite,A=(0,_.M)().activeCurriculum,E=(0,G.y)({targetType:b.ku.MoviesAndTv,queryParams:e.queryParams,presentationSlug:e.presentationSlug}),L=E.dashboard,S=E.presentation;return(0,q.P)({app:"movies-and-tv"}),(0,U.M)(X.C.getDefaultMetadata({title:null==S?void 0:S.name,phraseContext:{phraseHandler:Y,titlePhrase:"pageTitle",descriptionPhrase:"pageDescription"},canonicalLink:$.f.getCanonicalLink(),hrefLang:$.f.getStaticRouteHrefLang(null==S?void 0:S.learningLevel,(function(){return{application:W.O.MOVIES_AND_TV,action:H.e.MoviesAndTv.HOME}}),z.XA),allowIndexing:$.f.allowIndexing()})),n.useEffect((function(){!m&&L.hasCompleted&&(u&&L.data||r.Q.C$.trigger({application:W.O.DASHBOARD,action:H.e.Dashboard.HOME},{replace:!0}))}),[u,m,L.data,L.hasCompleted]),n.createElement(I,{dashboard:L.data,currentUser:g.data,getWidgetContentRequest:M._.dashboardWidgetContent,imageCdnUrl:null===(t=p.data)||void 0===t?void 0:t.imageCdnUrl,resourceThumbnailFallbackImageUrl:V.W.Fallbacks.RESOURCE_THUMBNAIL,presentation:S,curriculum:A,getCurriculumLinksRequest:function(e){return N.x.curriculumLinks(e,null==A?void 0:A.id)},showPreviewingBanner:(null===(a=g.data)||void 0===a?void 0:a.isAuthenticated)&&!o(v.C.StudentExperience),moviesAndTvIconUrl:V.W.MoviesAndTv.DASHBOARD_ICON,widgetAppLinks:Z,canFavourite:T,setFavourite:y,hasPermissions:o,hasLocalPermissions:l})}},68050:(e,t,a)=>{a.d(t,{Z:()=>c});var n=a(40841),i=a.n(n),r=a(32735),s=a(46304),o=a(74512);const l=r.forwardRef((({bsPrefix:e,className:t,as:a="div",...n},r)=>{const l=(0,s.vE)(e,"row"),c=(0,s.pi)(),d=(0,s.zG)(),u=`${l}-cols`,m=[];return c.forEach((e=>{const t=n[e];let a;delete n[e],null!=t&&"object"==typeof t?({cols:a}=t):a=t;const i=e!==d?`-${e}`:"";null!=a&&m.push(`${u}${i}-${a}`)})),(0,o.jsx)(a,{ref:r,...n,className:i()(t,l,...m)})}));l.displayName="Row";const c=l}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_clickview_lite=self.webpackChunk_clickview_lite||[]).push([[3962],{99705:(e,t,a)=>{var n,s;a.d(t,{b:()=>s}),function(e){e.AddToPlaylist="115005679748",e.EditSsoAccounts="8202508040345",e.LibraryEditor="360001974533",e.VideoAccess="360000153947",e.AddFromOnline="360011718234",e.UploadToLibraryEditor="360012069334",e.PBTErrorCodes="360012421153",e.ManuelReview="360020004534",e.LibraryReview="360000163788"}(n||(n={})),function(e){e.Integrations="4407268725529",e.Classrooms="4405362551833",e.MakeInteractive="4405370510873",e.EditSsoAccounts="8202605666073",e.UploadToLibraryEditor="10672936659865",e.AddFromLite="10671345281561",e.ManageSsoYearGroups="12522160412313",e.ContentReview="18525199576601",e.ContentPermissions="14692125209497",e.AccessSettings="22110291468057",e.ContentGuidelines="24133696186009",e.FoxtelFaq="24133519542169",e.ViviIntegration="23826297956377"}(s||(s={}))},83962:(e,t,a)=>{a.r(t),a.d(t,{ContactSchoolAdminView:()=>u});var n=a(32735),s=a(23481),i=a(9111),r=a(83345),o=a(99705),c=a(12778),l=a(99742),m="classrooms.contactSchoolAdmin",d=s.T.encloseNamespace(m),p=l.W.AddStudents.CONTACT_ADMIN;function u(e){var t=c.o.getLiteArticle(o.b.Classrooms);return n.createElement(i.G,{title:d("popupTitle"),closePopup:e.closePopup},n.createElement("div",{className:"text-center p-3"},n.createElement("img",{src:p,className:"img-fluid mb-3"}),n.createElement("h2",{className:"h3"},d("title")),n.createElement("p",{className:"mb-5"},n.createElement(r.x,{namespace:m,phrase:"paragraph"})),n.createElement("a",{className:"btn btn-link info-link",href:t,target:"_blank"},n.createElement(r.x,{namespace:m,phrase:"learnMore"}))))}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_clickview_lite=self.webpackChunk_clickview_lite||[]).push([[4373],{49935:(e,t,a)=>{a.d(t,{Oo:()=>u,b2:()=>d});var n=a(32735),r=a(36848),i=a(86764),c=a(3747),s=a(5859),o=a(35223),l=a(83914),m=function(e){var t=e.breadcrumb,a=t.name,i=t.appLink,c=t.active,s=e.withBackIcon;return n.createElement("li",{className:"breadcrumb-item".concat(c?" active":"")},c?n.createElement("strong",null,a):n.createElement(r.F,{appLink:i},s&&n.createElement(l.x,{svgName:o.vn.ChevronLeft,size:l.S.Small}),n.createElement("span",{className:s?"ms-2":""},a)))},u=function(e){var t=e.breadcrumbs,a=(0,c.a)(i.r.XS),r=null==t?void 0:t.length;return!r||a&&r<2?n.createElement(n.Fragment,null):a?n.createElement("nav",{"aria-label":"breadcrumb"},n.createElement("ol",{className:"breadcrumb m-0 p-0"},n.createElement(m,{breadcrumb:t[r-2],withBackIcon:!0}))):n.createElement("nav",{"aria-label":"breadcrumb"},n.createElement("ol",{className:"breadcrumb m-0 p-0"},t.map((function(e,t){return n.createElement(m,{key:t,breadcrumb:e})}))))},d=n.memo((function(e){var t=e.numItems,a=void 0===t?3:t;return(0,c.a)(i.r.XS)?n.createElement("div",{className:"partial-loading-background",style:{height:"1.3125rem",width:"6rem"}}):n.createElement("nav",{"aria-label":"breadcrumb"},n.createElement("ol",{className:"breadcrumb m-0 p-0"},s.u.getPartialLoadingItems({numItems:a}).map((function(e,t){var a=e.width;return n.createElement("li",{key:t,className:"breadcrumb-item"},n.createElement("span",{className:"d-inline-block partial-loading-background",style:{width:a},dangerouslySetInnerHTML:{__html:" "}}))}))))}))},38502:(e,t,a)=>{a.d(t,{r:()=>l});var n=a(32735),r=a(49985),i=a(36848),c=a(76246),s=a(11607),o=a(87432);function l(e){var t;return n.createElement("nav",{className:null!==(t=e.className)&&void 0!==t?t:""},n.createElement("ul",{className:"list-unstyled d-inline-block m-0 ".concat(o.Z.pillTabSelector)},e.tabs.map((function(e){return n.createElement("li",{className:"p-0 ".concat(e.active?"btn btn-dark":"btn btn-outline-dark"),key:e.name},e.appLink?n.createElement(i.F,{appLink:e.appLink,analyticsData:e.analyticsData,analyticsOptions:e.analyticsOptions,className:"cursor-pointer d-flex justify-content-center text-decoration-none text-reset px-2 ".concat(o.Z.pillItem)},e.name,"number"==typeof e.count&&n.createElement("div",{className:"ps-2"},n.createElement(c.C,{type:c.g.Count,data:e.count}))):n.createElement(s.L,{className:"".concat(o.Z.pillItem," d-flex justify-content-center p-2"),onClick:function(){return function(e){!e.active&&e.onSelect&&(e.onSelect(),e.analyticsData&&e.analyticsOptions&&r.k.logUserAction(e.analyticsData,e.analyticsOptions))}(e)}},e.name,"number"==typeof e.count&&n.createElement("div",{className:"ps-2"},n.createElement(c.C,{type:c.g.Count,data:e.count}))))}))))}},74696:(e,t,a)=>{a.d(t,{S:()=>l});var n=a(32735),r=a(68050),i=a(69111),c=a(9977),s=a(79967);const o={partialName:"SicQQ",partialDescription:"dPGMq",partialThumbnail:"vZrnb",partialDragHandle:"iq73R"};function l(e){return n.createElement(n.Fragment,null,Array(e.numVideos).fill(null).map((function(t,a){return n.createElement(m,Object.assign({key:a},e))})))}function m(e){var t=(0,s.k)(),a="sm"===c.O.getSize(t,"md"),l=e.withReordering&&!t.xs;return n.createElement(r.Z,{className:"".concat(a?"":"py-2")},n.createElement(i.Z,Object.assign({},c.O.getThumbnailColumns(),{className:"flex-column align-items-flex-start ".concat(a?"pb-2 pe-2":"mb-1 px-2")}),n.createElement(r.Z,null,!!l&&n.createElement("div",{className:"d-flex align-items-center justify-content-center col-2"},n.createElement("div",{className:"partial-loading-background ".concat(o.partialDragHandle)})),n.createElement(i.Z,{xs:c.O.getThumbnailColSize(l)},n.createElement("div",{className:"partial-loading-background ".concat(a?"rounded":"rounded-3"," ").concat(o.partialThumbnail)})))),n.createElement(i.Z,Object.assign({},c.O.getDetailsColumns(),{className:a?"pb-2":"px-2"}),n.createElement("div",{className:"partial-loading-background mb-1 ".concat(o.partialName)}),n.createElement("div",{className:"partial-loading-background ".concat(o.partialDescription)})))}l.defaultProps={numVideos:15}},99705:(e,t,a)=>{var n,r;a.d(t,{b:()=>r}),function(e){e.AddToPlaylist="115005679748",e.EditSsoAccounts="8202508040345",e.LibraryEditor="360001974533",e.VideoAccess="360000153947",e.AddFromOnline="360011718234",e.UploadToLibraryEditor="360012069334",e.PBTErrorCodes="360012421153",e.ManuelReview="360020004534",e.LibraryReview="360000163788"}(n||(n={})),function(e){e.Integrations="4407268725529",e.Classrooms="4405362551833",e.MakeInteractive="4405370510873",e.EditSsoAccounts="8202605666073",e.UploadToLibraryEditor="10672936659865",e.AddFromLite="10671345281561",e.ManageSsoYearGroups="12522160412313",e.ContentReview="18525199576601",e.ContentPermissions="14692125209497",e.AccessSettings="22110291468057",e.ContentGuidelines="24133696186009",e.FoxtelFaq="24133519542169",e.ViviIntegration="23826297956377"}(r||(r={}))},5859:(e,t,a)=>{function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,n=new Array(t);a<t;a++)n[a]=e[a];return n}a.d(t,{u:()=>i});var r={numItems:5,minWidth:50,maxWidth:100},i={getPartialLoadingItems:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=Object.assign(Object.assign({},r),t);return(e=Array(a.numItems),function(e){if(Array.isArray(e))return n(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return n(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);return"Object"===a&&e.constructor&&(a=e.constructor.name),"Map"===a||"Set"===a?Array.from(e):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?n(e,t):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.")}()).map((function(){return{width:"".concat(Math.max(Math.floor(Math.random()*a.maxWidth),a.minWidth),"px")}}))}}},23224:(e,t,a)=>{a.d(t,{j:()=>p});var n=a(32735),r=a(39202),i=a(23481),c=a(65858),s=a(38502),o=a(14070),l=a(97291),m="settings.restrictedVideosTabs",u=i.T.encloseNamespace(m),d={restrictedVideos:{application:l.O.SETTINGS,action:o.e.Settings.VIDEO_RESTRICTIONS},contentReview:{application:l.O.SETTINGS,action:o.e.Settings.CONTENT_REVIEW},contentReviewSettings:{application:l.O.SETTINGS,action:o.e.Settings.CONTENT_REVIEW_SETTINGS}};function p(e){return n.createElement("div",{className:"mb-3"},n.createElement(s.r,{tabs:[{name:u("restrictedVideos"),appLink:d.restrictedVideos,active:"restricted-videos"===e.active,analyticsData:{name:u("restrictedVideos"),url:r.C$.getHref(d.restrictedVideos)},analyticsOptions:{actionType:c.Vw.Click,entity:c.py.Url,location:c.LZ.MagicTabs}},{name:u("contentReview"),appLink:d.contentReview,active:"content-review"===e.active,analyticsData:{name:i.T.getPhrase(m,"contentReview"),url:r.C$.getHref(d.contentReview)},analyticsOptions:{actionType:c.Vw.Click,entity:c.py.Url,location:c.LZ.MagicTabs}},{name:u("contentReviewSettings"),appLink:d.contentReviewSettings,active:"content-review-settings"===e.active,analyticsData:{name:i.T.getPhrase(m,"contentReviewSettings"),url:r.C$.getHref(d.contentReviewSettings)},analyticsOptions:{actionType:c.Vw.Click,entity:c.py.Url,location:c.LZ.MagicTabs}}]}))}},81803:(e,t,a)=>{a.d(t,{d:()=>v});var n=a(32735),r=a(81886),i=a(23481),c=a(49935),s=a(22902),o=a(14070),l=a(97291),m=a(96368);function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,n=new Array(t);a<t;a++)n[a]=e[a];return n}var d="settings.settingsLayout",p=function(e){var t=(0,s.T)().hasPermissions,a=(0,m.e)();if(e)return t(e);var n=r.Q.C$.getCurrentAppLink();return n.application!==l.O.SETTINGS||a.some((function(e){return e.modules.some((function(e){return"appLink"in e&&e.appLink.action===n.action}))}))};function v(e){var t,a=p(e.requiredPermissions);if(n.useEffect((function(){a||r.Q.C$.trigger({application:l.O.SETTINGS,action:o.e.Settings.HOME},{replace:!0})}),[a]),!a)return n.createElement(n.Fragment,null);var s,m=e.breadcrumbs.map((function(t,a){return{name:t,appLink:{application:l.O.SETTINGS,action:o.e.Settings.HOME},active:a===e.breadcrumbs.length-1}}));return n.createElement("div",{className:"px-3"},n.createElement("div",{className:"d-flex align-items-center justify-content-between"},n.createElement("h1",{className:"h2"},e.heading),null===(t=e.headingButton)||void 0===t?void 0:t.call(e)),n.createElement("div",{className:"pb-3"},n.createElement(c.Oo,{breadcrumbs:[{name:i.T.getPhrase(d,"settingsBreadcrumb"),appLink:{application:l.O.SETTINGS,action:o.e.Settings.HOME}}].concat((s=m,function(e){if(Array.isArray(e))return u(e)}(s)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(s)||function(e,t){if(e){if("string"==typeof e)return u(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);return"Object"===a&&e.constructor&&(a=e.constructor.name),"Map"===a||"Set"===a?Array.from(e):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?u(e,t):void 0}}(s)||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.")}()))})),e.description&&n.createElement(n.Fragment,null,n.createElement("p",null,e.description),n.createElement("hr",null)),e.children)}},97383:(e,t,a)=>{a.r(t),a.d(t,{VideoRestrictionsView:()=>M});var n=a(32735),r=a(23481),i=a(20354),c=a(65858),s=a(36848),o=a(37395),l=a(83345),m=a(74696),u=a(4632),d=a(51365),p=a(16714),v=a(5345),b=a(1666),E=a(31949),g=a(97037),y=a(26361),f=a(67753),S=a(14070),T=a(97291),h=a(21491),N=a(44110),k=a(82431),I=a(23224),O=a(81803),w=a(23232),C=a(99705),L=a(12778),A=a(99742),R="settings.videoRestrictions",j=r.T.encloseNamespace(R);function V(){var e=L.o.getLiteArticle(C.b.ContentReview);return n.createElement(w.u,null,n.createElement(w.u.Image,{src:A.W.EmptyStates.ContentReview.RESTRICTED_VIDEOS}),n.createElement(w.u.Heading,null,n.createElement(l.x,{namespace:R,phrase:"emptyHeading"})),n.createElement(w.u.Cta,{href:e,text:j("emptyCta"),className:"btn btn-link info-link"}))}var x="settings.videoRestrictions",D=r.T.encloseNamespace(x),F={application:T.O.SETTINGS,action:S.e.Settings.CONTENT_PERMISSIONS};function M(e){var t,a,r,w,C,L=(0,g.c)(c.LZ.VideoThumbnail),A=L.setFavourite,R=L.canFavourite,j=i.a.useBasicFetch(h.I.getRestrictedObjects([v.c.User],e.cursor)),M=i.a.useBasicFetch(E.N.currentUser()),P=i.a.useBasicFetch(M.data&&b.h.yearGroups(M.data.customerId)),_=(0,N.i)();return n.createElement(O.d,{heading:D("heading"),breadcrumbs:[D("breadcrumb")],requiredPermissions:p.C.ManageVideoAccess},n.createElement(I.j,{active:"restricted-videos"}),n.createElement("div",{className:"d-flex justify-content-between align-items-center"},n.createElement("p",{className:"mb-0"},n.createElement(l.x,{namespace:x,phrase:"description"})," ",n.createElement(s.F,{appLink:F,className:"info-link"},n.createElement(l.x,{namespace:x,phrase:"contentPermissions"})))),n.createElement("hr",null),!j.hasCompleted&&n.createElement(m.S,null),j.hasCompleted&&!(null===(a=null===(t=j.data)||void 0===t?void 0:t.data)||void 0===a?void 0:a.length)&&n.createElement(V,null),!!(null===(w=null===(r=j.data)||void 0===r?void 0:r.data)||void 0===w?void 0:w.length)&&n.createElement(n.Fragment,null,n.createElement(d.M.Provider,{value:function(e,t){return[{order:1,label:D("manageVideoAccess"),button:!0,className:"btn btn-outline-dark",appLink:{application:T.O.DEFAULT,action:S.e.Default.MANAGE_ACCCESS,params:{objectId:e.id,objectTypeId:e.typeId}},analyticsOptions:Object.assign(Object.assign({},t.analyticsOptions),{actionType:c.Vw.SetAccess,workflowPhase:c.eu.Start}),analyticsData:t.analyticsData}]}},n.createElement(u.E4,{videos:j.data.data.filter((function(e){return!!y.l.getRestrictionByType(e,v.c.User)})),yearGroups:P.data,getVideoAppLink:f.W.getAppLink,getSeriesAppLink:k.j.getSeriesAppLink,setFavourite:A,canFavourite:R,presentationAudiences:_.data})),(null===(C=j.data.pagination)||void 0===C?void 0:C.cursors)&&n.createElement("div",{className:"clearfix"},n.createElement(o.t,{cursors:j.data.pagination.cursors,appLink:{application:T.O.SETTINGS,action:S.e.Settings.VIDEO_RESTRICTIONS},buttonVariant:"outline-dark",className:"py-2 float-end"}))))}},21491:(e,t,a)=>{a.d(t,{I:()=>c});var n=a(99940),r=a(97395),i=a(62803),c={getRestrictions:function(e){return{key:"restrictions:".concat(e),url:r._.urlBuilder("{gateway}/v1/objects/restrictions",{id:e})}},addRestriction:function(e){return{type:n.k.POST,key:"restrictions:".concat(e.objectTypeId,":").concat(e.objectId,":add"),url:"{gateway}/v1/restrictions",data:[e],invalidationKeys:["restrictions"]}},deleteRestrictions:function(e){return{url:r._.urlBuilder("{gateway}/v1/restrictions",{objectId:e}),key:"restrictions:delete",type:n.k.DELETE,invalidationKeys:["restrictions"]}},getRestrictedObjects:function(e,t){var a={type:e,"query.video":i.v.VIDEO_COLLECTION,"query.interactive":i.v.INTERACTIVE,"query.clip":i.v.CLIP_COLLECTION};return t&&(a.cursor=t),{url:r._.urlBuilder("{gateway}/v1/restrictions/objects",a),key:"restrictions:objects:".concat(e.sort().join(","),":").concat(t)}},approveAll:function(){return{url:"{gateway}/v1/library-reviews/restrictions",key:"restrictions:approve:all",type:n.k.DELETE}}}},44110:(e,t,a)=>{a.d(t,{i:()=>c});var n=a(20354),r=a(89454),i=a(86698),c=function(){var e=(0,i.y)({redirectOnError:!0}).activePresentation;return n.a.useBasicFetch(!!e&&r.O.presentationAudiences(e.id))}},87432:(e,t,a)=>{a.d(t,{Z:()=>n});const n={pillTabSelector:"Hdi6o",pillItem:"hUJx1"}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_clickview_lite=self.webpackChunk_clickview_lite||[]).push([[4417],{83657:(e,n,t)=>{t.d(n,{e:()=>s});var a=t(32735),r=t(79014),o=t(10874),i=t(76177),c=t(42735),l=t(86509);function s(e){var n=a.useMemo((function(){return e.actions.sort((function(e,n){return e.order-n.order}))}),[e.actions]),t=[],s=[];n.forEach((function(e){e.button?t.push(e):s.push(e)}));var u="d-flex";return e.className&&(u+=" ".concat(e.className)),t.length||s.length?a.createElement("div",{className:u},a.createElement(a.Fragment,null,a.createElement("span",{className:"d-flex align-items-center"},t.length?t.map((function(e,n){return a.createElement(a.Fragment,{key:n},function(){if(e.label){var n=r.q.isFunction(e.label)?e.label:function(){return a.createElement(a.Fragment,null,e.label)};return a.createElement(c.K,{appLink:e.appLink,href:e.href,onClick:e.onClick,svgName:e.svgName,className:e.className,tooltip:e.tooltip,showSpinner:e.showSpinner,analyticsData:e.analyticsData,analyticsOptions:e.analyticsOptions,openInNewTab:e.openInNewTab,disabled:e.disabled},n())}var t=a.createElement(o.h,{appLink:e.appLink,href:e.href,onClick:e.onClick,svgName:e.svgName,className:e.className,analyticsData:e.analyticsData,analyticsOptions:e.analyticsOptions,openInNewTab:e.openInNewTab,disabled:e.disabled});return e.tooltip?a.createElement(i.u,{title:e.tooltip,spanHack:!0},t):t}())})):a.createElement(a.Fragment,null),e.sortComponent&&e.sortComponent,s.length?a.createElement(l.m,{actions:s,dropdownToggleClassName:e.actionsDropdownClassName,dropdownToggleSvgSize:e.dropdownToggleSvgSize}):a.createElement(a.Fragment,null)))):a.createElement(a.Fragment,null)}},86509:(e,n,t)=>{t.d(n,{m:()=>g});var a=t(32735),r=t(79014),o=t(81886),i=t(45157),c=t(49985),l=t(36848),s=t(83914),u=t(76177),m=t(35223);const d={dropdownToggle:"UCAnJ"};function f(e){var n="dropdown-item";return e&&(n+=" ".concat(e)),n}function p(e){var n=r.q.isFunction(e.action.label)?e.action.label:function(){return a.createElement(a.Fragment,null,e.action.label)};if(e.action.appLink)return a.createElement(l.F,{appLink:e.action.appLink,onClick:e.action.onClick,className:f(e.action.className),analyticsData:e.action.analyticsData,analyticsOptions:e.action.analyticsOptions,openInNewTab:e.action.openInNewTab,disabled:e.action.disabled},n());function t(n){n.preventDefault(),e.action.analyticsData&&e.action.analyticsOptions&&c.k.logUserAction(e.action.analyticsData,e.action.analyticsOptions),r.q.isFunction(e.action.onClick)&&e.action.onClick(),e.action.href&&o.Q.Ab.PageLoad(e.action.href,e.action.openInNewTab)}return e.action.href?a.createElement("a",{className:f(e.action.className),onClick:t,href:e.action.href},n()):a.createElement("span",{className:"cursor-pointer ".concat(f(e.action.className)),onClick:t,role:"button",tabIndex:0,onKeyDown:function(e){return"Enter"===e.key&&t(e)}},n())}function g(e){if(!e.actions||!e.actions.length)return a.createElement(a.Fragment,null);var n="dropdown";e.className&&(n+=" ".concat(e.className));var t="actions-dropdown-".concat(i.Y.getRandomInt()),r="dropdown-toggle px-0 ".concat(d.dropdownToggle);return e.dropdownToggleClassName&&(r+=" ".concat(e.dropdownToggleClassName)),a.createElement("div",{className:n},a.createElement("button",{className:r,type:"button",id:t,"data-bs-toggle":"dropdown","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false"},a.createElement(s.x,{svgName:m.vn.More,size:e.dropdownToggleSvgSize})),a.createElement("div",{className:"dropdown-menu dropdown-menu-end dropdown-menu-right","aria-labelledby":t},e.actions.map((function(e,n){return e.tooltip?a.createElement(u.u,{key:n,title:e.tooltip,spanHack:!0},a.createElement(p,{action:e})):a.createElement(p,{key:n,action:e})}))))}g.defaultProps={dropdownToggleClassName:"btn btn-light",dropdownToggleSvgSize:s.S.Small}},80143:(e,n,t)=>{t.d(n,{n:()=>o});var a=t(32735),r=t(69454);function o(e,n){var t=a.useMemo((function(){return(null==e?void 0:e.length)&&n&&r.T.shouldShowAudiences(n)?r.T.getSortedPresentationAudiences(e,n):null}),[e]);return a.useMemo((function(){return(null==t?void 0:t.length)?r.T.getMergedPresentationAudienceString(t):null}),[t])}},69454:(e,n,t)=>{t.d(n,{T:()=>m});var a=t(75896),r=t(1048),o=t(55171);function i(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,a=new Array(n);t<n;t++)a[t]=e[t];return a}var c=/\d/,l=function(e){var n,t,r=a.m.first(e),o=a.m.last(e);return r.name===o.name?r.name:"Advanced"===o.name?"lower"===(n=r.name.split(" "),t=1,function(e){if(Array.isArray(e))return e}(n)||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var a,r,o,i,c=[],l=!0,s=!1;try{if(o=(t=t.call(e)).next,0===n){if(Object(t)!==t)return;l=!1}else for(;!(l=(a=o.call(t)).done)&&(c.push(a.value),c.length!==n);l=!0);}catch(e){s=!0,r=e}finally{try{if(!l&&null!=t.return&&(i=t.return(),Object(i)!==i))return}finally{if(s)throw r}}return c}}(n,t)||function(e,n){if(e){if("string"==typeof e)return i(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?i(e,n):void 0}}(n,t)||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.")}())[0].toLowerCase()?"Lower Sec - Adv":"Upper Sec - Adv":"Lower - Upper Sec"},s=/([0-9]+)/gi,u=/\s|\+/gi,m={getSortedPresentationAudiences:function(e,n){var t=e.filter((function(e){return!!e})).map((function(e){return e.id.toString()}));return n.filter((function(e){return t.includes(e.masterId.toString())}))},getMergedPresentationAudienceString:function(e){var n,t,r,i="";switch(+a.m.first(e).presentationId){case o.e.PresentationIds.DEFAULT:case o.e.PresentationIds.AU_SECONDARY:case o.e.PresentationIds.US_ELEMENTARY:case o.e.PresentationIds.AU_PRIMARY:if(1===e.length)return e[0];i=function(e){var n=e.map((function(e){return e.name})).join(" "),t=n.split(" ").filter((function(e){return!isNaN(+e)})).map((function(e){return+e}))||[],a=n.split(" ").filter((function(e){return isNaN(+e)}))||[],r=e.find((function(e){return!c.test(e.name)})),o=a.find((function(e){return e!==(null==r?void 0:r.name)}));if(e.length>1&&(o+="s"),r&&t.length)return"".concat(o," ").concat(r.name.charAt(0)," - ").concat(t.pop());var i=function(e){var n,t,a,r,o=!1,i=[];for(e=e.sort((function(e,n){return e-n})),a=0;a<e.length;a++)r=a+1,o||(n=e[a]),t=e[r],e[a]+1===t?o=!0:o?(i.push("".concat(n," - ").concat(e[a])),o=!1):(i.push("".concat(e[a])),o=!1);return i}(t);return"".concat(o," ").concat(i.join(", "))}(e);break;case o.e.PresentationIds.SCOTLAND_PRIMARY:case o.e.PresentationIds.INTERNATIONAL_PRIMARY:case o.e.PresentationIds.INTERNATIONAL_SECONDARY:if(1===e.length)return e[0];i=function(e){var n=e.map((function(e){return e.name})),t={};n.forEach((function(e,n){if(0!==n){var a=e.split(" ");Object.keys(t).forEach((function(e){a.includes(e)||delete t[e]}))}else e.split(" ").forEach((function(e,n){t[e]=0===n?"start":"end"}))}));var a=Object.keys(t)[0],r=t[a];if(!a)return e[0].name;var o=e[0].name,i=e[e.length-1].name,c=function(e){return e.split(a)[0]},l="".concat(c(o)," - ").concat(c(i));return"start"===r?"".concat(a," ").concat(l):"".concat(l," ").concat(a)}(e);break;case o.e.PresentationIds.ENGLISH_SECONDARY:i=l(e);break;case o.e.PresentationIds.SCOTLAND_SECONDARY:n=e,t=a.m.first(n),r=a.m.last(n),i=t.name===r.name?t.name:"Senior Phase"===r.name?"".concat(t.name," - Senior"):"Third - Fourth Level";break;case o.e.PresentationIds.ENGLAND_PRIMARY:i=function(e){var n=a.m.first(e),t=a.m.last(e),r=a.m.first(n.name.split(" ")),o=a.m.first(t.name.split(" ")),i=n.name.split(" ").find((function(e){return!isNaN(+e)})),c=t.name.split(" ").find((function(e){return!isNaN(+e)}));if(n===t)return"Key"===r||"Reception"===r?n.name:"".concat(r," KS").concat(i);var l="",s="";return l="Reception"===r?"R":"KS".concat(i),s="KS".concat(c),"Lower"===r&&"Upper"===o?"L ".concat(l," - U ").concat(s):("Lower"===r&&(l="Lower ".concat(l)),"Upper"===o&&(s="Upper ".concat(s)),"Key"===o&&(s=t.name),"".concat(l," - ").concat(s))}(e);case o.e.PresentationIds.US_MIDDLE:case o.e.PresentationIds.US_HIGH:}return i?{name:i}:null},sortMembersWithDuplicateNamesByAudience:function(e){var n=function(e){return e.length?(e.forEach((function(e){var r=+a.m.first(e.name.match(s));if(!n)return n=e,void(t=r);r<t&&(n=e)})),n):null;var n,t},t={},r=[];return e.forEach((function(e){if(!t[e.name])return t[e.name]=1,void r.push(e);r.push(e),t[e.name]++;var a=r.splice(r.length-t[e.name]).sort((function(e,t){var a=n(e.subjectPresentationAudiences.data),r=n(t.subjectPresentationAudiences.data);if(!a&&r)return 1;if(!r)return-1;var o=a.name.localeCompare(r.name);return 0===o?o:o>0?-1:1}));r=r.concat(a)})),r},getActiveAudiencesFromParams:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(r.t.isObject(n)&&!r.t.isEmpty(n)&&e&&e.length&&m.shouldShowAudiences(e)){var t=n.a;if(t){"string"==typeof t&&(t=[t]);var a=function(e){return e.replace(u,"").toLowerCase()},o=t.reduce((function(e,n){return e[a(n)]=n,e}),{});return e.filter((function(e){return o[a(e.name)]}))}}},getAudienceParams:function(e){return(null==e?void 0:e.length)?{a:e.map((function(e){return e.name}))}:null},shouldShowAudiences:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return!!e&&e.length>1}}}}]);
|