alistgo-alist-web 3.56.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/README.md +34 -0
- package/dist/assets/2fa-46b8256b.js +1 -0
- package/dist/assets/2fa-legacy.398e8e78.js +1 -0
- package/dist/assets/About-e47182af.js +1 -0
- package/dist/assets/About-legacy.1289a3bb.js +1 -0
- package/dist/assets/AddLabelDialog-0c30515a.js +1 -0
- package/dist/assets/AddLabelDialog-legacy.cc57656a.js +1 -0
- package/dist/assets/AddOrEdit-1124188f.js +1 -0
- package/dist/assets/AddOrEdit-6d416fd2.js +1 -0
- package/dist/assets/AddOrEdit-9d27739a.js +1 -0
- package/dist/assets/AddOrEdit-e6bf2264.js +1 -0
- package/dist/assets/AddOrEdit-legacy.0f9dd018.js +1 -0
- package/dist/assets/AddOrEdit-legacy.73708fb8.js +1 -0
- package/dist/assets/AddOrEdit-legacy.8c9d1f76.js +1 -0
- package/dist/assets/AddOrEdit-legacy.abdbec5f.js +1 -0
- package/dist/assets/Common-972fe675.js +1 -0
- package/dist/assets/Common-legacy.d3b29529.js +1 -0
- package/dist/assets/Copy-27ccc5bb.js +1 -0
- package/dist/assets/Copy-legacy.4726f176.js +1 -0
- package/dist/assets/Decompress-487355e7.js +1 -0
- package/dist/assets/Decompress-legacy.c2c88fbd.js +1 -0
- package/dist/assets/DeletePopover-14667228.js +1 -0
- package/dist/assets/DeletePopover-legacy.eea88399.js +1 -0
- package/dist/assets/EditLabelDialog-e1c497f9.js +1 -0
- package/dist/assets/EditLabelDialog-legacy.4297e407.js +1 -0
- package/dist/assets/File-d8b1045a.js +8 -0
- package/dist/assets/File-legacy.42c11a63.js +1 -0
- package/dist/assets/Folder-015eb94d.js +179 -0
- package/dist/assets/Folder-6ee8584f.css +1 -0
- package/dist/assets/Folder-legacy.4311946a.js +29 -0
- package/dist/assets/FolderTree-6f54b0b0.js +1 -0
- package/dist/assets/FolderTree-legacy.eeec4df2.js +1 -0
- package/dist/assets/Grid-9188d13c.js +1 -0
- package/dist/assets/Grid-legacy.304bdbd6.js +1 -0
- package/dist/assets/GridItem-e11988da.js +1 -0
- package/dist/assets/GridItem-legacy.92e61601.js +1 -0
- package/dist/assets/ImageWithError-335988a8.js +1 -0
- package/dist/assets/ImageWithError-legacy.3b16de13.js +1 -0
- package/dist/assets/Images-12aaeeaa.js +1 -0
- package/dist/assets/Images-legacy.08b105c3.js +1 -0
- package/dist/assets/Layout-66d6a6fd.js +11 -0
- package/dist/assets/Layout-legacy.b2082e61.js +1 -0
- package/dist/assets/List-d289fe27.js +9 -0
- package/dist/assets/List-legacy.0b19a233.js +1 -0
- package/dist/assets/Messenger-b99aa3a0.js +1 -0
- package/dist/assets/Messenger-legacy.f7d5c274.js +1 -0
- package/dist/assets/Metas-73ad14ea.js +1 -0
- package/dist/assets/Metas-legacy.047fb1e9.js +1 -0
- package/dist/assets/Other-db3bfec1.js +1 -0
- package/dist/assets/Other-legacy.ca03d7c1.js +1 -0
- package/dist/assets/PackageDownload-8b8471d2.js +1 -0
- package/dist/assets/PackageDownload-legacy.6d567c0f.js +1 -0
- package/dist/assets/Paginator-6b8b297f.js +1 -0
- package/dist/assets/Paginator-legacy.0e75f264.js +1 -0
- package/dist/assets/Password-eb061964.js +1 -0
- package/dist/assets/Password-legacy.471d11cd.js +1 -0
- package/dist/assets/PermissionForm-4251595a.js +1 -0
- package/dist/assets/PermissionForm-legacy.90ad121a.js +1 -0
- package/dist/assets/Profile-3fecd1ab.js +1 -0
- package/dist/assets/Profile-legacy.8c4b70ea.js +1 -0
- package/dist/assets/ResponsiveGrid-35b6c8ed.js +1 -0
- package/dist/assets/ResponsiveGrid-legacy.6c0954c3.js +1 -0
- package/dist/assets/Role-a54a8031.js +1 -0
- package/dist/assets/Role-legacy.4362cd27.js +1 -0
- package/dist/assets/S3-3368841d.js +1 -0
- package/dist/assets/S3-legacy.88de8a46.js +1 -0
- package/dist/assets/S3Transition-0528c963.js +1 -0
- package/dist/assets/S3Transition-legacy.288c6def.js +1 -0
- package/dist/assets/SettingItem-b001fb21.js +1 -0
- package/dist/assets/SettingItem-legacy.30070d20.js +1 -0
- package/dist/assets/SourceHanSansCN-Bold-b5627435.woff2 +0 -0
- package/dist/assets/Storages-71961af9.js +1 -0
- package/dist/assets/Storages-legacy.62a6c6f5.js +1 -0
- package/dist/assets/Tag-28e6c753.js +1 -0
- package/dist/assets/Tag-legacy.02ba977c.js +1 -0
- package/dist/assets/Tasks-955b8122.js +1 -0
- package/dist/assets/Tasks-legacy.db2a67ab.js +1 -0
- package/dist/assets/TimesNewRoman-d9fb32eb.ttf +0 -0
- package/dist/assets/Upload-2acc2769.js +5 -0
- package/dist/assets/Upload-dac85921.js +1 -0
- package/dist/assets/Upload-legacy.2aae06b6.js +6 -0
- package/dist/assets/Upload-legacy.63a456fd.js +1 -0
- package/dist/assets/Users-d61fcb09.js +1 -0
- package/dist/assets/Users-legacy.351af943.js +1 -0
- package/dist/assets/Wether-efd806ad.js +1 -0
- package/dist/assets/Wether-legacy.99a49486.js +1 -0
- package/dist/assets/aliyun_office-f185e970.js +1 -0
- package/dist/assets/aliyun_office-legacy.bb247542.js +1 -0
- package/dist/assets/aliyun_video-fefe8145.js +1 -0
- package/dist/assets/aliyun_video-legacy.5de29048.js +1 -0
- package/dist/assets/archive-cd361e2c.js +1 -0
- package/dist/assets/archive-legacy.1dba1a02.js +1 -0
- package/dist/assets/asciinema-53412307.css +1 -0
- package/dist/assets/asciinema-9a29aaad.js +7 -0
- package/dist/assets/asciinema-legacy.f47a54ab.js +1 -0
- package/dist/assets/audio-43f4c02b.css +1 -0
- package/dist/assets/audio-4a4cbc3a.js +154 -0
- package/dist/assets/audio-legacy.e6590bf5.js +1 -0
- package/dist/assets/backup-restore-7a7d8f68.js +1 -0
- package/dist/assets/backup-restore-legacy.9aaed952.js +1 -0
- package/dist/assets/color-a58de010.js +1 -0
- package/dist/assets/color-legacy.24148ccb.js +1 -0
- package/dist/assets/entry-125255d4.js +9 -0
- package/dist/assets/entry-1f8750d3.js +5 -0
- package/dist/assets/entry-2dcf102b.js +5 -0
- package/dist/assets/entry-40c0efae.js +6 -0
- package/dist/assets/entry-89a5b151.js +5 -0
- package/dist/assets/entry-c149acf6.js +5 -0
- package/dist/assets/entry-c9079448.js +5 -0
- package/dist/assets/entry-e8ead902.js +7 -0
- package/dist/assets/entry-fe0e94b2.js +5 -0
- package/dist/assets/entry-ff0ec710.js +5 -0
- package/dist/assets/entry-legacy.0bf5e0ca.js +1 -0
- package/dist/assets/entry-legacy.1bea9f3a.js +1 -0
- package/dist/assets/entry-legacy.3cbf81df.js +1 -0
- package/dist/assets/entry-legacy.5e9cadea.js +1 -0
- package/dist/assets/entry-legacy.759fde7b.js +1 -0
- package/dist/assets/entry-legacy.bca06ca5.js +1 -0
- package/dist/assets/entry-legacy.c35a6372.js +1 -0
- package/dist/assets/entry-legacy.d14255c4.js +1 -0
- package/dist/assets/entry-legacy.e8ec9e72.js +1 -0
- package/dist/assets/entry-legacy.fea7f65d.js +1 -0
- package/dist/assets/helper-35b1dcfb.js +1 -0
- package/dist/assets/helper-edad9708.js +1 -0
- package/dist/assets/helper-legacy.a9f06abb.js +1 -0
- package/dist/assets/helper-legacy.f89e2639.js +1 -0
- package/dist/assets/hls-d6b9fc1a.js +52 -0
- package/dist/assets/hls-legacy.ae2e1dfe.js +8 -0
- package/dist/assets/html-d6918c57.js +1 -0
- package/dist/assets/html-legacy.3d2480dd.js +1 -0
- package/dist/assets/image-a16903d2.js +1 -0
- package/dist/assets/image-legacy.80edfdc1.js +1 -0
- package/dist/assets/index-13b290a7.js +103 -0
- package/dist/assets/index-4ce3d2a1.js +1 -0
- package/dist/assets/index-5b99d24c.js +263 -0
- package/dist/assets/index-69644529.js +1 -0
- package/dist/assets/index-8034ec29.js +14 -0
- package/dist/assets/index-864d4e91.js +1 -0
- package/dist/assets/index-870b387c.js +5 -0
- package/dist/assets/index-b206f97b.css +1 -0
- package/dist/assets/index-c1c6ff9d.js +1 -0
- package/dist/assets/index-d9416289.js +4 -0
- package/dist/assets/index-legacy.0f46aa15.js +1 -0
- package/dist/assets/index-legacy.43a11866.js +1 -0
- package/dist/assets/index-legacy.52c6160a.js +1 -0
- package/dist/assets/index-legacy.5b54d5e4.js +1 -0
- package/dist/assets/index-legacy.62c06d64.js +17 -0
- package/dist/assets/index-legacy.9842d021.js +1 -0
- package/dist/assets/index-legacy.d760057f.js +1 -0
- package/dist/assets/index-legacy.de03403a.js +18 -0
- package/dist/assets/index-legacy.e98cf2bb.js +1 -0
- package/dist/assets/indexes-7cc6998a.js +2 -0
- package/dist/assets/indexes-legacy.c057d4aa.js +1 -0
- package/dist/assets/ipa-99035991.js +1 -0
- package/dist/assets/ipa-legacy.5f9016d0.js +1 -0
- package/dist/assets/item_type-32dc6fdf.js +1 -0
- package/dist/assets/item_type-legacy.1b6076a1.js +1 -0
- package/dist/assets/lg-22b72ba5.ttf +0 -0
- package/dist/assets/lg-f2fe1c00.svg +54 -0
- package/dist/assets/lg-fefc5c0d.woff +0 -0
- package/dist/assets/loading-298ad3ff.gif +0 -0
- package/dist/assets/management-c5058b09.js +1 -0
- package/dist/assets/management-legacy.dac45ae8.js +1 -0
- package/dist/assets/markdown-68e1268c.js +1 -0
- package/dist/assets/markdown-legacy.345b4c89.js +1 -0
- package/dist/assets/markdown_with_word_wrap-223f2b9c.js +1 -0
- package/dist/assets/markdown_with_word_wrap-legacy.bfb81d65.js +1 -0
- package/dist/assets/mySession-94f62c14.js +1 -0
- package/dist/assets/mySession-legacy.1dc68111.js +1 -0
- package/dist/assets/offline_download-827377f8.js +1 -0
- package/dist/assets/offline_download-legacy.8be0325e.js +1 -0
- package/dist/assets/plist-a2abd5f6.js +1 -0
- package/dist/assets/plist-legacy.48a58efc.js +1 -0
- package/dist/assets/polyfills-legacy.4a227757.js +1 -0
- package/dist/assets/storage-class-1ac53f89.js +1 -0
- package/dist/assets/storage-class-legacy.7f6d9768.js +1 -0
- package/dist/assets/style-a6d16836.css +1 -0
- package/dist/assets/style-a91f2fe1.js +1 -0
- package/dist/assets/style-legacy.92f43969.js +1 -0
- package/dist/assets/subtitles-octopus-worker-62892886.wasm +0 -0
- package/dist/assets/subtitles-octopus-worker-f95f2186.js +1 -0
- package/dist/assets/text-editor-4cdde982.js +11 -0
- package/dist/assets/text-editor-legacy.c89be03c.js +1 -0
- package/dist/assets/ua-parser-5a8f43f2.js +1 -0
- package/dist/assets/ua-parser-legacy.5e4c06d6.js +1 -0
- package/dist/assets/url-64ba4724.js +1 -0
- package/dist/assets/url-legacy.bce70b79.js +1 -0
- package/dist/assets/useTitle-efd03a2a.js +1 -0
- package/dist/assets/useTitle-legacy.771fa6e1.js +1 -0
- package/dist/assets/video-e846152c.js +9 -0
- package/dist/assets/video-legacy.3e8def69.js +9 -0
- package/dist/assets/video360-7ff50eab.js +18 -0
- package/dist/assets/video360-f0192288.css +1 -0
- package/dist/assets/video360-legacy.53143d53.js +16 -0
- package/dist/assets/video_box-06f63821.js +18 -0
- package/dist/assets/video_box-legacy.95767478.js +8 -0
- package/dist/assets/webauthn-json.browser-ponyfill-f2f06d6e.js +1 -0
- package/dist/assets/webauthn-json.browser-ponyfill-legacy.1eb8248a.js +1 -0
- package/dist/images/config-active.png +0 -0
- package/dist/images/config-gray.png +0 -0
- package/dist/images/figplayer.webp +0 -0
- package/dist/images/fileball.webp +0 -0
- package/dist/images/filetypes/3GP.png +0 -0
- package/dist/images/filetypes/7z.png +0 -0
- package/dist/images/filetypes/AAC.png +0 -0
- package/dist/images/filetypes/AI-1.png +0 -0
- package/dist/images/filetypes/AI.png +0 -0
- package/dist/images/filetypes/AMR.png +0 -0
- package/dist/images/filetypes/ASE.png +0 -0
- package/dist/images/filetypes/ASP.png +0 -0
- package/dist/images/filetypes/ASPX.png +0 -0
- package/dist/images/filetypes/AU.png +0 -0
- package/dist/images/filetypes/AVI.png +0 -0
- package/dist/images/filetypes/BMP.png +0 -0
- package/dist/images/filetypes/C++.png +0 -0
- package/dist/images/filetypes/CAD.png +0 -0
- package/dist/images/filetypes/CFM.png +0 -0
- package/dist/images/filetypes/CGI.png +0 -0
- package/dist/images/filetypes/COM.png +0 -0
- package/dist/images/filetypes/CPP.png +0 -0
- package/dist/images/filetypes/CSS.png +0 -0
- package/dist/images/filetypes/CSV.png +0 -0
- package/dist/images/filetypes/DMG.png +0 -0
- package/dist/images/filetypes/DOC.png +0 -0
- package/dist/images/filetypes/DOCX.png +0 -0
- package/dist/images/filetypes/FLAC.png +0 -0
- package/dist/images/filetypes/GIF.png +0 -0
- package/dist/images/filetypes/GZ.png +0 -0
- package/dist/images/filetypes/ICO.png +0 -0
- package/dist/images/filetypes/ISO.png +0 -0
- package/dist/images/filetypes/JAVA.png +0 -0
- package/dist/images/filetypes/JPEG.png +0 -0
- package/dist/images/filetypes/JPG.png +0 -0
- package/dist/images/filetypes/JSON.png +0 -0
- package/dist/images/filetypes/MDF.png +0 -0
- package/dist/images/filetypes/MMF.png +0 -0
- package/dist/images/filetypes/MOV.png +0 -0
- package/dist/images/filetypes/MP3.png +0 -0
- package/dist/images/filetypes/MP4.png +0 -0
- package/dist/images/filetypes/MPG-1.png +0 -0
- package/dist/images/filetypes/MPG.png +0 -0
- package/dist/images/filetypes/MSI.png +0 -0
- package/dist/images/filetypes/OBJ.png +0 -0
- package/dist/images/filetypes/OTF.png +0 -0
- package/dist/images/filetypes/PDF.png +0 -0
- package/dist/images/filetypes/PHP.png +0 -0
- package/dist/images/filetypes/PKG.png +0 -0
- package/dist/images/filetypes/PNG-1.png +0 -0
- package/dist/images/filetypes/PNG.png +0 -0
- package/dist/images/filetypes/PPT-1.png +0 -0
- package/dist/images/filetypes/PPT.png +0 -0
- package/dist/images/filetypes/PPTX.png +0 -0
- package/dist/images/filetypes/PSD.png +0 -0
- package/dist/images/filetypes/PY.png +0 -0
- package/dist/images/filetypes/RM.png +0 -0
- package/dist/images/filetypes/RMVB.png +0 -0
- package/dist/images/filetypes/SQL.png +0 -0
- package/dist/images/filetypes/SRT.png +0 -0
- package/dist/images/filetypes/SVG.png +0 -0
- package/dist/images/filetypes/TAR.png +0 -0
- package/dist/images/filetypes/TIF-1.png +0 -0
- package/dist/images/filetypes/TIF.png +0 -0
- package/dist/images/filetypes/TIFF.png +0 -0
- package/dist/images/filetypes/TXT-1.png +0 -0
- package/dist/images/filetypes/TXT.png +0 -0
- package/dist/images/filetypes/WAV.png +0 -0
- package/dist/images/filetypes/WMA.png +0 -0
- package/dist/images/filetypes/WMV.png +0 -0
- package/dist/images/filetypes/WPS.png +0 -0
- package/dist/images/filetypes/XLS.png +0 -0
- package/dist/images/filetypes/XLSX.png +0 -0
- package/dist/images/filetypes/XML.png +0 -0
- package/dist/images/filetypes/ZIP.png +0 -0
- package/dist/images/filetypes/aif.png +0 -0
- package/dist/images/filetypes/apk.png +0 -0
- package/dist/images/filetypes/exe.png +0 -0
- package/dist/images/filetypes/htm.png +0 -0
- package/dist/images/filetypes/html.png +0 -0
- package/dist/images/filetypes/ipa.png +0 -0
- package/dist/images/filetypes/rar.png +0 -0
- package/dist/images/filetypes/rat.png +0 -0
- package/dist/images/filetypes/tipa.png +0 -0
- package/dist/images/iPlay.webp +0 -0
- package/dist/images/iina.webp +0 -0
- package/dist/images/infuse.webp +0 -0
- package/dist/images/mpv.webp +0 -0
- package/dist/images/mxplayer-pro.webp +0 -0
- package/dist/images/mxplayer.webp +0 -0
- package/dist/images/new_bg.png +0 -0
- package/dist/images/new_icon.png +0 -0
- package/dist/images/nplayer.webp +0 -0
- package/dist/images/omniplayer.webp +0 -0
- package/dist/images/permissions-active.png +0 -0
- package/dist/images/permissions-gray.png +0 -0
- package/dist/images/potplayer.webp +0 -0
- package/dist/images/role-active.png +0 -0
- package/dist/images/role-gray.png +0 -0
- package/dist/images/tag-active.png +0 -0
- package/dist/images/tag-gray.png +0 -0
- package/dist/images/vlc.webp +0 -0
- package/dist/index.html +81 -0
- package/dist/static/epub.js/viewer.html +467 -0
- package/dist/static/manifest.json +13 -0
- package/dist/streamer/mitm.html +186 -0
- package/dist/streamer/sw.js +141 -0
- package/package.json +104 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
!function(){function e(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var i,r,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(i=n.next()).done)&&(o.push(i.value),!t||o.length!==t);a=!0);}catch(u){s=!0,r=u}finally{try{a||null==n.return||n.return()}finally{if(s)throw r}}return o}(e,t)||o(e,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.")}()}function t(e){return function(e){if(Array.isArray(e))return a(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||o(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.")}()}function n(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */i=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",a=r.asyncIterator||"@@asyncIterator",s=r.toStringTag||"@@toStringTag";function u(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(R){u=function(e,t,n){return e[t]=n}}function l(e,t,n,i){var r=t&&t.prototype instanceof d?t:d,o=Object.create(r.prototype),a=new x(i||[]);return o._invoke=function(e,t,n){var i="suspendedStart";return function(r,o){if("executing"===i)throw new Error("Generator is already running");if("completed"===i){if("throw"===r)throw o;return L()}for(n.method=r,n.arg=o;;){var a=n.delegate;if(a){var s=E(a,n);if(s){if(s===h)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===i)throw i="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i="executing";var u=c(e,t,n);if("normal"===u.type){if(i=n.done?"completed":"suspendedYield",u.arg===h)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(i="completed",n.method="throw",n.arg=u.arg)}}}(e,n,a),o}function c(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(R){return{type:"throw",arg:R}}}e.wrap=l;var h={};function d(){}function v(){}function f(){}var _={};u(_,o,(function(){return this}));var p=Object.getPrototypeOf,m=p&&p(p(C([])));m&&m!==t&&n.call(m,o)&&(_=m);var g=f.prototype=d.prototype=Object.create(_);function b(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function w(e,t){function i(r,o,a,s){var u=c(e[r],e,o);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==y(h)&&n.call(h,"__await")?t.resolve(h.__await).then((function(e){i("next",e,a,s)}),(function(e){i("throw",e,a,s)})):t.resolve(h).then((function(e){l.value=e,a(l)}),(function(e){return i("throw",e,a,s)}))}s(u.arg)}var r;this._invoke=function(e,n){function o(){return new t((function(t,r){i(e,n,t,r)}))}return r=r?r.then(o,o):o()}}function E(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,E(e,t),"throw"===t.method))return h;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var i=c(n,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,h;var r=i.arg;return r?r.done?(t[e.resultName]=r.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,h):r:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,h)}function k(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function T(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function x(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function C(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,r=function t(){for(;++i<e.length;)if(n.call(e,i))return t.value=e[i],t.done=!1,t;return t.value=void 0,t.done=!0,t};return r.next=r}}return{next:L}}function L(){return{value:void 0,done:!0}}return v.prototype=f,u(g,"constructor",f),u(f,"constructor",v),v.displayName=u(f,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,u(e,s,"GeneratorFunction")),e.prototype=Object.create(g),e},e.awrap=function(e){return{__await:e}},b(w.prototype),u(w.prototype,a,(function(){return this})),e.AsyncIterator=w,e.async=function(t,n,i,r,o){void 0===o&&(o=Promise);var a=new w(l(t,n,i,r),o);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},b(g),u(g,s,"Generator"),u(g,o,(function(){return this})),u(g,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var i=t.pop();if(i in e)return n.value=i,n.done=!1,n}return n.done=!0,n}},e.values=C,x.prototype={constructor:x,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(T),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function i(n,i){return a.type="throw",a.arg=e,t.next=n,i&&(t.method="next",t.arg=void 0),!!i}for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r],a=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),u=n.call(o,"finallyLoc");if(s&&u){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(e,t){for(var i=this.tryEntries.length-1;i>=0;--i){var r=this.tryEntries[i];if(r.tryLoc<=this.prev&&n.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,h):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),T(n),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var i=n.completion;if("throw"===i.type){var r=i.arg;T(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:C(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),h}},e}function r(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=o(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,r=function(){};return{s:r,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,u=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){u=!0,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(u)throw a}}}}function o(e,t){if(e){if("string"==typeof e)return a(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(e,t):void 0}}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function s(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function u(e,t,n){return t&&s(e.prototype,t),n&&s(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&m(e,t)}function h(e){var t=p();return function(){var n,i=g(e);if(t){var r=g(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return d(this,n)}}function d(e,t){if(t&&("object"===y(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return v(e)}function v(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function f(e){var t="function"==typeof Map?new Map:void 0;return f=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,i)}function i(){return _(e,arguments,g(this).constructor)}return i.prototype=Object.create(e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),m(i,e)},f(e)}function _(e,t,n){return _=p()?Reflect.construct.bind():function(e,t,n){var i=[null];i.push.apply(i,t);var r=new(Function.bind.apply(e,i));return n&&m(r,n.prototype),r},_.apply(null,arguments)}function p(){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(e){return!1}}function m(e,t){return m=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},m(e,t)}function g(e){return g=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},g(e)}function y(e){return y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},y(e)}System.register(["./index-legacy.62c06d64.js","./video_box-legacy.95767478.js","./index-legacy.de03403a.js"],(function(o,a){"use strict";var s,d,_,p,m,g,b,w,E,k,T,x;return{setters:[function(e){s=e.ad,d=e.d2,_=e.q,p=e.an,m=e.r,g=e.B,b=e.x,w=e.ao,E=e.b_,k=e.b$,T=e.az},function(e){x=e.V},null],execute:function(){var a=document.createElement("style");function C(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,r,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(i=o.next()).done;)a.push(i.value)}catch(s){r={error:s}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return a}function L(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(C(arguments[t]));return e}a.textContent=".view360-container{position:relative;touch-action:pan-y;overflow:hidden}.view360-canvas{position:absolute;left:0;top:0;width:100%;height:100%;-ms-user-select:none;user-select:none;-webkit-user-drag:none}.view360-canvas.ctx-lost{text-indent:.001px}.view360-container.is-1by1,.view360-container.is-square{padding-top:100%}.view360-container.is-5by4{padding-top:80%}.view360-container.is-4by3{padding-top:75%}.view360-container.is-3by2{padding-top:66.6666%}.view360-container.is-5by3{padding-top:60%}.view360-container.is-16by9{padding-top:56.25%}.view360-container.is-2by1{padding-top:50%}.view360-container.is-3by1{padding-top:33.3333%}.view360-container.is-4by5{padding-top:125%}.view360-container.is-3by4{padding-top:133.3333%}.view360-container.is-2by3{padding-top:150%}.view360-container.is-3by5{padding-top:166.6666%}.view360-container.is-9by16{padding-top:177.7777%}.view360-container.is-1by2{padding-top:200%}.view360-container.is-1by3{padding-top:300%}.view360-container:-ms-fullscreen{padding-top:0}.view360-container:fullscreen{padding-top:0}.view360-controls{position:absolute;top:0;left:0;width:100%;height:100%;padding:0;margin:0;border:0;pointer-events:none;-ms-user-select:none;user-select:none;-webkit-user-drag:none;z-index:1}.view360-main.view360-vr-presenting .view360-controls{display:none}.view360-controls-float-left,.view360-controls-float-right{position:absolute;display:flex;flex-direction:column}.view360-controls-float-left{left:0;top:0}.view360-controls-float-right{right:0;top:0}.view360-controls-main{position:absolute;bottom:0;left:0;width:100%;opacity:1;transition:none}.view360-controls-main.view360-controls-hidden{opacity:0;transition:opacity .5s}.view360-controls-main.view360-controls-hidden *{pointer-events:none}.view360-controls-main.view360-controls-fixed{opacity:1}.view360-controls-background{width:100%;height:calc(100% + 32px);position:absolute;left:0;bottom:0;background-image:linear-gradient(0deg,#323232,rgba(50,50,50,0))}.view360-controls-background.view360-controls-hidden{display:none}.view360-controls-mid{display:flex;flex-direction:row;position:relative}.view360-controls-left{display:flex;flex:1;justify-content:flex-start;align-items:center;flex-direction:row}.view360-controls-right,.view360-controls-bottom{display:flex;align-items:center;flex-direction:row}.view360-controls-button{display:inline-block;background-color:transparent;cursor:pointer;border:0;position:relative;background-size:24px 24px;background-origin:content-box;background-repeat:no-repeat;box-sizing:border-box;pointer-events:all;border-radius:20px;transition:opacity .25s;width:40px;height:40px;margin:6px;padding:8px;opacity:.8}.view360-controls-button:hover{opacity:1}.view360-controls-button.view360-controls-vr{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='48' width='48' viewBox='0 0 100 100'%3E%3Cg%3E%3Cpath d='M5,30 L95,30 L95,80 L55,80 L50,70 L45,80 L5,80 L5,30' fill='transparent' stroke='%23fff' stroke-width='8' stroke-linejoin='round' stroke-linecap='round'/%3E%3Cpath d='M5,30 L15,10 L85,10 L95,30' fill='transparent' stroke='%23fff' stroke-width='8' stroke-linejoin='round' stroke-linecap='round'/%3E%3Ccircle cx='30' cy='55' r='10' stroke='%23fff' stroke-width='8' fill='transparent' /%3E%3Ccircle cx='70' cy='55' r='10' stroke='%23fff' stroke-width='8' fill='transparent' /%3E%3C/g%3E%3C/svg%3E\")}.view360-controls-button.view360-controls-play{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' stroke-width='2' stroke='%23fff' fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none'%3E%3C/path%3E%3Cpath d='M7 4v16l13 -8z'%3E%3C/path%3E%3C/svg%3E\")}.view360-controls-button.view360-controls-pause{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' stroke-width='2' stroke='%23fff' fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none'%3E%3C/path%3E%3Crect x='6' y='5' width='4' height='14' rx='1'%3E%3C/rect%3E%3Crect x='14' y='5' width='4' height='14' rx='1'%3E%3C/rect%3E%3C/svg%3E\")}.view360-controls-button.view360-controls-unmuted{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' stroke-width='2' stroke='%23fff' fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none'%3E%3C/path%3E%3Cpath d='M15 8a5 5 0 0 1 0 8'%3E%3C/path%3E%3Cpath d='M17.7 5a9 9 0 0 1 0 14'%3E%3C/path%3E%3Cpath d='M6 15h-2a1 1 0 0 1 -1 -1v-4a1 1 0 0 1 1 -1h2l3.5 -4.5a0.8 .8 0 0 1 1.5 .5v14a0.8 .8 0 0 1 -1.5 .5l-3.5 -4.5'%3E%3C/path%3E%3C/svg%3E\")}.view360-controls-button.view360-controls-muted{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' stroke-width='2' stroke='%23fff' fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none'%3E%3C/path%3E%3Cpath d='M6 15h-2a1 1 0 0 1 -1 -1v-4a1 1 0 0 1 1 -1h2l3.5 -4.5a0.8 .8 0 0 1 1.5 .5v14a0.8 .8 0 0 1 -1.5 .5l-3.5 -4.5'%3E%3C/path%3E%3Cpath d='M16 10l4 4m0 -4l-4 4'%3E%3C/path%3E%3C/svg%3E\")}.view360-controls-button.view360-controls-fullscreen{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' stroke-width='2' stroke='%23fff' fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none'%3E%3C/path%3E%3Cpath d='M4 8v-2a2 2 0 0 1 2 -2h2'%3E%3C/path%3E%3Cpath d='M4 16v2a2 2 0 0 0 2 2h2'%3E%3C/path%3E%3Cpath d='M16 4h2a2 2 0 0 1 2 2v2'%3E%3C/path%3E%3Cpath d='M16 20h2a2 2 0 0 0 2 -2v-2'%3E%3C/path%3E%3C/svg%3E\")}.view360-controls-button.view360-controls-fullscreen-exit{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' stroke-width='2' stroke='%23fff' fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none'%3E%3C/path%3E%3Cpath d='M15 19v-2a2 2 0 0 1 2 -2h2'%3E%3C/path%3E%3Cpath d='M15 5v2a2 2 0 0 0 2 2h2'%3E%3C/path%3E%3Cpath d='M5 15h2a2 2 0 0 1 2 2v2'%3E%3C/path%3E%3Cpath d='M5 9h2a2 2 0 0 0 2 -2v-2'%3E%3C/path%3E%3C/svg%3E\")}.view360-controls-button.view360-controls-gyro-enabled{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='48' width='48'%3E%3Cpath fill='%23fff' d='M22.5 7.6v2.95q-1 .15-1.975.475-.975.325-1.875.825L16.5 9.7q1.35-.9 2.875-1.4 1.525-.5 3.125-.7Zm15.35 15.35q-.2 1.6-.7 3.125-.5 1.525-1.4 2.875L33.6 26.8q.5-.9.825-1.875.325-.975.475-1.975Zm3.8 20.45L1.3 3.05 3.45.9 43.8 41.25ZM7 41.4q-1.25 0-2.125-.875T4 38.4v-8.6h3v8.6h8.6v3ZM41 13V4.4h-8.6v-3H41q1.25 0 2.125.875T44 4.4V13ZM4 13V4.4q0-.55.2-1.1t.6-1l2.1 2.1V13Zm28.4 28.4v-3h8.5l2.1 2.1q-.4.45-.925.675-.525.225-1.075.225Zm-21.2-37-3-3h7.4v3ZM44 37.2l-3-3v-4.4h3ZM10.15 22.95h2.95q.5 3.7 3.1 6.3 2.6 2.6 6.3 3.1v2.95q-4.9-.55-8.35-4-3.45-3.45-4-8.35Zm4-11.35 2.1 2.05q-1.3 1.3-2.1 2.9-.8 1.6-1.05 3.4h-2.95q.25-2.4 1.275-4.525Q12.45 13.3 14.15 11.6ZM31.8 29.2l2.05 2.1q-1.7 1.7-3.825 2.725Q27.9 35.05 25.5 35.3v-2.95q1.8-.25 3.4-1.05 1.6-.8 2.9-2.1ZM25.5 7.6q4.9.55 8.35 4 3.45 3.45 4 8.35H34.9q-.5-3.7-3.1-6.3-2.6-2.6-6.3-3.1Z'/%3E%3C/svg%3E\")}.view360-controls-button.view360-controls-gyro-disabled{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='48' width='48'%3E%3Cpath fill='%23fff' d='M7 44q-1.2 0-2.1-.9Q4 42.2 4 41v-8.6h3V41h8.6v3ZM4 15.6V7q0-1.2.9-2.1Q5.8 4 7 4h8.6v3H7v8.6Zm18.5 22.25q-4.9-.55-8.35-4-3.45-3.45-4-8.35h2.95q.5 3.7 3.125 6.3 2.625 2.6 6.275 3.1ZM10.15 22.5q.55-4.9 4-8.35 3.45-3.45 8.35-4v2.95q-3.7.5-6.3 3.1-2.6 2.6-3.1 6.3Zm13.85 5q-1.45 0-2.475-1.025Q20.5 25.45 20.5 24q0-1.45 1.025-2.475Q22.55 20.5 24 20.5q1.45 0 2.475 1.025Q27.5 22.55 27.5 24q0 1.45-1.025 2.475Q25.45 27.5 24 27.5Zm1.5 10.35V34.9q3.7-.5 6.3-3.125 2.6-2.625 3.1-6.275h2.95q-.55 4.9-4 8.35-3.45 3.45-8.35 4Zm9.4-15.35q-.5-3.7-3.1-6.3-2.6-2.6-6.3-3.1v-2.95q4.9.55 8.35 4 3.45 3.45 4 8.35ZM32.4 44v-3H41v-8.6h3V41q0 1.2-.9 2.1-.9.9-2.1.9ZM41 15.6V7h-8.6V4H41q1.2 0 2.1.9.9.9.9 2.1v8.6Z'/%3E%3C/svg%3E\")}.view360-controls-time{display:inline-block;vertical-align:top;white-space:nowrap;color:#fff;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",Segoe UI Symbol;font-weight:400;font-size:14px;z-index:1}.view360-controls-time:first-child{padding:0 16px}.view360-controls-progress{flex:1;width:100%;padding:0 16px;box-sizing:border-box}.view360-controls-progress:not(:first-child){padding-left:0}.view360-controls-bottom .view360-controls-progress{padding-bottom:20px}.view360-controls-volume{display:inline-flex;flex-direction:row;align-items:center;transition:width .25s,background-color .25s;overflow:hidden}.view360-controls-volume:not(:disabled).view360-controls-fixed,.view360-controls-volume:not(:disabled):hover{width:112px}.view360-controls-volume .view360-range{flex:1;height:100%;padding:0}.view360-controls-volume .view360-range .view360-range-track{width:calc(100% - 12px);transform:translate(-4px)}.view360-controls-volume .view360-controls-button{margin:0;padding:0;width:24px;height:24px;flex-shrink:0}.view360-controls-volume:disabled{opacity:.5;pointer-events:none}.view360-controls-volume:disabled *{pointer-events:none}.view360-controls-pie{width:36px;height:36px;margin:6px;padding:0;border-radius:18px;opacity:.8;pointer-events:all;cursor:pointer;color:#fff;position:relative;transition:opacity .25s}.view360-controls-pie>svg{position:absolute;top:0;left:0;width:100%;height:100%}.view360-controls-pie:hover{opacity:1}.view360-range{position:relative;cursor:pointer;pointer-events:all;display:flex;justify-content:center;align-items:center;touch-action:pan-y}.view360-range:hover .view360-range-thumb{opacity:1}.view360-range-track{width:100%;height:4px;border-radius:4px;position:relative;background-color:rgba(230,230,230,.4)}.view360-range-filler,.view360-range-load{position:absolute;left:0;top:0;width:0;height:100%;border-radius:4px}.view360-range-filler{background-color:#fff}.view360-range-load{background-color:#757575}.view360-range-thumb{width:13px;height:13px;position:absolute;top:-5px;left:-6.5px;border-radius:50%;background-color:#fff;box-sizing:border-box;transition:opacity .25s;opacity:0}.view360-range-thumb.view360-controls-fixed{opacity:1}.view360-controls-unavailable{display:none!important}@media screen and (max-width:768px){.view360-controls-button{background-size:18px 18px;width:30px;height:30px;margin:4.5px;padding:6px;border-radius:15px}.view360-controls-volume .view360-controls-button{width:18px;height:18px}.view360-controls-volume:not(:disabled).view360-controls-fixed,.view360-controls-volume:not(:disabled):hover{width:84px}.view360-controls-pie{width:27px;height:27px;margin:4.5px;padding:0;border-radius:13.5px}}.view360-spinner{position:absolute;top:0;left:0;width:100%;height:100%;display:flex;justify-content:center;align-items:center;background-color:rgba(0,0,0,.15)}.view360-spinner-ring{top:0;left:0;padding:0;margin:0;width:64px;height:64px;box-sizing:content-box;background-color:transparent;border-style:solid;border-radius:50%;border-width:10px;border-color:#fff;border-bottom-color:transparent;animation:view360-spin-animation 1.2s linear infinite}@keyframes view360-spin-animation{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.view360-container.view360-vr-presenting{width:100vw;height:100vh;position:fixed;left:0;top:0;z-index:9999}.view360-hotspots{width:100%;height:100%;position:absolute;top:0;left:0;pointer-events:none}.view360-hotspot{pointer-events:none;visibility:hidden;position:absolute;top:0;left:0}.view360-hotspot-visible{visibility:visible;pointer-events:all}.view360-controls-main,.view360-controls-float-left,.view360-controls-float-right{pointer-events:all!important}.view360-controls-top .view360-range{height:8px!important}\n",document.head.appendChild(a);var R=function(e){return void 0===e},O=function(){function e(e,t){var n,i;if(this._canceled=!1,t)try{for(var r=
|
|
2
|
+
/*! *****************************************************************************
|
|
3
|
+
Copyright (c) Microsoft Corporation.
|
|
4
|
+
|
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
purpose with or without fee is hereby granted.
|
|
7
|
+
|
|
8
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
9
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
10
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
11
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
12
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
+
***************************************************************************** */
|
|
16
|
+
function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(Object.keys(t)),o=r.next();!o.done;o=r.next()){var a=o.value;this[a]=t[a]}}catch(s){n={error:s}}finally{try{o&&!o.done&&(i=r.return)&&i.call(r)}finally{if(n)throw n.error}}this.eventType=e}var t=e.prototype;return t.stop=function(){this._canceled=!0},t.isCanceled=function(){return this._canceled},e}(),A=function(){function e(){this._eventHandler={}}var t=e.prototype;return t.trigger=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var i=e instanceof O?e.eventType:e,r=L(this._eventHandler[i]||[]);return r.length<=0||(e instanceof O?(e.currentTarget=this,r.forEach((function(t){t(e)}))):r.forEach((function(e){e.apply(void 0,L(t))}))),this},t.once=function(e,t){var n=this;if("object"===y(e)&&R(t)){var i=e;for(var r in i)this.once(r,i[r]);return this}if("string"==typeof e&&"function"==typeof t){this.on(e,(function i(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];t.apply(void 0,L(r)),n.off(e,i)}))}return this},t.hasOn=function(e){return!!this._eventHandler[e]},t.on=function(e,t){if("object"===y(e)&&R(t)){var n=e;for(var i in n)this.on(i,n[i]);return this}if("string"==typeof e&&"function"==typeof t){var r=this._eventHandler[e];R(r)&&(this._eventHandler[e]=[],r=this._eventHandler[e]),r.push(t)}return this},t.off=function(e,t){if(R(e))return this._eventHandler={},this;if(R(t)){if("string"==typeof e)return delete this._eventHandler[e],this;var n=e;for(var i in n)this.off(i,n[i]);return this}var r=this._eventHandler[e];if(r)for(var o=r.length,a=0;a<o;++a)if(r[a]===t){r.splice(a,1),o<=1&&delete this._eventHandler[e];break}return this},e.VERSION="3.0.5",e}(),I=O,S=1e-6,M="undefined"!=typeof Float32Array?Float32Array:Array;function P(){var e=new M(16);return M!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e}function N(e,t,n){var i=t[0],r=t[1],o=t[2],a=t[3],s=t[4],u=t[5],l=t[6],c=t[7],h=t[8],d=t[9],v=t[10],f=t[11],_=t[12],p=t[13],m=t[14],g=t[15],y=n[0],b=n[1],w=n[2],E=n[3];return e[0]=y*i+b*s+w*h+E*_,e[1]=y*r+b*u+w*d+E*p,e[2]=y*o+b*l+w*v+E*m,e[3]=y*a+b*c+w*f+E*g,y=n[4],b=n[5],w=n[6],E=n[7],e[4]=y*i+b*s+w*h+E*_,e[5]=y*r+b*u+w*d+E*p,e[6]=y*o+b*l+w*v+E*m,e[7]=y*a+b*c+w*f+E*g,y=n[8],b=n[9],w=n[10],E=n[11],e[8]=y*i+b*s+w*h+E*_,e[9]=y*r+b*u+w*d+E*p,e[10]=y*o+b*l+w*v+E*m,e[11]=y*a+b*c+w*f+E*g,y=n[12],b=n[13],w=n[14],E=n[15],e[12]=y*i+b*s+w*h+E*_,e[13]=y*r+b*u+w*d+E*p,e[14]=y*o+b*l+w*v+E*m,e[15]=y*a+b*c+w*f+E*g,e}Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)});var D=function(e,t,n,i,r){var o,a=1/Math.tan(t/2);return e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,null!=r&&r!==1/0?(o=1/(i-r),e[10]=(r+i)*o,e[14]=2*r*i*o):(e[10]=-1,e[14]=-2*i),e};function B(){var e=new M(3);return M!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function F(e){var t=e[0],n=e[1],i=e[2];return Math.hypot(t,n,i)}function U(e,t,n){var i=new M(3);return i[0]=e,i[1]=t,i[2]=n,i}function z(e,t){var n=t[0],i=t[1],r=t[2],o=n*n+i*i+r*r;return o>0&&(o=1/Math.sqrt(o)),e[0]=t[0]*o,e[1]=t[1]*o,e[2]=t[2]*o,e}function V(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function G(e,t,n){var i=t[0],r=t[1],o=t[2],a=n[0],s=n[1],u=n[2];return e[0]=r*u-o*s,e[1]=o*a-i*u,e[2]=i*s-r*a,e}function H(e,t,n){var i=t[0],r=t[1],o=t[2],a=n[3]*i+n[7]*r+n[11]*o+n[15];return a=a||1,e[0]=(n[0]*i+n[4]*r+n[8]*o+n[12])/a,e[1]=(n[1]*i+n[5]*r+n[9]*o+n[13])/a,e[2]=(n[2]*i+n[6]*r+n[10]*o+n[14])/a,e}function j(e,t,n){var i=n[0],r=n[1],o=n[2],a=n[3],s=t[0],u=t[1],l=t[2],c=r*l-o*u,h=o*s-i*l,d=i*u-r*s,v=r*d-o*h,f=o*c-i*d,_=i*h-r*c,p=2*a;return c*=p,h*=p,d*=p,v*=2,f*=2,_*=2,e[0]=s+c+v,e[1]=u+h+f,e[2]=l+d+_,e}function Y(){var e=new M(4);return M!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function q(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}function W(e,t,n){var i=t[0],r=t[1],o=t[2],a=t[3],s=n[0],u=n[1],l=n[2],c=n[3];return e[0]=i*c+a*s+r*l-o*u,e[1]=r*c+a*u+o*s-i*l,e[2]=o*c+a*l+i*u-r*s,e[3]=a*c-i*s-r*u-o*l,e}function X(e,t,n){n*=.5;var i=t[0],r=t[1],o=t[2],a=t[3],s=Math.sin(n),u=Math.cos(n);return e[0]=i*u+a*s,e[1]=r*u+o*s,e[2]=o*u-r*s,e[3]=a*u-i*s,e}function K(e,t,n){n*=.5;var i=t[0],r=t[1],o=t[2],a=t[3],s=Math.sin(n),u=Math.cos(n);return e[0]=i*u-o*s,e[1]=r*u+a*s,e[2]=o*u+i*s,e[3]=a*u-r*s,e}function Z(e,t,n){n*=.5;var i=t[0],r=t[1],o=t[2],a=t[3],s=Math.sin(n),u=Math.cos(n);return e[0]=i*u+r*s,e[1]=r*u-i*s,e[2]=o*u+a*s,e[3]=a*u-o*s,e}function Q(e,t,n,i){var r,o,a,s,u,l=t[0],c=t[1],h=t[2],d=t[3],v=n[0],f=n[1],_=n[2],p=n[3];return(o=l*v+c*f+h*_+d*p)<0&&(o=-o,v=-v,f=-f,_=-_,p=-p),1-o>S?(r=Math.acos(o),a=Math.sin(r),s=Math.sin((1-i)*r)/a,u=Math.sin(i*r)/a):(s=1-i,u=i),e[0]=s*l+u*v,e[1]=s*c+u*f,e[2]=s*h+u*_,e[3]=s*d+u*p,e}B(),function(){var e,t=(e=new M(4),M!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e)}();var J,$=function(e){var t=new M(4);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},ee=function(e,t,n,i){var r=new M(4);return r[0]=e,r[1]=t,r[2]=n,r[3]=i,r},te=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},ne=function(e,t,n,i,r){return e[0]=t,e[1]=n,e[2]=i,e[3]=r,e},ie=function(e,t){var n=t[0],i=t[1],r=t[2],o=t[3],a=n*n+i*i+r*r+o*o;return a>0&&(a=1/Math.sqrt(a)),e[0]=n*a,e[1]=i*a,e[2]=r*a,e[3]=o*a,e},re=function(e,t){var n=e[0],i=e[1],r=e[2],o=e[3],a=t[0],s=t[1],u=t[2],l=t[3];return Math.abs(n-a)<=S*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(i-s)<=S*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(r-u)<=S*Math.max(1,Math.abs(r),Math.abs(u))&&Math.abs(o-l)<=S*Math.max(1,Math.abs(o),Math.abs(l))};B(),U(1,0,0),U(0,1,0),Y(),Y(),J=new M(9),M!=Float32Array&&(J[1]=0,J[2]=0,J[3]=0,J[5]=0,J[6]=0,J[7]=0),J[0]=1,J[4]=1,J[8]=1,function(){var e=function(){var e=new M(2);return M!=Float32Array&&(e[0]=0,e[1]=0),e}()}();var oe=function(e,t){return oe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},oe(e,t)};function ae(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}oe(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var se=function(){return se=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},se.apply(this,arguments)};var ue="undefined"!=typeof window,le=ue?window.navigator.userAgent:"",ce=!!ue&&!!("getComputedStyle"in window),he=/MSIE|Trident|Windows Phone|Edge/.test(le),de=!!ue&&!!("addEventListener"in document),ve="width",fe="height";function _e(e,t){return e.getAttribute(t)||""}function pe(e){return[].slice.call(e)}function me(e,t){return void 0===t&&(t="data-"),"loading"in e&&"lazy"===e.getAttribute("loading")||!!e.getAttribute(t+"lazy")}function ge(e,t,n){de?e.addEventListener(t,n,!1):e.attachEvent?e.attachEvent("on"+t,n):e["on"+t]=n}function ye(e,t,n){e.removeEventListener?e.removeEventListener(t,n,!1):e.detachEvent?e.detachEvent("on"+t,n):e["on"+t]=null}function be(e,t){var n=e["client"+t]||e["offset"+t];return parseFloat(n||function(e){return(ce?window.getComputedStyle(e):e.currentStyle)||{}}(e)[t.toLowerCase()])||0}function we(e,t,n){var i=pe(e.querySelectorAll(function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var i=Array(e),r=0;for(t=0;t<n;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,r++)i[r]=o[a];return i}(["["+n+"skip] ["+n+"width]"],t.map((function(e){return["["+n+"skip] "+e,e+"["+n+"skip]","["+n+"width] "+e].join(", ")}))).join(", ")));return pe(e.querySelectorAll("["+n+"width], "+t.join(", "))).filter((function(e){return-1===i.indexOf(e)}))}var Ee=[];function ke(e,t){!Ee.length&&ge(window,"resize",xe),e.__PREFIX__=t,Ee.push(e),Te(e)}function Te(e,t){void 0===t&&(t="data-");var n=e.__PREFIX__||t,i=parseInt(_e(e,""+n+ve),10)||0,r=parseInt(_e(e,""+n+fe),10)||0;if(_e(e,n+"fixed")===fe){var o=be(e,"Height")||r;e.style.width=i/r*o+"px"}else{o=function(e){return be(e,"Width")}(e)||i;e.style.height=r/i*o+"px"}}function xe(){Ee.forEach((function(e){Te(e)}))}var Ce=function(e){function t(t,n){void 0===n&&(n={});var i=e.call(this)||this;i.isReady=!1,i.isPreReady=!1,i.hasDataSize=!1,i.hasLoading=!1,i.isSkip=!1,i.onCheck=function(e){if(i.clear(),e&&"error"===e.type&&i.onError(i.element),!i.hasLoading||!i.checkElement()){var t=!i.hasDataSize&&!i.hasLoading;i.onReady(t)}},i.options=se({prefix:"data-"},n),i.element=t;var r=i.options.prefix;return i.hasDataSize=function(e,t){return void 0===t&&(t="data-"),!!e.getAttribute(t+"width")}(t,r),i.isSkip=function(e,t){return void 0===t&&(t="data-"),!!e.getAttribute(t+"skip")}(t,r),i.hasLoading=me(t,r),i}ae(t,e);var n=t.prototype;return n.check=function(){return this.isSkip||!this.checkElement()?(this.onAlreadyReady(!0),!1):(this.hasDataSize&&ke(this.element,this.options.prefix),(this.hasDataSize||this.hasLoading)&&this.onAlreadyPreReady(),!0)},n.addEvents=function(){var e=this,t=this.element;this.constructor.EVENTS.forEach((function(n){ge(t,n,e.onCheck)}))},n.clear=function(){var e=this,t=this.element;this.constructor.EVENTS.forEach((function(n){ye(t,n,e.onCheck)})),this.removeAutoSizer()},n.destroy=function(){this.clear(),this.off()},n.removeAutoSizer=function(){if(this.hasDataSize){var e=this.options.prefix;!function(e,t){var n=Ee.indexOf(e);if(!(n<0)){var i=_e(e,t+"fixed");delete e.__PREFIX__,e.style[i===fe?ve:fe]="",Ee.splice(n,1),!Ee.length&&ye(window,"resize",xe)}}(this.element,e)}},n.onError=function(e){this.trigger("error",{element:this.element,target:e})},n.onPreReady=function(){this.isPreReady||(this.isPreReady=!0,this.trigger("preReady",{element:this.element,hasLoading:this.hasLoading,isSkip:this.isSkip}))},n.onReady=function(e){this.isReady||((e=!this.isPreReady&&e)&&(this.isPreReady=!0),this.removeAutoSizer(),this.isReady=!0,this.trigger("ready",{element:this.element,withPreReady:e,hasLoading:this.hasLoading,isSkip:this.isSkip}))},n.onAlreadyError=function(e){var t=this;setTimeout((function(){t.onError(e)}))},n.onAlreadyPreReady=function(){var e=this;setTimeout((function(){e.onPreReady()}))},n.onAlreadyReady=function(e){var t=this;setTimeout((function(){t.onReady(e)}))},t.EVENTS=[],t}(A),Le=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}ae(t,e);var n=t.prototype;return n.setHasLoading=function(e){this.hasLoading=e},n.check=function(){return this.isSkip?(this.onAlreadyReady(!0),!1):(this.hasDataSize?(ke(this.element,this.options.prefix),this.onAlreadyPreReady()):this.trigger("requestChildren"),!0)},n.checkElement=function(){return!0},n.destroy=function(){this.clear(),this.trigger("requestDestroy"),this.off()},n.onAlreadyPreReady=function(){e.prototype.onAlreadyPreReady.call(this),this.trigger("reqeustReadyChildren")},t.EVENTS=[],t}(Ce),Re=function(e){function t(t){void 0===t&&(t={});var n=e.call(this)||this;return n.readyCount=0,n.preReadyCount=0,n.totalCount=0,n.totalErrorCount=0,n.isPreReadyOver=!0,n.elementInfos=[],n.options=se({loaders:{},prefix:"data-"},t),n}ae(t,e);var n=t.prototype;return n.check=function(e){var t=this,n=this.options.prefix;this.clear(),this.elementInfos=pe(e).map((function(e,i){var r=t.getLoader(e,{prefix:n});return r.check(),r.on("error",(function(e){t.onError(i,e.target)})).on("preReady",(function(e){var n=t.elementInfos[i];n.hasLoading=e.hasLoading,n.isSkip=e.isSkip;var r=t.checkPreReady(i);t.onPreReadyElement(i),r&&t.onPreReady()})).on("ready",(function(e){var n=e.withPreReady,r=e.hasLoading,o=e.isSkip,a=t.elementInfos[i];a.hasLoading=r,a.isSkip=o;var s=n&&t.checkPreReady(i),u=t.checkReady(i);n&&t.onPreReadyElement(i),t.onReadyElement(i),s&&t.onPreReady(),u&&t.onReady()})),{loader:r,element:e,hasLoading:!1,hasError:!1,isPreReady:!1,isReady:!1,isSkip:!1}}));var i=this.elementInfos.length;return this.totalCount=i,i||setTimeout((function(){t.onPreReady(),t.onReady()})),this},n.getTotalCount=function(){return this.totalCount},n.isPreReady=function(){return this.elementInfos.every((function(e){return e.isPreReady}))},n.isReady=function(){return this.elementInfos.every((function(e){return e.isReady}))},n.hasError=function(){return this.totalErrorCount>0},n.clear=function(){this.isPreReadyOver=!1,this.totalCount=0,this.preReadyCount=0,this.readyCount=0,this.totalErrorCount=0,this.elementInfos.forEach((function(e){e.loader&&e.loader.destroy()})),this.elementInfos=[]},n.destroy=function(){this.clear(),this.off()},n.getLoader=function(e,t){var n=this,i=e.tagName.toLowerCase(),r=this.options.loaders,o=t.prefix,a=Object.keys(r);if(r[i])return new r[i](e,t);var s=new Le(e,t),u=pe(e.querySelectorAll(a.join(", ")));s.setHasLoading(u.some((function(e){return me(e,o)})));var l=!1,c=this.clone().on("error",(function(e){s.onError(e.target)})).on("ready",(function(){s.onReady(l)}));return s.on("requestChildren",(function(){var t=we(e,a,n.options.prefix);c.check(t).on("preReady",(function(e){(l=e.isReady)||s.onPreReady()}))})).on("reqeustReadyChildren",(function(){c.check(u)})).on("requestDestroy",(function(){c.destroy()})),s},n.clone=function(){return new t(se({},this.options))},n.checkPreReady=function(e){return this.elementInfos[e].isPreReady=!0,++this.preReadyCount,!(this.preReadyCount<this.totalCount)},n.checkReady=function(e){return this.elementInfos[e].isReady=!0,++this.readyCount,!(this.readyCount<this.totalCount)},n.onError=function(e,t){var n=this.elementInfos[e];n.hasError=!0,this.trigger(new I("error",{element:n.element,index:e,target:t,errorCount:this.getErrorCount(),totalErrorCount:++this.totalErrorCount}))},n.onPreReadyElement=function(e){var t=this.elementInfos[e];this.trigger(new I("preReadyElement",{element:t.element,index:e,preReadyCount:this.preReadyCount,readyCount:this.readyCount,totalCount:this.totalCount,isPreReady:this.isPreReady(),isReady:this.isReady(),hasLoading:t.hasLoading,isSkip:t.isSkip}))},n.onPreReady=function(){this.isPreReadyOver=!0,this.trigger(new I("preReady",{readyCount:this.readyCount,totalCount:this.totalCount,isReady:this.isReady(),hasLoading:this.hasLoading()}))},n.onReadyElement=function(e){var t=this.elementInfos[e];this.trigger(new I("readyElement",{index:e,element:t.element,hasError:t.hasError,errorCount:this.getErrorCount(),totalErrorCount:this.totalErrorCount,preReadyCount:this.preReadyCount,readyCount:this.readyCount,totalCount:this.totalCount,isPreReady:this.isPreReady(),isReady:this.isReady(),hasLoading:t.hasLoading,isPreReadyOver:this.isPreReadyOver,isSkip:t.isSkip}))},n.onReady=function(){this.trigger(new I("ready",{errorCount:this.getErrorCount(),totalErrorCount:this.totalErrorCount,totalCount:this.totalCount}))},n.getErrorCount=function(){return this.elementInfos.filter((function(e){return e.hasError})).length},n.hasLoading=function(){return this.elementInfos.some((function(e){return e.hasLoading}))},t}(A),Oe=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return ae(t,e),t.prototype.checkElement=function(){var e=this.element,t=e.getAttribute("src");if(e.complete){if(t)return e.naturalWidth||this.onAlreadyError(e),!1;this.onAlreadyPreReady()}return this.addEvents(),he&&e.setAttribute("src",t),!0},t.EVENTS=["load","error"],t}(Ce),Ae=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return ae(t,e),t.prototype.checkElement=function(){var e=this.element;return!(e.readyState>=1)&&(e.error?(this.onAlreadyError(e),!1):(this.addEvents(),!0))},t.EVENTS=["loadedmetadata","error"],t}(Ce),Ie=function(e){function t(t){return void 0===t&&(t={}),e.call(this,se({loaders:{img:Oe,video:Ae}},t))||this}return ae(t,e),t}(Re);function Se(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{u(i.next(e))}catch(t){o(t)}}function s(e){try{u(i.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((i=i.apply(e,t||[])).next())}))}var Me,Pe=function(e){c(n,e);var t=h(n);function n(e,i){var r;return l(this,n),r=t.call(this,e),Object.setPrototypeOf(v(r),n.prototype),r.name="View360Error",r.code=i,r}return u(n)}(f(Error)),Ne={WRONG_TYPE:0,WRONG_OPTION:1,ELEMENT_NOT_FOUND:2,CANVAS_NOT_FOUND:3,WEBGL_NOT_SUPPORTED:4,FAILED_CREATE_CONTEXT_2D:5,PROVIDE_PROJECTION_FIRST:6,FAILED_LINKING_PROGRAM:7,INSUFFICIENT_ARGS:8},De={WRONG_TYPE:function(e,t){return"".concat(y(e)," is not a ").concat(t.map((function(e){return'"'.concat(e,'"')})).join(" or "),".")},WRONG_OPTION:function(e,t){return'Bad option: given "'.concat(e,'" for option "').concat(t,'".')},ELEMENT_NOT_FOUND:function(e){return'Element with selector "'.concat(e,'" not found.')},CANVAS_NOT_FOUND:"The canvas element was not found inside the given root element.",WEBGL_NOT_SUPPORTED:"WebGL is not supported on this browser.",FAILED_CREATE_CONTEXT_2D:"Failed to create canvas 2D context",PROVIDE_PROJECTION_FIRST:'"projection" should be provided before initialization.',FAILED_LINKING_PROGRAM:function(e,t){return'Failed linking WebGL program - "'.concat(e,"\nShader compile Log: ").concat(t)},INSUFFICIENT_ARGS:function(e,t){return'Insufficient arguments: given "'.concat(e,'" for "').concat(t,'".')}},Be="mousedown",Fe="mousemove",Ue="mouseup",ze="touchstart",Ve="touchmove",Ge="touchend",He="wheel",je="resize",Ye="contextmenu",qe="mouseenter",We="mouseleave",Xe="keydown",Ke="keyup",Ze="click",Qe="webglcontextcreationerror",Je="webglcontextlost",$e="webglcontextrestored",et="deviceorientation",tt="devicemotion",nt="orientationchange",it="play",rt="pause",ot="loadeddata",at="volumechange",st="timeupdate",ut="durationchange",lt="canplaythrough",ct="transitionend",ht="end",dt="div",vt="button";!function(e){e[e.LEFT=0]="LEFT",e[e.MIDDLE=1]="MIDDLE",e[e.RIGHT=2]="RIGHT"}(Me||(Me={}));var ft,_t="grab",pt="grabbing",mt="",gt=["LEFT","UP","RIGHT","DOWN"];!function(e){e[e.LEFT=37]="LEFT",e[e.UP=38]="UP",e[e.RIGHT=39]="RIGHT",e[e.DOWN=40]="DOWN"}(ft||(ft={}));var yt,bt,wt={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",DOWN:"ArrowDown"},Et=["requestFullscreen","webkitRequestFullscreen","webkitRequestFullScreen","webkitCancelFullScreen","mozRequestFullScreen","msRequestFullscreen"],kt=["fullscreenElement","webkitFullscreenElement","webkitCurrentFullScreenElement","mozFullScreenElement","msFullscreenElement"],Tt=["exitFullscreen","webkitExitFullscreen","webkitCancelFullScreen","mozCancelFullScreen","msExitFullscreen"],xt=["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],Ct="view360-ctx-lost",Lt="view360-vr-presenting",Rt="view360-hotspots",Ot="view360-hotspot",At="view360-hotspot-visible",It="ready",St="loadStart",Mt="load",Pt="projectionChange",Nt="resize",Dt="beforeRender",Bt="render",Ft="viewChange",Ut="staticClick",zt="vrStart",Vt="vrEnd",Gt=function(e){return 1-Math.pow(1-e,3)},Ht="animationEnd",jt="update",Yt="inputStart",qt="change",Wt="inputEnd",Xt="enable",Kt="disable",Zt="staticClick",Qt=Math.PI/180,Jt=180/Math.PI,$t=Gt,en=300,tn={min:-1/0,max:1/0},nn={min:-90,max:90},rn={min:.6,max:10};!function(e){e[e.ZERO=0]="ZERO",e[e.CW_90=1]="CW_90",e[e.CCW_90=2]="CCW_90",e[e.CW_180=3]="CW_180"}(bt||(bt={}));var on="view360videotimechange",an="http://www.w3.org/2000/svg",sn="immersive-vr",un="local",ln=null!==(yt=Number.EPSILON)&&void 0!==yt?yt:2220446049250313e-31,cn=function(e){return"string"==typeof e},hn=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:dt,n=document.createElement(t);return n.classList.add(e),n},dn=function(e,t){var n,i=null;if(cn(e)){var r=(t||document).querySelector(e);if(!r)return null;i=r}else(n=e)&&n.nodeType===Node.ELEMENT_NODE&&(i=e);return i},vn=function(e,t){var n=dn(e,t);if(!n)throw cn(e)?new Pe(De.ELEMENT_NOT_FOUND(e),Ne.ELEMENT_NOT_FOUND):new Pe(De.WRONG_TYPE(e,["HTMLElement","string"]),Ne.WRONG_TYPE);return n},fn=function(e,t){var n=e.querySelector(t);if(!n)throw new Pe(De.CANVAS_NOT_FOUND,Ne.CANVAS_NOT_FOUND);return n},_n=function(e,t,n){return Math.max(Math.min(e,n),t)},pn=function(e,t,n){return e*(1-n)+t*n},mn=function(e,t,n){var i=Math.abs(n-t);if(e<t)e=n-(t-e)%i;else if(e>n){e=t+(e-n)%i}return e},gn=function(e){return"object"===y(e)?e:{}},yn=function(e,t){return 2*Math.atan(Math.tan(.5*e)/t)},bn=function(){if(!document)return!1;var e,t=r(kt);try{for(t.s();!(e=t.n()).done;){var n=e.value;if(document[n])return!0}}catch(i){t.e(i)}finally{t.f()}return!1},wn=function(){return window.isSecureContext&&!!DeviceMotionEvent&&"requestPermission"in DeviceMotionEvent},En=function(e,t,n,i){q(e);var r=_n(n,-89.99,89.99);return K(e,e,t*Qt),X(e,e,r*Qt),Z(e,e,i*Qt),e},kn=function(e){var t,n,i=e[0],r=e[1],o=e[2],a=e[3],s=i*i+r*r+o*o+a*a,u=i*a-r*o;if(u>.499995*s)t=Math.PI/2,n=2*Math.atan2(r,i);else if(u<-.499995*s)t=-Math.PI/2,n=-2*Math.atan2(r,i);else{var l=U(0,0,1),c=U(0,1,0);j(l,l,e),j(c,c,e);var h=Math.sqrt(l[0]*l[0]+l[2]*l[2]);t=Math.atan2(-l[1],h),n=Math.atan2(l[0],l[2])}return{pitch:_n(t*Jt,-90,90),yaw:mn(n*Jt,0,360)}},Tn=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.duration,i=void 0===n?en:n,r=t.loop,o=void 0!==r&&r,a=t.range,s=void 0===a?{min:0,max:1}:a,u=t.easing,c=void 0===u?$t:u;l(this,e),this._duration=i,this._loop=o,this._range=s,this._easing=c,this._activated=!1,this.reset(0)}return u(e,[{key:"val",get:function(){return this._val}},{key:"start",get:function(){return this._start}},{key:"end",get:function(){return this._end}},{key:"progress",get:function(){return this._progress}},{key:"activated",get:function(){return this._activated}},{key:"duration",get:function(){return this._duration},set:function(e){this._duration=e}},{key:"loop",get:function(){return this._loop},set:function(e){this._loop=e}},{key:"range",get:function(){return this._range}},{key:"easing",get:function(){return this._easing},set:function(e){this._easing=e}},{key:"update",value:function(e){if(!this._activated)return this._val=this._end,0;var t=this._start,n=this._end,i=this._duration,r=this._val,o=this._loop,a=this._progress+e/i;this._progress=o?mn(a,0,1):_n(a,0,1);var s=this._easing(this._progress);return this._val=pn(t,n,s),!o&&this._progress>=1&&(this._activated=!1),this._val-r}},{key:"reset",value:function(e){var t=this._range,n=_n(e,t.min,t.max);this._start=n,this._end=n,this._val=n,this._progress=0,this._activated=!1}},{key:"add",value:function(e){var t=this._range;this._start=_n(this._start+e,t.min,t.max),this._end=_n(this._end+e,t.min,t.max),this._val=_n(this._val+e,t.min,t.max)}},{key:"setNewEndByDelta",value:function(e){var t=this._range;this._start=this._val,this._end=_n(this._end+e,t.min,t.max),this._progress=0,this._activated=!0}},{key:"setRange",value:function(e,t){this._start=_n(this._start,e,t),this._end=_n(this._end,e,t),this._range={min:e,max:t}}}]),e}(),xn=function(){function e(t,n,i){var r=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=o.duration,s=void 0===a?en:a,u=o.easing,c=void 0===u?$t:u;l(this,e),this._camera=t,this._motion=new Tn({duration:s,easing:c,range:{min:0,max:1}}),this._from=n,this._to=i,this._finishPromise=new Promise((function(e){r._finish=e})),this._motion.setNewEndByDelta(1)}return u(e,[{key:"duration",get:function(){return this._motion.duration},set:function(e){this._motion.duration=e}},{key:"easing",get:function(){return this._motion.easing},set:function(e){this._motion.easing=e}},{key:"getFinishPromise",value:function(){return this._finishPromise}},{key:"update",value:function(e){var t=this._camera,n=this._from,i=this._to,r=this._motion;r.update(e);var o=r.val,a=Y(),s=pn(n.zoom,i.zoom,o);Q(a,n.rotation,i.rotation,o),t.rotate(a,s),o>=1&&this._finish()}}]),e}(),Cn=function(e){c(n,e);var t=h(n);function n(e){var i,r=e.initialYaw,o=e.initialPitch,a=e.initialZoom,s=e.yawRange,u=e.pitchRange,c=e.zoomRange,h=e.fov;return l(this,n),(i=t.call(this)).yaw=r,i.pitch=o,i.zoom=a,i.rollOffset=0,i.initialYaw=r,i.initialPitch=o,i.initialZoom=a,i.position=B(),i.animation=null,i._up=U(0,1,0),i._aspect=1,i._initialYawRange=s,i._initialPitchRange=u,i._initialZoomRange=c,i._yawRange=s,i._pitchRange=u,i._zoomRange=c,i.quaternion=Y(),i._updateQuaternion(),i.viewMatrix=P(),i.projectionMatrix=P(),i.fov=h,i._maxRenderHeight=-1,i}return u(n,[{key:"aspect",get:function(){return this._aspect}},{key:"changed",get:function(){return this._changed}},{key:"yawRange",get:function(){return this._initialYawRange},set:function(e){this._initialYawRange=e}},{key:"pitchRange",get:function(){return this._initialPitchRange},set:function(e){this._initialPitchRange=e}},{key:"zoomRange",get:function(){return this._initialZoomRange},set:function(e){this._initialZoomRange=e}},{key:"destroy",value:function(){this.off()}},{key:"resize",value:function(e,t){var n=this._aspect;this._aspect=e/t,this._aspect!==n&&this.updateMatrix()}},{key:"lookAt",value:function(e){var t=e.yaw,n=void 0===t?this.yaw:t,i=e.pitch,r=void 0===i?this.pitch:i,o=e.zoom,a=void 0===o?this.zoom:o,s=$(this.quaternion),u=this.zoom;this.yaw=mn(n,0,360),this.pitch=_n(r,-90,90),this.zoom=a,this._updateQuaternion();var l=Math.abs(a-u);(!re(this.quaternion,s)||l>=10*ln)&&this.updateMatrix()}},{key:"rotate",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.zoom,n=ie(Y(),e),i=re(this.quaternion,n);te(this.quaternion,n);var r=this.zoom,o=kn(n),a=o.yaw,s=o.pitch;this.yaw=a,this.pitch=s,this.zoom=t;var u=Math.abs(t-r);(!i||u>=10*ln)&&this.updateMatrix()}},{key:"animateTo",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.yaw,n=void 0===t?this.yaw:t,r=e.pitch,o=void 0===r?this.pitch:r,a=e.zoom,s=void 0===a?this.zoom:a,u=e.duration,l=void 0===u?0:u,c=e.easing,h=void 0===c?$t:c;return Se(this,void 0,void 0,i().mark((function e(){var t,r,a,u,c=this;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.yaw!==n||this.pitch!==o||this.zoom!==s){e.next=2;break}return e.abrupt("return");case 2:return t={rotation:$(this.quaternion),zoom:this.zoom},r={rotation:En(Y(),n,o,this.rollOffset),zoom:s},a=new xn(this,t,r,{duration:l,easing:h}),u=a.getFinishPromise(),this.animation=a,u.then((function(){c.animation=null,c.trigger(Ht,{animation:a})})),e.abrupt("return",u);case 9:case"end":return e.stop()}}),e,this)})))}},{key:"restrictYawRange",value:function(e,t){this._yawRange={min:e,max:t}}},{key:"restrictPitchRange",value:function(e,t){this._pitchRange={min:e,max:t}}},{key:"restrictZoomRange",value:function(e,t){this._zoomRange={min:e,max:t}}},{key:"restrictRenderHeight",value:function(e){this._maxRenderHeight=e}},{key:"resetRange",value:function(){this._yawRange=this._initialYawRange,this._pitchRange=this._initialPitchRange,this._zoomRange=this._initialZoomRange,this._maxRenderHeight=-1}},{key:"getYawRange",value:function(e){var t=this._yawRange,n=this._maxRenderHeight;if(!t)return tn;var i=.5*this.getHorizontalFov(e),r=t.min,o=t.max;if(n>0){var a=yn(i*Qt,this._aspect),s=.5*n,u=Math.tan(a),l=Math.sqrt((1+s*s)/(1+u*u)),c=Math.atan(Math.tan(i*Qt)*l)*Jt;r=t.min+c,o=t.max-c}return r>o&&(r=0,o=0),{min:r,max:o}}},{key:"getPitchRange",value:function(e){var t=this._pitchRange,n=this._maxRenderHeight;if(!t)return nn;var i=t.min,r=t.max;if(n>0){var o=.5*this.getVerticalFov(e);i=t.min+o,r=t.max-o}return i>r&&(i=0,r=0),{min:Math.max(i,-90),max:Math.min(r,90)}}},{key:"getZoomRange",value:function(){var e,t=null!==(e=this._zoomRange)&&void 0!==e?e:rn,n=this.getHorizontalFov(t.max),i=this.getHorizontalFov(t.min),r=this.getHorizontalFov(this.zoom);return{min:Math.max(n,1),max:Math.min(i,180),current:r}}},{key:"getHorizontalFov",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.zoom;return this._getZoomedHorizontalFov(e)*Jt}},{key:"getVerticalFov",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.zoom,t=this._aspect,n=this._getZoomedHorizontalFov(e),i=yn(n,t);return i*Jt}},{key:"fovToZoom",value:function(e){var t=this.fov;return Math.tan(Qt*t*.5)/Math.tan(Qt*e*.5)}},{key:"updateMatrix",value:function(){var e=this._up,t=this._aspect,n=this.viewMatrix,i=this.projectionMatrix,r=this.position,o=this.quaternion,a=B(),s=U(0,0,-1);j(s,s,o),j(a,e,o);var u=this._getZoomedHorizontalFov(),l=yn(u,t);!function(e,t,n,i){var r,o,a,s,u,l,c,h,d,v,f=t[0],_=t[1],p=t[2],m=i[0],g=i[1],y=i[2],b=n[0],w=n[1],E=n[2];Math.abs(f-b)<S&&Math.abs(_-w)<S&&Math.abs(p-E)<S?function(e){e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1}(e):(c=f-b,h=_-w,d=p-E,r=g*(d*=v=1/Math.hypot(c,h,d))-y*(h*=v),o=y*(c*=v)-m*d,a=m*h-g*c,(v=Math.hypot(r,o,a))?(r*=v=1/v,o*=v,a*=v):(r=0,o=0,a=0),s=h*a-d*o,u=d*r-c*a,l=c*o-h*r,(v=Math.hypot(s,u,l))?(s*=v=1/v,u*=v,l*=v):(s=0,u=0,l=0),e[0]=r,e[1]=s,e[2]=c,e[3]=0,e[4]=o,e[5]=u,e[6]=h,e[7]=0,e[8]=a,e[9]=l,e[10]=d,e[11]=0,e[12]=-(r*f+o*_+a*p),e[13]=-(s*f+u*_+l*p),e[14]=-(c*f+h*_+d*p),e[15]=1)}(n,r,s,a),D(i,l,t,.1,100),this._changed=!0}},{key:"onFrameRender",value:function(){this._changed=!1}},{key:"_updateQuaternion",value:function(){En(this.quaternion,this.yaw,this.pitch,this.rollOffset)}},{key:"_getZoomedHorizontalFov",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.zoom;return 2*Math.atan(Math.tan(Qt*this.fov*.5)/e)}}]),n}(A),Ln=function(e){c(n,e);var t=h(n);function n(){var e;return l(this,n),(e=t.call(this))._onMouseDown=function(t){var n=e._el;n&&t.button===Me.LEFT&&(t.preventDefault(),n.focus?n.focus():window.focus(),e._prevPos[0]=t.clientX,e._prevPos[1]=t.clientY,window.addEventListener(Fe,e._onMouseMove,!1),window.addEventListener(Ue,e._onMouseUp,!1),e.trigger(Yt,{srcEvent:t,isTouch:!1,isKeyboard:!1}))},e._onMouseMove=function(t){t.preventDefault();var n=t.clientX,i=t.clientY,r=e._prevPos,o=n-r[0],a=i-r[1];e.trigger(qt,{delta:{x:o,y:a},isTouch:!1,isKeyboard:!1}),r[0]=n,r[1]=i},e._onMouseUp=function(){e._prevPos[0]=0,e._prevPos[1]=0,window.removeEventListener(Fe,e._onMouseMove,!1),window.removeEventListener(Ue,e._onMouseUp,!1),e.trigger(Wt,{isTouch:!1,isKeyboard:!1,scrolling:!1})},e._el=null,e._prevPos=[0,0],e}return u(n,[{key:"enable",value:function(e){this._el||(e.addEventListener(Be,this._onMouseDown),this._el=e)}},{key:"disable",value:function(){var e=this._el;e&&(e.removeEventListener(Be,this._onMouseDown),window.removeEventListener(Fe,this._onMouseMove,!1),window.removeEventListener(Ue,this._onMouseUp,!1),this._el=null)}}]),n}(A),Rn=function(e){c(n,e);var t=h(n);function n(){var e;return l(this,n),(e=t.call(this))._onTouchStart=function(t){if(!(t.touches.length>1||e._scrolling)){var n=t.touches[0];e._isFirstTouch=!0,e._prevPos[0]=n.clientX,e._prevPos[1]=n.clientY,e.trigger(Yt,{srcEvent:t,isTouch:!0,isKeyboard:!1})}},e._onTouchMove=function(t){if(!(t.touches.length>1||e._scrolling)){var n=t.touches[0],i=e._scrollable,r=e._prevPos,o=n.clientX,a=n.clientY,s=o-r[0],u=a-r[1];if(e._isFirstTouch){if(i&&!bn()&&Math.abs(u)>Math.abs(s))return void(e._scrolling=!0);e._isFirstTouch=!1}!1!==t.cancelable&&t.preventDefault(),e.trigger(qt,{delta:{x:s,y:u},isTouch:!0,isKeyboard:!1}),r[0]=o,r[1]=a}},e._onTouchEnd=function(t){if(0===t.touches.length){var n=t.touches[0],i=e._prevPos;n?(i[0]=n.clientX,i[1]=n.clientY):(i[0]=0,i[1]=0,e.trigger(Wt,{isTouch:!0,isKeyboard:!1,scrolling:e._scrolling})),!1!==t.cancelable&&t.preventDefault(),e._scrolling=!1}},e._el=null,e._prevPos=[0,0],e._isFirstTouch=!1,e._scrolling=!1,e._scrollable=!1,e}return u(n,[{key:"scrollable",get:function(){return this._scrollable},set:function(e){this._scrollable=e}},{key:"enable",value:function(e){this._el||(e.addEventListener(ze,this._onTouchStart,{passive:!1}),e.addEventListener(Ve,this._onTouchMove,{passive:!1}),e.addEventListener(Ge,this._onTouchEnd),this._el=e)}},{key:"disable",value:function(){var e=this._el;e&&(e.removeEventListener(ze,this._onTouchStart),e.removeEventListener(Ve,this._onTouchMove),e.removeEventListener(Ge,this._onTouchEnd),this._el=null)}}]),n}(A),On=function(e){c(i,e);var t=h(i);function i(){var e;return l(this,i),(e=t.call(this))._onKeyDown=function(t){if(t.location===KeyboardEvent.DOM_KEY_LOCATION_STANDARD){e._updateKeyPress(t,!0);var n=e._getPressedKeyCount();n<=0||(t.preventDefault(),1!==n||t.repeat||e.trigger(Yt,{srcEvent:t,isTouch:!1,isKeyboard:!0}))}},e._onKeyUp=function(t){t.location===KeyboardEvent.DOM_KEY_LOCATION_STANDARD&&(e._updateKeyPress(t,!1),e._getPressedKeyCount()>0||e.trigger(Wt,{isTouch:!1,isKeyboard:!0,scrolling:!1}))},e._el=null,e._clearPressedKeys(),e}return u(i,[{key:"active",get:function(){var e=this._pressed;return e.LEFT||e.UP||e.RIGHT||e.DOWN}},{key:"enable",value:function(e){this._el||(e.addEventListener(Xe,this._onKeyDown),e.addEventListener(Ke,this._onKeyUp),this._el=e,this._clearPressedKeys())}},{key:"disable",value:function(){var e=this._el;e&&(e.removeEventListener(Xe,this._onKeyDown),e.removeEventListener(Ke,this._onKeyUp),this._el=null,this._clearPressedKeys())}},{key:"update",value:function(){var e=this._getDeltaByPressedKeys();0===e.x&&0===e.y||this.trigger(qt,{delta:e,isTouch:!1,isKeyboard:!0})}},{key:"_clearPressedKeys",value:function(){this._pressed=gt.reduce((function(e,t){return Object.assign(Object.assign({},e),n({},t,!1))}),{})}},{key:"_updateKeyPress",value:function(e,t){var n=this._pressed,i=null!=e.keyCode?ft[e.keyCode]:wt[e.key];i&&(n[i]=t)}},{key:"_getPressedKeyCount",value:function(){var e=this;return gt.filter((function(t){return e._pressed[t]})).length}},{key:"_getDeltaByPressedKeys",value:function(){var e=this._pressed,t=0,n=0;return e.LEFT&&(t+=1),e.RIGHT&&(t-=1),e.UP&&(n+=1),e.DOWN&&(n-=1),{x:t,y:n}}}]),i}(A),An=function(e){c(n,e);var t=h(n);function n(e,i){var r,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=o.duration,s=void 0===a?en:a,u=o.easing,c=void 0===u?$t:u,h=o.pointerScale,d=void 0===h?[1,1]:h,v=o.keyboardScale,f=void 0===v?[1,1]:v,_=o.disablePitch,p=void 0!==_&&_,m=o.disableYaw,g=void 0!==m&&m,y=o.disableKeyboard,b=void 0!==y&&y;return l(this,n),(r=t.call(this))._onInputStart=function(e){r._changedWhileDragging=!1,r.trigger(Yt,Object.assign(Object.assign({},e),{inputType:"rotate"}))},r._onChange=function(e){var t,n=e.delta,i=1/r._zoomScale,o=r._screenScale,a=r._keyboardScale,s=r._pointerScale;t=e.isKeyboard?[a[0]*i,a[1]*i]:[s[0]*o[0]*i,s[1]*o[1]*i];var u=n.x*t[0],l=n.y*t[1];r._xMotion.setNewEndByDelta(u),r._yMotion.setNewEndByDelta(l),r._changedWhileDragging=!0},r._onInputEnd=function(e){r.trigger(Wt,Object.assign(Object.assign({},e),{inputType:"rotate"})),r._changedWhileDragging||e.isKeyboard||e.scrolling||r.trigger(Zt,{isTouch:e.isTouch}),r._changedWhileDragging=!1},r._controlEl=e,r._pointerScale=d,r._keyboardScale=f,r._duration=s,r._easing=c,r._disablePitch=p,r._disableYaw=g,r._disableKeyboard=b,r._enableBlocked=i,r._mouseInput=new Ln,r._touchInput=new Rn,r._keyboardInput=new On,r._xMotion=new Tn({duration:s,range:tn,easing:c}),r._yMotion=new Tn({duration:s,range:nn,easing:c}),r._screenScale=[1,1],r._zoomScale=1,r._enabled=!1,r._changedWhileDragging=!1,r._bindInputs(),r}return u(n,[{key:"enabled",get:function(){return this._enabled}},{key:"enableBlocked",get:function(){return this._enableBlocked}},{key:"animating",get:function(){return this._keyboardInput.active||this._xMotion.activated||this._yMotion.activated}},{key:"yaw",get:function(){return this._xMotion}},{key:"pitch",get:function(){return this._yMotion}},{key:"scrollable",get:function(){return this._touchInput.scrollable},set:function(e){this._touchInput.scrollable=e}},{key:"pointerScale",get:function(){return this._pointerScale},set:function(e){this._pointerScale=e}},{key:"keyboardScale",get:function(){return this._keyboardScale},set:function(e){this._keyboardScale=e}},{key:"duration",get:function(){return this._duration},set:function(e){this._duration=e,this._xMotion.duration=e,this._yMotion.duration=e}},{key:"easing",get:function(){return this._easing},set:function(e){this._easing=e,this._xMotion.easing=e,this._yMotion.easing=e}},{key:"disablePitch",get:function(){return this._disablePitch},set:function(e){this._disablePitch=e}},{key:"disableYaw",get:function(){return this._disableYaw},set:function(e){this._disableYaw=e}},{key:"disableKeyboard",get:function(){return this._disableKeyboard},set:function(e){this._disableKeyboard=e}},{key:"destroy",value:function(){this.disable(),this._mouseInput.off(),this._touchInput.off(),this._keyboardInput.off(),this.off(),this._changedWhileDragging=!1}},{key:"update",value:function(e){if(this._enabled){var t=this._xMotion,n=this._yMotion,i=this._keyboardInput;this._disableKeyboard||i.update(),this._disablePitch||n.update(e),this._disableYaw||t.update(e)}}},{key:"updateRange",value:function(e,t){var n=e.getYawRange(t),i=e.getPitchRange(t);this._xMotion.setRange(n.min,n.max),this._yMotion.setRange(i.min,i.max)}},{key:"setZoomScale",value:function(e){this._zoomScale=e}},{key:"resize",value:function(e,t,n,i){var r=yn(e*Qt,t)*Jt;this._screenScale[0]=e/n,this._screenScale[1]=r/i}},{key:"enable",value:function(){if(!this._enabled){var e=this._controlEl;this._mouseInput.enable(e),this._touchInput.enable(e),this._keyboardInput.enable(e),this._enabled=!0,this._enableBlocked=!1,this.trigger(Xt,{control:this,updateCursor:!0})}}},{key:"disable",value:function(){this._enabled&&(this._mouseInput.disable(),this._touchInput.disable(),this._keyboardInput.disable(),this._enabled=!1,this.trigger(Kt,{updateCursor:!0}))}},{key:"sync",value:function(e){this.updateRange(e,e.zoom),this._xMotion.reset(e.yaw),this._yMotion.reset(e.pitch)}},{key:"_bindInputs",value:function(){var e=this._mouseInput,t=this._touchInput,n=this._keyboardInput;e.on(Yt,this._onInputStart),e.on(qt,this._onChange),e.on(Wt,this._onInputEnd),t.on(Yt,this._onInputStart),t.on(qt,this._onChange),t.on(Wt,this._onInputEnd),n.on(Yt,this._onInputStart),n.on(qt,this._onChange),n.on(Wt,this._onInputEnd)}}]),n}(A),In=function(e){c(n,e);var t=h(n);function n(){var e;return l(this,n),(e=t.call(this))._onWheel=function(t){var n=e._scrollable;if(0!==t.deltaY&&!n){t.preventDefault(),t.stopPropagation(),e._inputTimer<0?e.trigger(Yt,{srcEvent:t,isTouch:!1,isKeyboard:!1}):e._clearTimer();var i=e._baseScale*t.deltaY;e.trigger(qt,{delta:i,isTouch:!1,isKeyboard:!1}),e._inputTimer=window.setTimeout((function(){e.trigger(Wt,{isTouch:!1,isKeyboard:!1,scrolling:!1}),e._inputTimer=-1}),en)}},e._el=null,e._baseScale=.04,e._scrollable=!1,e._inputTimer=-1,e}return u(n,[{key:"scrollable",get:function(){return this._scrollable},set:function(e){this._scrollable=e}},{key:"enable",value:function(e){this._el||(e.addEventListener(He,this._onWheel,{passive:!1,capture:!1}),this._el=e,this._clearTimer())}},{key:"disable",value:function(){var e=this._el;e&&(e.removeEventListener(He,this._onWheel,!1),this._el=null,this._clearTimer())}},{key:"_clearTimer",value:function(){window.clearTimeout(this._inputTimer),this._inputTimer=-1}}]),n}(A),Sn=function(e){c(n,e);var t=h(n);function n(){var e;return l(this,n),(e=t.call(this))._onTouchMove=function(t){var n=t.touches;if(2===n.length&&t.cancelable){t.preventDefault(),t.stopPropagation();var i=e._prevDistance,r=[n[0].pageX-n[1].pageX,n[0].pageY-n[1].pageY],o=Math.sqrt(r[0]*r[0]+r[1]*r[1])*e._baseScale,a=e._isFirstTouch?0:o-i;e._isFirstTouch&&e.trigger(Yt,{srcEvent:t,isTouch:!0,isKeyboard:!1}),e._prevDistance=o,e._isFirstTouch=!1,e.trigger(qt,{delta:a,isTouch:!0,isKeyboard:!1})}},e._onTouchEnd=function(t){0===t.touches.length&&(e._isFirstTouch||e.trigger(Wt,{isTouch:!0,isKeyboard:!1,scrolling:!1}),e._prevDistance=-1,e._isFirstTouch=!0)},e._el=null,e._baseScale=-.2,e._prevDistance=-1,e._isFirstTouch=!0,e}return u(n,[{key:"enable",value:function(e){this._el||(e.addEventListener(Ve,this._onTouchMove,{passive:!1,capture:!1}),e.addEventListener(Ge,this._onTouchEnd),this._el=e,this._prevDistance=-1,this._isFirstTouch=!0)}},{key:"disable",value:function(){var e=this._el;e&&(e.removeEventListener(Ve,this._onTouchMove,!1),e.removeEventListener(Ge,this._onTouchEnd),this._el=null)}}]),n}(A),Mn=function(e){c(n,e);var t=h(n);function n(e,i){var r,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=o.scale,s=void 0===a?1:a,u=o.duration,c=void 0===u?en:u,h=o.easing,d=void 0===h?$t:h;return l(this,n),(r=t.call(this))._onInputStart=function(e){r.trigger(Yt,Object.assign(Object.assign({},e),{inputType:"zoom"}))},r._onChange=function(e){var t=e.delta*r._scale;r._motion.setNewEndByDelta(t)},r._onInputEnd=function(e){r.trigger(Wt,Object.assign(Object.assign({},e),{inputType:"zoom"}))},r._scale=s,r._controlEl=e,r._enableBlocked=i,r._wheelInput=new In,r._pinchInput=new Sn,r._motion=new Tn({duration:c,easing:d,range:tn}),r._enabled=!1,r._bindInputs(),r}return u(n,[{key:"enabled",get:function(){return this._enabled}},{key:"enableBlocked",get:function(){return this._enableBlocked}},{key:"animating",get:function(){return this._motion.activated}},{key:"zoom",get:function(){return this._motion.val}},{key:"scrollable",get:function(){return this._wheelInput.scrollable},set:function(e){this._wheelInput.scrollable=e}},{key:"range",get:function(){return this._motion.range}},{key:"scale",get:function(){return this._scale},set:function(e){this._scale=e}},{key:"duration",get:function(){return this._motion.duration}},{key:"easing",get:function(){return this._motion.easing}},{key:"destroy",value:function(){this.disable(),this._wheelInput.off(),this._pinchInput.off(),this.off()}},{key:"update",value:function(e){this._enabled&&this._motion.update(e)}},{key:"enable",value:function(){if(!this._enabled){var e=this._controlEl;this._wheelInput.enable(e),this._pinchInput.enable(e),this._enabled=!0,this._enableBlocked=!1,this.trigger(Xt,{control:this,updateCursor:!1})}}},{key:"disable",value:function(){this._enabled&&(this._wheelInput.disable(),this._pinchInput.disable(),this._enabled=!1,this.trigger(Kt,{updateCursor:!1}))}},{key:"sync",value:function(e){var t=this._motion,n=e.getZoomRange();t.setRange(n.min,n.max),t.reset(n.current)}},{key:"_bindInputs",value:function(){var e=this._wheelInput,t=this._pinchInput;e.on(Yt,this._onInputStart),e.on(qt,this._onChange),e.on(Wt,this._onInputEnd),t.on(Yt,this._onInputStart),t.on(qt,this._onChange),t.on(Wt,this._onInputEnd)}}]),n}(A),Pn={PITCH_DELTA:1,YAW_DELTA_BY_ROLL:2,YAW_DELTA_BY_YAW:3};Pn[Pn.PITCH_DELTA]={targetAxis:[0,1,0],meshPoint:[0,0,1]},Pn[Pn.YAW_DELTA_BY_ROLL]={targetAxis:[0,1,0],meshPoint:[1,0,0]},Pn[Pn.YAW_DELTA_BY_YAW]={targetAxis:[1,0,0],meshPoint:[0,0,1]};var Nn=function(e){c(n,e);var t=h(n);function n(){var e;return l(this,n),(e=t.call(this))._onDeviceOrientation=function(t){var n=e._orientation,i=t.alpha,r=t.beta,o=t.gamma;null!=i&&null!=r&&null!=o&&(n.alpha=i,n.beta=r,n.gamma=o,e._orientationUpdated=!0,e._needsCalibrate&&(e._needsCalibrate=!1,e._calibrateSensor()))},e._updateScreenOrientation=function(){window.screen&&window.screen.orientation&&void 0!==window.screen.orientation.angle?e._screenOrientation=screen.orientation.angle:void 0!==window.orientation?e._screenOrientation=window.orientation>=0?window.orientation:360+window.orientation:e._screenOrientation=0},e.quaternion=Y(),e._orientation={alpha:0,beta:90,gamma:0},e._yawOrigin=0,e._yawOffset=0,e._orientationUpdated=!1,e._screenOrientation=0,e._needsCalibrate=!0,e._enabled=!1,e}return u(n,[{key:"enabled",get:function(){return this._enabled}},{key:"orientationUpdated",get:function(){return this._orientationUpdated}},{key:"ignoreRoll",get:function(){return this._ignoreRoll},set:function(e){this._ignoreRoll=e}},{key:"enable",value:function(){this._enabled||(window.addEventListener(et,this._onDeviceOrientation),window.addEventListener(nt,this._updateScreenOrientation),this._updateScreenOrientation(),this._orientationUpdated=!1,this._needsCalibrate=!0,this._enabled=!0)}},{key:"disable",value:function(){this._enabled&&(window.removeEventListener(et,this._onDeviceOrientation),window.removeEventListener(nt,this._updateScreenOrientation),this._enabled=!1)}},{key:"update",value:function(){this._updateRotation(),this._orientationUpdated=!1}},{key:"collectDelta",value:function(){if(!this._orientationUpdated)return{pitch:0,yaw:0};var e=$(this.quaternion);return this._updateRotation(),this._orientationUpdated=!1,this._toEulerDelta(e,this.quaternion)}},{key:"setInitialRotation",value:function(e){this._yawOrigin=e}},{key:"_calibrateSensor",value:function(){var e=this._yawOrigin,t=this.quaternion;this._yawOffset=0,this._updateRotation();var n=kn(t).yaw;this._yawOffset=n-e,this._updateRotation(),this._needsCalibrate=!1}},{key:"_updateRotation",value:function(){var e=this.quaternion,t=this._orientation,n=t.alpha,i=t.beta,r=t.gamma;q(e),K(e,e,(n-this._yawOffset)*Qt),X(e,e,i*Qt),Z(e,e,-r*Qt);var o=Y(),a=.5*-this._screenOrientation*Qt,s=ee(-Math.sqrt(.5),0,0,Math.sqrt(.5));ne(o,0,Math.sin(a),0,Math.cos(a)),W(e,e,o),W(e,e,s),ie(e,e)}},{key:"_toEulerDelta",value:function(e,t){return{yaw:this._getDeltaYaw(e,t),pitch:this._getDeltaPitch(e,t)}}},{key:"_getDeltaYaw",value:function(e,t){var n=this._getRotationDelta(e,t,Pn.YAW_DELTA_BY_YAW);return this._getRotationDelta(e,t,Pn.YAW_DELTA_BY_ROLL)*Math.sin(this._extractPitchFromQuat(t))+n}},{key:"_getDeltaPitch",value:function(e,t){return this._getRotationDelta(e,t,Pn.PITCH_DELTA)}},{key:"_getRotationDelta",value:function(e,t,n){var i=U(Pn[n].targetAxis[0],Pn[n].targetAxis[1],Pn[n].targetAxis[2]),r=Pn[n].meshPoint,o=$(e),a=$(t);ie(o,o),ie(a,a);var s=U(0,0,1),u=U(0,0,1);j(s,s,o),j(u,u,a),j(i,i,a);var l,c=V(i,G(B(),s,u))>0?1:-1,h=U(r[0],r[1],r[2]);l=n!==Pn.YAW_DELTA_BY_YAW?U(0,c,0):U(c,0,0),j(h,h,a),j(l,l,a);var d=h,v=l,f=B();G(f,d,v),z(f,f);var _=f[0],p=f[1],m=f[2];j(u=U(r[0],r[1],r[2]),u,a),j(s=U(r[0],r[1],r[2]),s,o);var g=Math.abs(s[0]*_+s[1]*p+s[2]*m),y=B();!function(e,t,n){e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2]}(y,s,function(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e}(B(),f,g));var b=(y[0]*u[0]+y[1]*u[1]+y[2]*u[2])/(F(y)*F(u));b>1&&(b=1);var w=Math.acos(b),E=G(B(),u,y);return g=_*E[0]+p*E[1]+m*E[2],w*(n!==Pn.YAW_DELTA_BY_YAW?g>0?1:-1:g<0?1:-1)*c*Jt}},{key:"_extractPitchFromQuat",value:function(e){var t=U(0,0,1);return j(t,t,e),-1*Math.atan2(t[1],Math.sqrt(Math.pow(t[0],2)+Math.pow(t[2],2)))}}]),n}(A),Dn=function(e){c(n,e);var t=h(n);function n(e){var i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=r.ignoreRoll,a=void 0===o||o;return l(this,n),(i=t.call(this))._enableBlocked=e,i._ignoreRoll=a,i._input=new Nn,i}return u(n,[{key:"enabled",get:function(){return this._input.enabled}},{key:"enableBlocked",get:function(){return this._enableBlocked}},{key:"animating",get:function(){return this._input.enabled&&this._input.orientationUpdated}},{key:"ignoreRoll",get:function(){return this._ignoreRoll},set:function(e){this._ignoreRoll=e}},{key:"destroy",value:function(){this.disable(),this._input.off(),this.off()}},{key:"update",value:function(e,t,n,i){this._ignoreRoll?this._updateYawPitch(e,t,n,i):this._updateQuaternion(e,i)}},{key:"enable",value:function(){this._input.enabled||(this._input.enable(),this._enableBlocked=!1,this.trigger(Xt,{control:this,updateCursor:!1}))}},{key:"disable",value:function(){this._input.enabled&&(this._input.disable(),this.trigger(Kt,{updateCursor:!1}))}},{key:"sync",value:function(){}},{key:"_updateYawPitch",value:function(e,t,n,i){var r=this._input;if(r.enabled){var o=r.collectDelta(),a=o.yaw,s=o.pitch;t.add(a),n.add(s),e.lookAt({yaw:t.val,pitch:n.val,zoom:i})}}},{key:"_updateQuaternion",value:function(e,t){var n=this._input;n.enabled&&(n.update(),e.rotate(n.quaternion,t))}}],[{key:"isAvailable",value:function(){return Se(this,void 0,void 0,i().mark((function e(){var t,n,r;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(DeviceMotionEvent){e.next=2;break}return e.abrupt("return",!1);case 2:return n=function(){return new Promise((function(e){t=function(t){e(t.rotationRate&&null!=t.rotationRate.alpha)},window.addEventListener(tt,t)}))},r=function(){return new Promise((function(e){setTimeout((function(){return e(!1)}),1e3)}))},e.abrupt("return",Promise.race([n(),r()]).then((function(e){return window.removeEventListener(tt,t),e})));case 5:case"end":return e.stop()}}),e)})))}},{key:"requestSensorPermission",value:function(){return Se(this,void 0,void 0,i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!wn()){e.next=2;break}return e.abrupt("return",DeviceMotionEvent.requestPermission().then((function(e){return"granted"===e})).catch((function(){return!1})));case 2:return e.abrupt("return",!0);case 3:case"end":return e.stop()}}),e)})))}}]),n}(A),Bn=function(){function e(t,n,i){var r=this,o=i.useGrabCursor,a=i.scrollable,s=i.wheelScrollable,u=i.disableContextMenu,c=i.rotate,h=i.zoom,d=i.gyro;l(this,e),this._preventContextMenu=function(e){e.preventDefault()},this._onInputStart=function(e){r._useGrabCursor&&!e.isKeyboard&&r._setCursor(pt)},this._onInputEnd=function(e){r._useGrabCursor&&!e.isKeyboard&&r._setCursor(_t)},this._onEnable=function(e){var t=e.control;e.updateCursor&&r._useGrabCursor&&r._setCursor(_t),t.sync(r._camera)},this._onDisable=function(e){e.updateCursor&&r._setCursor(mt)},this._onCameraAnimationEnd=function(e){e.animation.getFinishPromise().then((function(){r.sync()}))},this._useGrabCursor=o,this._disableContextMenu=u,this._camera=n,this._controlEl=t,this._ignoreZoomScale=!1,this._enabled=!1,this._rotateControl=new An(t,!c,gn(c)),this._zoomControl=new Mn(t,!h,gn(h)),this._gyroControl=new Dn(!d,gn(d)),this._rotateControl.scrollable=a,this._zoomControl.scrollable=s,this._bindEvents()}return u(e,[{key:"useGrabCursor",get:function(){return this._useGrabCursor},set:function(e){e!==this._useGrabCursor&&(this._useGrabCursor=e,e&&this._enabled?this._setCursor(_t):e||this._setCursor(mt))}},{key:"disableContextMenu",get:function(){return this._disableContextMenu},set:function(e){e!==this._disableContextMenu&&(this._disableContextMenu=e,e&&this._enabled?this._blockContextMenu():e||this._restoreContextMenu())}},{key:"scrollable",get:function(){return this._rotateControl.scrollable},set:function(e){this._rotateControl.scrollable=e}},{key:"wheelScrollable",get:function(){return this._zoomControl.scrollable},set:function(e){this._zoomControl.scrollable=e}},{key:"ignoreZoomScale",get:function(){return this._ignoreZoomScale},set:function(e){this._ignoreZoomScale=e}},{key:"enabled",get:function(){return this._enabled}},{key:"rotate",get:function(){return this._rotateControl}},{key:"zoom",get:function(){return this._zoomControl}},{key:"gyro",get:function(){return this._gyroControl}},{key:"animating",get:function(){return this._rotateControl.animating||this._zoomControl.animating||this._gyroControl.animating}},{key:"destroy",value:function(){this.disable(),this._rotateControl.destroy(),this._zoomControl.destroy(),this._setCursor(mt)}},{key:"resize",value:function(e,t){var n=this._camera;this._rotateControl.resize(n.fov,n.aspect,e,t)}},{key:"enable",value:function(){return Se(this,void 0,void 0,i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._enabled){e.next=2;break}return e.abrupt("return");case 2:if(this._rotateControl.enableBlocked||this._rotateControl.enable(),this._zoomControl.enableBlocked||this._zoomControl.enable(),this._gyroControl.enableBlocked){e.next=9;break}return e.next=7,Dn.isAvailable();case 7:if(!e.sent){e.next=9;break}this._gyroControl.enable();case 9:this.sync(),this._disableContextMenu&&this._blockContextMenu(),this._enabled=!0;case 12:case"end":return e.stop()}}),e,this)})))}},{key:"disable",value:function(){this._enabled&&(this._rotateControl.disable(),this._zoomControl.disable(),this._gyroControl.disable(),this._restoreContextMenu(),this._enabled=!1)}},{key:"update",value:function(e){var t=this._camera,n=this._rotateControl,i=this._zoomControl,r=this._gyroControl;i.update(e);var o,a,s=(o=t.fov,a=i.zoom,Math.tan(Qt*o*.5)/Math.tan(Qt*a*.5)),u=this._ignoreZoomScale?1:Math.max(s,1);n.setZoomScale(u),n.updateRange(t,s),n.update(e);var l=n.yaw,c=n.pitch;r.enabled?r.update(t,l,c,s):t.lookAt({yaw:l.val,pitch:c.val,zoom:s})}},{key:"sync",value:function(){var e=this._camera;this._zoomControl.sync(e),this._rotateControl.sync(e)}},{key:"_blockContextMenu",value:function(){this._controlEl.addEventListener(Ye,this._preventContextMenu)}},{key:"_restoreContextMenu",value:function(){this._controlEl.removeEventListener(Ye,this._preventContextMenu)}},{key:"_setCursor",value:function(e){(this._useGrabCursor||e===mt)&&(this._controlEl.style.cursor=e)}},{key:"_bindEvents",value:function(){var e=this._rotateControl,t=this._zoomControl;e.on(Yt,this._onInputStart),e.on(Wt,this._onInputEnd),e.on(Xt,this._onEnable),e.on(Kt,this._onDisable),t.on(Xt,this._onEnable),t.on(Kt,this._onDisable),this._camera.on(Ht,this._onCameraAnimationEnd)}}]),e}(),Fn=function(){function e(t){var n=t.width,i=t.height,r=t.flipY;l(this,e),this.width=n,this.height=i,this.flipY=r,this.wrapS=WebGLRenderingContext.CLAMP_TO_EDGE,this.wrapT=WebGLRenderingContext.CLAMP_TO_EDGE}return u(e,[{key:"destroy",value:function(){}},{key:"isVideo",value:function(){return!1}},{key:"isCube",value:function(){return!1}}]),e}(),Un=function(e){c(n,e);var t=h(n);function n(e){var i,r=e.source,o=e.width,a=e.height,s=e.flipY;return l(this,n),(i=t.call(this,{width:o,height:a,flipY:s})).source=r,i}return u(n)}(Fn),zn=function(e){c(n,e);var t=h(n);function n(){return l(this,n),t.apply(this,arguments)}return u(n,[{key:"destroy",value:function(){var e=this.source;e.pause(),e.removeAttribute("src"),e.load()}},{key:"isVideo",value:function(){return!0}},{key:"isPaused",value:function(){var e=this.source;return e.paused||e.ended||e.readyState<=2}},{key:"hasAudio",value:function(){var e=this.source;return e.audioTracks?e.audioTracks.length>0:null!=e.webkitAudioDecodedByteCount?e.webkitAudioDecodedByteCount>0:null==e.mozHasAudio||e.mozHasAudio}}]),n}(Un),Vn=function(e){c(n,e);var t=h(n);function n(e){var i,r=e.sources,o=e.width,a=e.height,s=e.flipY;return l(this,n),(i=t.call(this,{width:o,height:a,flipY:s})).sources=r,i}return u(n,[{key:"isCube",value:function(){return!0}}]),n}(Fn),Gn=function(){function e(){l(this,e),this._loadChecker=new Ie}return u(e,[{key:"load",value:function(e,t){return Se(this,void 0,void 0,i().mark((function n(){var r;return i().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!t){n.next=4;break}return n.abrupt("return",this.loadVideo(e,gn(t)));case 4:if(!(Array.isArray(e)&&e.length>1)){n.next=8;break}return n.abrupt("return",this.loadCubeImage(e));case 8:return r=Array.isArray(e)?e[0]:e,n.abrupt("return",this.loadImage(r));case 10:case"end":return n.stop()}}),n,this)})))}},{key:"loadImage",value:function(e){return Se(this,void 0,void 0,i().mark((function t(){var n;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=this._toImageArray(e),t.abrupt("return",this._load(n,(function(e){var t=n[0];e(new Un({source:t,width:t.naturalWidth,height:t.naturalHeight,flipY:!0}))})));case 2:case"end":return t.stop()}}),t,this)})))}},{key:"loadCubeImage",value:function(e){return Se(this,void 0,void 0,i().mark((function t(){var n;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=this._toImageArray(e),t.abrupt("return",this._load(n,(function(e){e(new Vn({sources:n,width:n[0].naturalWidth,height:n[0].naturalHeight,flipY:!1}))})));case 2:case"end":return t.stop()}}),t,this)})))}},{key:"loadVideo",value:function(e,t){return Se(this,void 0,void 0,i().mark((function n(){var r,o;return i().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r=Object.assign({autoplay:!0,muted:!0,loop:!1,volume:1},t),o=this._toVideoElement(e,r),n.abrupt("return",this._load([o],(function(e){var t=r.autoplay,n=r.muted;o.currentTime=0,t&&n&&o.play().catch((function(){})),e(new zn({source:o,width:o.videoWidth,height:o.videoHeight,flipY:!0}))})));case 3:case"end":return n.stop()}}),n,this)})))}},{key:"_load",value:function(e,t){var n=this._loadChecker;return new Promise((function(i,r){n.once("ready",(function(e){e.errorCount>0||t(i)})),n.once("error",r),n.check(e)}))}},{key:"_toImageArray",value:function(e){return(Array.isArray(e)?e:[e]).map((function(e){if(cn(e)){var t=new Image;return t.crossOrigin="anonymous",t.src=e,t}return e}))}},{key:"_toVideoElement",value:function(e,t){var n=this,i=t.muted,r=t.loop,o=t.volume;if(e instanceof HTMLVideoElement)return e;var a=document.createElement("video");return a.crossOrigin="anonymous",a.playsInline=!0,a.setAttribute("webkit-playsinline",""),a.muted=i,a.volume=o,a.loop=r,Array.isArray(e)?e.forEach((function(e){return n._appendSourceElement(a,e)})):this._appendSourceElement(a,e),a.querySelectorAll("source").length>0&&a.readyState<1&&a.load(),a}},{key:"_appendSourceElement",value:function(e,t){if(t instanceof HTMLSourceElement)return t;var n=document.createElement("source");n.src=t,e.appendChild(n)}}]),e}(),Hn=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window;l(this,e),this.maxDeltaTime=t,this._context=n,this._rafId=-1,this._rafTimer=-1,this._lastUpdateTime=-1}return u(e,[{key:"start",value:function(e){var t=this,n=this._context;if(n&&e&&!(this._rafId>=0||this._rafTimer>=0)){this._lastUpdateTime=Date.now(),this._rafId=n.requestAnimationFrame((function i(r,o){var a=Date.now(),s=Math.min(a-t._lastUpdateTime,1e3*t.maxDeltaTime);e(s,o),t._lastUpdateTime=a,t._rafId=n.requestAnimationFrame(i)}))}}},{key:"stop",value:function(){this._rafId>=0&&this._context.cancelAnimationFrame(this._rafId),this._rafTimer>=0&&clearTimeout(this._rafTimer),this._rafId=-1,this._rafTimer=-1}},{key:"changeContext",value:function(e){this.stop(),this._context=e}}]),e}(),jn=function(){function e(t,n){var i,r=this;l(this,e),this._skipFirstResize=(i=!0,function(){i?i=!1:r._onResize()}),this._useResizeObserver=t,this._enabled=!1,this._resizeObserver=null,this._onResize=n}return u(e,[{key:"useResizeObserver",get:function(){return this._useResizeObserver}},{key:"enabled",get:function(){return this._enabled}},{key:"enable",value:function(e){if(this._enabled&&this.disable(),this._useResizeObserver&&window.ResizeObserver){var t=e.getBoundingClientRect(),n=0!==t.width||0!==t.height,i=new ResizeObserver(n?this._skipFirstResize:this._onResize);i.observe(e),this._resizeObserver=i}else window.addEventListener(je,this._onResize);return this._enabled=!0,this}},{key:"disable",value:function(){if(!this._enabled)return this;var e=this._resizeObserver;return e?(e.disconnect(),this._resizeObserver=null):window.removeEventListener(je,this._onResize),this._enabled=!1,this}}]),e}(),Yn=function(){function e(t,n,i){var r=this;l(this,e),this._onInputStart=function(){r._canInterrupt&&(r._interrupted=!0,r._clearTimeout())},this._onInputEnd=function(){r._setUninterruptedAfterDelay(r._delay)},this._onGyroEnable=function(){r.disable()},this._onMouseEnter=function(){r._pauseOnHover&&(r._interrupted=!0,r._hovering=!0)},this._onMouseLeave=function(){r._pauseOnHover&&(r._hovering=!1,r._setUninterruptedAfterDelay(r._delayOnMouseLeave))},this._camera=t.camera,this._control=t.control,this._element=n,this._enabled=!1,this._interrupted=!1,this._interruptionTimer=-1,this._hovering=!1;var o=gn(i),a=o.delay,s=void 0===a?2e3:a,u=o.delayOnMouseLeave,c=void 0===u?0:u,h=o.speed,d=void 0===h?1:h,v=o.pauseOnHover,f=void 0!==v&&v,_=o.canInterrupt,p=void 0===_||_,m=o.disableOnInterrupt,g=void 0!==m&&m;this._enableBlocked=!i,this._delay=s,this._delayOnMouseLeave=c,this._speed=d,this._pauseOnHover=f,this._canInterrupt=p,this._disableOnInterrupt=g}return u(e,[{key:"enabled",get:function(){return this._enabled}},{key:"enableBlocked",get:function(){return this._enableBlocked}},{key:"playing",get:function(){return this._enabled&&!this._interrupted}},{key:"delay",get:function(){return this._delay},set:function(e){this._delay=e}},{key:"delayOnMouseLeave",get:function(){return this._delayOnMouseLeave},set:function(e){this._delayOnMouseLeave=e}},{key:"speed",get:function(){return this._speed},set:function(e){this._speed=e}},{key:"pauseOnHover",get:function(){return this._pauseOnHover},set:function(e){this._pauseOnHover=e}},{key:"canInterrupt",get:function(){return this._canInterrupt},set:function(e){this._canInterrupt=e}},{key:"disableOnInterrupt",get:function(){return this._disableOnInterrupt},set:function(e){this._disableOnInterrupt=e}},{key:"destroy",value:function(){this.disable()}},{key:"update",value:function(e){if(this._enabled)if(this._interrupted)this._disableOnInterrupt&&this.disable();else{var t=this._camera,n=-this._speed*e/100;t.yaw=mn(t.yaw+n,0,360)}}},{key:"enable",value:function(){var e=this._control,t=this._element;this._enabled||e.gyro.enabled||(e.rotate.on(Yt,this._onInputStart),e.rotate.on(Wt,this._onInputEnd),e.zoom.on(Yt,this._onInputStart),e.zoom.on(Wt,this._onInputEnd),e.gyro.on(Xt,this._onGyroEnable),t.addEventListener(qe,this._onMouseEnter,!1),t.addEventListener(We,this._onMouseLeave,!1),this._enabled=!0,this._enableBlocked=!1)}},{key:"enableAfterDelay",value:function(){this.enable(),this._interrupted=!0,this._setUninterruptedAfterDelay(this._delay)}},{key:"disable",value:function(){if(this._enabled){var e=this._control,t=this._element;e.rotate.off(Yt,this._onInputStart),e.rotate.off(Wt,this._onInputEnd),e.zoom.off(Yt,this._onInputStart),e.zoom.off(Wt,this._onInputEnd),e.gyro.off(Xt,this._onGyroEnable),t.removeEventListener(qe,this._onMouseEnter,!1),t.removeEventListener(We,this._onMouseLeave,!1),this._enabled=!1,this._interrupted=!1,this._hovering=!1,this._clearTimeout()}}},{key:"_setUninterruptedAfterDelay",value:function(e){var t=this;this._hovering||(this._clearTimeout(),e>0?this._interruptionTimer=window.setTimeout((function(){t._interrupted=!1,t._interruptionTimer=-1}),e):(this._interrupted=!1,this._interruptionTimer=-1))}},{key:"_clearTimeout",value:function(){this._interruptionTimer>=0&&(window.clearTimeout(this._interruptionTimer),this._interruptionTimer=-1)}}]),e}(),qn=function(e){c(n,e);var t=h(n);function n(e){var i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return l(this,n),(i=t.call(this)).destroy=function(){i.exit(),i.off()},i._onSessionEnd=function(){i.exit(),i.trigger(Vt)},i._xrSession=null,i._xrRefSpace=null,i._ctx=e,i._options=r,i}return u(n,[{key:"isAvailable",value:function(){return Se(this,void 0,void 0,i().mark((function e(){var t;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=window.navigator.xr){e.next=3;break}return e.abrupt("return",!1);case 3:return e.abrupt("return",t.isSessionSupported(sn).then((function(e){return e})).catch((function(){return!1})));case 4:case"end":return e.stop()}}),e)})))}},{key:"enter",value:function(){return Se(this,void 0,void 0,i().mark((function e(){var t,n,r,o,a;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this._ctx,n=window.navigator.xr){e.next=4;break}return e.abrupt("return");case 4:return e.next=6,Dn.requestSensorPermission();case 6:return r=Object.assign({requiredFeatures:[un]},this._options),e.next=9,t.makeXRCompatible();case 9:return e.next=11,n.requestSession(sn,r);case 11:return o=e.sent,t.bindXRLayer(o),e.next=15,o.requestReferenceSpace(un);case 15:a=e.sent,this._setSession(o,a),this.trigger(zt,{session:o});case 18:case"end":return e.stop()}}),e,this)})))}},{key:"exit",value:function(){var e=this._xrSession;e&&e.end().catch((function(){})),this._xrSession=null,this._xrRefSpace=null}},{key:"canRender",value:function(e){var t=this._xrRefSpace;return!!t&&!!e.getViewerPose(t)}},{key:"getEyeParams",value:function(e){var t=e.session,n=e.getViewerPose(this._xrRefSpace);if(!n)return null;var i=t.renderState.baseLayer;return i?n.views.map((function(e){return{viewport:i.getViewport(e),vMatrix:e.transform.inverse.matrix,pMatrix:e.projectionMatrix}})):null}},{key:"_setSession",value:function(e,t){this._xrSession=e,this._xrRefSpace=t,e.addEventListener(ht,this._onSessionEnd)}}]),n}(A),Wn=u((function e(t,n){l(this,e),this.element=t,this.position=n})),Xn=function(){function e(t,n,i){var r=i.zoom,o=void 0!==r&&r;l(this,e),this._containerEl=dn(".".concat(Rt),t),this._renderer=n,this._hotspots=[],this._zoom=o}return u(e,[{key:"refresh",value:function(){var e=this,t=this._containerEl;if(t){var n=[].slice.apply(t.querySelectorAll(".".concat(Ot)));this._hotspots=n.map((function(t){return e._parseHotspot(t)}))}}},{key:"render",value:function(e){var t=this._hotspots,n=.5*this._renderer.width,i=.5*this._renderer.height,r=e.zoom,o="translate(-50%, -50%)",a=this._zoom?"scale(".concat(r,")"):"";t.forEach((function(t){var r=t.position,s=B();if(function(e,t){e[0]=t[0],e[1]=t[1],e[2]=t[2]}(s,r),H(s,s,e.viewMatrix),H(s,s,e.projectionMatrix),s[2]>1||s[2]<0)t.element.classList.remove(At);else{var u=function(e,t){var n=new M(2);return n[0]=e,n[1]=t,n}(s[0]*n+n,-s[1]*i+i);t.element.classList.add(At),t.element.style.transform=[o,"translate(".concat(u[0],"px, ").concat(u[1],"px)"),a].join(" ")}}))}},{key:"_parseHotspot",value:function(e){var t=e.dataset.yaw,n=e.dataset.pitch,i=e.dataset.position;if(t||n){var r=t?parseFloat(t):0,o=n?parseFloat(n):0,a=this._yawPitchToVec3(r,o);return new Wn(e,a)}if(i){var s=i.split(" ").map((function(e){return parseFloat(e)}));if(s.length<3)throw new Pe(De.INSUFFICIENT_ARGS(i,'hotspot attribute "data-position"'),Ne.INSUFFICIENT_ARGS);return new Wn(e,U(s[0],s[1],s[2]))}var u=U(0,0,-1);return new Wn(e,u)}},{key:"_yawPitchToVec3",value:function(e,t){var n=e*Qt,i=t*Qt,r=B();return r[1]=Math.sin(i),r[2]=Math.cos(i),r[0]=r[2]*Math.sin(-n),r[2]=-r[2]*Math.cos(-n),r}}]),e}(),Kn=function(){function e(t,n,i){l(this,e),this.obj=t,this.geometry=n,this.buffers=i}return u(e,[{key:"count",get:function(){return this.geometry.indicies.count}}]),e}(),Zn=function(){function e(t,n){var i=this;l(this,e),this._onContextLost=function(){i._canvas.classList.add(Ct),i._contextLost=!0},this._onContextRestore=function(){i._canvas.classList.remove(Ct),i._contextLost=!1},this._canvas=t,this._contextLost=!1,this._debug=n,this._extensions={vao:null,loseContext:null}}return u(e,[{key:"canvas",get:function(){return this._canvas}},{key:"maxTextureSize",get:function(){return this._maxTextureSize}},{key:"isWebGL2",get:function(){return this._isWebGL2}},{key:"supportVAO",get:function(){return this._isWebGL2||!!this._extensions.vao}},{key:"lost",get:function(){return this._contextLost}},{key:"debug",get:function(){return this._debug}},{key:"init",value:function(){var e=this._canvas,t=this._getContext(e),n=t.gl,i=t.isWebGL2;this._gl=n,this._maxTextureSize=n.getParameter(n.MAX_TEXTURE_SIZE),this._isWebGL2=i,this._isWebGL2||(this._extensions.vao=n.getExtension("OES_vertex_array_object")),this._extensions.loseContext=n.getExtension("WEBGL_lose_context"),e.addEventListener(Je,this._onContextLost),e.addEventListener($e,this._onContextRestore)}},{key:"destroy",value:function(){var e=this._gl,t=this._canvas;e&&(e.bindBuffer(e.ARRAY_BUFFER,null),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,null)),t.removeEventListener(Je,this._onContextLost),t.removeEventListener($e,this._onContextRestore)}},{key:"forceLoseContext",value:function(){var e=this._extensions.loseContext;e&&e.loseContext()}},{key:"forceRestoreContext",value:function(){var e=this._extensions.loseContext;e&&e.restoreContext()}},{key:"clear",value:function(){var e=this._gl;e.clear(e.COLOR_BUFFER_BIT)}},{key:"resize",value:function(){var e=this._gl;e.viewport(0,0,e.drawingBufferWidth,e.drawingBufferHeight)}},{key:"viewport",value:function(e,t,n,i){this._gl.viewport(e,t,n,i)}},{key:"createVAO",value:function(e,t){var n=this._createNativeVAO(),i=new Kn(n,e,{indicies:this._createBuffer(),position:this._createBuffer(),uv:this._createBuffer()});return n&&(this._bindNativeVAO(n),this._supplyGeometryData(i,t),this._bindNativeVAO(null),this._unbindBuffers()),i}},{key:"draw",value:function(e,t){var n=this._gl;e.obj?this._bindNativeVAO(e.obj):this._supplyGeometryData(e,t),n.drawElements(n.TRIANGLES,e.count,n.UNSIGNED_SHORT,0),e.obj?this._bindNativeVAO(null):this._unbindBuffers()}},{key:"releaseVAO",value:function(e){e.obj&&this._deleteNativeVAO(e.obj),this._deleteBuffer(e.buffers.indicies),this._deleteBuffer(e.buffers.position),this._deleteBuffer(e.buffers.uv)}},{key:"getUniformLocations",value:function(e,t){var n=this._gl,i=Object.keys(t).reduce((function(t,i){return t[i]=n.getUniformLocation(e,i),t}),{});return Object.assign(Object.assign({},this._getCommonUniformLocations(e)),i)}},{key:"updateCommonUniforms",value:function(e,t,n){var i=this._gl,r=n.uniformLocations,o=e.matrix,a=P();N(a,t.viewMatrix,o),i.uniformMatrix4fv(r.uMVMatrix,!1,a),i.uniformMatrix4fv(r.uPMatrix,!1,t.projectionMatrix)}},{key:"updateVRUniforms",value:function(e,t,n,i){var r=this._gl,o=e.uniformLocations;r.uniformMatrix4fv(o.uMVMatrix,!1,t),r.uniformMatrix4fv(o.uPMatrix,!1,n),o.uEye&&r.uniform1f(o.uEye,i)}},{key:"updateUniforms",value:function(e){var t=this._gl,n=e.uniforms,i=e.uniformLocations;for(var r in n){var o=n[r],a=i[r];o&&(o.needsUpdate&&o.update(t,a,this._isWebGL2))}}},{key:"releaseShaderResources",value:function(e){var t=this._gl,n=e.uniforms;for(var i in n){var r=n[i];r&&(r.needsUpdate&&r.destroy(t))}t.deleteProgram(e.program)}},{key:"useProgram",value:function(e){this._gl.useProgram(e.program)}},{key:"createProgram",value:function(e,t){var n=this._gl,i=n.createProgram(),r=this._compileShader(n.VERTEX_SHADER,e),o=this._compileShader(n.FRAGMENT_SHADER,t);if(n.attachShader(i,r),n.attachShader(i,o),n.bindAttribLocation(i,0,"position"),n.bindAttribLocation(i,1,"uv"),n.linkProgram(i),this._debug&&!n.getProgramParameter(i,n.LINK_STATUS)){var a=null;throw n.getShaderParameter(r,n.COMPILE_STATUS)?n.getShaderParameter(o,n.COMPILE_STATUS)||(a=n.getShaderInfoLog(o)):a=n.getShaderInfoLog(r),new Pe(De.FAILED_LINKING_PROGRAM(n.getProgramInfoLog(i),a),Ne.FAILED_LINKING_PROGRAM)}return n.deleteShader(r),n.deleteShader(o),i}},{key:"createWebGLTexture",value:function(e){var t=this._gl,n=t.createTexture();if(t.bindTexture(t.TEXTURE_2D,n),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,e.wrapS),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,e.wrapT),!e.isVideo()&&this._isWebGL2){var i=t;i.texStorage2D(i.TEXTURE_2D,1,i.RGBA8,e.width,e.height)}return n}},{key:"createWebGLCubeTexture",value:function(e,t){var n=this._gl,i=n.createTexture();if(n.bindTexture(n.TEXTURE_CUBE_MAP,i),n.texParameteri(n.TEXTURE_CUBE_MAP,n.TEXTURE_MIN_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_CUBE_MAP,n.TEXTURE_MAG_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_CUBE_MAP,n.TEXTURE_WRAP_S,e.wrapS),n.texParameteri(n.TEXTURE_CUBE_MAP,n.TEXTURE_WRAP_T,e.wrapT),this._isWebGL2){var r=n;r.texStorage2D(r.TEXTURE_CUBE_MAP,1,r.RGBA8,t,t)}return i}},{key:"makeXRCompatible",value:function(){return Se(this,void 0,void 0,i().mark((function e(){var t,n;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this._gl,!(n=t.getContextAttributes())||!0===n.xrCompatible){e.next=5;break}return e.next=5,t.makeXRCompatible();case 5:case"end":return e.stop()}}),e,this)})))}},{key:"bindXRLayer",value:function(e){var t=this._gl,n=new XRWebGLLayer(e,t);e.updateRenderState({baseLayer:n})}},{key:"bindXRFrame",value:function(e){var t=this._gl,n=e.session.renderState.baseLayer;t.bindFramebuffer(t.FRAMEBUFFER,n.framebuffer)}},{key:"useDefaultFrameBuffer",value:function(){var e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,null)}},{key:"_createBuffer",value:function(){return this._gl.createBuffer()}},{key:"_deleteBuffer",value:function(e){return this._gl.deleteBuffer(e)}},{key:"_createNativeVAO",value:function(){var e=this._gl;if(this._isWebGL2)return e.createVertexArray();var t=this._extensions.vao;return(null==t?void 0:t.createVertexArrayOES())||null}},{key:"_bindNativeVAO",value:function(e){var t=this._gl;if(this._isWebGL2)t.bindVertexArray(e);else{var n=this._extensions.vao;null==n||n.bindVertexArrayOES(e)}}},{key:"_deleteNativeVAO",value:function(e){var t=this._gl;if(this._isWebGL2)t.deleteVertexArray(e);else{var n=this._extensions.vao;null==n||n.deleteVertexArrayOES(e)}}},{key:"_supplyGeometryData",value:function(e,t){var n=e.geometry;this._supplyIndiciesData(n.indicies,e.buffers.indicies),this._supplyAttributeData(n.vertices,t.program,"position",e.buffers.position),this._supplyAttributeData(n.uvs,t.program,"uv",e.buffers.uv)}},{key:"_unbindBuffers",value:function(){var e=this._gl;e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,null),e.bindBuffer(e.ARRAY_BUFFER,null)}},{key:"_supplyIndiciesData",value:function(e,t){var n=this._gl;n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,t),n.bufferData(n.ELEMENT_ARRAY_BUFFER,e.data,n.STATIC_DRAW)}},{key:"_supplyAttributeData",value:function(e,t,n,i){var r=this._gl,o=r.getAttribLocation(t,n);o<0||(r.bindBuffer(r.ARRAY_BUFFER,i),r.bufferData(r.ARRAY_BUFFER,e.data,r.STATIC_DRAW),r.vertexAttribPointer(o,e.itemSize,r.FLOAT,!1,0,0),r.enableVertexAttribArray(o))}},{key:"_compileShader",value:function(e,t){var n=this._gl,i=n.createShader(e);return n.shaderSource(i,t),n.compileShader(i),i}},{key:"_getCommonUniformLocations",value:function(e){var t=this._gl;return{uMVMatrix:t.getUniformLocation(e,"uMVMatrix"),uPMatrix:t.getUniformLocation(e,"uPMatrix")}}},{key:"_getContext",value:function(e){var t=null,n=!1,i={preserveDrawingBuffer:!1,antialias:!1},r=function(e){return e.statusMessage};e.addEventListener(Qe,r);for(var o=0,a=["webgl2","webgl","experimental-webgl","webkit-3d","moz-webgl"];o<a.length;o++){var s=a[o];try{t=e.getContext(s,i),n="webgl2"===s}catch(u){}if(t)break}if(e.removeEventListener(Qe,r),!t)throw new Pe(De.WEBGL_NOT_SUPPORTED,Ne.WEBGL_NOT_SUPPORTED);return{gl:t,isWebGL2:n}}}]),e}(),Qn=function(){function e(t,n){l(this,e),this._canvas=t,this._elementSize={x:0,y:0},this._pixelRatio=1,this.ctx=new Zn(t,n)}return u(e,[{key:"canvas",get:function(){return this._canvas}},{key:"width",get:function(){return this._elementSize.x}},{key:"height",get:function(){return this._elementSize.y}},{key:"pixelRatio",get:function(){return this._pixelRatio}},{key:"aspect",get:function(){return this._elementSize.x/this._elementSize.y}},{key:"destroy",value:function(){var e=this._canvas;this.ctx.destroy(),e.width=1,e.height=1}},{key:"resize",value:function(){var e=this._canvas,t=this._elementSize,n=window.devicePixelRatio;t.x=e.clientWidth,t.y=e.clientHeight,e.width=t.x*n,e.height=t.y*n,this._pixelRatio=n,this.ctx.resize()}},{key:"render",value:function(e,t){var n=this.ctx;n.lost||(n.clear(),n.useProgram(e.program),n.updateCommonUniforms(e,t,e.program),e.update({camera:t}),n.updateUniforms(e.program),n.draw(e.vao,e.program))}},{key:"renderVR",value:function(e,t,n){var i=this.ctx,r=t.getEyeParams(n);r&&e&&(i.bindXRFrame(n),i.useProgram(e.program),i.updateUniforms(e.program),r.forEach((function(t,n){var r=t.viewport,o=N(P(),t.vMatrix,e.matrix);i.viewport(r.x,r.y,r.width,r.height),i.updateVRUniforms(e.program,o,t.pMatrix,n),i.draw(e.vao,e.program)})))}}]),e}(),Jn=function(e){c(n,e);var t=h(n);function n(e){var i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=r.projection,a=void 0===o?null:o,s=r.initialYaw,u=void 0===s?0:s,c=r.initialPitch,h=void 0===c?0:c,d=r.initialZoom,f=void 0===d?1:d,_=r.yawRange,p=void 0===_?null:_,m=r.pitchRange,g=void 0===m?null:m,y=r.zoomRange,b=void 0===y?null:y,w=r.fov,E=void 0===w?90:w,k=r.useGrabCursor,T=void 0===k||k,x=r.disableContextMenu,C=void 0!==x&&x,L=r.rotate,R=void 0===L||L,O=r.zoom,A=void 0===O||O,I=r.gyro,S=void 0!==I&&I,M=r.scrollable,P=void 0===M||M,N=r.wheelScrollable,D=void 0!==N&&N,B=r.autoplay,F=void 0!==B&&B,U=r.hotspot,z=void 0===U?{}:U,V=r.autoInit,G=void 0===V||V,H=r.autoResize,j=void 0===H||H,Y=r.canvasSelector,q=void 0===Y?"canvas":Y,W=r.useResizeObserver,X=void 0===W||W,K=r.on,Z=void 0===K?{}:K,Q=r.plugins,J=void 0===Q?[]:Q,$=r.maxDeltaTime,ee=void 0===$?1/30:$,te=r.tabIndex,ne=void 0===te?0:te,ie=r.debug,re=void 0!==ie&&ie;l(this,n),(i=t.call(this)).renderFrame=function(e){var t=i._camera,n=i._renderer,r=i._control,o=i._hotspot,a=i._autoplay,s=i._mesh;s&&(i._emit(Dt),a.playing&&(a.update(e),r.sync()),t.animation?t.animation.update(e):r.update(e),n.render(s,t),o.render(t),t.changed&&i._emit(Ft,{yaw:t.yaw,pitch:t.pitch,zoom:t.zoom,quaternion:[t.quaternion[0],t.quaternion[1],t.quaternion[2],t.quaternion[3]]}),t.onFrameRender(),i._emit(Bt))},i._renderFrameOnDemand=function(e){var t=i._camera,n=i._control,r=i._autoplay,o=i._mesh,a=null==o?void 0:o.getTexture();i._initialized&&a&&(t.animation||n.animating||r.playing||a.isVideo())&&i.renderFrame(e)},i._renderVRFrame=function(e,t){var n=i._vr,r=i._mesh,o=i._renderer;r&&(i._emit(Dt),o.renderVR(r,n,t),i._emit(Bt))},i._rootEl=vn(e),i._plugins=J,i._initialized=!1,i._autoInit=G,i._autoResize=j,i._canvasSelector=q,i._useResizeObserver=X,i._tabIndex=ne,i._debug=re;var oe=fn(i._rootEl,q);return i._renderer=new Qn(oe,re),i._camera=new Cn({initialYaw:u,initialPitch:h,initialZoom:f,fov:E,yawRange:p,pitchRange:g,zoomRange:b}),i._control=new Bn(oe,i._camera,{useGrabCursor:T,scrollable:P,wheelScrollable:D,disableContextMenu:C,rotate:R,zoom:A,gyro:S}),i._animator=new Hn(ee),i._autoplay=new Yn(v(i),oe,F),i._projection=a,i._mesh=null,i._autoResizer=new jn(X,(function(){return i.resize()})),i._vr=new qn(i._renderer.ctx),i._hotspot=new Xn(i._rootEl,i._renderer,z),i._addEventHandlers(Z),a&&G&&i.init(),i}return u(n,[{key:"rootEl",get:function(){return this._rootEl}},{key:"renderer",get:function(){return this._renderer}},{key:"camera",get:function(){return this._camera}},{key:"control",get:function(){return this._control}},{key:"vr",get:function(){return this._vr}},{key:"hotspot",get:function(){return this._hotspot}},{key:"plugins",get:function(){return this._plugins}},{key:"projection",get:function(){return this._projection},set:function(e){this._initialized&&e?this.load(e):this._projection=e}},{key:"mesh",get:function(){return this._mesh}},{key:"initialized",get:function(){return this._initialized}},{key:"autoplay",get:function(){return this._autoplay}},{key:"autoInit",get:function(){return this._autoInit}},{key:"autoResize",get:function(){return this._autoResize}},{key:"canvasSelector",get:function(){return this._canvasSelector}},{key:"useResizeObserver",get:function(){return this._useResizeObserver}},{key:"tabIndex",get:function(){return this._tabIndex},set:function(e){var t=this._renderer.canvas;this._tabIndex=e,null!=e?t.tabIndex=e:t.removeAttribute("tabindex")}},{key:"maxDeltaTime",get:function(){return this._animator.maxDeltaTime},set:function(e){this._animator.maxDeltaTime=e}},{key:"debug",get:function(){return this._debug},set:function(e){this._debug=e}},{key:"initialYaw",get:function(){return this._camera.initialYaw},set:function(e){this._camera.initialYaw=e}},{key:"initialPitch",get:function(){return this._camera.initialPitch},set:function(e){this._camera.initialPitch=e}},{key:"initialZoom",get:function(){return this._camera.initialZoom},set:function(e){this._camera.initialZoom=e}},{key:"yawRange",get:function(){return this._camera.yawRange},set:function(e){this._camera.yawRange=e,this._projection&&this._projection.updateCamera(this._camera)}},{key:"pitchRange",get:function(){return this._camera.pitchRange},set:function(e){this._camera.pitchRange=e,this._projection&&this._projection.updateCamera(this._camera)}},{key:"zoomRange",get:function(){return this._camera.zoomRange},set:function(e){this._camera.zoomRange=e,this._projection&&this._projection.updateCamera(this._camera)}},{key:"fov",get:function(){return this._camera.fov},set:function(e){var t=this._camera,n=this._control;t.fov=e,t.updateMatrix(),n.sync()}},{key:"rotate",get:function(){return this._control.rotate}},{key:"zoom",get:function(){return this._control.zoom}},{key:"gyro",get:function(){return this._control.gyro}},{key:"useGrabCursor",get:function(){return this._control.useGrabCursor},set:function(e){this._control.useGrabCursor=e}},{key:"disableContextMenu",get:function(){return this._control.disableContextMenu},set:function(e){this._control.disableContextMenu=e}},{key:"scrollable",get:function(){return this._control.scrollable},set:function(e){this._control.scrollable=e}},{key:"wheelScrollable",get:function(){return this._control.wheelScrollable},set:function(e){this._control.wheelScrollable=e}},{key:"destroy",value:function(){var e=this;this._camera.destroy(),this._animator.stop(),this._renderer.destroy(),this._control.destroy(),this._autoResizer.disable(),this._mesh&&(this._mesh.destroy(this._renderer.ctx),this._mesh=null),this._plugins.forEach((function(t){return t.destroy(e)})),this._initialized=!1}},{key:"init",value:function(){return Se(this,void 0,void 0,i().mark((function e(){var t,n,r,o,a,s,u,l,c=this;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._projection){e.next=2;break}throw new Pe(De.PROVIDE_PROJECTION_FIRST,Ne.PROVIDE_PROJECTION_FIRST);case 2:return t=this._renderer,n=this._camera,r=this._control,o=this._animator,a=this._hotspot,s=this._projection,u=t.canvas,this._bindComponentEvents(),t.ctx.init(),this._resizeComponents(),n.updateMatrix(),this._autoResize&&this._autoResizer.enable(u),this._autoplay.enableBlocked||this._autoplay.enable(),this._plugins.forEach((function(e){e.init(c)})),e.next=18,this._loadTexture(s);case 18:return l=e.sent,this._applyProjection(s,l),a.refresh(),o.start(this._renderFrameOnDemand),e.next=24,r.enable();case 24:null==this._tabIndex||u.hasAttribute("tabIndex")||(u.tabIndex=this._tabIndex),this._initialized=!0,this.renderFrame(0),this._emit(It);case 28:case"end":return e.stop()}}),e,this)})))}},{key:"load",value:function(e){return Se(this,void 0,void 0,i().mark((function t(){var n;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e){t.next=2;break}return t.abrupt("return",!1);case 2:if(!this._initialized){t.next=10;break}return t.next=5,this._loadTexture(e);case 5:n=t.sent,this._applyProjection(e,n),this.renderFrame(0),t.next=12;break;case 10:this._projection=e,this.init();case 12:return t.abrupt("return",!0);case 13:case"end":return t.stop()}}),t,this)})))}},{key:"resize",value:function(){if(this._initialized){this._resizeComponents(),this.renderFrame(0);var e=this._renderer,t=e.width,n=e.height;this._emit(Nt,{width:t,height:n})}}},{key:"addPlugins",value:function(){for(var e,t=this,n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];this._initialized&&i.forEach((function(e){e.init(t)})),(e=this._plugins).push.apply(e,i)}},{key:"removePlugins",value:function(){for(var e=this,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];n.forEach((function(t){var n=e._plugins.indexOf(t);n<0||(t.destroy(e),e._plugins.splice(n,1))}))}},{key:"_emit",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];var r=n?n[0]:{};this.trigger(e,Object.assign({type:e,target:this},r))}},{key:"_applyProjection",value:function(e,t){var n=this._camera,i=this._control,r=this._renderer,o=this._mesh;o&&o.destroy(r.ctx);var a=e.createMesh(r.ctx,t);e.updateCamera(n),e.updateControl(i),this._mesh=a,this._emit(Pt,{projection:e})}},{key:"_loadTexture",value:function(e){return Se(this,void 0,void 0,i().mark((function t(){var n,r,o,a;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=new Gn,r=e.src,o=e.video,this._emit(St,{src:r,video:o}),t.next=5,n.load(r,o);case 5:return a=t.sent,this._emit(Mt,{src:r,video:o}),t.abrupt("return",a);case 8:case"end":return t.stop()}}),t,this)})))}},{key:"_resizeComponents",value:function(){var e=this._renderer,t=this._camera,n=this._control;e.resize(),t.resize(e.width,e.height),n.resize(e.width,e.height)}},{key:"_addEventHandlers",value:function(e){var t=this;Object.keys(e).forEach((function(n){t.on(n,e[n])}))}},{key:"_bindComponentEvents",value:function(){var e=this,t=this._rootEl,n=this._control,i=this._animator,r=this._renderer,o=this._vr;[Zt,Yt,Wt].forEach((function(t){n.rotate.on(t,(function(n){e._emit(t,n)})),n.zoom.on(t,(function(n){e._emit(t,n)}))})),o.on(zt,(function(n){t.classList.add(Lt),i.changeContext(n.session),i.start(e._renderVRFrame),e._emit(zt)})),o.on(Vt,(function(){t.classList.remove(Lt),r.ctx.useDefaultFrameBuffer(),i.changeContext(window),i.start(e._renderFrameOnDemand),e.resize(),e._emit(Vt)}))}}]),n}(A);Jn.VERSION="4.0.0-beta.7";var $n=function(e){c(n,e);var t=h(n);function n(){var e;return l(this,n),(e=t.call(this)).matrix=P(),e.rotation=Y(),e.position=U(0,0,0),e.scale=U(1,1,1),e}return u(n,[{key:"updateMatrix",value:function(){!function(e,t,n,i){var r=t[0],o=t[1],a=t[2],s=t[3],u=r+r,l=o+o,c=a+a,h=r*u,d=r*l,v=r*c,f=o*l,_=o*c,p=a*c,m=s*u,g=s*l,y=s*c,b=i[0],w=i[1],E=i[2];e[0]=(1-(f+p))*b,e[1]=(d+y)*b,e[2]=(v-g)*b,e[3]=0,e[4]=(d-y)*w,e[5]=(1-(h+p))*w,e[6]=(_+m)*w,e[7]=0,e[8]=(v+g)*E,e[9]=(_-m)*E,e[10]=(1-(h+f))*E,e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1}(this.matrix,this.rotation,this.position,this.scale)}},{key:"update",value:function(e){this.trigger(jt,e)}}]),n}(A),ei=u((function e(t){l(this,e),this.position=t.position,this.order=t.order})),ti={CONTROLS_ROOT:"view360-controls",CONTROLS_BG:"view360-controls-background",CONTROLS_MAIN:"view360-controls-main",CONTROLS_TOP:"view360-controls-top",CONTROLS_BOTTOM:"view360-controls-bottom",CONTROLS_MID:"view360-controls-mid",CONTROLS_LEFT:"view360-controls-left",CONTROLS_RIGHT:"view360-controls-right",CONTROLS_FLOAT_LEFT:"view360-controls-float-left",CONTROLS_FLOAT_RIGHT:"view360-controls-float-right",CONTROLS_BUTTON:"view360-controls-button",PROGRESS_ROOT:"view360-controls-progress",VOLUME_ROOT:"view360-controls-volume",RANGE_ROOT:"view360-range",RANGE_TRACK:"view360-range-track",RANGE_THUMB:"view360-range-thumb",RANGE_FILLER:"view360-range-filler",PLAY_BUTTON:"view360-controls-play",PAUSE_BUTTON:"view360-controls-pause",UNMUTED_BUTTON:"view360-controls-unmuted",MUTED_BUTTON:"view360-controls-muted",FULLSCREEN_BUTTON:"view360-controls-fullscreen",FULLSCREEN_EXIT_BUTTON:"view360-controls-fullscreen-exit",VR_BUTTON:"view360-controls-vr",GYRO_ENABLED:"view360-controls-gyro-enabled",GYRO_DISABLED:"view360-controls-gyro-disabled",VIDEO_TIME_DISPLAY:"view360-controls-time",PIEVIEW_ROOT:"view360-controls-pie",FIXED:"view360-controls-fixed",UNAVAILABLE:"view360-controls-unavailable",HIDDEN:"view360-controls-hidden"},ni={TOP_LEFT:"top-left",TOP_RIGHT:"top-right",MAIN_TOP:"main-top",MAIN_BOTTOM:"main-bottom",MAIN_LEFT:"main-left",MAIN_RIGHT:"main-right"},ii=function(e){c(n,e);var t=h(n);function n(){var e;l(this,n),(e=t.call(this))._onHold=function(t){var n,i=t.srcEvent,r=t.isTouch,o=e._bbox;if(o){var a=r?i.touches[0].pageX:i.pageX,s=o.x+(null!==(n=window.scrollX)&&void 0!==n?n:window.pageXOffset),u=_n(a,s,s+o.width),l=(u-s)/o.width;e._motion.reset(u),e.thumbEl.classList.add(e._fixedClass),e.trigger(Yt,l)}},e._onChange=function(t){var n,i=t.delta,r=e._motion,o=e._bbox;if(o){r.setNewEndByDelta(i.x),r.update(1);var a=o.x+(null!==(n=window.scrollX)&&void 0!==n?n:window.pageXOffset),s=(_n(r.val,a,a+o.width)-a)/o.width;e.trigger(qt,s)}},e._onRelease=function(){e._bbox&&(e.thumbEl.classList.remove(e._fixedClass),e.trigger(Wt))};var i=document.createElement(dt),r=document.createElement(dt),o=document.createElement(dt),a=document.createElement(dt);return i.draggable=!1,r.appendChild(a),r.appendChild(o),i.appendChild(r),e.rootEl=i,e.trackEl=r,e.thumbEl=o,e.fillerEl=a,e._mouseInput=new Ln,e._touchInput=new Rn,e._motion=new Tn({duration:1,range:tn,easing:function(e){return e}}),e._bbox={x:0,y:0,width:0,height:0,left:0,right:0,bottom:0,top:0},e._fixedClass=ti.FIXED,e}return u(n,[{key:"init",value:function(e){var t=this._mouseInput,n=this._touchInput;this.rootEl.classList.add(e.RANGE_ROOT),this.trackEl.classList.add(e.RANGE_TRACK),this.thumbEl.classList.add(e.RANGE_THUMB),this.fillerEl.classList.add(e.RANGE_FILLER),this._fixedClass=e.FIXED,t.on(Yt,this._onHold),n.on(Yt,this._onHold),t.on(Wt,this._onRelease),n.on(Wt,this._onRelease),t.on(qt,this._onChange),n.on(qt,this._onChange),t.enable(this.rootEl),n.enable(this.rootEl),this.resize()}},{key:"destroy",value:function(){var e=this._mouseInput,t=this._touchInput;this.rootEl.className="",this.trackEl.className="",this.thumbEl.className="",this.fillerEl.className="",e.off(),t.off(),e.disable(),t.disable()}},{key:"resize",value:function(){this._bbox=this.trackEl.getBoundingClientRect()}},{key:"updateStyle",value:function(e){var t=this._bbox.width,n=_n(e,0,1);this.fillerEl.style.width="".concat(100*n,"%"),this.thumbEl.style.transform="translateX(".concat(n*t,"px)")}}]),n}(A),ri=function(e){c(n,e);var t=h(n);function n(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=i.position,o=void 0===r?ni.MAIN_TOP:r,a=i.order,s=void 0===a?9999:a;return l(this,n),(e=t.call(this,{position:o,order:s}))._onResize=function(){e._rangeControl.resize()},e._onTimeUpdate=function(){var t=e._video;t&&(e._currentTime=t.source.currentTime,e._rangeControl.updateStyle(e._currentTime/e._duration))},e._onDurationChange=function(){var t=e._video;t&&(e._duration=t.source.duration,e._rangeControl.updateStyle(e._currentTime/e._duration))},e._onHold=function(t){var n=e._video,i=e._controlBar;if(n&&i){var r=n.isPaused();n.source.pause();var o=n.source.duration*t;n.source.currentTime=o,n.source.dispatchEvent(new CustomEvent(on,{detail:{time:o}})),i.rootEl.classList.add(i.className.FIXED),e._wasPaused=!e._playPromise&&r}},e._onControl=function(t){var n=e._video;if(n){var i=n.source.duration*t;n.source.currentTime=i,n.source.dispatchEvent(new CustomEvent(on,{detail:{time:i}}))}},e._onRelease=function(){var t=e._video,n=e._controlBar;t&&n&&(e._wasPaused||e._playPromise||(e._playPromise=t.source.play().catch((function(){})),e._playPromise.then((function(){e._playPromise=null})),n.rootEl.classList.remove(n.className.FIXED))),e._wasPaused=!1},e.position=o,e.order=s,e._controlBar=null,e._rangeControl=new ii,e._video=null,e._wasPaused=!1,e._currentTime=0,e._duration=0,e._playPromise=null,e}return u(n,[{key:"element",get:function(){return this._rangeControl.rootEl}},{key:"init",value:function(e,t){var n,i=null===(n=e.mesh)||void 0===n?void 0:n.getTexture(),r=this.element,o=this._rangeControl,a=t.className.UNAVAILABLE;i&&i.isVideo()?(r.classList.remove(a),r.classList.add(t.className.PROGRESS_ROOT),e.on(Nt,this._onResize),i.source.addEventListener(st,this._onTimeUpdate),i.source.addEventListener(ut,this._onDurationChange),i.source.addEventListener(on,this._onTimeUpdate),o.init(t.className),o.on(Yt,this._onHold),o.on(qt,this._onControl),o.on(Wt,this._onRelease),this._video=i,this._currentTime=i.source.currentTime,this._duration=i.source.duration,this._controlBar=t,o.updateStyle(this._currentTime/this._duration)):r.classList.add(a)}},{key:"destroy",value:function(e){var t=this._video;e.off(Nt,this._onResize),t&&(t.source.removeEventListener(st,this._onTimeUpdate),t.source.removeEventListener(ut,this._onDurationChange),t.source.removeEventListener(on,this._onTimeUpdate)),this._rangeControl.destroy(),this._video=null,this._playPromise=null}}]),n}(ei),oi=function(e){c(n,e);var t=h(n);function n(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=i.position,o=void 0===r?ni.MAIN_LEFT:r,a=i.order,s=void 0===a?9999:a;return l(this,n),(e=t.call(this,{position:o,order:s}))._onClick=function(){var t=e._video;t&&(e._paused?t.source.play():t.source.pause())},e._onPlay=function(){if(e._controlBar){var t=e.element,n=e._controlBar.className;t.classList.add(n.PAUSE_BUTTON),t.classList.remove(n.PLAY_BUTTON),t.title="Pause Video",e._paused=!1}},e._onPause=function(){if(e._controlBar){var t=e.element,n=e._controlBar.className;t.classList.add(n.PLAY_BUTTON),t.classList.remove(n.PAUSE_BUTTON),t.title="Play Video",e._paused=!0}},e.element=document.createElement(vt),e._video=null,e._paused=!0,e._controlBar=null,e}return u(n,[{key:"init",value:function(e,t){var n,i=this.element,r=null===(n=e.mesh)||void 0===n?void 0:n.getTexture(),o=t.className,a=o.UNAVAILABLE;if(r&&r.isVideo()){i.classList.add(o.CONTROLS_BUTTON),i.classList.remove(a);var s=r.isPaused();this._video=r,this._paused=s,this._controlBar=t,s?this._onPause():this._onPlay(),i.addEventListener(Ze,this._onClick),r.source.addEventListener(it,this._onPlay),r.source.addEventListener(rt,this._onPause)}else i.classList.add(a)}},{key:"destroy",value:function(){var e=this._video,t=this.element;e&&(t.className="",t.removeEventListener(Ze,this._onClick),e.source.removeEventListener(it,this._onPlay),e.source.removeEventListener(rt,this._onPause),this._video=null,this._paused=!0,this._controlBar=null)}}]),n}(ei),ai=function(e){c(n,e);var t=h(n);function n(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=i.position,o=void 0===r?ni.MAIN_RIGHT:r,a=i.order,s=void 0===a?9999:a;return l(this,n),(e=t.call(this,{position:o,order:s}))._onResize=function(){e._rangeControl.resize(),e._updateDisplay()},e._onClick=function(){var t=e._video;t&&!e._rootEl.disabled&&(t.source.muted=!t.source.muted)},e._onVolumeChange=function(){var t=e._buttonEl,n=e._video,i=e._controlBar;if(n&&i){var r=i.className;n.source.muted||0===n.source.volume?(t.classList.add(r.MUTED_BUTTON),t.classList.remove(r.UNMUTED_BUTTON)):(t.classList.add(r.UNMUTED_BUTTON),t.classList.remove(r.MUTED_BUTTON)),e._updateDisplay()}},e._onHold=function(t){var n=e._video,i=e._controlBar;if(n&&i){var r=i.className;n.source.volume=t,e._rootEl.classList.add(r.FIXED),i.containerEl.classList.add(r.FIXED),e._updateDisplay()}},e._onChange=function(t){var n=e._video;n&&(n.source.volume=t,n.source.muted=!(t>0),e._updateDisplay())},e._onRelease=function(){var t=e._controlBar;if(t){var n=t.className;e._rootEl.classList.remove(n.FIXED),t.containerEl.classList.remove(n.FIXED)}},e._updateDisplay=function(){var t=e._video,n=e._rootEl;if(t)if(t.hasAudio()){n.disabled=!1;var i=t.source.muted?0:t.source.volume;e._rangeControl.updateStyle(i)}else n.disabled=!0},e._controlBar=null,e._rangeControl=new ii,e._createElements(),e._video=null,e}return u(n,[{key:"element",get:function(){return this._rootEl}},{key:"init",value:function(e,t){var n,i=null===(n=e.mesh)||void 0===n?void 0:n.getTexture(),r=this._rootEl,o=this._buttonEl,a=this._rangeControl,s=t.className,u=s.UNAVAILABLE;i&&i.isVideo()?(r.classList.remove(u),r.classList.add(s.CONTROLS_BUTTON),r.classList.add(s.VOLUME_ROOT),o.classList.add(s.CONTROLS_BUTTON),i.source.muted?o.classList.add(s.MUTED_BUTTON):o.classList.add(s.UNMUTED_BUTTON),e.on(Nt,this._onResize),r.addEventListener(ct,this._onResize),o.addEventListener(Ze,this._onClick),i.source.addEventListener(at,this._onVolumeChange),i.source.addEventListener(ot,this._updateDisplay),i.source.addEventListener(lt,this._updateDisplay),a.init(s),a.on(Yt,this._onHold),a.on(qt,this._onChange),a.on(Wt,this._onRelease),this._controlBar=t,this._video=i,this._updateDisplay()):r.classList.add(u)}},{key:"destroy",value:function(e){var t=this._video,n=this._buttonEl,i=this._rootEl;i.className="",n.className="",e.off(Nt,this._onResize),i.removeEventListener(ct,this._onResize),n.removeEventListener(Ze,this._onClick),t&&(t.source.removeEventListener(at,this._onVolumeChange),t.source.removeEventListener(ot,this._updateDisplay),t.source.removeEventListener(lt,this._updateDisplay)),this._controlBar=null,this._rangeControl.destroy(),this._video=null}},{key:"_createElements",value:function(){var e=document.createElement(vt),t=document.createElement(dt);e.appendChild(this._rangeControl.rootEl),e.appendChild(t),e.title="Toggle Mute",this._rootEl=e,this._buttonEl=t}}]),n}(ei),si=function(e){c(n,e);var t=h(n);function n(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=i.position,o=void 0===r?ni.MAIN_RIGHT:r,a=i.order,s=void 0===a?9999:a;return l(this,n),(e=t.call(this,{position:o,order:s}))._onClick=function(){var t=e._targetEl;t&&(bn()?e._exitFullscreen():e._requestFullscreen(t))},e._onFullscreenChange=function(){var t=e.element,n=e._controlBar;if(n){var i=n.className;bn()?(t.classList.add(i.FULLSCREEN_EXIT_BUTTON),t.classList.remove(i.FULLSCREEN_BUTTON)):(t.classList.add(i.FULLSCREEN_BUTTON),t.classList.remove(i.FULLSCREEN_EXIT_BUTTON))}},e.element=document.createElement(vt),e.element.title="Toggle Fullscreen",e._controlBar=null,e._targetEl=null,e}return u(n,[{key:"init",value:function(e,t){var n=this.element,i=t.className;this._fullscreenAvailable()?(n.classList.add(i.CONTROLS_BUTTON),n.classList.remove(i.UNAVAILABLE),n.addEventListener(Ze,this._onClick),this._addFullscreenHandlers(),bn()?n.classList.add(i.FULLSCREEN_EXIT_BUTTON):n.classList.add(i.FULLSCREEN_BUTTON),this._controlBar=t,this._targetEl=e.rootEl):n.classList.add(i.UNAVAILABLE)}},{key:"destroy",value:function(){var e=this.element;e.className="",e.removeEventListener(Ze,this._onClick),this._removeFullscreenHandlers(),this._controlBar=null,this._targetEl=null}},{key:"_fullscreenAvailable",value:function(){return Et.some((function(e){return!!document[e]}))}},{key:"_requestFullscreen",value:function(e){var t,n=r(Et);try{for(n.s();!(t=n.n()).done;){var i=e[t.value];if(i)return void i.call(e)}}catch(o){n.e(o)}finally{n.f()}}},{key:"_exitFullscreen",value:function(){var e,t=r(Tt);try{for(t.s();!(e=t.n()).done;){var n=e.value,i=document[n];if(i)return void i.call(document)}}catch(o){t.e(o)}finally{t.f()}}},{key:"_addFullscreenHandlers",value:function(){var e=this;xt.forEach((function(t){document.addEventListener(t,e._onFullscreenChange)}))}},{key:"_removeFullscreenHandlers",value:function(){var e=this;xt.forEach((function(t){document.removeEventListener(t,e._onFullscreenChange)}))}}]),n}(ei),ui=function(e){c(n,e);var t=h(n);function n(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=i.position,o=void 0===r?ni.MAIN_LEFT:r,a=i.order,s=void 0===a?9999:a;return l(this,n),(e=t.call(this,{position:o,order:s}))._onTimeUpdate=function(){var t=e._video;t&&(e._currentTime=t.source.currentTime,e._updateDisplay())},e._onDurationChange=function(){var t=e._video;t&&(e._duration=t.source.duration,e._updateDisplay())},e._onCustomTimeChange=function(t){e._currentTime=t.detail.time,e._updateDisplay()},e.element=document.createElement(dt),e._video=null,e._currentTime=0,e._duration=0,e}return u(n,[{key:"init",value:function(e,t){var n,i=null===(n=e.mesh)||void 0===n?void 0:n.getTexture(),r=this.element,o=t.className;i&&i.isVideo()?(r.classList.add(o.VIDEO_TIME_DISPLAY),r.classList.remove(o.UNAVAILABLE),i.source.addEventListener(st,this._onTimeUpdate),i.source.addEventListener(ut,this._onDurationChange),i.source.addEventListener(on,this._onCustomTimeChange),this._video=i,this._currentTime=i.source.currentTime,this._duration=i.source.duration,this._updateDisplay()):r.classList.add(o.UNAVAILABLE)}},{key:"destroy",value:function(){var e=this._video;e&&(this.element.className="",e.source.removeEventListener(st,this._onTimeUpdate),e.source.removeEventListener(ut,this._onDurationChange),e.source.removeEventListener(on,this._onCustomTimeChange),this._video=null)}},{key:"_updateDisplay",value:function(){var e=this._currentTime,t=Math.floor(e/60),n=Math.floor(e-60*t),i=n<10?"0".concat(n):n,r=this._duration,o=Math.floor(r/60),a=Math.floor(r-60*o),s=a<10?"0".concat(a):a;this.element.innerText="".concat(t,":").concat(i," / ").concat(o,":").concat(s)}}]),n}(ei),li=function(e){c(n,e);var t=h(n);function n(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=i.resetCamera,o=void 0===r||r,a=i.position,s=void 0===a?ni.TOP_RIGHT:a,u=i.order,c=void 0===u?9999:u;return l(this,n),(e=t.call(this,{position:s,order:c}))._onClick=function(){var t=e._viewer,n=e.resetCamera;if(t&&n){var i=gn(n),r=i.yaw,o=void 0===r?t.initialYaw:r,a=i.pitch,s=void 0===a?t.initialPitch:a,u=i.zoom,l=void 0===u?t.initialZoom:u,c=i.duration,h=void 0===c?500:c;t.camera.animateTo({yaw:o,pitch:s,zoom:l,duration:h})}},e._updatePie=function(t){var n=t.target,i=e._piePathEl,r=e._rangeCircleEl,o=n.camera,a=o.getHorizontalFov(),s=o.getYawRange(o.zoom),u=.5*a,l=24*Math.PI,c=l*a/360,h=l*(o.yaw+u+90)/360;if(i.setAttribute("stroke-dasharray","".concat(c," ").concat(l-c)),i.setAttribute("stroke-dashoffset","".concat(h)),isFinite(s.min)&&isFinite(s.max)){var d=45*Math.PI,v=(mn(s.min,-180,180)-u)/360,f=(mn(s.max,-180,180)+u)/360,_=d*Math.abs(f-v),p=-d*(v-.25);r.setAttribute("stroke-dasharray","".concat(_," ").concat(d-_)),r.setAttribute("stroke-dashoffset","".concat(p))}else r.setAttribute("stroke-dasharray",""),r.setAttribute("stroke-dashoffset","")},e.element=document.createElement(dt),e.element.title="Reset view",e.resetCamera=o,e._createPieElements(),e._viewer=null,e}return u(n,[{key:"init",value:function(e,t){var n=this.element;e.initialized?this._updatePie({target:e}):e.once(It,this._updatePie);var i=t.className.PIEVIEW_ROOT;n.classList.add(i),this.resetCamera&&n.addEventListener(Ze,this._onClick),e.on(Ft,this._updatePie),this._viewer=e}},{key:"destroy",value:function(e){var t=this.element;t.removeEventListener(Ze,this._onClick),t.className="",e.off(It,this._updatePie),e.off(Ft,this._updatePie),this._viewer=null}},{key:"_createPieElements",value:function(){var e=this.element,t=document.createElementNS(an,"svg");t.setAttribute("viewBox","0 0 48 48"),t.setAttribute("width","100%"),t.setAttribute("height","100%");var n=document.createElementNS(an,"circle");n.setAttribute("stroke","currentColor"),n.setAttribute("fill","transparent"),n.setAttribute("cx","24"),n.setAttribute("cy","24"),n.setAttribute("r","12"),n.setAttribute("stroke-width","24"),t.appendChild(n);var i=document.createElementNS(an,"circle");i.setAttribute("stroke","currentColor"),i.setAttribute("fill","transparent"),i.setAttribute("cx","24"),i.setAttribute("cy","24"),i.setAttribute("r","22.5"),i.setAttribute("stroke-width","3"),t.appendChild(i),e.appendChild(t),this._piePathEl=n,this._rangeCircleEl=i}}]),n}(ei),ci=function(e){c(n,e);var t=h(n);function n(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=i.position,o=void 0===r?ni.MAIN_RIGHT:r,a=i.order,s=void 0===a?9999:a;return l(this,n),(e=t.call(this,{position:o,order:s}))._onClick=function(){var t=e._viewer;t&&t.vr.enter()},e.element=document.createElement(vt),e.element.title="Enter VR",e._viewer=null,e}return u(n,[{key:"init",value:function(e,t){var n=this.element,i=t.className;n.classList.add(i.UNAVAILABLE),n.classList.add(i.VR_BUTTON),n.classList.add(i.CONTROLS_BUTTON),e.vr.isAvailable().then((function(e){e&&n.classList.remove(i.UNAVAILABLE)})),n.addEventListener(Ze,this._onClick),this._viewer=e}},{key:"destroy",value:function(){var e=this.element;e.className="",e.removeEventListener(Ze,this._onClick),this._viewer=null}}]),n}(ei),hi=function(e){c(n,e);var t=h(n);function n(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=i.position,o=void 0===r?ni.MAIN_RIGHT:r,a=i.order,s=void 0===a?9999:a;return l(this,n),(e=t.call(this,{position:o,order:s}))._onClick=function(){var t=e._viewer,n=e._controlBar;if(t&&n){var i=t.control.gyro;i.enabled?i.disable():Dn.requestSensorPermission().then((function(t){t?i.enable():e.element.classList.add(n.className.UNAVAILABLE)}))}},e._updateStyle=function(){var t=e.element,n=e._viewer,i=e._controlBar;if(n&&i){var r=n.control.gyro,o=i.className;r.enabled?(t.classList.add(o.GYRO_ENABLED),t.classList.remove(o.GYRO_DISABLED)):(t.classList.add(o.GYRO_DISABLED),t.classList.remove(o.GYRO_ENABLED))}},e.element=document.createElement(dt),e.element.title="Toggle gyroscope control",e}return u(n,[{key:"init",value:function(e,t){var n=this,i=this.element,r=t.className;i.addEventListener(Ze,this._onClick),i.classList.add(r.CONTROLS_BUTTON),i.classList.add(r.UNAVAILABLE);var o=function(){i.classList.remove(r.UNAVAILABLE),e.control.gyro.on(Xt,n._updateStyle),e.control.gyro.on(Kt,n._updateStyle)};wn()?o():Dn.isAvailable().then((function(e){e&&o()})),this._controlBar=t,this._viewer=e,this._updateStyle()}},{key:"destroy",value:function(e){var t=this.element;e.control.gyro.off(Xt,this._updateStyle),e.control.gyro.off(Kt,this._updateStyle),t.removeEventListener(Ze,this._onClick),t.className="",this._controlBar=null,this._viewer=null}}]),n}(ei),di=function(){function e(t,n){var i=this,r=n.initialDelay,o=void 0===r?3e3:r,a=n.delay,s=void 0===a?0:a,u=n.idleDelay,c=void 0===u?3e3:u;l(this,e),this._onMouseEnter=function(){i._isCursorInside=!0,i.show()},this._onMouseLeave=function(){i._isCursorInside=!1,i._hideAfterDelay()},this._onMouseMove=function(){i._isFullscreen&&i.showTemporaliy()},this._onHold=function(e){i._isGrabbing=!0,"mouse"===e.pointerType&&(i._isCursorInside=!0),window.addEventListener(Ue,i._onRelease),i.show()},this._onRelease=function(){i._isGrabbing=!1,window.removeEventListener(Ue,i._onRelease),i._hideAfterDelay()},this._onVideoPlay=function(){i._targetEl&&i._controlBar.containerEl.classList.remove(i._fixedClass)},this._onVideoPause=function(){i._targetEl&&i._controlBar.containerEl.classList.add(i._fixedClass)},this._onFullscreenChange=function(){i._isFullscreen=bn(),i._isFullscreen&&i._hideAfterDelay()},this._controlBar=t,this._initialDelay=o,this._delay=s,this._idleDelay=c,this._timer=-1,this._isCursorInside=!1,this._isGrabbing=!1,this._isFullscreen=!1,this._video=null,this._targetEl=null}return u(e,[{key:"enabled",get:function(){return!!this._targetEl}},{key:"hidden",get:function(){return this._controlBar.containerEl.classList.contains(this._hiddenClass)}},{key:"_hiddenClass",get:function(){return this._controlBar.className.HIDDEN}},{key:"_fixedClass",get:function(){return this._controlBar.className.FIXED}},{key:"enable",value:function(e){var t,n=this;this._targetEl&&this.disable(e);var i=this._initialDelay,r=e.rootEl;this._targetEl=e.rootEl,this._timer=window.setTimeout((function(){n.hide()}),i),r.addEventListener(Be,this._onHold),r.addEventListener(qe,this._onMouseEnter),r.addEventListener(Fe,this._onMouseMove),r.addEventListener(We,this._onMouseLeave),this._addFullscreenHandlers();var o=null===(t=e.mesh)||void 0===t?void 0:t.getTexture();o&&o.isVideo()&&(o.isPaused()&&this._controlBar.containerEl.classList.add(this._fixedClass),o.source.addEventListener(it,this._onVideoPlay),o.source.addEventListener(rt,this._onVideoPause),this._video=o)}},{key:"disable",value:function(e){if(this._targetEl){var t=this._controlBar,n=e.rootEl,i=this._video;n.removeEventListener(Be,this._onHold),window.removeEventListener(Ue,this._onRelease),n.removeEventListener(qe,this._onMouseEnter),n.removeEventListener(Fe,this._onMouseMove),n.removeEventListener(We,this._onMouseLeave),this._removeFullscreenHandlers(),window.clearTimeout(this._timer),t.containerEl.classList.remove(this._fixedClass),i&&(i.source.removeEventListener(it,this._onVideoPlay),i.source.removeEventListener(rt,this._onVideoPause)),this._isCursorInside=!1,this._isGrabbing=!1,this._video=null,this._targetEl=null}}},{key:"show",value:function(){this._clearHideTimer(),this._controlBar.containerEl.classList.remove(this._hiddenClass)}},{key:"showTemporaliy",value:function(){this.show(),this._hideAfterDelay(this._idleDelay)}},{key:"hide",value:function(){this._clearHideTimer(),this._controlBar.containerEl.classList.add(this._hiddenClass)}},{key:"_clearHideTimer",value:function(){this._timer&&(window.clearTimeout(this._timer),this._timer=-1)}},{key:"_hideAfterDelay",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._delay;this._isGrabbing||!this._isFullscreen&&this._isCursorInside||(this._clearHideTimer(),t<=0?this.hide():this._timer=window.setTimeout((function(){e.hide()}),t))}},{key:"_addFullscreenHandlers",value:function(){var e=this;xt.forEach((function(t){document.addEventListener(t,e._onFullscreenChange)}))}},{key:"_removeFullscreenHandlers",value:function(){var e=this;xt.forEach((function(t){document.removeEventListener(t,e._onFullscreenChange)}))}}]),e}(),vi=function(){function e(){var t=this;l(this,e),this._onKeyDown=function(e){var n=t._video;if(n){e.preventDefault(),e.stopPropagation();var i=n.source,r=null!=e.keyCode?ft[e.keyCode]:wt[e.key];switch(r){case"LEFT":case"RIGHT":return t._changeVideoTime(i,"RIGHT"===r);case"UP":case"DOWN":return t._changeVideoVolume(i,"UP"===r)}(32===e.keyCode||" "===e.key)&&t._toggleVideo(n)}}}return u(e,[{key:"enable",value:function(e,t){this._video=t,e.addEventListener(Xe,this._onKeyDown,!0)}},{key:"disable",value:function(e){this._video=null,e.removeEventListener(Xe,this._onKeyDown,!0)}},{key:"_changeVideoTime",value:function(e,t){var n=t?5:-5;e.currentTime+=n,e.dispatchEvent(new CustomEvent(on,{detail:{time:e.currentTime}}))}},{key:"_changeVideoVolume",value:function(e,t){var n=t?.1:-.1;e.muted?e.volume=_n(n,0,1):e.volume=_n(e.volume+n,0,1),e.volume>0?e.muted=!1:e.muted=!0}},{key:"_toggleVideo",value:function(e){e.isPaused()?e.source.play():e.source.pause()}}]),e}(),fi=function(){function e(){var t,n=this,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=i.autoHide,o=i.showBackground,a=i.clickToPlay,s=void 0===a||a,u=i.keyboardControls,c=void 0===u||u,h=i.progressBar,d=void 0===h||h,v=i.playButton,f=void 0===v||v,_=i.volumeButton,p=void 0===_||_,m=i.fullscreenButton,g=void 0===m||m,y=i.videoTime,b=void 0===y||y,w=i.pieView,E=void 0===w||w,k=i.vrButton,T=void 0===k||k,x=i.gyroButton,C=void 0===x||x,L=i.className,R=void 0===L?{}:L,O=i.customItems,A=void 0===O?[]:O;l(this,e),this._onStaticClick=function(e){var t,i=e.target,r=e.isTouch,o=n._autoHider;if(r){if(!o.enabled)return;o.hidden?o.showTemporaliy():o.hide()}else{if(!n.clickToPlay)return;var a=null===(t=i.mesh)||void 0===t?void 0:t.getTexture();if(!a||!a.isVideo())return;a.isPaused()?a.source.play():a.source.pause()}},this._onNewSrcLoad=function(e){var t=e.target,i=n._items;n._updateBackground(t),n._updateAutoHide(t),n._updateKeyboardHandler(t),Object.keys(i).forEach((function(e){i[e].forEach((function(e){e.destroy(t,n),e.init(t,n)}))}))},this.autoHide=r,this.showBackground=o,this.clickToPlay=s,this.keyboardControls=c,this.progressBar=d,this.playButton=f,this.volumeButton=p,this.fullscreenButton=g,this.videoTime=b,this.pieView=E,this.vrButton=T,this.gyroButton=C,this.className=Object.assign(Object.assign({},e.DEFAULT_CLASS),R);var I=null!==(t=R.CONTROLS_ROOT)&&void 0!==t?t:e.DEFAULT_CLASS.CONTROLS_ROOT;this._rootEl=hn(I),this._createPositionWrappers(),this._items=Object.keys(e.POSITION).reduce((function(t,n){return t[e.POSITION[n]]=[],t}),{}),this._customItems=A,this._autoHider=new di(this,gn(r)),this._videoControl=new vi,A.forEach((function(e){n._items[e.position].push(e)}))}return u(e,[{key:"rootEl",get:function(){return this._rootEl}},{key:"containerEl",get:function(){return this._containerEl}},{key:"backgroundEl",get:function(){return this._bgEl}},{key:"items",get:function(){return this._items}},{key:"customItems",get:function(){return this._customItems}},{key:"init",value:function(e){var t=e.rootEl,n=this._rootEl,i=this._createDefaultItems();this._updateBackground(e),this._updateAutoHide(e),this._updateKeyboardHandler(e),t.appendChild(n),this._addItem(e,i),this._addItem(e,this._customItems),e.on(Pt,this._onNewSrcLoad),e.on(Ut,this._onStaticClick)}},{key:"destroy",value:function(e){var t=this,n=e.rootEl,i=this._rootEl,r=this._items;i.parentElement===n&&n.removeChild(i),Object.keys(r).forEach((function(n){r[n].forEach((function(n){n.destroy(e,t)})),r[n]=[]})),this._clearItemElements(),this._autoHider.disable(e),this._videoControl.disable(n),e.off(Pt,this._onNewSrcLoad),e.off(Ut,this._onStaticClick)}},{key:"_addItem",value:function(e,t){var n,i=this,o=r(t);try{var a=function(){var t=n.value,r=i._items[t.position],o=i._wrapperEl[t.position],a=function(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n;return-1}(r,(function(e){return e.order>t.order}));if(a>=0){var s=r[a].element;r.splice(a,0,t),o.insertBefore(t.element,s)}else r.push(t),o.appendChild(t.element);t.init(e,i)};for(o.s();!(n=o.n()).done;)a()}catch(s){o.e(s)}finally{o.f()}}},{key:"_createPositionWrappers",value:function(){var t,i=Object.assign(Object.assign({},e.DEFAULT_CLASS),this.className),r=this._rootEl,o=hn(i.CONTROLS_BG),a=hn(i.CONTROLS_FLOAT_LEFT),s=hn(i.CONTROLS_FLOAT_RIGHT);r.appendChild(a),r.appendChild(s);var u=hn(i.CONTROLS_MAIN),l=hn(i.CONTROLS_TOP),c=hn(i.CONTROLS_BOTTOM),h=hn(i.CONTROLS_MID),d=hn(i.CONTROLS_LEFT),v=hn(i.CONTROLS_RIGHT);h.appendChild(d),h.appendChild(v),u.appendChild(o),u.appendChild(l),u.appendChild(h),u.appendChild(c),r.appendChild(u),this._bgEl=o,this._containerEl=u,this._wrapperEl=(n(t={},e.POSITION.MAIN_TOP,l),n(t,e.POSITION.MAIN_LEFT,d),n(t,e.POSITION.MAIN_RIGHT,v),n(t,e.POSITION.MAIN_BOTTOM,c),n(t,e.POSITION.TOP_LEFT,a),n(t,e.POSITION.TOP_RIGHT,s),t)}},{key:"_clearItemElements",value:function(){var t=this;Object.keys(e.POSITION).map((function(t){return e.POSITION[t]})).map((function(e){return t._wrapperEl[e]})).forEach((function(e){for(;e.firstChild;)e.removeChild(e.firstChild)}))}},{key:"_updateAutoHide",value:function(e){var t,n=this.autoHide,i=this._autoHider;if(null!=n)n?i.enable(e):i.disable(e);else{var r=null===(t=e.mesh)||void 0===t?void 0:t.getTexture();r&&r.isVideo()?i.enable(e):i.disable(e)}}},{key:"_updateBackground",value:function(t){var n,i,r=this._bgEl,o=this.showBackground,a=null!==(n=this.className.HIDDEN)&&void 0!==n?n:e.DEFAULT_CLASS.HIDDEN;if(null!=o)o?r.classList.remove(a):r.classList.add(a);else{var s=null===(i=t.mesh)||void 0===i?void 0:i.getTexture();s&&s.isVideo()?r.classList.remove(a):r.classList.add(a)}}},{key:"_updateKeyboardHandler",value:function(e){var t,n=e.rootEl,i=this._videoControl,r=null===(t=e.mesh)||void 0===t?void 0:t.getTexture();this.keyboardControls&&r&&r.isVideo()?i.enable(n,r):i.disable(n)}},{key:"_createDefaultItems",value:function(){var e=[];return this.progressBar&&e.push(new ri(gn(this.progressBar))),this.playButton&&e.push(new oi(gn(this.playButton))),this.volumeButton&&e.push(new ai(gn(this.volumeButton))),this.gyroButton&&e.push(new hi(gn(this.gyroButton))),this.vrButton&&e.push(new ci(gn(this.vrButton))),this.fullscreenButton&&e.push(new si(gn(this.fullscreenButton))),this.videoTime&&e.push(new ui(gn(this.videoTime))),this.pieView&&e.push(new li(gn(this.pieView))),e}}]),e}();fi.DEFAULT_CLASS=ti,fi.POSITION=ni;var _i=function(){function e(t){var n=t.src,i=t.video,r=void 0!==i&&i;l(this,e),this.src=n,this.video=r}return u(e,[{key:"updateCamera",value:function(e){e.resetRange()}},{key:"updateControl",value:function(e){e.ignoreZoomScale=!1}}]),e}(),pi=function(){function e(){l(this,e),this.needsUpdate=!0}return u(e,[{key:"destroy",value:function(e){}}]),e}(),mi=function(e){c(n,e);var t=h(n);function n(e,i){var r;return l(this,n),(r=t.call(this)).vao=e,r.program=i,r}return u(n,[{key:"destroy",value:function(e){e.releaseVAO(this.vao),e.releaseShaderResources(this.program)}},{key:"getTexture",value:function(){return this.program.uniforms.uTexture.texture}}]),n}($n),gi=u((function e(t,n,i,r){l(this,e),this.program=t.createProgram(n,i),this.uniforms=r,this.uniformLocations=t.getUniformLocations(this.program,r)})),yi=u((function e(t,n){l(this,e),this.data=t,this.itemSize=n,this.count=t.length/n})),bi=u((function e(t,n,i){l(this,e),this.vertices=new yi(new Float32Array(t),3),this.indicies=new yi(new Uint16Array(n),1),this.uvs=new yi(new Float32Array(i),2)})),wi=function(e){c(n,e);var t=h(n);function n(e,i){var r;return l(this,n),(r=t.call(this)).texture=i,r._webglTexture=e.createWebGLTexture(i),r}return u(n,[{key:"destroy",value:function(e){this.texture.destroy(),e.deleteTexture(this._webglTexture)}},{key:"update",value:function(e,t,n){var i=this.texture,r=i.isVideo();e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,i.flipY),e.uniform1i(t,0),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,this._webglTexture),!r&&n?e.texSubImage2D(e.TEXTURE_2D,0,0,0,e.RGBA,e.UNSIGNED_BYTE,i.source):e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,i.source),r||(this.needsUpdate=!1)}}]),n}(pi),Ei="#define GLSLIFY 1\nuniform sampler2D uTexture;varying highp vec2 vUV;void main(){gl_FragColor=texture2D(uTexture,vUV.st);}",ki=function(e){c(n,e);var t=h(n);function n(){l(this,n);var e,i,r=60,o=-.5*Math.PI,a=[],s=[],u=[];for(e=0;e<=60;e++){var c=(e/60-.5)*Math.PI,h=Math.sin(c),d=Math.cos(c);for(i=0;i<=r;i++){var v=2*(i/r-.5)*Math.PI+o,f=Math.sin(v),_=Math.cos(v)*d,p=h,m=f*d,g=i/r,y=e/60;if(a.push(g,y),s.push(_,p,m),i!==r&&60!==e){var b=61*e+i,w=b+r+1;u.push(b,b+1,w,w,b+1,w+1)}}}return t.call(this,s,u,a)}return u(n)}(bi),Ti=function(e){c(n,e);var t=h(n);function n(e){return l(this,n),t.call(this,e)}return u(n,[{key:"createMesh",value:function(e,t){var n={uTexture:new wi(e,t)},i=new ki,r=new gi(e,"#define GLSLIFY 1\nattribute vec3 position;attribute vec2 uv;uniform mat4 uMVMatrix;uniform mat4 uPMatrix;varying highp vec2 vUV;void main(){vUV=uv;gl_Position=uPMatrix*uMVMatrix*vec4(position,1.0);}",Ei,n),o=e.createVAO(i,r);return new mi(o,r)}}]),n}(_i),xi=function(e){c(n,e);var t=h(n);function n(e){var i;return l(this,n),(i=t.call(this)).val=e,i}return u(n,[{key:"update",value:function(e,t){e.uniform1f(t,this.val),this.needsUpdate=!1}}]),n}(pi),Ci=function(e){c(i,e);var n=h(i);function i(e){var t;return l(this,i),(t=n.call(this)).val=e,t}return u(i,[{key:"update",value:function(e,n){e.uniform4fv(n,this.val.reduce((function(e,n){return[].concat(t(e),t(n))}),[])),this.needsUpdate=!1}}]),i}(pi);(function(e){c(n,e);var t=h(n);function n(e){var i;return l(this,n),(i=t.call(this,e))._mode=e.mode,i}return u(n,[{key:"createMesh",value:function(e,t){var i,r;if(this._mode===n.MODE.LEFT_RIGHT)i=[.5,1,0,0],r=[.5,1,.5,0];else i=[1,.5,0,0],r=[1,.5,0,.5];var o={uTexture:new wi(e,t),uEye:new xi(0),uTexScaleOffset:new Ci([i,r])},a=new ki,s=new gi(e,"#define GLSLIFY 1\nattribute vec3 position;attribute vec2 uv;uniform mat4 uMVMatrix;uniform mat4 uPMatrix;uniform vec4 uTexScaleOffset[2];uniform float uEye;varying highp vec2 vUV;void main(){vec4 scaleOffset=uTexScaleOffset[int(uEye)];vUV=uv.xy*scaleOffset.xy+scaleOffset.zw;gl_Position=uPMatrix*uMVMatrix*vec4(position,1.0);}",Ei,o),u=e.createVAO(a,s);return new mi(u,s)}}]),n}(_i)).MODE={LEFT_RIGHT:"left_right",TOP_BOTTOM:"top_bottom"};var Li=T('<canvas class="view360-canvas"></canvas>'),Ri=T('<video id="view360-video" playsinline crossorigin="anonymous" style="display: none;"></video>');o("default",(function(){var t,n=s.objs.filter((function(e){return e.type===d.VIDEO}));0===n.length&&(n=[s.obj]),_((function(){var e=document.getElementById("view360-container"),n=document.getElementById("view360-video");e&&n&&(t=new Jn(e,{projection:new Ti({src:n,video:{autoplay:p("video_autoplay")}}),plugins:[new fi({pieView:{order:0},gyroButton:{position:"top-right",order:1},vrButton:{position:"top-right",order:2}})]}))})),m((function(){var e;return null===(e=t)||void 0===e?void 0:e.destroy()}));var i=e(g(!1),2),r=(i[0],i[1]);return b(x,{onAutoNextChange:r,get children(){return b(w,{w:"$full",h:"60vh",id:"video360-player",get children(){return b(w,{w:"100%",h:"100%",id:"view360-container",className:"view360-container",get children(){return[Li.cloneNode(!0),(e=Ri.cloneNode(!0),E((function(){return k(e,"src",s.raw_url)})),e)];var e}})}})}})}))}}}))}();
|