@openlist-frontend/openlist-frontend 4.2.0 → 4.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (175) hide show
  1. package/dist/VERSION +1 -1
  2. package/dist/assets/polyfills-legacy-h7H8XqQx.js +1 -0
  3. package/dist/i18n.tar.gz +0 -0
  4. package/dist/index.html +1 -1
  5. package/dist/lite/VERSION +1 -1
  6. package/dist/lite/assets/{2fa-Cpwit0Sr.js → 2fa-DTutmNbf.js} +1 -1
  7. package/dist/lite/assets/{2fa-legacy-BV80Xmmb.js → 2fa-legacy-DbBySHVF.js} +1 -1
  8. package/dist/lite/assets/{About-Cu2-75RR.js → About-_hJuNaH_.js} +1 -1
  9. package/dist/lite/assets/{About-legacy-C37sOQhm.js → About-legacy-CaLm7kbI.js} +1 -1
  10. package/dist/lite/assets/{AddOrEdit-Wdbp4PWO.js → AddOrEdit-49-UQtaG.js} +1 -1
  11. package/dist/lite/assets/{AddOrEdit-BWduAPOa.js → AddOrEdit-BCTuahUP.js} +1 -1
  12. package/dist/lite/assets/{AddOrEdit-CZnPofX2.js → AddOrEdit-Bgz6_5Sb.js} +1 -1
  13. package/dist/lite/assets/{AddOrEdit-cxf_NyVS.js → AddOrEdit-CbKEYHAy.js} +1 -1
  14. package/dist/lite/assets/{AddOrEdit-legacy-DAXPEGkN.js → AddOrEdit-legacy-CcWxIJSY.js} +1 -1
  15. package/dist/lite/assets/{AddOrEdit-legacy-2bg6358l.js → AddOrEdit-legacy-DOf8eTkz.js} +1 -1
  16. package/dist/lite/assets/{AddOrEdit-legacy-BB_Q5cWC.js → AddOrEdit-legacy-DvuS1lGq.js} +1 -1
  17. package/dist/lite/assets/{AddOrEdit-legacy-Bi5RkSpR.js → AddOrEdit-legacy-SS88nL_8.js} +1 -1
  18. package/dist/lite/assets/Common-7SPE00KT.js +1 -0
  19. package/dist/lite/assets/{Common-SxI9gPMx.js → Common-DKBpZ31X.js} +1 -1
  20. package/dist/lite/assets/{Common-legacy-DlpN8uIa.js → Common-legacy-B179Edqf.js} +1 -1
  21. package/dist/lite/assets/Common-legacy-DG884Joe.js +1 -0
  22. package/dist/lite/assets/{Copy-DTFns9Y1.js → Copy-BQypLOnU.js} +1 -1
  23. package/dist/lite/assets/{Copy-legacy-B72Ffy5O.js → Copy-legacy-CHg9MrvY.js} +1 -1
  24. package/dist/lite/assets/{Decompress-legacy-CZ_oH15V.js → Decompress-legacy-Cb2O6mH9.js} +1 -1
  25. package/dist/lite/assets/{Decompress-BPew2ezc.js → Decompress-sZhi71xA.js} +1 -1
  26. package/dist/lite/assets/{DeletePopover-cSxOxJZY.js → DeletePopover-9knkuVst.js} +1 -1
  27. package/dist/lite/assets/{DeletePopover-legacy-CBtUkOSh.js → DeletePopover-legacy-KFuQEYkg.js} +1 -1
  28. package/dist/lite/assets/{File-D7bnUBYC.js → File-Cm5ZVXiU.js} +1 -1
  29. package/dist/lite/assets/{File-legacy-aPuubWt-.js → File-legacy-BghKHFM3.js} +1 -1
  30. package/dist/lite/assets/{Folder-legacy-Bp34_ra2.js → Folder-legacy-rxbbWmwF.js} +1 -1
  31. package/dist/lite/assets/{Folder-DdumvcC1.js → Folder-u_3vXWLj.js} +3 -3
  32. package/dist/lite/assets/{Grid-C9qEJXle.js → Grid-CQOeEHng.js} +1 -1
  33. package/dist/lite/assets/{Grid-legacy-DFmTlJOv.js → Grid-legacy-CZ5i1Iq2.js} +1 -1
  34. package/dist/lite/assets/{GridItem-Cb9pnioW.js → GridItem-BnM21uyA.js} +1 -1
  35. package/dist/lite/assets/{GridItem-legacy-8gNLCEoo.js → GridItem-legacy-iFmz7kDs.js} +1 -1
  36. package/dist/lite/assets/{Images-C_Ql-iwF.js → Images-DohfDDrf.js} +1 -1
  37. package/dist/lite/assets/{Images-legacy-CoWBNLGZ.js → Images-legacy-4WKrTzml.js} +1 -1
  38. package/dist/lite/assets/{Layout-BQJH47LI.js → Layout-Dq3Tblc3.js} +4 -4
  39. package/dist/lite/assets/{Layout-legacy-MFuRQRbi.js → Layout-legacy-BqI9aaEd.js} +1 -1
  40. package/dist/lite/assets/{List-Dp5qYO6K.js → List-CKWRuz8M.js} +1 -1
  41. package/dist/lite/assets/{List-legacy-LpRbqCuW.js → List-legacy-CfJa4V_M.js} +1 -1
  42. package/dist/lite/assets/{Messenger-m_DjhhjC.js → Messenger-Csg3VDhD.js} +1 -1
  43. package/dist/lite/assets/{Messenger-legacy-qy8NmzD_.js → Messenger-legacy-Aqu2TXLS.js} +1 -1
  44. package/dist/lite/assets/{Metas-BW-d9X3k.js → Metas-CFhxnUzn.js} +1 -1
  45. package/dist/lite/assets/{Metas-legacy-DF5C5c9k.js → Metas-legacy-CpZKT74d.js} +1 -1
  46. package/dist/lite/assets/{Move-Btb_epTo.js → Move-Bp7Hz-5A.js} +1 -1
  47. package/dist/lite/assets/{Move-legacy-CkLWtx_Y.js → Move-legacy-iko-6o08.js} +1 -1
  48. package/dist/lite/assets/{Other-D3tOfd7k.js → Other-CmK2wAaG.js} +1 -1
  49. package/dist/lite/assets/{Other-legacy-Cx6-rrJn.js → Other-legacy-BfsPMHAC.js} +1 -1
  50. package/dist/lite/assets/{PackageDownload-C4OIBiuO.js → PackageDownload-DAD_3hcp.js} +1 -1
  51. package/dist/lite/assets/{PackageDownload-legacy-D6wcXpsR.js → PackageDownload-legacy-CYUHsuep.js} +1 -1
  52. package/dist/lite/assets/{Password-DOgJvyE0.js → Password-CsEn2L1J.js} +1 -1
  53. package/dist/lite/assets/{Password-legacy-Dau7Rj6C.js → Password-legacy-C_ug59KC.js} +1 -1
  54. package/dist/lite/assets/{Profile-vc4L2vOh.js → Profile-DE1w63ju.js} +1 -1
  55. package/dist/lite/assets/{Profile-legacy-CG7V6K6c.js → Profile-legacy-BccA5tXg.js} +1 -1
  56. package/dist/lite/assets/{PublicKeys-BhL22dhK.js → PublicKeys-DhLQRXa5.js} +1 -1
  57. package/dist/lite/assets/{PublicKeys-legacy-w8t5s90k.js → PublicKeys-legacy-Dm2rmP-Z.js} +1 -1
  58. package/dist/lite/assets/{ResponsiveGrid--eNaea9R.js → ResponsiveGrid-CPv65KKk.js} +1 -1
  59. package/dist/lite/assets/{ResponsiveGrid-legacy-BcOgU6tQ.js → ResponsiveGrid-legacy-B09IQ8PO.js} +1 -1
  60. package/dist/lite/assets/{S3-D5KR0Y4t.js → S3-3qppG_kP.js} +1 -1
  61. package/dist/lite/assets/{S3-legacy-DwkNpjzH.js → S3-legacy-GtHjMhMP.js} +1 -1
  62. package/dist/lite/assets/{SettingItem-gAxndiQS.js → SettingItem-BNkjHZxi.js} +1 -1
  63. package/dist/lite/assets/{SettingItem-legacy-CoygdggD.js → SettingItem-legacy-DhwPjjh6.js} +1 -1
  64. package/dist/lite/assets/{Shares-DYa-7p_E.js → Shares-CxJ5bbP4.js} +1 -1
  65. package/dist/lite/assets/{Shares-legacy-CD4V2Nkm.js → Shares-legacy-bRg_GWJc.js} +1 -1
  66. package/dist/lite/assets/{Storages-B0C3wLOw.js → Storages-CiA0_Ux3.js} +1 -1
  67. package/dist/lite/assets/{Storages-legacy-Hu3NLgcV.js → Storages-legacy-nNc5p2x6.js} +1 -1
  68. package/dist/lite/assets/{Upload-CujV1cl2.js → Upload-6mLh9vS_.js} +1 -1
  69. package/dist/lite/assets/{Upload-CoXrosgy.js → Upload-LroLcc--.js} +1 -1
  70. package/dist/lite/assets/{Upload-legacy-BrGogy7u.js → Upload-legacy-DzBqXsqi.js} +1 -1
  71. package/dist/lite/assets/{Upload-legacy-ipwT0CGa.js → Upload-legacy-YbbM49hO.js} +1 -1
  72. package/dist/lite/assets/{Users-CQMS_vRF.js → Users-Cebos0QK.js} +1 -1
  73. package/dist/lite/assets/{Users-legacy-CMqmVwDR.js → Users-legacy-D4Ji7uVA.js} +1 -1
  74. package/dist/lite/assets/{aliyun_video-BPU9Winc.js → aliyun_video-DMomVZ86.js} +1 -1
  75. package/dist/lite/assets/{aliyun_video-legacy-DqXKJ6bJ.js → aliyun_video-legacy-BVrXTQ7C.js} +1 -1
  76. package/dist/lite/assets/{archive-CFoJgIJg.js → archive-iaznZ7i5.js} +1 -1
  77. package/dist/lite/assets/{archive-legacy-CbLxcvcU.js → archive-legacy-BTi-FFWj.js} +1 -1
  78. package/dist/lite/assets/{artplayer-CKFboV1K.js → artplayer-GcZA8xWm.js} +1 -1
  79. package/dist/lite/assets/{artplayer-legacy-nsuIJ8X1.js → artplayer-legacy-0q8fSTli.js} +1 -1
  80. package/dist/lite/assets/{asciinema-Co15uYSl.js → asciinema-hP2thET0.js} +1 -1
  81. package/dist/lite/assets/{asciinema-legacy-cldShqIF.js → asciinema-legacy-HM3pomQn.js} +1 -1
  82. package/dist/lite/assets/{audio-DN7yh-1u.js → audio-CEdHvJQm.js} +1 -1
  83. package/dist/lite/assets/{audio-legacy-ZcTFmCaq.js → audio-legacy-Bf3rfImY.js} +1 -1
  84. package/dist/lite/assets/{backup-restore-CyTdjYa5.js → backup-restore-BI1XH72_.js} +1 -1
  85. package/dist/lite/assets/{backup-restore-legacy-4843qwpn.js → backup-restore-legacy-o4-z3xf2.js} +1 -1
  86. package/dist/lite/assets/{cg-BoXizs5U.js → cg-Cugc4PRy.js} +1 -1
  87. package/dist/lite/assets/{cg-legacy-B6dnZxHN.js → cg-legacy-en8-FR60.js} +1 -1
  88. package/dist/lite/assets/{doc-CwFJHCye.js → doc-Dx8w2-z-.js} +1 -1
  89. package/dist/lite/assets/{doc-legacy-BcqyYqI8.js → doc-legacy-Cirxey5M.js} +1 -1
  90. package/dist/lite/assets/{download-BWIL9ZbS.js → download-D5HXXjYD.js} +1 -1
  91. package/dist/lite/assets/{download-legacy-BRxDfnJM.js → download-legacy-BtfDXiWv.js} +1 -1
  92. package/dist/lite/assets/{flash-Do4k4HF4.js → flash-D3tyxPhf.js} +1 -1
  93. package/dist/lite/assets/{flash-legacy-Dth0lnEy.js → flash-legacy-C4GlbMx5.js} +1 -1
  94. package/dist/lite/assets/{heic-BQ1sxr--.js → heic-DddGOj_0.js} +1 -1
  95. package/dist/lite/assets/{heic-legacy-D7C3AFkl.js → heic-legacy-B6Y5cyvF.js} +1 -1
  96. package/dist/lite/assets/{helper-COm3HMuR.js → helper-DZTPC0ym.js} +1 -1
  97. package/dist/lite/assets/{helper-CW89pSnh.js → helper-DcuvUci3.js} +1 -1
  98. package/dist/lite/assets/{helper-legacy-CRIrgp8-.js → helper-legacy-Cuhr9yhF.js} +1 -1
  99. package/dist/lite/assets/{helper-legacy-CmC0lRkW.js → helper-legacy-qY9yuzKw.js} +1 -1
  100. package/dist/lite/assets/{html-BH-siIo1.js → html-TrHlpF58.js} +1 -1
  101. package/dist/lite/assets/{html-legacy-C6F-KW6p.js → html-legacy-RtqGGa31.js} +1 -1
  102. package/dist/lite/assets/{icon-I31eZk5I.js → icon-TcP3LdUy.js} +1 -1
  103. package/dist/lite/assets/{icon-legacy-Cmi1b15o.js → icon-legacy-CCjPA35g.js} +1 -1
  104. package/dist/lite/assets/{im-32Y5iioc.js → im-Bfh3t-9k.js} +1 -1
  105. package/dist/lite/assets/{im-legacy-CuBPXwQP.js → im-legacy-bfeqh7q-.js} +1 -1
  106. package/dist/lite/assets/{image-Cn7F3i7p.js → image-CHfw1saX.js} +1 -1
  107. package/dist/lite/assets/{image-legacy-BdZBZ4I3.js → image-legacy-FyBUH0Wv.js} +1 -1
  108. package/dist/lite/assets/{index-BdrlLL7h.js → index-Do6wV20T.js} +4 -4
  109. package/dist/lite/assets/{index-legacy-DVVw2Tdl.js → index-legacy-DX8ZPqos.js} +1 -1
  110. package/dist/lite/assets/{index_page-CI4452wz.js → index_page-Ci6zIIEm.js} +1 -1
  111. package/dist/lite/assets/{index_page-legacy-DpZgbky_.js → index_page-legacy-Dia6n6V8.js} +1 -1
  112. package/dist/lite/assets/{info-4RJdJqGX.js → info-Eur0D5WL.js} +1 -1
  113. package/dist/lite/assets/{info-legacy-D81BT5je.js → info-legacy-DSnpfN_T.js} +1 -1
  114. package/dist/lite/assets/{ipa-BRMsKQrP.js → ipa-QQId27CM.js} +1 -1
  115. package/dist/lite/assets/{ipa-legacy-DxYHqNRr.js → ipa-legacy-Dk-qFvQl.js} +1 -1
  116. package/dist/lite/assets/{login-DSgwb8b8.js → login-DNWEpAg4.js} +1 -1
  117. package/dist/lite/assets/{login-legacy-CE4m2hrW.js → login-legacy-X5eqwtmJ.js} +1 -1
  118. package/dist/lite/assets/{manage-Bn2g6-4u.js → manage-BoJn00at.js} +2 -2
  119. package/dist/lite/assets/{manage-legacy-Ctq_PlSk.js → manage-legacy-BWRpx6eL.js} +1 -1
  120. package/dist/lite/assets/markdown-BeLwer8m.js +1 -0
  121. package/dist/lite/assets/{markdown-legacy-SrX3ihxa.js → markdown-legacy-DqCEmWHU.js} +1 -1
  122. package/dist/lite/assets/{markdown_with_word_wrap-CTF7F6kA.js → markdown_with_word_wrap-Ck5Le6kt.js} +1 -1
  123. package/dist/lite/assets/{markdown_with_word_wrap-legacy-5S3gtO5K.js → markdown_with_word_wrap-legacy-B778apZq.js} +1 -1
  124. package/dist/lite/assets/{offline_download-DplxhzId.js → offline_download-BxvK9sas.js} +1 -1
  125. package/dist/lite/assets/{offline_download-legacy-D-fNKFYv.js → offline_download-legacy-Sn7LVNoj.js} +1 -1
  126. package/dist/lite/assets/{open-with-DB-thDwq.js → open-with-Dm0Xiltd.js} +1 -1
  127. package/dist/lite/assets/{open-with-legacy-BV0zWWih.js → open-with-legacy-CzqkMUrw.js} +1 -1
  128. package/dist/lite/assets/{operations-DUc1_ZG_.js → operations-DtIJGjr3.js} +1 -1
  129. package/dist/lite/assets/{operations-legacy-D7uRiFrF.js → operations-legacy-x4qCe3Nr.js} +1 -1
  130. package/dist/lite/assets/{plist-Bdtf7mmC.js → plist-I5MRvpO4.js} +1 -1
  131. package/dist/lite/assets/{plist-legacy-BUgj41A2.js → plist-legacy-BjlqWsae.js} +1 -1
  132. package/dist/lite/assets/polyfills-legacy-CY-LI3wc.js +1 -0
  133. package/dist/lite/assets/{ppt-legacy-CfobOD2q.js → ppt-legacy-BauMuKYT.js} +1 -1
  134. package/dist/lite/assets/{ppt-CQUs3gCH.js → ppt-sj6qWvel.js} +1 -1
  135. package/dist/lite/assets/{previews-ikRB1E3g.js → previews-C3V57ws2.js} +2 -2
  136. package/dist/lite/assets/{previews-legacy-BOyZeoEk.js → previews-legacy-C_1n4grk.js} +1 -1
  137. package/dist/lite/assets/{rehype-katex-PXUO2tmG.js → rehype-katex-fpXCKXq-.js} +1 -1
  138. package/dist/lite/assets/{rehype-katex-legacy-l00blOnq.js → rehype-katex-legacy-t-Y3uu45.js} +1 -1
  139. package/dist/lite/assets/{remark-math-B2pF2g5L.js → remark-math-DmyB6UtF.js} +1 -1
  140. package/dist/lite/assets/{remark-math-legacy-C2fL8O2-.js → remark-math-legacy-BxMiMhBe.js} +1 -1
  141. package/dist/lite/assets/{ri-BpBjk-eu.js → ri-Co752El1.js} +1 -1
  142. package/dist/lite/assets/{ri-legacy-DF_J6UvM.js → ri-legacy-C5_hBj57.js} +1 -1
  143. package/dist/lite/assets/{si-CExwmFBP.js → si-8vtL5WDZ.js} +1 -1
  144. package/dist/lite/assets/{si-legacy-CM4ZmTcr.js → si-legacy-CRNlhjOc.js} +1 -1
  145. package/dist/lite/assets/{solid-contextmenu-DNoyC52a.js → solid-contextmenu-Q14whW6u.js} +1 -1
  146. package/dist/lite/assets/{solid-contextmenu-legacy-DSVwqGw2.js → solid-contextmenu-legacy-sZs92FT7.js} +1 -1
  147. package/dist/lite/assets/{store-BgSFahAe.js → store-jmqpI8w9.js} +1 -1
  148. package/dist/lite/assets/{store-legacy-DEv5m7Se.js → store-legacy-CI1UFD5I.js} +1 -1
  149. package/dist/lite/assets/test-VgTEJWSX.js +1 -0
  150. package/dist/lite/assets/{test-legacy-CwP5y5rh.js → test-legacy-BRB5AFL9.js} +1 -1
  151. package/dist/lite/assets/{text-editor-CXH-M_d8.js → text-editor-DN-5m547.js} +1 -1
  152. package/dist/lite/assets/{text-editor-legacy-Bvg6h1LG.js → text-editor-legacy-DlNbA4NX.js} +1 -1
  153. package/dist/lite/assets/{ti-DorTQHjy.js → ti-CJTnvYDC.js} +1 -1
  154. package/dist/lite/assets/{ti-legacy-BLnieiZv.js → ti-legacy-C5F9deYz.js} +1 -1
  155. package/dist/lite/assets/{url-CrBOHT0m.js → url-Dc_ERS90.js} +1 -1
  156. package/dist/lite/assets/{url-legacy-BlD6ZzNt.js → url-legacy-DqRcH2qB.js} +1 -1
  157. package/dist/lite/assets/{video-2Qz8WbEM.js → video-CMVGTs9H.js} +1 -1
  158. package/dist/lite/assets/{video-legacy-CZofzk3c.js → video-legacy-CARCtj8A.js} +1 -1
  159. package/dist/lite/assets/{video360-DUQPJklE.js → video360-Cn4J_avk.js} +1 -1
  160. package/dist/lite/assets/{video360-legacy-t7FzLnsS.js → video360-legacy-QrceD6P2.js} +1 -1
  161. package/dist/lite/assets/{video_box-wwi7WLeT.js → video_box-BpjZ-ZST.js} +1 -1
  162. package/dist/lite/assets/{video_box-legacy-B4dnjnjL.js → video_box-legacy-DJTbgfFE.js} +1 -1
  163. package/dist/lite/assets/{vs-DQyKZ4nV.js → vs-D6iduhy9.js} +1 -1
  164. package/dist/lite/assets/{vs-legacy-Gzvbg9kw.js → vs-legacy-HDoHHJI2.js} +1 -1
  165. package/dist/lite/assets/{xls-UBX1oyWL.js → xls-B0hoyRio.js} +1 -1
  166. package/dist/lite/assets/{xls-legacy-BTO_I1zz.js → xls-legacy-B5QjbgBE.js} +1 -1
  167. package/dist/lite/i18n.tar.gz +0 -0
  168. package/dist/lite/index.html +2 -2
  169. package/package.json +1 -1
  170. package/dist/assets/polyfills-legacy-3zNmgeF1.js +0 -1
  171. package/dist/lite/assets/Common-GRQCAwrU.js +0 -1
  172. package/dist/lite/assets/Common-legacy-eXCYBqpA.js +0 -1
  173. package/dist/lite/assets/markdown-BDzlyh3V.js +0 -1
  174. package/dist/lite/assets/polyfills-legacy-D9TUrbOt.js +0 -1
  175. package/dist/lite/assets/test-Bp2AX12i.js +0 -1
@@ -1 +1 @@
1
- System.register(["./store-legacy-DEv5m7Se.js","./video_box-legacy-B4dnjnjL.js"],function(t,e){var i,s,n,o,r,a,h,l,c,u,d,_,p,m,E,g,v,f,T,b,w,y,C,R,O,L,I,A,N,x,S,M,P,D,U,B,k,F,V,z,H,G,Y,W,j,q,K,X,Z,$,Q,J,tt,et,it,st,nt,ot,rt,at,ht,lt,ct,ut,dt,_t,pt,mt,Et,gt,vt,ft,Tt,bt,wt,yt,Ct,Rt,Ot,Lt,It,At,Nt,xt,St,Mt,Pt,Dt,Ut,Bt,kt,Ft,Vt,zt,Ht,Gt,Yt,Wt,jt,qt,Kt,Xt,Zt,$t,Qt,Jt,te,ee,ie,se,ne,oe,re,ae,he,le,ce,ue,de,_e,pe,me,Ee,ge,ve,fe,Te,be,we,ye,Ce,Re,Oe,Le,Ie,Ae,Ne,xe,Se,Me,Pe,De,Ue,Be,ke,Fe,Ve,ze,He,Ge;function Ye(t,e){var i="function"==typeof Symbol&&t[Symbol.iterator];if(!i)return t;var s,n,o=i.call(t),r=[];try{for(;(void 0===e||e-- >0)&&!(s=o.next()).done;)r.push(s.value)}catch(a){n={error:a}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}return r}function We(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(Ye(arguments[e]));return t}function je(){var t=new v(16);return v!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function qe(t,e,i){var s=e[0],n=e[1],o=e[2],r=e[3],a=e[4],h=e[5],l=e[6],c=e[7],u=e[8],d=e[9],_=e[10],p=e[11],m=e[12],E=e[13],g=e[14],v=e[15],f=i[0],T=i[1],b=i[2],w=i[3];return t[0]=f*s+T*a+b*u+w*m,t[1]=f*n+T*h+b*d+w*E,t[2]=f*o+T*l+b*_+w*g,t[3]=f*r+T*c+b*p+w*v,f=i[4],T=i[5],b=i[6],w=i[7],t[4]=f*s+T*a+b*u+w*m,t[5]=f*n+T*h+b*d+w*E,t[6]=f*o+T*l+b*_+w*g,t[7]=f*r+T*c+b*p+w*v,f=i[8],T=i[9],b=i[10],w=i[11],t[8]=f*s+T*a+b*u+w*m,t[9]=f*n+T*h+b*d+w*E,t[10]=f*o+T*l+b*_+w*g,t[11]=f*r+T*c+b*p+w*v,f=i[12],T=i[13],b=i[14],w=i[15],t[12]=f*s+T*a+b*u+w*m,t[13]=f*n+T*h+b*d+w*E,t[14]=f*o+T*l+b*_+w*g,t[15]=f*r+T*c+b*p+w*v,t}function Ke(t,e,i,s,n){var o,r=1/Math.tan(e/2);return t[0]=r/i,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=r,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=n&&n!==1/0?(o=1/(s-n),t[10]=(n+s)*o,t[14]=2*n*s*o):(t[10]=-1,t[14]=-2*s),t}function Xe(){var t=new v(3);return v!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function Ze(t){var e=t[0],i=t[1],s=t[2];return Math.hypot(e,i,s)}function $e(t,e,i){var s=new v(3);return s[0]=t,s[1]=e,s[2]=i,s}function Qe(t,e){var i=e[0],s=e[1],n=e[2],o=i*i+s*s+n*n;return o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t}function Je(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function ti(t,e,i){var s=e[0],n=e[1],o=e[2],r=i[0],a=i[1],h=i[2];return t[0]=n*h-o*a,t[1]=o*r-s*h,t[2]=s*a-n*r,t}function ei(t,e,i){var s=e[0],n=e[1],o=e[2],r=i[3]*s+i[7]*n+i[11]*o+i[15];return r=r||1,t[0]=(i[0]*s+i[4]*n+i[8]*o+i[12])/r,t[1]=(i[1]*s+i[5]*n+i[9]*o+i[13])/r,t[2]=(i[2]*s+i[6]*n+i[10]*o+i[14])/r,t}function ii(t,e,i){var s=i[0],n=i[1],o=i[2],r=i[3],a=e[0],h=e[1],l=e[2],c=n*l-o*h,u=o*a-s*l,d=s*h-n*a,_=n*d-o*u,p=o*c-s*d,m=s*u-n*c,E=2*r;return c*=E,u*=E,d*=E,_*=2,p*=2,m*=2,t[0]=a+c+_,t[1]=h+u+p,t[2]=l+d+m,t}function si(t){var e=new v(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function ni(t,e,i,s){var n=new v(4);return n[0]=t,n[1]=e,n[2]=i,n[3]=s,n}function oi(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function ri(t,e,i,s,n){return t[0]=e,t[1]=i,t[2]=s,t[3]=n,t}function ai(t,e){var i=e[0],s=e[1],n=e[2],o=e[3],r=i*i+s*s+n*n+o*o;return r>0&&(r=1/Math.sqrt(r)),t[0]=i*r,t[1]=s*r,t[2]=n*r,t[3]=o*r,t}function hi(t,e){var i=t[0],s=t[1],n=t[2],o=t[3],r=e[0],a=e[1],h=e[2],l=e[3];return Math.abs(i-r)<=1e-6*Math.max(1,Math.abs(i),Math.abs(r))&&Math.abs(s-a)<=1e-6*Math.max(1,Math.abs(s),Math.abs(a))&&Math.abs(n-h)<=1e-6*Math.max(1,Math.abs(n),Math.abs(h))&&Math.abs(o-l)<=1e-6*Math.max(1,Math.abs(o),Math.abs(l))}function li(){var t=new v(4);return v!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function ci(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t}function ui(t,e,i){var s=e[0],n=e[1],o=e[2],r=e[3],a=i[0],h=i[1],l=i[2],c=i[3];return t[0]=s*c+r*a+n*l-o*h,t[1]=n*c+r*h+o*a-s*l,t[2]=o*c+r*l+s*h-n*a,t[3]=r*c-s*a-n*h-o*l,t}function di(t,e,i){i*=.5;var s=e[0],n=e[1],o=e[2],r=e[3],a=Math.sin(i),h=Math.cos(i);return t[0]=s*h+r*a,t[1]=n*h+o*a,t[2]=o*h-n*a,t[3]=r*h-s*a,t}function _i(t,e,i){i*=.5;var s=e[0],n=e[1],o=e[2],r=e[3],a=Math.sin(i),h=Math.cos(i);return t[0]=s*h-o*a,t[1]=n*h+r*a,t[2]=o*h+s*a,t[3]=r*h-n*a,t}function pi(t,e,i){i*=.5;var s=e[0],n=e[1],o=e[2],r=e[3],a=Math.sin(i),h=Math.cos(i);return t[0]=s*h+n*a,t[1]=n*h-s*a,t[2]=o*h+r*a,t[3]=r*h-o*a,t}function mi(t,e,i,s){var n,o,r,a,h=e[0],l=e[1],c=e[2],u=e[3],d=i[0],_=i[1],p=i[2],m=i[3],E=h*d+l*_+c*p+u*m;return E<0&&(E=-E,d=-d,_=-_,p=-p,m=-m),1-E>1e-6?(n=Math.acos(E),o=Math.sin(n),r=Math.sin((1-s)*n)/o,a=Math.sin(s*n)/o):(r=1-s,a=s),t[0]=r*h+a*d,t[1]=r*l+a*_,t[2]=r*c+a*p,t[3]=r*u+a*m,t}function Ei(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}O(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}function gi(t,e){return t.getAttribute(e)||""}function vi(t){return[].slice.call(t)}function fi(t,e){return void 0===e&&(e="data-"),"loading"in t&&"lazy"===t.getAttribute("loading")||!!t.getAttribute(e+"lazy")}function Ti(t,e,i){S?t.addEventListener(e,i,!1):t.attachEvent?t.attachEvent("on"+e,i):t["on"+e]=i}function bi(t,e,i){t.removeEventListener?t.removeEventListener(e,i,!1):t.detachEvent?t.detachEvent("on"+e,i):t["on"+e]=null}function wi(t,e){var i=t["client"+e]||t["offset"+e];return parseFloat(i||function(t){return(N?window.getComputedStyle(t):t.currentStyle)||{}}(t)[e.toLowerCase()])||0}function yi(t,e,i){var s=vi(t.querySelectorAll(function(){for(var t=0,e=0,i=arguments.length;e<i;e++)t+=arguments[e].length;var s=Array(t),n=0;for(e=0;e<i;e++)for(var o=arguments[e],r=0,a=o.length;r<a;r++,n++)s[n]=o[r];return s}(["["+i+"skip] ["+i+"width]"],e.map(function(t){return["["+i+"skip] "+t,t+"["+i+"skip]","["+i+"width] "+t].join(", ")})).join(", ")));return vi(t.querySelectorAll("["+i+"width], "+e.join(", "))).filter(function(t){return-1===s.indexOf(t)})}function Ci(t,e){!D.length&&Ti(window,"resize",Oi),t.__PREFIX__=e,D.push(t),Ri(t)}function Ri(t,e){void 0===e&&(e="data-");var i=t.__PREFIX__||e,s=parseInt(gi(t,""+i+M),10)||0,n=parseInt(gi(t,""+i+P),10)||0;if(gi(t,i+"fixed")===P){var o=wi(t,"Height")||n;t.style[M]=s/n*o+"px"}else o=function(t){return wi(t,"Width")}(t)||s,t.style[P]=n/s*o+"px"}function Oi(){D.forEach(function(t){Ri(t)})}function Li(t,e,i,s){return new(i||(i=Promise))(function(n,o){function r(t){try{h(s.next(t))}catch(e){o(e)}}function a(t){try{h(s.throw(t))}catch(e){o(e)}}function h(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i(function(t){t(e)})).then(r,a)}h((s=s.apply(t,e||[])).next())})}return{setters:[function(t){i=t.D,s=t.Pi,n=t.Tn,o=t.Zi,r=t.aa,a=t.da,h=t.g,l=t.na,c=t.ua,u=t.zi},function(t){d=t.n}],execute:function(){var e;(_=document.createElement("style")).textContent=".view360-container{touch-action:pan-y;position:relative;overflow:hidden}.view360-canvas{user-select:none;-webkit-user-drag:none;width:100%;height:100%;position:absolute;top:0;left:0}.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.333%}.view360-container.is-2by3{padding-top:150%}.view360-container.is-3by5{padding-top:166.667%}.view360-container.is-9by16{padding-top:177.778%}.view360-container.is-1by2{padding-top:200%}.view360-container.is-1by3{padding-top:300%}.view360-container:fullscreen{padding-top:0}.view360-container:fullscreen{padding-top:0}.view360-controls{pointer-events:none;user-select:none;-webkit-user-drag:none;z-index:1;border:0;width:100%;height:100%;margin:0;padding:0;position:absolute;top:0;left:0}.view360-main.view360-vr-presenting .view360-controls{display:none}.view360-controls-float-left,.view360-controls-float-right{flex-direction:column;display:flex;position:absolute}.view360-controls-float-left{top:0;left:0}.view360-controls-float-right{top:0;right:0}.view360-controls-main{opacity:1;width:100%;transition:none;position:absolute;bottom:0;left:0}.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{background-image:linear-gradient(rgba(50,50,50,0),#323232);width:100%;height:calc(100% + 32px);position:absolute;bottom:0;left:0}.view360-controls-background.view360-controls-hidden{display:none}.view360-controls-mid{flex-direction:row;display:flex;position:relative}.view360-controls-left{flex-direction:row;flex:1;justify-content:flex-start;align-items:center;display:flex}.view360-controls-right,.view360-controls-bottom{flex-direction:row;align-items:center;display:flex}.view360-controls-button{cursor:pointer;box-sizing:border-box;pointer-events:all;opacity:.8;background-color:transparent;background-repeat:no-repeat;background-size:24px 24px;background-origin:content-box;border:0;border-radius:20px;width:40px;height:40px;margin:6px;padding:8px;transition:opacity .25s;display:inline-block;position:relative}.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{vertical-align:top;white-space:nowrap;color:#fff;z-index:1;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;font-size:14px;font-weight:400;display:inline-block}.view360-controls-time:first-child{padding:0 16px}.view360-controls-progress{box-sizing:border-box;flex:1;width:100%;padding:0 16px}.view360-controls-progress:not(:first-child){padding-left:0}.view360-controls-bottom .view360-controls-progress{padding-bottom:20px}.view360-controls-volume{flex-direction:row;align-items:center;transition:width .25s,background-color .25s;display:inline-flex;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{flex-shrink:0;width:24px;height:24px;margin:0;padding:0}.view360-controls-volume:disabled{opacity:.5;pointer-events:none}.view360-controls-volume:disabled *{pointer-events:none}.view360-controls-pie{opacity:.8;pointer-events:all;cursor:pointer;color:#fff;border-radius:18px;width:36px;height:36px;margin:6px;padding:0;transition:opacity .25s;position:relative}.view360-controls-pie>svg{width:100%;height:100%;position:absolute;top:0;left:0}.view360-controls-pie:hover{opacity:1}.view360-range{cursor:pointer;pointer-events:all;touch-action:pan-y;justify-content:center;align-items:center;display:flex;position:relative}.view360-range:hover .view360-range-thumb{opacity:1}.view360-range-track{background-color:rgba(230,230,230,.4);border-radius:4px;width:100%;height:4px;position:relative}.view360-range-filler,.view360-range-load{border-radius:4px;width:0;height:100%;position:absolute;top:0;left:0}.view360-range-filler{background-color:#fff}.view360-range-load{background-color:#757575}.view360-range-thumb{box-sizing:border-box;opacity:0;background-color:#fff;border-radius:50%;width:13px;height:13px;transition:opacity .25s;position:absolute;top:-5px;left:-6.5px}.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;border-radius:15px;width:30px;height:30px;margin:4.5px;padding:6px}.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{border-radius:13.5px;width:27px;height:27px;margin:4.5px;padding:0}}.view360-spinner{background-color:rgba(0,0,0,.15);justify-content:center;align-items:center;width:100%;height:100%;display:flex;position:absolute;top:0;left:0}.view360-spinner-ring{box-sizing:content-box;background-color:transparent;border:10px solid #fff;border-bottom-color:transparent;border-radius:50%;width:64px;height:64px;margin:0;padding:0;animation:1.2s linear infinite view360-spin-animation;top:0;left:0}@keyframes view360-spin-animation{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.view360-container.view360-vr-presenting{z-index:9999;width:100vw;height:100vh;position:fixed;top:0;left:0}.view360-hotspots{pointer-events:none;width:100%;height:100%;position:absolute;top:0;left:0}.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/*$vite$:1*/",document.head.appendChild(_),p=function(t){return void 0===t},m=function(){function t(t,e){var i,s;if(this._canceled=!1,e)try{for(var n=function(t){var e="function"==typeof Symbol&&Symbol.iterator,i=e&&t[e],s=0;if(i)return i.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&s>=t.length&&(t=void 0),{value:t&&t[s++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(Object.keys(e)),o=n.next();!o.done;o=n.next()){var r=o.value;this[r]=e[r]}}catch(a){i={error:a}}finally{try{o&&!o.done&&(s=n.return)&&s.call(n)}finally{if(i)throw i.error}}this.eventType=t}var e=t.prototype;return e.stop=function(){this._canceled=!0},e.isCanceled=function(){return this._canceled},t}(),E=function(){function t(){this._eventHandler={}}var e=t.prototype;return e.trigger=function(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];var s=t instanceof m?t.eventType:t,n=We(this._eventHandler[s]||[]);return n.length<=0||(t instanceof m?(t.currentTarget=this,n.forEach(function(e){e(t)})):n.forEach(function(t){t.apply(void 0,We(e))})),this},e.once=function(t,e){var i=this;if("object"==typeof t&&p(e)){var s=t;for(var n in s)this.once(n,s[n]);return this}if("string"==typeof t&&"function"==typeof e){var o=function(){for(var s=[],n=0;n<arguments.length;n++)s[n]=arguments[n];e.apply(void 0,We(s)),i.off(t,o)};this.on(t,o)}return this},e.hasOn=function(t){return!!this._eventHandler[t]},e.on=function(t,e){if("object"==typeof t&&p(e)){var i=t;for(var s in i)this.on(s,i[s]);return this}if("string"==typeof t&&"function"==typeof e){var n=this._eventHandler[t];p(n)&&(this._eventHandler[t]=[],n=this._eventHandler[t]),n.push(e)}return this},e.off=function(t,e){if(p(t))return this._eventHandler={},this;if(p(e)){if("string"==typeof t)return delete this._eventHandler[t],this;var i=t;for(var s in i)this.off(s,i[s]);return this}var n=this._eventHandler[t];if(n)for(var o=n.length,r=0;r<o;++r)if(n[r]===e){n.splice(r,1),o<=1&&delete this._eventHandler[t];break}return this},t.VERSION="3.0.5",t}(),g=m,v="undefined"!=typeof Float32Array?Float32Array:Array,Math.PI,Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)}),f=Ke,Xe(),function(){var t,e=(t=new v(4),v!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t)}(),T=si,b=ni,w=oi,y=ri,C=ai,R=hi,Xe(),$e(1,0,0),$e(0,1,0),li(),li(),e=new v(9),v!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,function(){var t=function(){var t=new v(2);return v!=Float32Array&&(t[0]=0,t[1]=0),t}()}(),O=function(t,e){return O=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},O(t,e)},L=function(){return L=Object.assign||function(t){for(var e,i=1,s=arguments.length;i<s;i++)for(var n in e=arguments[i])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t},L.apply(this,arguments)},I="undefined"!=typeof window,A=I?window.navigator.userAgent:"",N=!!I&&!!("getComputedStyle"in window),x=/MSIE|Trident|Windows Phone|Edge/.test(A),S=!!I&&!!("addEventListener"in document),M="width",P="height",D=[],B=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}Ei(e,t);var i=e.prototype;return i.setHasLoading=function(t){this.hasLoading=t},i.check=function(){return this.isSkip?(this.onAlreadyReady(),!1):(this.hasDataSize?(Ci(this.element,this.options.prefix),this.onAlreadyPreReady()):this.trigger("requestChildren"),!0)},i.checkElement=function(){return!0},i.destroy=function(){this.clear(),this.trigger("requestDestroy"),this.off()},i.onAlreadyPreReady=function(){t.prototype.onAlreadyPreReady.call(this),this.trigger("reqeustReadyChildren")},e.EVENTS=[],e}(U=function(t){function e(e,i){void 0===i&&(i={});var s=t.call(this)||this;s.isReady=!1,s.isPreReady=!1,s.hasDataSize=!1,s.hasLoading=!1,s.isSkip=!1,s.onCheck=function(t){s.clear(),t&&"error"===t.type&&s.onError(s.element),s.hasLoading&&s.checkElement()||s.onReady()},s.options=L({prefix:"data-"},i),s.element=e;var n=s.options.prefix;return s.hasDataSize=function(t,e){return void 0===e&&(e="data-"),!!t.getAttribute(e+"width")}(e,n),s.isSkip=function(t,e){return void 0===e&&(e="data-"),!!t.getAttribute(e+"skip")}(e,n),s.hasLoading=fi(e,n),s}Ei(e,t);var i=e.prototype;return i.check=function(){return this.isSkip||!this.checkElement()?(this.onAlreadyReady(),!1):(this.hasDataSize&&Ci(this.element,this.options.prefix),(this.hasDataSize||this.hasLoading)&&this.onAlreadyPreReady(),!0)},i.addEvents=function(){var t=this,e=this.element;this.constructor.EVENTS.forEach(function(i){Ti(e,i,t.onCheck)})},i.clear=function(){var t=this,e=this.element;this.constructor.EVENTS.forEach(function(i){bi(e,i,t.onCheck)}),this.removeAutoSizer()},i.destroy=function(){this.clear(),this.off()},i.removeAutoSizer=function(){if(this.hasDataSize){var t=this.options.prefix;!function(t,e){var i=D.indexOf(t);if(!(i<0)){var s=gi(t,e+"fixed");delete t.__PREFIX__,t.style[s===P?M:P]="",D.splice(i,1),!D.length&&bi(window,"resize",Oi)}}(this.element,t)}},i.onError=function(t){this.trigger("error",{element:this.element,target:t})},i.onPreReady=function(){this.isPreReady||(this.isPreReady=!0,this.trigger("preReady",{element:this.element,hasLoading:this.hasLoading,isSkip:this.isSkip}))},i.onReady=function(){var t=this.isPreReady;this.isPreReady=!0,this.isReady||(this.removeAutoSizer(),this.isReady=!0,this.trigger("ready",{element:this.element,withPreReady:!t,hasLoading:this.hasLoading,isSkip:this.isSkip}))},i.onAlreadyError=function(t){var e=this;setTimeout(function(){e.onError(t)})},i.onAlreadyPreReady=function(){var t=this;setTimeout(function(){t.onPreReady()})},i.onAlreadyReady=function(){var t=this;setTimeout(function(){t.onReady()})},e.EVENTS=[],e}(E)),k=function(t){function e(e){void 0===e&&(e={});var i=t.call(this)||this;return i.readyCount=0,i.preReadyCount=0,i.totalCount=0,i.totalErrorCount=0,i.isPreReadyOver=!0,i.elementInfos=[],i.options=L({loaders:{},prefix:"data-"},e),i}Ei(e,t);var i=e.prototype;return i.check=function(t){var e=this,i=this.options.prefix;this.clear(),this.elementInfos=vi(t).map(function(t,s){var n=e.getLoader(t,{prefix:i});return n.check(),n.on("error",function(t){e.onError(s,t.target)}).on("preReady",function(t){var i=e.elementInfos[s];i.hasLoading=t.hasLoading,i.isSkip=t.isSkip;var n=e.checkPreReady(s);e.onPreReadyElement(s),n&&e.onPreReady()}).on("ready",function(t){var i=t.withPreReady,n=t.hasLoading,o=t.isSkip,r=e.elementInfos[s];r.hasLoading=n,r.isSkip=o;var a=i&&e.checkPreReady(s),h=e.checkReady(s);i&&e.onPreReadyElement(s),e.onReadyElement(s),a&&e.onPreReady(),h&&e.onReady()}),{loader:n,element:t,hasLoading:!1,hasError:!1,isPreReady:!1,isReady:!1,isSkip:!1}});var s=this.elementInfos.length;return this.totalCount=s,s||setTimeout(function(){e.onPreReady(),e.onReady()}),this},i.getTotalCount=function(){return this.totalCount},i.isPreReady=function(){return this.elementInfos.every(function(t){return t.isPreReady})},i.isReady=function(){return this.elementInfos.every(function(t){return t.isReady})},i.hasError=function(){return this.totalErrorCount>0},i.clear=function(){this.isPreReadyOver=!1,this.totalCount=0,this.preReadyCount=0,this.readyCount=0,this.totalErrorCount=0,this.elementInfos.forEach(function(t){t.loader&&t.loader.destroy()}),this.elementInfos=[]},i.destroy=function(){this.clear(),this.off()},i.getLoader=function(t,e){var i=this,s=t.tagName.toLowerCase(),n=this.options.loaders,o=e.prefix,r=Object.keys(n);if(n[s])return new n[s](t,e);var a=new B(t,e),h=vi(t.querySelectorAll(r.join(", ")));a.setHasLoading(h.some(function(t){return fi(t,o)}));var l=this.clone().on("error",function(t){a.onError(t.target)}).on("ready",function(){a.onReady()});return a.on("requestChildren",function(){var e=yi(t,r,i.options.prefix);l.check(e).on("preReady",function(t){t.isReady||a.onPreReady()})}).on("reqeustReadyChildren",function(){l.check(h)}).on("requestDestroy",function(){l.destroy()}),a},i.clone=function(){return new e(L({},this.options))},i.checkPreReady=function(t){return this.elementInfos[t].isPreReady=!0,++this.preReadyCount,!(this.preReadyCount<this.totalCount)},i.checkReady=function(t){return this.elementInfos[t].isReady=!0,++this.readyCount,!(this.readyCount<this.totalCount)},i.onError=function(t,e){var i=this.elementInfos[t];i.hasError=!0,this.trigger(new g("error",{element:i.element,index:t,target:e,errorCount:this.getErrorCount(),totalErrorCount:++this.totalErrorCount}))},i.onPreReadyElement=function(t){var e=this.elementInfos[t];this.trigger(new g("preReadyElement",{element:e.element,index:t,preReadyCount:this.preReadyCount,readyCount:this.readyCount,totalCount:this.totalCount,isPreReady:this.isPreReady(),isReady:this.isReady(),hasLoading:e.hasLoading,isSkip:e.isSkip}))},i.onPreReady=function(){this.isPreReadyOver=!0,this.trigger(new g("preReady",{readyCount:this.readyCount,totalCount:this.totalCount,isReady:this.isReady(),hasLoading:this.hasLoading()}))},i.onReadyElement=function(t){var e=this.elementInfos[t];this.trigger(new g("readyElement",{index:t,element:e.element,hasError:e.hasError,errorCount:this.getErrorCount(),totalErrorCount:this.totalErrorCount,preReadyCount:this.preReadyCount,readyCount:this.readyCount,totalCount:this.totalCount,isPreReady:this.isPreReady(),isReady:this.isReady(),hasLoading:e.hasLoading,isPreReadyOver:this.isPreReadyOver,isSkip:e.isSkip}))},i.onReady=function(){this.trigger(new g("ready",{errorCount:this.getErrorCount(),totalErrorCount:this.totalErrorCount,totalCount:this.totalCount}))},i.getErrorCount=function(){return this.elementInfos.filter(function(t){return t.hasError}).length},i.hasLoading=function(){return this.elementInfos.some(function(t){return t.hasLoading})},e}(E),F=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ei(e,t),e.prototype.checkElement=function(){var t=this.element,e=t.getAttribute("src");if(t.complete){if(e)return t.naturalWidth||this.onAlreadyError(t),!1;this.onAlreadyPreReady()}return this.addEvents(),x&&t.setAttribute("src",e),!0},e.EVENTS=["load","error"],e}(U),V=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ei(e,t),e.prototype.checkElement=function(){var t=this.element;return!(t.readyState>=1||(t.error?(this.onAlreadyError(t),1):(this.addEvents(),0)))},e.EVENTS=["loadedmetadata","error"],e}(U),z=function(t){function e(e){return void 0===e&&(e={}),t.call(this,L({loaders:{img:F,video:V}},e))||this}return Ei(e,t),e}(k),H=class t extends Error{constructor(e,i){super(e),Object.setPrototypeOf(this,t.prototype),this.name="View360Error",this.code=i}},G={CODES:{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},MESSAGES:{WRONG_TYPE:(t,e)=>`${typeof t} is not a ${e.map(t=>`"${t}"`).join(" or ")}.`,WRONG_OPTION:(t,e)=>`Bad option: given "${t}" for option "${e}".`,ELEMENT_NOT_FOUND:t=>`Element with selector "${t}" 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:(t,e)=>`Failed linking WebGL program - "${t}\nShader compile Log: ${e}`,INSUFFICIENT_ARGS:(t,e)=>`Insufficient arguments: given "${t}" for "${e}".`}},Y={MOUSE_DOWN:"mousedown",MOUSE_MOVE:"mousemove",MOUSE_UP:"mouseup",TOUCH_START:"touchstart",TOUCH_MOVE:"touchmove",TOUCH_END:"touchend",WHEEL:"wheel",RESIZE:"resize",CONTEXT_MENU:"contextmenu",MOUSE_ENTER:"mouseenter",MOUSE_LEAVE:"mouseleave",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",POINTER_UP:"pointerup",POINTER_CANCEL:"pointercancel",POINTER_ENTER:"pointerenter",POINTER_LEAVE:"pointerleave",KEY_DOWN:"keydown",KEY_UP:"keyup",LOAD:"load",ERROR:"error",CLICK:"click",DOUBLE_CLICK:"dblclick",CONTEXT_CREATE_ERROR:"webglcontextcreationerror",CONTEXT_LOST:"webglcontextlost",CONTEXT_RESTORED:"webglcontextrestored",DEVICE_ORIENTATION:"deviceorientation",DEVICE_MOTION:"devicemotion",ORIENTATION_CHANGE:"orientationchange",VIDEO_PLAY:"play",VIDEO_PAUSE:"pause",VIDEO_LOADED_DATA:"loadeddata",VIDEO_VOLUME_CHANGE:"volumechange",VIDEO_TIME_UPDATE:"timeupdate",VIDEO_DURATION_CHANGE:"durationchange",VIDEO_CAN_PLAYTHROUGH:"canplaythrough",TRANSITION_END:"transitionend",XR_END:"end"},W="div",j="button",function(t){t[t.LEFT=0]="LEFT",t[t.MIDDLE=1]="MIDDLE",t[t.RIGHT=2]="RIGHT"}(q||(q={})),K={GRAB:"grab",GRABBING:"grabbing",NONE:""},X=["LEFT","UP","RIGHT","DOWN"],function(t){t[t.LEFT=37]="LEFT",t[t.UP=38]="UP",t[t.RIGHT=39]="RIGHT",t[t.DOWN=40]="DOWN"}(Z||(Z={})),$={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",DOWN:"ArrowDown"},Q=["requestFullscreen","webkitRequestFullscreen","webkitRequestFullScreen","webkitCancelFullScreen","mozRequestFullScreen","msRequestFullscreen"],J=["fullscreenElement","webkitFullscreenElement","webkitCurrentFullScreenElement","mozFullScreenElement","msFullscreenElement"],tt=["exitFullscreen","webkitExitFullscreen","webkitCancelFullScreen","mozCancelFullScreen","msExitFullscreen"],et=["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],it={CONTAINER:"view360-container",CANVAS:"view360-canvas",CTX_LOST:"view360-ctx-lost",IN_VR:"view360-vr-presenting",HOTSPOT_CONTAINER:"view360-hotspots",HOTSPOT:"view360-hotspot",HOTSPOT_VISIBLE:"view360-hotspot-visible",HOTSPOT_FLIP_X:"view360-hotspot-flip-x",HOTSPOT_FLIP_Y:"view360-hotspot-flip-y"},st={READY:"ready",LOAD_START:"loadStart",LOAD:"load",PROJECTION_CHANGE:"projectionChange",RESIZE:"resize",BEFORE_RENDER:"beforeRender",RENDER:"render",INPUT_START:"inputStart",INPUT_END:"inputEnd",VIEW_CHANGE:"viewChange",STATIC_CLICK:"staticClick",VR_START:"vrStart",VR_END:"vrEnd"},nt={LINEAR:t=>t,SINE_WAVE:t=>Math.sin(t*Math.PI*2),EASE_OUT_CUBIC:t=>1-Math.pow(1-t,3),EASE_OUT_BOUNCE:t=>{const e=7.5625,i=2.75;return t<1/i?e*t*t:t<2/i?e*(t-=1.5/i)*t+.75:t<2.5/i?e*(t-=2.25/i)*t+.9375:e*(t-=2.625/i)*t+.984375}},rt={CHANGE:"change",ANIMATION_END:"animationEnd"},at={UPDATE:"update"},ht={INPUT_START:"inputStart",CHANGE:"change",INPUT_END:"inputEnd",ENABLE:"enable",DISABLE:"disable",STATIC_CLICK:"staticClick"},lt=Math.PI/180,ct=180/Math.PI,ut=nt.EASE_OUT_CUBIC,dt=300,_t={min:-1/0,max:1/0},pt={min:-90,max:90},mt={min:.6,max:10},function(t){t[t.ZERO=0]="ZERO",t[t.CW_90=1]="CW_90",t[t.CCW_90=2]="CCW_90",t[t.CW_180=3]="CW_180"}(Et||(Et={})),gt="view360videotimechange",vt="http://www.w3.org/2000/svg",ft="immersive-vr",Tt="local",bt=null!==(ot=Number.EPSILON)&&void 0!==ot?ot:2220446049250313e-31,wt=t=>"string"==typeof t,yt=t=>!!t&&t.nodeType===Node.ELEMENT_NODE,Ct=(t,e=W)=>{const i=document.createElement(e);return i.classList.add(t),i},Rt=(t,e)=>{let i=null;if(wt(t)){const s=(e||document).querySelector(t);if(!s)return null;i=s}else yt(t)&&(i=t);return i},Ot=(t,e)=>{const i=Rt(t,e);if(!i)throw wt(t)?new H(G.MESSAGES.ELEMENT_NOT_FOUND(t),G.CODES.ELEMENT_NOT_FOUND):new H(G.MESSAGES.WRONG_TYPE(t,["HTMLElement","string"]),G.CODES.WRONG_TYPE);return i},Lt=(t,e)=>{const i=t.querySelector(e);if(!i)throw new H(G.MESSAGES.CANVAS_NOT_FOUND,G.CODES.CANVAS_NOT_FOUND);return i},It=(t,e,i)=>Math.max(Math.min(t,i),e),At=(t,e,i)=>t*(1-i)+e*i,Nt=(t,e,i)=>{const s=Math.abs(i-e);return t<e?t=i-(e-t)%s:t>i&&(t=e+(t-i)%s),t},xt=(t,e)=>{for(let i=0;i<t.length;i++)if(e(t[i]))return i;return-1},St=t=>"object"==typeof t?t:{},Mt=(t,e)=>2*Math.atan(Math.tan(.5*t)/e),Pt=()=>{if(!document)return!1;for(const t of J)if(document[t])return!0;return!1},Dt=()=>window.isSecureContext&&!!DeviceMotionEvent&&"requestPermission"in DeviceMotionEvent,Ut=(t,e)=>Math.tan(lt*t*.5)/Math.tan(lt*e*.5),Bt=(t,e,i,s)=>{ci(t);const n=It(i,-89.99,89.99);return _i(t,t,e*lt),di(t,t,n*lt),pi(t,t,s*lt),t},kt=t=>{const e=t[0],i=t[1],s=t[2],n=t[3],o=e*e+i*i+s*s+n*n,r=e*n-i*s;let a,h;if(r>.499995*o)a=Math.PI/2,h=2*Math.atan2(i,e);else if(r<-.499995*o)a=-Math.PI/2,h=-2*Math.atan2(i,e);else{const e=$e(0,0,1),i=$e(0,1,0);ii(e,e,t),ii(i,i,t);const s=Math.sqrt(e[0]*e[0]+e[2]*e[2]);a=Math.atan2(-e[1],s),h=Math.atan2(e[0],e[2])}return{pitch:It(a*ct,-90,90),yaw:Nt(h*ct,0,360)}},Ft=class{get val(){return this._val}get start(){return this._start}get end(){return this._end}get progress(){return this._progress}get activated(){return this._activated}get duration(){return this._duration}set duration(t){this._duration=t}get loop(){return this._loop}set loop(t){this._loop=t}get range(){return this._range}get easing(){return this._easing}set easing(t){this._easing=t}constructor({duration:t=300,loop:e=!1,range:i={min:0,max:1},easing:s=ut}={}){this._duration=t,this._loop=e,this._range=i,this._easing=s,this._activated=!1,this.reset(0)}update(t){if(!this._activated)return this._val=this._end,0;const e=this._start,i=this._end,s=this._duration,n=this._val,o=this._loop,r=this._progress+t/s;return this._progress=o?Nt(r,0,1):It(r,0,1),this._val=At(e,i,this._easing(this._progress)),!o&&this._progress>=1&&(this._activated=!1),this._val-n}reset(t){const e=this._range,i=It(t,e.min,e.max);this._start=i,this._end=i,this._val=i,this._progress=0,this._activated=!1}add(t){const e=this._range;this._start=It(this._start+t,e.min,e.max),this._end=It(this._end+t,e.min,e.max),this._val=It(this._val+t,e.min,e.max)}setNewEndByDelta(t){const e=this._range;this._start=this._val,this._end=It(this._end+t,e.min,e.max),this._progress=0,this._activated=!0}setRange(t,e){this._start=It(this._start,t,e),this._end=It(this._end,t,e),this._range={min:t,max:e}}},Vt=class{get duration(){return this._motion.duration}set duration(t){this._motion.duration=t}get easing(){return this._motion.easing}set easing(t){this._motion.easing=t}constructor(t,e,i,{duration:s=300,easing:n=ut}={}){this._camera=t,this._motion=new Ft({duration:s,easing:n,range:{min:0,max:1}}),this._from=e,this._to=i,this._finishPromise=new Promise(t=>{this._finish=t}),this._motion.setNewEndByDelta(1)}getFinishPromise(){return this._finishPromise}update(t){const e=this._camera,i=this._from,s=this._to,n=this._motion;n.update(t);const o=n.val,r=li(),a=At(i.zoom,s.zoom,o);mi(r,i.rotation,s.rotation,o),e.rotate(r,a),o>=1&&this._finish()}},zt=class extends E{get aspect(){return this._aspect}get changed(){return this._changed}get yawRange(){return this._initialYawRange}set yawRange(t){this._initialYawRange=t}get pitchRange(){return this._initialPitchRange}set pitchRange(t){this._initialPitchRange=t}get zoomRange(){return this._initialZoomRange}set zoomRange(t){this._initialZoomRange=t}constructor({initialYaw:t,initialPitch:e,initialZoom:i,yawRange:s,pitchRange:n,zoomRange:o,fov:r}){super(),this.yaw=t,this.pitch=e,this.zoom=i,this.rollOffset=0,this.initialYaw=t,this.initialPitch=e,this.initialZoom=i,this.position=Xe(),this.animation=null,this._up=$e(0,1,0),this._aspect=1,this._initialYawRange=s,this._initialPitchRange=n,this._initialZoomRange=o,this._yawRange=s,this._pitchRange=n,this._zoomRange=o,this.quaternion=li(),this._updateQuaternion(),this.viewMatrix=je(),this.projectionMatrix=je(),this.fov=r,this._maxRenderHeight=-1}destroy(){this.off()}resize(t,e){const i=this._aspect;this._aspect=t/e,this._aspect!==i&&this.updateMatrix()}lookAt({yaw:t=this.yaw,pitch:e=this.pitch,zoom:i=this.zoom}){const s=T(this.quaternion),n=this.zoom;this.yaw=Nt(t,0,360),this.pitch=It(e,-90,90),this.zoom=i,this._updateQuaternion();const o=Math.abs(i-n);(!R(this.quaternion,s)||o>=10*bt)&&this.updateMatrix()}rotate(t,e=this.zoom){const i=C(li(),t),s=R(this.quaternion,i);w(this.quaternion,i);const n=this.zoom,{yaw:o,pitch:r}=kt(i);this.yaw=o,this.pitch=r,this.zoom=e;const a=Math.abs(e-n);(!s||a>=10*bt)&&this.updateMatrix()}animateTo({yaw:t=this.yaw,pitch:e=this.pitch,zoom:i=this.zoom,duration:s=0,easing:n=ut}={}){return Li(this,void 0,void 0,function*(){if(this.yaw===t&&this.pitch===e&&this.zoom===i)return;const o={rotation:T(this.quaternion),zoom:this.zoom},r={rotation:Bt(li(),t,e,this.rollOffset),zoom:i},a=new Vt(this,o,r,{duration:s,easing:n}),h=a.getFinishPromise();return this.animation=a,h.then(()=>{this.animation=null,this.trigger(rt.ANIMATION_END,{animation:a})}),h})}restrictYawRange(t,e){this._yawRange={min:t,max:e}}restrictPitchRange(t,e){this._pitchRange={min:t,max:e}}restrictZoomRange(t,e){this._zoomRange={min:t,max:e}}restrictRenderHeight(t){this._maxRenderHeight=t}resetRange(){this._yawRange=this._initialYawRange,this._pitchRange=this._initialPitchRange,this._zoomRange=this._initialZoomRange,this._maxRenderHeight=-1}getYawRange(t){const e=this._yawRange,i=this._maxRenderHeight;if(!e)return _t;const s=.5*this.getHorizontalFov(t);let n=e.min,o=e.max;if(i>0){const t=Mt(s*lt,this._aspect),r=.5*i,a=Math.tan(t),h=Math.sqrt((1+r*r)/(1+a*a)),l=Math.atan(Math.tan(s*lt)*h)*ct;n=e.min+l,o=e.max-l}return n>o&&(n=0,o=0),{min:n,max:o}}getPitchRange(t){const e=this._pitchRange,i=this._maxRenderHeight;if(!e)return pt;let s=e.min,n=e.max;if(i>0){const i=.5*this.getVerticalFov(t);s=e.min+i,n=e.max-i}return s>n&&(s=0,n=0),{min:Math.max(s,-90),max:Math.min(n,90)}}getZoomRange(){var t;const e=null!==(t=this._zoomRange)&&void 0!==t?t:mt,i=this.getHorizontalFov(e.max),s=this.getHorizontalFov(e.min),n=this.getHorizontalFov(this.zoom);return{min:Math.max(i,1),max:Math.min(s,180),current:n}}getHorizontalFov(t=this.zoom){return this._getZoomedHorizontalFov(t)*ct}getVerticalFov(t=this.zoom){const e=this._aspect;return Mt(this._getZoomedHorizontalFov(t),e)*ct}fovToZoom(t){const e=this.fov;return Math.tan(lt*e*.5)/Math.tan(lt*t*.5)}updateMatrix(){const t=this._up,e=this._aspect,i=this.viewMatrix,s=this.projectionMatrix,n=this.position,o=this.quaternion,r=Xe(),a=$e(0,0,-1);ii(a,a,o),ii(r,t,o);const h=Mt(this._getZoomedHorizontalFov(),e);!function(t,e,i,s){var n,o,r,a,h,l,c,u,d,_,p=e[0],m=e[1],E=e[2],g=s[0],v=s[1],f=s[2],T=i[0],b=i[1],w=i[2];Math.abs(p-T)<1e-6&&Math.abs(m-b)<1e-6&&Math.abs(E-w)<1e-6?function(t){t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1}(t):(c=p-T,u=m-b,d=E-w,n=v*(d*=_=1/Math.hypot(c,u,d))-f*(u*=_),o=f*(c*=_)-g*d,r=g*u-v*c,(_=Math.hypot(n,o,r))?(n*=_=1/_,o*=_,r*=_):(n=0,o=0,r=0),a=u*r-d*o,h=d*n-c*r,l=c*o-u*n,(_=Math.hypot(a,h,l))?(a*=_=1/_,h*=_,l*=_):(a=0,h=0,l=0),t[0]=n,t[1]=a,t[2]=c,t[3]=0,t[4]=o,t[5]=h,t[6]=u,t[7]=0,t[8]=r,t[9]=l,t[10]=d,t[11]=0,t[12]=-(n*p+o*m+r*E),t[13]=-(a*p+h*m+l*E),t[14]=-(c*p+u*m+d*E),t[15]=1)}(i,n,a,r),f(s,h,e,.1,100),this._changed=!0}onFrameRender(){this._changed=!1}_updateQuaternion(){Bt(this.quaternion,this.yaw,this.pitch,this.rollOffset)}_getZoomedHorizontalFov(t=this.zoom){return 2*Math.atan(Math.tan(lt*this.fov*.5)/t)}},Ht=class extends E{constructor(){super(),this._onMouseDown=t=>{const e=this._el;e&&t.button===q.LEFT&&(t.preventDefault(),e.focus?e.focus():window.focus(),this._prevPos[0]=t.clientX,this._prevPos[1]=t.clientY,window.addEventListener(Y.MOUSE_MOVE,this._onMouseMove,!1),window.addEventListener(Y.MOUSE_UP,this._onMouseUp,!1),this.trigger(ht.INPUT_START,{srcEvent:t,isTouch:!1,isKeyboard:!1}))},this._onMouseMove=t=>{t.preventDefault();const e=t.clientX,i=t.clientY,s=this._prevPos,n=e-s[0],o=i-s[1];this.trigger(ht.CHANGE,{delta:{x:n,y:o},isTouch:!1,isKeyboard:!1}),s[0]=e,s[1]=i},this._onMouseUp=()=>{this._prevPos[0]=0,this._prevPos[1]=0,window.removeEventListener(Y.MOUSE_MOVE,this._onMouseMove,!1),window.removeEventListener(Y.MOUSE_UP,this._onMouseUp,!1),this.trigger(ht.INPUT_END,{isTouch:!1,isKeyboard:!1,scrolling:!1})},this._el=null,this._prevPos=[0,0]}enable(t){this._el||(t.addEventListener(Y.MOUSE_DOWN,this._onMouseDown),this._el=t)}disable(){const t=this._el;t&&(t.removeEventListener(Y.MOUSE_DOWN,this._onMouseDown),window.removeEventListener(Y.MOUSE_MOVE,this._onMouseMove,!1),window.removeEventListener(Y.MOUSE_UP,this._onMouseUp,!1),this._el=null)}},Gt=class extends E{get scrollable(){return this._scrollable}set scrollable(t){this._scrollable=t}constructor(){super(),this._onTouchStart=t=>{if(t.touches.length>1||this._scrolling)return;const e=t.touches[0];this._isFirstTouch=!0,this._prevPos[0]=e.clientX,this._prevPos[1]=e.clientY,this.trigger(ht.INPUT_START,{srcEvent:t,isTouch:!0,isKeyboard:!1})},this._onTouchMove=t=>{if(t.touches.length>1||this._scrolling)return;const e=t.touches[0],i=this._scrollable,s=this._prevPos,n=e.clientX,o=e.clientY,r=n-s[0],a=o-s[1];if(this._isFirstTouch){if(i&&!Pt()&&Math.abs(a)>Math.abs(r))return void(this._scrolling=!0);this._isFirstTouch=!1}!1!==t.cancelable&&t.preventDefault(),this.trigger(ht.CHANGE,{delta:{x:r,y:a},isTouch:!0,isKeyboard:!1}),s[0]=n,s[1]=o},this._onTouchEnd=t=>{if(0!==t.touches.length)return;const e=t.touches[0],i=this._prevPos;e?(i[0]=e.clientX,i[1]=e.clientY):(i[0]=0,i[1]=0,this.trigger(ht.INPUT_END,{isTouch:!0,isKeyboard:!1,scrolling:this._scrolling})),!1!==t.cancelable&&t.preventDefault(),this._scrolling=!1},this._el=null,this._prevPos=[0,0],this._isFirstTouch=!1,this._scrolling=!1,this._scrollable=!1}enable(t){this._el||(t.addEventListener(Y.TOUCH_START,this._onTouchStart,{passive:!1}),t.addEventListener(Y.TOUCH_MOVE,this._onTouchMove,{passive:!1}),t.addEventListener(Y.TOUCH_END,this._onTouchEnd),this._el=t)}disable(){const t=this._el;t&&(t.removeEventListener(Y.TOUCH_START,this._onTouchStart),t.removeEventListener(Y.TOUCH_MOVE,this._onTouchMove),t.removeEventListener(Y.TOUCH_END,this._onTouchEnd),this._el=null)}},Yt=class extends E{get active(){const t=this._pressed;return t.LEFT||t.UP||t.RIGHT||t.DOWN}constructor(){super(),this._onKeyDown=t=>{if(t.location!==KeyboardEvent.DOM_KEY_LOCATION_STANDARD)return;this._updateKeyPress(t,!0);const e=this._getPressedKeyCount();e<=0||(t.preventDefault(),1!==e||t.repeat||this.trigger(ht.INPUT_START,{srcEvent:t,isTouch:!1,isKeyboard:!0}))},this._onKeyUp=t=>{t.location===KeyboardEvent.DOM_KEY_LOCATION_STANDARD&&(this._updateKeyPress(t,!1),this._getPressedKeyCount()>0||this.trigger(ht.INPUT_END,{isTouch:!1,isKeyboard:!0,scrolling:!1}))},this._el=null,this._clearPressedKeys()}enable(t){this._el||(t.addEventListener(Y.KEY_DOWN,this._onKeyDown),t.addEventListener(Y.KEY_UP,this._onKeyUp),this._el=t,this._clearPressedKeys())}disable(){const t=this._el;t&&(t.removeEventListener(Y.KEY_DOWN,this._onKeyDown),t.removeEventListener(Y.KEY_UP,this._onKeyUp),this._el=null,this._clearPressedKeys())}update(){const t=this._getDeltaByPressedKeys();0===t.x&&0===t.y||this.trigger(ht.CHANGE,{delta:t,isTouch:!1,isKeyboard:!0})}_clearPressedKeys(){this._pressed=X.reduce((t,e)=>Object.assign(Object.assign({},t),{[e]:!1}),{})}_updateKeyPress(t,e){const i=this._pressed,s=null!=t.keyCode?Z[t.keyCode]:$[t.key];s&&(i[s]=e)}_getPressedKeyCount(){return X.filter(t=>this._pressed[t]).length}_getDeltaByPressedKeys(){const t=this._pressed;let e=0,i=0;return t.LEFT&&(e+=1),t.RIGHT&&(e-=1),t.UP&&(i+=1),t.DOWN&&(i-=1),{x:e,y:i}}},Wt=class extends E{get enabled(){return this._enabled}get enableBlocked(){return this._enableBlocked}get animating(){return this._keyboardInput.active||this._xMotion.activated||this._yMotion.activated}get yaw(){return this._xMotion}get pitch(){return this._yMotion}get scrollable(){return this._touchInput.scrollable}set scrollable(t){this._touchInput.scrollable=t}get pointerScale(){return this._pointerScale}set pointerScale(t){this._pointerScale=t}get keyboardScale(){return this._keyboardScale}set keyboardScale(t){this._keyboardScale=t}get duration(){return this._duration}set duration(t){this._duration=t,this._xMotion.duration=t,this._yMotion.duration=t}get easing(){return this._easing}set easing(t){this._easing=t,this._xMotion.easing=t,this._yMotion.easing=t}get disablePitch(){return this._disablePitch}set disablePitch(t){this._disablePitch=t}get disableYaw(){return this._disableYaw}set disableYaw(t){this._disableYaw=t}get disableKeyboard(){return this._disableKeyboard}set disableKeyboard(t){this._disableKeyboard=t}constructor(t,e,{duration:i=300,easing:s=ut,pointerScale:n=[1,1],keyboardScale:o=[1,1],disablePitch:r=!1,disableYaw:a=!1,disableKeyboard:h=!1}={}){super(),this._onInputStart=t=>{this._changedWhileDragging=!1,this.trigger(ht.INPUT_START,Object.assign(Object.assign({},t),{inputType:"rotate"}))},this._onChange=t=>{const e=t.delta,i=1/this._zoomScale,s=this._screenScale,n=this._keyboardScale,o=this._pointerScale;let r;r=t.isKeyboard?[n[0]*i,n[1]*i]:[o[0]*s[0]*i,o[1]*s[1]*i];const a=e.x*r[0],h=e.y*r[1];this._xMotion.setNewEndByDelta(a),this._yMotion.setNewEndByDelta(h),this._changedWhileDragging=!0},this._onInputEnd=t=>{this.trigger(ht.INPUT_END,Object.assign(Object.assign({},t),{inputType:"rotate"})),this._changedWhileDragging||t.isKeyboard||t.scrolling||this.trigger(ht.STATIC_CLICK,{isTouch:t.isTouch}),this._changedWhileDragging=!1},this._controlEl=t,this._pointerScale=n,this._keyboardScale=o,this._duration=i,this._easing=s,this._disablePitch=r,this._disableYaw=a,this._disableKeyboard=h,this._enableBlocked=e,this._mouseInput=new Ht,this._touchInput=new Gt,this._keyboardInput=new Yt,this._xMotion=new Ft({duration:i,range:_t,easing:s}),this._yMotion=new Ft({duration:i,range:pt,easing:s}),this._screenScale=[1,1],this._zoomScale=1,this._enabled=!1,this._changedWhileDragging=!1,this._bindInputs()}destroy(){this.disable(),this._mouseInput.off(),this._touchInput.off(),this._keyboardInput.off(),this.off(),this._changedWhileDragging=!1}update(t){if(!this._enabled)return;const e=this._xMotion,i=this._yMotion,s=this._keyboardInput;this._disableKeyboard||s.update(),this._disablePitch||i.update(t),this._disableYaw||e.update(t)}updateRange(t,e){const i=t.getYawRange(e),s=t.getPitchRange(e);this._xMotion.setRange(i.min,i.max),this._yMotion.setRange(s.min,s.max)}setZoomScale(t){this._zoomScale=t}resize(t,e,i,s){const n=Mt(t*lt,e)*ct;this._screenScale[0]=t/i,this._screenScale[1]=n/s}enable(){if(this._enabled)return;const t=this._controlEl;this._mouseInput.enable(t),this._touchInput.enable(t),this._keyboardInput.enable(t),this._enabled=!0,this._enableBlocked=!1,this.trigger(ht.ENABLE,{control:this,updateCursor:!0})}disable(){this._enabled&&(this._mouseInput.disable(),this._touchInput.disable(),this._keyboardInput.disable(),this._enabled=!1,this.trigger(ht.DISABLE,{updateCursor:!0}))}sync(t){this.updateRange(t,t.zoom),this._xMotion.reset(t.yaw),this._yMotion.reset(t.pitch)}_bindInputs(){const t=this._mouseInput,e=this._touchInput,i=this._keyboardInput;t.on(ht.INPUT_START,this._onInputStart),t.on(ht.CHANGE,this._onChange),t.on(ht.INPUT_END,this._onInputEnd),e.on(ht.INPUT_START,this._onInputStart),e.on(ht.CHANGE,this._onChange),e.on(ht.INPUT_END,this._onInputEnd),i.on(ht.INPUT_START,this._onInputStart),i.on(ht.CHANGE,this._onChange),i.on(ht.INPUT_END,this._onInputEnd)}},jt=class extends E{get scrollable(){return this._scrollable}set scrollable(t){this._scrollable=t}constructor(){super(),this._onWheel=t=>{const e=this._scrollable;if(0===t.deltaY||e)return;t.preventDefault(),t.stopPropagation(),this._inputTimer<0?this.trigger(ht.INPUT_START,{srcEvent:t,isTouch:!1,isKeyboard:!1}):this._clearTimer();const i=this._baseScale*t.deltaY;this.trigger(ht.CHANGE,{delta:i,isTouch:!1,isKeyboard:!1}),this._inputTimer=window.setTimeout(()=>{this.trigger(ht.INPUT_END,{isTouch:!1,isKeyboard:!1,scrolling:!1}),this._inputTimer=-1},dt)},this._el=null,this._baseScale=.04,this._scrollable=!1,this._inputTimer=-1}enable(t){this._el||(t.addEventListener(Y.WHEEL,this._onWheel,{passive:!1,capture:!1}),this._el=t,this._clearTimer())}disable(){const t=this._el;t&&(t.removeEventListener(Y.WHEEL,this._onWheel,!1),this._el=null,this._clearTimer())}_clearTimer(){window.clearTimeout(this._inputTimer),this._inputTimer=-1}},qt=class extends E{constructor(){super(),this._onTouchMove=t=>{const e=t.touches;if(2!==e.length)return;if(!t.cancelable)return;t.preventDefault(),t.stopPropagation();const i=this._prevDistance,s=[e[0].pageX-e[1].pageX,e[0].pageY-e[1].pageY],n=Math.sqrt(s[0]*s[0]+s[1]*s[1])*this._baseScale,o=this._isFirstTouch?0:n-i;this._isFirstTouch&&this.trigger(ht.INPUT_START,{srcEvent:t,isTouch:!0,isKeyboard:!1}),this._prevDistance=n,this._isFirstTouch=!1,this.trigger(ht.CHANGE,{delta:o,isTouch:!0,isKeyboard:!1})},this._onTouchEnd=t=>{0===t.touches.length&&(this._isFirstTouch||this.trigger(ht.INPUT_END,{isTouch:!0,isKeyboard:!1,scrolling:!1}),this._prevDistance=-1,this._isFirstTouch=!0)},this._el=null,this._baseScale=-.2,this._prevDistance=-1,this._isFirstTouch=!0}enable(t){this._el||(t.addEventListener(Y.TOUCH_MOVE,this._onTouchMove,{passive:!1,capture:!1}),t.addEventListener(Y.TOUCH_END,this._onTouchEnd),this._el=t,this._prevDistance=-1,this._isFirstTouch=!0)}disable(){const t=this._el;t&&(t.removeEventListener(Y.TOUCH_MOVE,this._onTouchMove,!1),t.removeEventListener(Y.TOUCH_END,this._onTouchEnd),this._el=null)}},Kt=class extends E{get enabled(){return this._enabled}get enableBlocked(){return this._enableBlocked}get animating(){return this._motion.activated}get zoom(){return this._motion.val}get scrollable(){return this._wheelInput.scrollable}set scrollable(t){this._wheelInput.scrollable=t}get range(){return this._motion.range}get scale(){return this._scale}set scale(t){this._scale=t}get duration(){return this._motion.duration}get easing(){return this._motion.easing}constructor(t,e,{scale:i=1,duration:s=300,easing:n=ut}={}){super(),this._onInputStart=t=>{this.trigger(ht.INPUT_START,Object.assign(Object.assign({},t),{inputType:"zoom"}))},this._onChange=({delta:t})=>{const e=t*this._scale;this._motion.setNewEndByDelta(e)},this._onInputEnd=t=>{this.trigger(ht.INPUT_END,Object.assign(Object.assign({},t),{inputType:"zoom"}))},this._scale=i,this._controlEl=t,this._enableBlocked=e,this._wheelInput=new jt,this._pinchInput=new qt,this._motion=new Ft({duration:s,easing:n,range:_t}),this._enabled=!1,this._bindInputs()}destroy(){this.disable(),this._wheelInput.off(),this._pinchInput.off(),this.off()}update(t){this._enabled&&this._motion.update(t)}enable(){if(this._enabled)return;const t=this._controlEl;this._wheelInput.enable(t),this._pinchInput.enable(t),this._enabled=!0,this._enableBlocked=!1,this.trigger(ht.ENABLE,{control:this,updateCursor:!1})}disable(){this._enabled&&(this._wheelInput.disable(),this._pinchInput.disable(),this._enabled=!1,this.trigger(ht.DISABLE,{updateCursor:!1}))}sync(t){const e=this._motion,i=t.getZoomRange();e.setRange(i.min,i.max),e.reset(i.current)}_bindInputs(){const t=this._wheelInput,e=this._pinchInput;t.on(ht.INPUT_START,this._onInputStart),t.on(ht.CHANGE,this._onChange),t.on(ht.INPUT_END,this._onInputEnd),e.on(ht.INPUT_START,this._onInputStart),e.on(ht.CHANGE,this._onChange),e.on(ht.INPUT_END,this._onInputEnd)}},(Xt={PITCH_DELTA:1,YAW_DELTA_BY_ROLL:2,YAW_DELTA_BY_YAW:3})[Xt.PITCH_DELTA]={targetAxis:[0,1,0],meshPoint:[0,0,1]},Xt[Xt.YAW_DELTA_BY_ROLL]={targetAxis:[0,1,0],meshPoint:[1,0,0]},Xt[Xt.YAW_DELTA_BY_YAW]={targetAxis:[1,0,0],meshPoint:[0,0,1]},Zt=class extends E{get enabled(){return this._enabled}get orientationUpdated(){return this._orientationUpdated}get ignoreRoll(){return this._ignoreRoll}set ignoreRoll(t){this._ignoreRoll=t}constructor(){super(),this._onDeviceOrientation=t=>{const e=this._orientation,{alpha:i,beta:s,gamma:n}=t;null!=i&&null!=s&&null!=n&&(e.alpha=i,e.beta=s,e.gamma=n,this._orientationUpdated=!0,this._needsCalibrate&&(this._needsCalibrate=!1,this._calibrateSensor()))},this._updateScreenOrientation=()=>{window.screen&&window.screen.orientation&&void 0!==window.screen.orientation.angle?this._screenOrientation=screen.orientation.angle:void 0!==window.orientation?this._screenOrientation=window.orientation>=0?window.orientation:360+window.orientation:this._screenOrientation=0},this.quaternion=li(),this._orientation={alpha:0,beta:90,gamma:0},this._yawOrigin=0,this._yawOffset=0,this._orientationUpdated=!1,this._screenOrientation=0,this._needsCalibrate=!0,this._enabled=!1}enable(){this._enabled||(window.addEventListener(Y.DEVICE_ORIENTATION,this._onDeviceOrientation),window.addEventListener(Y.ORIENTATION_CHANGE,this._updateScreenOrientation),this._updateScreenOrientation(),this._orientationUpdated=!1,this._needsCalibrate=!0,this._enabled=!0)}disable(){this._enabled&&(window.removeEventListener(Y.DEVICE_ORIENTATION,this._onDeviceOrientation),window.removeEventListener(Y.ORIENTATION_CHANGE,this._updateScreenOrientation),this._enabled=!1)}update(){this._updateRotation(),this._orientationUpdated=!1}collectDelta(){if(!this._orientationUpdated)return{pitch:0,yaw:0};const t=T(this.quaternion);return this._updateRotation(),this._orientationUpdated=!1,this._toEulerDelta(t,this.quaternion)}setInitialRotation(t){this._yawOrigin=t}_calibrateSensor(){const t=this._yawOrigin,e=this.quaternion;this._yawOffset=0,this._updateRotation();const{yaw:i}=kt(e);this._yawOffset=i-t,this._updateRotation(),this._needsCalibrate=!1}_updateRotation(){const t=this.quaternion,{alpha:e,beta:i,gamma:s}=this._orientation;ci(t),_i(t,t,(e-this._yawOffset)*lt),di(t,t,i*lt),pi(t,t,-s*lt);const n=li(),o=.5*-this._screenOrientation*lt,r=b(-Math.sqrt(.5),0,0,Math.sqrt(.5));y(n,0,Math.sin(o),0,Math.cos(o)),ui(t,t,n),ui(t,t,r),C(t,t)}_toEulerDelta(t,e){return{yaw:this._getDeltaYaw(t,e),pitch:this._getDeltaPitch(t,e)}}_getDeltaYaw(t,e){const i=this._getRotationDelta(t,e,Xt.YAW_DELTA_BY_YAW);return this._getRotationDelta(t,e,Xt.YAW_DELTA_BY_ROLL)*Math.sin(this._extractPitchFromQuat(e))+i}_getDeltaPitch(t,e){return this._getRotationDelta(t,e,Xt.PITCH_DELTA)}_getRotationDelta(t,e,i){const s=$e(Xt[i].targetAxis[0],Xt[i].targetAxis[1],Xt[i].targetAxis[2]),n=Xt[i].meshPoint,o=T(t),r=T(e);C(o,o),C(r,r);let a=$e(0,0,1),h=$e(0,0,1);ii(a,a,o),ii(h,h,r),ii(s,s,r);const l=Je(s,ti(Xe(),a,h))>0?1:-1,c=$e(n[0],n[1],n[2]);let u;u=i!==Xt.YAW_DELTA_BY_YAW?$e(0,l,0):$e(l,0,0),ii(c,c,r),ii(u,u,r);const d=c,_=u,p=Xe();ti(p,d,_),Qe(p,p);const m=p[0],E=p[1],g=p[2];h=$e(n[0],n[1],n[2]),ii(h,h,r),a=$e(n[0],n[1],n[2]),ii(a,a,o);let v=Math.abs(a[0]*m+a[1]*E+a[2]*g);const f=Xe();!function(t,e,i){t[0]=e[0]-i[0],t[1]=e[1]-i[1],t[2]=e[2]-i[2]}(f,a,function(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t}(Xe(),p,v));let b=(f[0]*h[0]+f[1]*h[1]+f[2]*h[2])/(Ze(f)*Ze(h));b>1&&(b=1);const w=Math.acos(b),y=ti(Xe(),h,f);let R;return v=m*y[0]+E*y[1]+g*y[2],R=i!==Xt.YAW_DELTA_BY_YAW?v>0?1:-1:v<0?1:-1,w*R*l*ct}_extractPitchFromQuat(t){const e=$e(0,0,1);return ii(e,e,t),-1*Math.atan2(e[1],Math.sqrt(Math.pow(e[0],2)+Math.pow(e[2],2)))}},$t=class extends E{get enabled(){return this._input.enabled}get enableBlocked(){return this._enableBlocked}get animating(){return this._input.enabled&&this._input.orientationUpdated}get ignoreRoll(){return this._ignoreRoll}set ignoreRoll(t){this._ignoreRoll=t}static isAvailable(){return Li(this,void 0,void 0,function*(){if(!DeviceMotionEvent)return!1;let t;return Promise.race([new Promise(e=>{t=t=>{e(t.rotationRate&&null!=t.rotationRate.alpha)},window.addEventListener(Y.DEVICE_MOTION,t)}),new Promise(t=>{setTimeout(()=>t(!1),1e3)})]).then(e=>(window.removeEventListener(Y.DEVICE_MOTION,t),e))})}static requestSensorPermission(){return Li(this,void 0,void 0,function*(){return!Dt()||DeviceMotionEvent.requestPermission().then(t=>"granted"===t).catch(()=>!1)})}constructor(t,{ignoreRoll:e=!0}={}){super(),this._enableBlocked=t,this._ignoreRoll=e,this._input=new Zt}destroy(){this.disable(),this._input.off(),this.off()}update(t,e,i,s){this._ignoreRoll?this._updateYawPitch(t,e,i,s):this._updateQuaternion(t,s)}enable(){this._input.enabled||(this._input.enable(),this._enableBlocked=!1,this.trigger(ht.ENABLE,{control:this,updateCursor:!1}))}disable(){this._input.enabled&&(this._input.disable(),this.trigger(ht.DISABLE,{updateCursor:!1}))}sync(){}_updateYawPitch(t,e,i,s){const n=this._input;if(!n.enabled)return;const{yaw:o,pitch:r}=n.collectDelta();e.add(o),i.add(r),t.lookAt({yaw:e.val,pitch:i.val,zoom:s})}_updateQuaternion(t,e){const i=this._input;i.enabled&&(i.update(),t.rotate(i.quaternion,e))}},Qt=class{get useGrabCursor(){return this._useGrabCursor}set useGrabCursor(t){t!==this._useGrabCursor&&(this._useGrabCursor=t,t&&this._enabled?this._setCursor(K.GRAB):t||this._setCursor(K.NONE))}get disableContextMenu(){return this._disableContextMenu}set disableContextMenu(t){t!==this._disableContextMenu&&(this._disableContextMenu=t,t&&this._enabled?this._blockContextMenu():t||this._restoreContextMenu())}get scrollable(){return this._rotateControl.scrollable}set scrollable(t){this._rotateControl.scrollable=t}get wheelScrollable(){return this._zoomControl.scrollable}set wheelScrollable(t){this._zoomControl.scrollable=t}get ignoreZoomScale(){return this._ignoreZoomScale}set ignoreZoomScale(t){this._ignoreZoomScale=t}get enabled(){return this._enabled}get rotate(){return this._rotateControl}get zoom(){return this._zoomControl}get gyro(){return this._gyroControl}get animating(){return this._rotateControl.animating||this._zoomControl.animating||this._gyroControl.animating}constructor(t,e,{useGrabCursor:i,scrollable:s,wheelScrollable:n,disableContextMenu:o,rotate:r,zoom:a,gyro:h}){this._preventContextMenu=t=>{t.preventDefault()},this._onInputStart=t=>{this._useGrabCursor&&!t.isKeyboard&&this._setCursor(K.GRABBING)},this._onInputEnd=t=>{this._useGrabCursor&&!t.isKeyboard&&this._setCursor(K.GRAB)},this._onEnable=({control:t,updateCursor:e})=>{e&&this._useGrabCursor&&this._setCursor(K.GRAB),t.sync(this._camera)},this._onDisable=({updateCursor:t})=>{t&&this._setCursor(K.NONE)},this._onCameraAnimationEnd=({animation:t})=>{t.getFinishPromise().then(()=>{this.sync()})},this._useGrabCursor=i,this._disableContextMenu=o,this._camera=e,this._controlEl=t,this._ignoreZoomScale=!1,this._enabled=!1,this._rotateControl=new Wt(t,!r,St(r)),this._zoomControl=new Kt(t,!a,St(a)),this._gyroControl=new $t(!h,St(h)),this._rotateControl.scrollable=s,this._zoomControl.scrollable=n,this._bindEvents()}destroy(){this.disable(),this._rotateControl.destroy(),this._zoomControl.destroy(),this._setCursor(K.NONE)}resize(t,e){const i=this._camera;this._rotateControl.resize(i.fov,i.aspect,t,e)}enable(){return Li(this,void 0,void 0,function*(){this._enabled||(this._rotateControl.enableBlocked||this._rotateControl.enable(),this._zoomControl.enableBlocked||this._zoomControl.enable(),this._gyroControl.enableBlocked||(yield $t.isAvailable())&&this._gyroControl.enable(),this.sync(),this._disableContextMenu&&this._blockContextMenu(),this._enabled=!0)})}disable(){this._enabled&&(this._rotateControl.disable(),this._zoomControl.disable(),this._gyroControl.disable(),this._restoreContextMenu(),this._enabled=!1)}update(t){const e=this._camera,i=this._rotateControl,s=this._zoomControl,n=this._gyroControl;s.update(t);const o=Ut(e.fov,s.zoom),r=this._ignoreZoomScale?1:Math.max(o,1);i.setZoomScale(r),i.updateRange(e,o),i.update(t);const a=i.yaw,h=i.pitch;n.enabled?n.update(e,a,h,o):e.lookAt({yaw:a.val,pitch:h.val,zoom:o})}sync(){const t=this._camera;this._zoomControl.sync(t),this._rotateControl.sync(t)}_blockContextMenu(){this._controlEl.addEventListener(Y.CONTEXT_MENU,this._preventContextMenu)}_restoreContextMenu(){this._controlEl.removeEventListener(Y.CONTEXT_MENU,this._preventContextMenu)}_setCursor(t){(this._useGrabCursor||t===K.NONE)&&(this._controlEl.style.cursor=t)}_bindEvents(){const t=this._rotateControl,e=this._zoomControl;t.on(ht.INPUT_START,this._onInputStart),t.on(ht.INPUT_END,this._onInputEnd),t.on(ht.ENABLE,this._onEnable),t.on(ht.DISABLE,this._onDisable),e.on(ht.ENABLE,this._onEnable),e.on(ht.DISABLE,this._onDisable),this._camera.on(rt.ANIMATION_END,this._onCameraAnimationEnd)}},Jt=class{constructor({width:t,height:e,flipY:i}){this.width=t,this.height=e,this.flipY=i,this.wrapS=WebGLRenderingContext.CLAMP_TO_EDGE,this.wrapT=WebGLRenderingContext.CLAMP_TO_EDGE}destroy(){}isVideo(){return!1}isCube(){return!1}},te=class extends Jt{constructor({source:t,width:e,height:i,flipY:s}){super({width:e,height:i,flipY:s}),this.source=t}},ee=class extends te{destroy(){const t=this.source;t.pause(),t.removeAttribute("src"),t.load()}isVideo(){return!0}isPaused(){const t=this.source;return t.paused||t.ended||t.readyState<=2}hasAudio(){const t=this.source;return t.audioTracks?t.audioTracks.length>0:null!=t.webkitAudioDecodedByteCount?t.webkitAudioDecodedByteCount>0:null==t.mozHasAudio||t.mozHasAudio}},ie=class extends Jt{constructor({sources:t,width:e,height:i,flipY:s}){super({width:e,height:i,flipY:s}),this.sources=t}isCube(){return!0}},se=class{constructor(){this._loadChecker=new z}load(t,e){return Li(this,void 0,void 0,function*(){if(e)return this.loadVideo(t,St(e));if(Array.isArray(t)&&t.length>1)return this.loadCubeImage(t);{const e=Array.isArray(t)?t[0]:t;return this.loadImage(e)}})}loadImage(t){return Li(this,void 0,void 0,function*(){const e=this._toImageArray(t);return this._load(e,t=>{const i=e[0];t(new te({source:i,width:i.naturalWidth,height:i.naturalHeight,flipY:!0}))})})}loadCubeImage(t){return Li(this,void 0,void 0,function*(){const e=this._toImageArray(t);return this._load(e,t=>{t(new ie({sources:e,width:e[0].naturalWidth,height:e[0].naturalHeight,flipY:!1}))})})}loadVideo(t,e){return Li(this,void 0,void 0,function*(){const i=Object.assign({autoplay:!0,muted:!0,loop:!1,volume:1},e),s=this._toVideoElement(t,i);return this._load([s],t=>{const{autoplay:e,muted:n}=i;s.currentTime=0,e&&n&&s.play().catch(()=>{}),t(new ee({source:s,width:s.videoWidth,height:s.videoHeight,flipY:!0}))})})}_load(t,e){const i=this._loadChecker;return new Promise((s,n)=>{i.once("ready",t=>{t.errorCount>0||e(s)}),i.once("error",n),i.check(t)})}_toImageArray(t){return(Array.isArray(t)?t:[t]).map(t=>{if(wt(t)){const e=new Image;return e.crossOrigin="anonymous",e.src=t,e}return t})}_toVideoElement(t,{muted:e,loop:i,volume:s}){if(t instanceof HTMLVideoElement)return t;const n=document.createElement("video");return n.crossOrigin="anonymous",n.playsInline=!0,n.setAttribute("webkit-playsinline",""),n.muted=e,n.volume=s,n.loop=i,Array.isArray(t)?t.forEach(t=>this._appendSourceElement(n,t)):this._appendSourceElement(n,t),n.querySelectorAll("source").length>0&&n.readyState<1&&n.load(),n}_appendSourceElement(t,e){if(e instanceof HTMLSourceElement)return e;const i=document.createElement("source");i.src=e,t.appendChild(i)}},ne=class{constructor(t,e=window){this.maxDeltaTime=t,this._context=e,this._rafId=-1,this._rafTimer=-1,this._lastUpdateTime=-1}start(t){const e=this._context;if(!e||!t)return;if(this._rafId>=0||this._rafTimer>=0)return;const i=(s,n)=>{const o=Date.now();t(Math.min(o-this._lastUpdateTime,1e3*this.maxDeltaTime),n),this._lastUpdateTime=o,this._rafId=e.requestAnimationFrame(i)};this._lastUpdateTime=Date.now(),this._rafId=e.requestAnimationFrame(i)}stop(){this._rafId>=0&&this._context.cancelAnimationFrame(this._rafId),this._rafTimer>=0&&clearTimeout(this._rafTimer),this._rafId=-1,this._rafTimer=-1}changeContext(t){this.stop(),this._context=t}},oe=class{get useResizeObserver(){return this._useResizeObserver}get enabled(){return this._enabled}constructor(t,e){this._skipFirstResize=(()=>{let t=!0;return()=>{t?t=!1:this._onResize()}})(),this._useResizeObserver=t,this._enabled=!1,this._resizeObserver=null,this._onResize=e}enable(t){if(this._enabled&&this.disable(),this._useResizeObserver&&window.ResizeObserver){const e=t.getBoundingClientRect(),i=0!==e.width||0!==e.height,s=new ResizeObserver(i?this._skipFirstResize:this._onResize);s.observe(t),this._resizeObserver=s}else window.addEventListener(Y.RESIZE,this._onResize);return this._enabled=!0,this}disable(){if(!this._enabled)return this;const t=this._resizeObserver;return t?(t.disconnect(),this._resizeObserver=null):window.removeEventListener(Y.RESIZE,this._onResize),this._enabled=!1,this}},re=class{get enabled(){return this._enabled}get enableBlocked(){return this._enableBlocked}get playing(){return this._enabled&&!this._interrupted}get delay(){return this._delay}set delay(t){this._delay=t}get delayOnMouseLeave(){return this._delayOnMouseLeave}set delayOnMouseLeave(t){this._delayOnMouseLeave=t}get speed(){return this._speed}set speed(t){this._speed=t}get pauseOnHover(){return this._pauseOnHover}set pauseOnHover(t){this._pauseOnHover=t}get canInterrupt(){return this._canInterrupt}set canInterrupt(t){this._canInterrupt=t}get disableOnInterrupt(){return this._disableOnInterrupt}set disableOnInterrupt(t){this._disableOnInterrupt=t}constructor(t,e,i){this._onInputStart=()=>{this._canInterrupt&&(this._interrupted=!0,this._clearTimeout())},this._onInputEnd=()=>{this._setUninterruptedAfterDelay(this._delay)},this._onGyroEnable=()=>{this.disable()},this._onMouseEnter=()=>{this._pauseOnHover&&(this._interrupted=!0,this._hovering=!0)},this._onMouseLeave=()=>{this._pauseOnHover&&(this._hovering=!1,this._setUninterruptedAfterDelay(this._delayOnMouseLeave))},this._camera=t.camera,this._control=t.control,this._element=e,this._enabled=!1,this._interrupted=!1,this._interruptionTimer=-1,this._hovering=!1;const{delay:s=2e3,delayOnMouseLeave:n=0,speed:o=1,pauseOnHover:r=!1,canInterrupt:a=!0,disableOnInterrupt:h=!1}=St(i);this._enableBlocked=!i,this._delay=s,this._delayOnMouseLeave=n,this._speed=o,this._pauseOnHover=r,this._canInterrupt=a,this._disableOnInterrupt=h}destroy(){this.disable()}update(t){if(!this._enabled)return;if(this._interrupted)return void(this._disableOnInterrupt&&this.disable());const e=this._camera,i=-this._speed*t/100;e.yaw=Nt(e.yaw+i,0,360)}enable(){const t=this._control,e=this._element;this._enabled||t.gyro.enabled||(t.rotate.on(ht.INPUT_START,this._onInputStart),t.rotate.on(ht.INPUT_END,this._onInputEnd),t.zoom.on(ht.INPUT_START,this._onInputStart),t.zoom.on(ht.INPUT_END,this._onInputEnd),t.gyro.on(ht.ENABLE,this._onGyroEnable),e.addEventListener(Y.MOUSE_ENTER,this._onMouseEnter,!1),e.addEventListener(Y.MOUSE_LEAVE,this._onMouseLeave,!1),this._enabled=!0,this._enableBlocked=!1)}enableAfterDelay(){this.enable(),this._interrupted=!0,this._setUninterruptedAfterDelay(this._delay)}disable(){if(!this._enabled)return;const t=this._control,e=this._element;t.rotate.off(ht.INPUT_START,this._onInputStart),t.rotate.off(ht.INPUT_END,this._onInputEnd),t.zoom.off(ht.INPUT_START,this._onInputStart),t.zoom.off(ht.INPUT_END,this._onInputEnd),t.gyro.off(ht.ENABLE,this._onGyroEnable),e.removeEventListener(Y.MOUSE_ENTER,this._onMouseEnter,!1),e.removeEventListener(Y.MOUSE_LEAVE,this._onMouseLeave,!1),this._enabled=!1,this._interrupted=!1,this._hovering=!1,this._clearTimeout()}_setUninterruptedAfterDelay(t){this._hovering||(this._clearTimeout(),t>0?this._interruptionTimer=window.setTimeout(()=>{this._interrupted=!1,this._interruptionTimer=-1},t):(this._interrupted=!1,this._interruptionTimer=-1))}_clearTimeout(){this._interruptionTimer>=0&&(window.clearTimeout(this._interruptionTimer),this._interruptionTimer=-1)}},ae=class extends E{constructor(t,e={}){super(),this.destroy=()=>{this.exit(),this.off()},this._onSessionEnd=()=>{this.exit(),this.trigger(st.VR_END)},this._xrSession=null,this._xrRefSpace=null,this._ctx=t,this._options=e}isAvailable(){return Li(this,void 0,void 0,function*(){const t=window.navigator.xr;return!!t&&t.isSessionSupported(ft).then(t=>t).catch(()=>!1)})}enter(){return Li(this,void 0,void 0,function*(){const t=this._ctx,e=window.navigator.xr;if(!e)return;yield $t.requestSensorPermission();const i=Object.assign({requiredFeatures:[Tt]},this._options);yield t.makeXRCompatible();const s=yield e.requestSession(ft,i);t.bindXRLayer(s);const n=yield s.requestReferenceSpace(Tt);this._setSession(s,n),this.trigger(st.VR_START,{session:s})})}exit(){const t=this._xrSession;t&&t.end().catch(()=>{}),this._xrSession=null,this._xrRefSpace=null}canRender(t){const e=this._xrRefSpace;return!!e&&!!t.getViewerPose(e)}getEyeParams(t){const e=t.session,i=t.getViewerPose(this._xrRefSpace);if(!i)return null;const s=e.renderState.baseLayer;return s?i.views.map(t=>({viewport:s.getViewport(t),vMatrix:t.transform.inverse.matrix,pMatrix:t.projectionMatrix})):null}_setSession(t,e){this._xrSession=t,this._xrRefSpace=e,t.addEventListener(Y.XR_END,this._onSessionEnd)}},he=class{constructor(t,e){this.element=t,this.position=e}},le=class{constructor(t,e,{zoom:i=!1}){this._containerEl=Rt(`.${it.HOTSPOT_CONTAINER}`,t),this._renderer=e,this._hotspots=[],this._zoom=i}refresh(){const t=this._containerEl;t&&(this._hotspots=[].slice.apply(t.querySelectorAll(`.${it.HOTSPOT}`)).map(t=>this._parseHotspot(t)))}render(t){const e=this._hotspots,i=.5*this._renderer.width,s=.5*this._renderer.height,n=t.zoom,o="translate(-50%, -50%)",r=this._zoom?`scale(${n})`:"";e.forEach(e=>{const n=e.position,a=Xe();if(function(t,e){t[0]=e[0],t[1]=e[1],t[2]=e[2]}(a,n),ei(a,a,t.viewMatrix),ei(a,a,t.projectionMatrix),a[2]>1||a[2]<0)return void e.element.classList.remove(it.HOTSPOT_VISIBLE);const h=function(t,e){var i=new v(2);return i[0]=t,i[1]=e,i}(a[0]*i+i,-a[1]*s+s);e.element.classList.add(it.HOTSPOT_VISIBLE),e.element.style.transform=[o,`translate(${h[0]}px, ${h[1]}px)`,r].join(" ")})}_parseHotspot(t){const e=t.dataset.yaw,i=t.dataset.pitch,s=t.dataset.position;if(e||i){const s=e?parseFloat(e):0,n=i?parseFloat(i):0;return new he(t,this._yawPitchToVec3(s,n))}if(s){const e=s.split(" ").map(t=>parseFloat(t));if(e.length<3)throw new H(G.MESSAGES.INSUFFICIENT_ARGS(s,'hotspot attribute "data-position"'),G.CODES.INSUFFICIENT_ARGS);return new he(t,$e(e[0],e[1],e[2]))}return new he(t,$e(0,0,-1))}_yawPitchToVec3(t,e){const i=t*lt,s=e*lt,n=Xe();return n[1]=Math.sin(s),n[2]=Math.cos(s),n[0]=n[2]*Math.sin(-i),n[2]=-n[2]*Math.cos(-i),n}},ce=class{get count(){return this.geometry.indicies.count}constructor(t,e,i){this.obj=t,this.geometry=e,this.buffers=i}},ue=class{get canvas(){return this._canvas}get maxTextureSize(){return this._maxTextureSize}get isWebGL2(){return this._isWebGL2}get supportVAO(){return this._isWebGL2||!!this._extensions.vao}get lost(){return this._contextLost}get debug(){return this._debug}constructor(t,e){this._onContextLost=()=>{this._canvas.classList.add(it.CTX_LOST),this._contextLost=!0},this._onContextRestore=()=>{this._canvas.classList.remove(it.CTX_LOST),this._contextLost=!1},this._canvas=t,this._contextLost=!1,this._debug=e,this._extensions={vao:null,loseContext:null}}init(){const t=this._canvas,{gl:e,isWebGL2:i}=this._getContext(t);this._gl=e,this._maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE),this._isWebGL2=i,this._isWebGL2||(this._extensions.vao=e.getExtension("OES_vertex_array_object")),this._extensions.loseContext=e.getExtension("WEBGL_lose_context"),t.addEventListener(Y.CONTEXT_LOST,this._onContextLost),t.addEventListener(Y.CONTEXT_RESTORED,this._onContextRestore)}destroy(){const t=this._gl,e=this._canvas;t&&(t.bindBuffer(t.ARRAY_BUFFER,null),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null)),e.removeEventListener(Y.CONTEXT_LOST,this._onContextLost),e.removeEventListener(Y.CONTEXT_RESTORED,this._onContextRestore)}forceLoseContext(){const t=this._extensions.loseContext;t&&t.loseContext()}forceRestoreContext(){const t=this._extensions.loseContext;t&&t.restoreContext()}clear(){const t=this._gl;t.clear(t.COLOR_BUFFER_BIT)}resize(){const t=this._gl;t.viewport(0,0,t.drawingBufferWidth,t.drawingBufferHeight)}viewport(t,e,i,s){this._gl.viewport(t,e,i,s)}createVAO(t,e){const i=this._createNativeVAO(),s=new ce(i,t,{indicies:this._createBuffer(),position:this._createBuffer(),uv:this._createBuffer()});return i&&(this._bindNativeVAO(i),this._supplyGeometryData(s,e),this._bindNativeVAO(null),this._unbindBuffers()),s}draw(t,e){const i=this._gl;t.obj?this._bindNativeVAO(t.obj):this._supplyGeometryData(t,e),i.drawElements(i.TRIANGLES,t.count,i.UNSIGNED_SHORT,0),t.obj?this._bindNativeVAO(null):this._unbindBuffers()}releaseVAO(t){t.obj&&this._deleteNativeVAO(t.obj),this._deleteBuffer(t.buffers.indicies),this._deleteBuffer(t.buffers.position),this._deleteBuffer(t.buffers.uv)}getUniformLocations(t,e){const i=this._gl,s=Object.keys(e).reduce((e,s)=>(e[s]=i.getUniformLocation(t,s),e),{});return Object.assign(Object.assign({},this._getCommonUniformLocations(t)),s)}updateCommonUniforms(t,e,i){const s=this._gl,n=i.uniformLocations,o=t.matrix,r=je();qe(r,e.viewMatrix,o),s.uniformMatrix4fv(n.uMVMatrix,!1,r),s.uniformMatrix4fv(n.uPMatrix,!1,e.projectionMatrix)}updateVRUniforms(t,e,i,s){const n=this._gl,o=t.uniformLocations;n.uniformMatrix4fv(o.uMVMatrix,!1,e),n.uniformMatrix4fv(o.uPMatrix,!1,i),o.uEye&&n.uniform1f(o.uEye,s)}updateUniforms(t){const e=this._gl,i=t.uniforms,s=t.uniformLocations;for(const n in i){const t=i[n],o=s[n];t&&t.needsUpdate&&t.update(e,o,this._isWebGL2)}}releaseShaderResources(t){const e=this._gl,i=t.uniforms;for(const s in i){const t=i[s];t&&t.needsUpdate&&t.destroy(e)}e.deleteProgram(t.program)}useProgram(t){this._gl.useProgram(t.program)}createProgram(t,e){const i=this._gl,s=i.createProgram(),n=this._compileShader(i.VERTEX_SHADER,t),o=this._compileShader(i.FRAGMENT_SHADER,e);if(i.attachShader(s,n),i.attachShader(s,o),i.bindAttribLocation(s,0,"position"),i.bindAttribLocation(s,1,"uv"),i.linkProgram(s),this._debug&&!i.getProgramParameter(s,i.LINK_STATUS)){let t=null;throw i.getShaderParameter(n,i.COMPILE_STATUS)?i.getShaderParameter(o,i.COMPILE_STATUS)||(t=i.getShaderInfoLog(o)):t=i.getShaderInfoLog(n),new H(G.MESSAGES.FAILED_LINKING_PROGRAM(i.getProgramInfoLog(s),t),G.CODES.FAILED_LINKING_PROGRAM)}return i.deleteShader(n),i.deleteShader(o),s}createWebGLTexture(t){const e=this._gl,i=e.createTexture();if(e.bindTexture(e.TEXTURE_2D,i),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,t.wrapS),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,t.wrapT),!t.isVideo()&&this._isWebGL2){const i=e;i.texStorage2D(i.TEXTURE_2D,1,i.RGBA8,t.width,t.height)}return i}createWebGLCubeTexture(t,e){const i=this._gl,s=i.createTexture();if(i.bindTexture(i.TEXTURE_CUBE_MAP,s),i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_MIN_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_MAG_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_WRAP_S,t.wrapS),i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_WRAP_T,t.wrapT),this._isWebGL2){const t=i;t.texStorage2D(t.TEXTURE_CUBE_MAP,1,t.RGBA8,e,e)}return s}makeXRCompatible(){return Li(this,void 0,void 0,function*(){const t=this._gl,e=t.getContextAttributes();e&&!0!==e.xrCompatible&&(yield t.makeXRCompatible())})}bindXRLayer(t){const e=this._gl,i=new XRWebGLLayer(t,e);t.updateRenderState({baseLayer:i})}bindXRFrame(t){const e=this._gl,i=t.session.renderState.baseLayer;e.bindFramebuffer(e.FRAMEBUFFER,i.framebuffer)}useDefaultFrameBuffer(){const t=this._gl;t.bindFramebuffer(t.FRAMEBUFFER,null)}_createBuffer(){return this._gl.createBuffer()}_deleteBuffer(t){return this._gl.deleteBuffer(t)}_createNativeVAO(){const t=this._gl;if(this._isWebGL2)return t.createVertexArray();{const t=this._extensions.vao;return(null==t?void 0:t.createVertexArrayOES())||null}}_bindNativeVAO(t){const e=this._gl;if(this._isWebGL2)e.bindVertexArray(t);else{const e=this._extensions.vao;null==e||e.bindVertexArrayOES(t)}}_deleteNativeVAO(t){const e=this._gl;if(this._isWebGL2)e.deleteVertexArray(t);else{const e=this._extensions.vao;null==e||e.deleteVertexArrayOES(t)}}_supplyGeometryData(t,e){const i=t.geometry;this._supplyIndiciesData(i.indicies,t.buffers.indicies),this._supplyAttributeData(i.vertices,e.program,"position",t.buffers.position),this._supplyAttributeData(i.uvs,e.program,"uv",t.buffers.uv)}_unbindBuffers(){const t=this._gl;t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null),t.bindBuffer(t.ARRAY_BUFFER,null)}_supplyIndiciesData(t,e){const i=this._gl;i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,e),i.bufferData(i.ELEMENT_ARRAY_BUFFER,t.data,i.STATIC_DRAW)}_supplyAttributeData(t,e,i,s){const n=this._gl,o=n.getAttribLocation(e,i);o<0||(n.bindBuffer(n.ARRAY_BUFFER,s),n.bufferData(n.ARRAY_BUFFER,t.data,n.STATIC_DRAW),n.vertexAttribPointer(o,t.itemSize,n.FLOAT,!1,0,0),n.enableVertexAttribArray(o))}_compileShader(t,e){const i=this._gl,s=i.createShader(t);return i.shaderSource(s,e),i.compileShader(s),s}_getCommonUniformLocations(t){const e=this._gl;return{uMVMatrix:e.getUniformLocation(t,"uMVMatrix"),uPMatrix:e.getUniformLocation(t,"uPMatrix")}}_getContext(t){const e=["webgl2","webgl","experimental-webgl","webkit-3d","moz-webgl"];let i=null,s=!1;const n={preserveDrawingBuffer:!1,antialias:!1},o=t=>t.statusMessage;t.addEventListener(Y.CONTEXT_CREATE_ERROR,o);for(const a of e){try{i=t.getContext(a,n),s="webgl2"===a}catch(r){}if(i)break}if(t.removeEventListener(Y.CONTEXT_CREATE_ERROR,o),!i)throw new H(G.MESSAGES.WEBGL_NOT_SUPPORTED,G.CODES.WEBGL_NOT_SUPPORTED);return{gl:i,isWebGL2:s}}},de=class{get canvas(){return this._canvas}get width(){return this._elementSize.x}get height(){return this._elementSize.y}get pixelRatio(){return this._pixelRatio}get aspect(){return this._elementSize.x/this._elementSize.y}constructor(t,e){this._canvas=t,this._elementSize={x:0,y:0},this._pixelRatio=1,this.ctx=new ue(t,e)}destroy(){const t=this._canvas;this.ctx.destroy(),t.width=1,t.height=1}resize(){const t=this._canvas,e=this._elementSize,i=window.devicePixelRatio;e.x=t.clientWidth,e.y=t.clientHeight,t.width=e.x*i,t.height=e.y*i,this._pixelRatio=i,this.ctx.resize()}render(t,e){const i=this.ctx;i.lost||(i.clear(),i.useProgram(t.program),i.updateCommonUniforms(t,e,t.program),t.update({camera:e}),i.updateUniforms(t.program),i.draw(t.vao,t.program))}renderVR(t,e,i){const s=this.ctx,n=e.getEyeParams(i);n&&t&&(s.bindXRFrame(i),s.useProgram(t.program),s.updateUniforms(t.program),n.forEach((e,i)=>{const n=e.viewport,o=qe(je(),e.vMatrix,t.matrix);s.viewport(n.x,n.y,n.width,n.height),s.updateVRUniforms(t.program,o,e.pMatrix,i),s.draw(t.vao,t.program)}))}},(_e=class extends E{get rootEl(){return this._rootEl}get renderer(){return this._renderer}get camera(){return this._camera}get control(){return this._control}get vr(){return this._vr}get hotspot(){return this._hotspot}get plugins(){return this._plugins}get projection(){return this._projection}set projection(t){this._initialized&&t?this.load(t):this._projection=t}get mesh(){return this._mesh}get initialized(){return this._initialized}get autoplay(){return this._autoplay}get autoInit(){return this._autoInit}get autoResize(){return this._autoResize}get canvasSelector(){return this._canvasSelector}get useResizeObserver(){return this._useResizeObserver}get tabIndex(){return this._tabIndex}set tabIndex(t){const e=this._renderer.canvas;this._tabIndex=t,null!=t?e.tabIndex=t:e.removeAttribute("tabindex")}get maxDeltaTime(){return this._animator.maxDeltaTime}set maxDeltaTime(t){this._animator.maxDeltaTime=t}get debug(){return this._debug}set debug(t){this._debug=t}get initialYaw(){return this._camera.initialYaw}set initialYaw(t){this._camera.initialYaw=t}get initialPitch(){return this._camera.initialPitch}set initialPitch(t){this._camera.initialPitch=t}get initialZoom(){return this._camera.initialZoom}set initialZoom(t){this._camera.initialZoom=t}get yawRange(){return this._camera.yawRange}set yawRange(t){this._camera.yawRange=t,this._projection&&this._projection.updateCamera(this._camera)}get pitchRange(){return this._camera.pitchRange}set pitchRange(t){this._camera.pitchRange=t,this._projection&&this._projection.updateCamera(this._camera)}get zoomRange(){return this._camera.zoomRange}set zoomRange(t){this._camera.zoomRange=t,this._projection&&this._projection.updateCamera(this._camera)}get fov(){return this._camera.fov}set fov(t){const e=this._camera,i=this._control;e.fov=t,e.updateMatrix(),i.sync()}get rotate(){return this._control.rotate}get zoom(){return this._control.zoom}get gyro(){return this._control.gyro}get useGrabCursor(){return this._control.useGrabCursor}set useGrabCursor(t){this._control.useGrabCursor=t}get disableContextMenu(){return this._control.disableContextMenu}set disableContextMenu(t){this._control.disableContextMenu=t}get scrollable(){return this._control.scrollable}set scrollable(t){this._control.scrollable=t}get wheelScrollable(){return this._control.wheelScrollable}set wheelScrollable(t){this._control.wheelScrollable=t}constructor(t,{projection:e=null,initialYaw:i=0,initialPitch:s=0,initialZoom:n=1,yawRange:o=null,pitchRange:r=null,zoomRange:a=null,fov:h=90,useGrabCursor:l=!0,disableContextMenu:c=!1,rotate:u=!0,zoom:d=!0,gyro:_=!1,scrollable:p=!0,wheelScrollable:m=!1,autoplay:E=!1,hotspot:g={},autoInit:v=!0,autoResize:f=!0,canvasSelector:T="canvas",useResizeObserver:b=!0,on:w={},plugins:y=[],maxDeltaTime:C=1/30,tabIndex:R=0,debug:O=!1}={}){super(),this.renderFrame=t=>{const e=this._camera,i=this._renderer,s=this._control,n=this._hotspot,o=this._autoplay,r=this._mesh;r&&(this._emit(st.BEFORE_RENDER),o.playing&&(o.update(t),s.sync()),e.animation?e.animation.update(t):s.update(t),i.render(r,e),n.render(e),e.changed&&this._emit(st.VIEW_CHANGE,{yaw:e.yaw,pitch:e.pitch,zoom:e.zoom,quaternion:[e.quaternion[0],e.quaternion[1],e.quaternion[2],e.quaternion[3]]}),e.onFrameRender(),this._emit(st.RENDER))},this._renderFrameOnDemand=t=>{const e=this._camera,i=this._control,s=this._autoplay,n=this._mesh,o=null==n?void 0:n.getTexture();this._initialized&&o&&(e.animation||i.animating||s.playing||o.isVideo())&&this.renderFrame(t)},this._renderVRFrame=(t,e)=>{const i=this._vr,s=this._mesh,n=this._renderer;s&&(this._emit(st.BEFORE_RENDER),n.renderVR(s,i,e),this._emit(st.RENDER))},this._rootEl=Ot(t),this._plugins=y,this._initialized=!1,this._autoInit=v,this._autoResize=f,this._canvasSelector=T,this._useResizeObserver=b,this._tabIndex=R,this._debug=O;const L=Lt(this._rootEl,T);this._renderer=new de(L,O),this._camera=new zt({initialYaw:i,initialPitch:s,initialZoom:n,fov:h,yawRange:o,pitchRange:r,zoomRange:a}),this._control=new Qt(L,this._camera,{useGrabCursor:l,scrollable:p,wheelScrollable:m,disableContextMenu:c,rotate:u,zoom:d,gyro:_}),this._animator=new ne(C),this._autoplay=new re(this,L,E),this._projection=e,this._mesh=null,this._autoResizer=new oe(b,()=>this.resize()),this._vr=new ae(this._renderer.ctx),this._hotspot=new le(this._rootEl,this._renderer,g),this._addEventHandlers(w),e&&v&&this.init()}destroy(){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(t=>t.destroy(this)),this._initialized=!1}init(){return Li(this,void 0,void 0,function*(){if(!this._projection)throw new H(G.MESSAGES.PROVIDE_PROJECTION_FIRST,G.CODES.PROVIDE_PROJECTION_FIRST);const t=this._renderer,e=this._camera,i=this._control,s=this._animator,n=this._hotspot,o=this._projection,r=t.canvas;this._bindComponentEvents(),t.ctx.init(),this._resizeComponents(),e.updateMatrix(),this._autoResize&&this._autoResizer.enable(r),this._autoplay.enableBlocked||this._autoplay.enable(),this._plugins.forEach(t=>{t.init(this)});const a=yield this._loadTexture(o);this._applyProjection(o,a),n.refresh(),s.start(this._renderFrameOnDemand),yield i.enable(),null==this._tabIndex||r.hasAttribute("tabIndex")||(r.tabIndex=this._tabIndex),this._initialized=!0,this.renderFrame(0),this._emit(st.READY)})}load(t){return Li(this,void 0,void 0,function*(){if(!t)return!1;if(this._initialized){const e=yield this._loadTexture(t);this._applyProjection(t,e),this.renderFrame(0)}else this._projection=t,this.init();return!0})}resize(){if(!this._initialized)return;this._resizeComponents(),this.renderFrame(0);const{width:t,height:e}=this._renderer;this._emit(st.RESIZE,{width:t,height:e})}addPlugins(...t){this._initialized&&t.forEach(t=>{t.init(this)}),this._plugins.push(...t)}removePlugins(...t){t.forEach(t=>{const e=this._plugins.indexOf(t);e<0||(t.destroy(this),this._plugins.splice(e,1))})}_emit(t,...e){const i=e?e[0]:{};this.trigger(t,Object.assign({type:t,target:this},i))}_applyProjection(t,e){const i=this._camera,s=this._control,n=this._renderer,o=this._mesh;o&&o.destroy(n.ctx);const r=t.createMesh(n.ctx,e);t.updateCamera(i),t.updateControl(s),this._mesh=r,this._emit(st.PROJECTION_CHANGE,{projection:t})}_loadTexture(t){return Li(this,void 0,void 0,function*(){const e=new se,{src:i,video:s}=t;this._emit(st.LOAD_START,{src:i,video:s});const n=yield e.load(i,s);return this._emit(st.LOAD,{src:i,video:s}),n})}_resizeComponents(){const t=this._renderer,e=this._camera,i=this._control;t.resize(),e.resize(t.width,t.height),i.resize(t.width,t.height)}_addEventHandlers(t){Object.keys(t).forEach(e=>{this.on(e,t[e])})}_bindComponentEvents(){const t=this._rootEl,e=this._control,i=this._animator,s=this._renderer,n=this._vr;[ht.STATIC_CLICK,ht.INPUT_START,ht.INPUT_END].forEach(t=>{e.rotate.on(t,e=>{this._emit(t,e)}),e.zoom.on(t,e=>{this._emit(t,e)})}),n.on(st.VR_START,e=>{t.classList.add(it.IN_VR),i.changeContext(e.session),i.start(this._renderVRFrame),this._emit(st.VR_START)}),n.on(st.VR_END,()=>{t.classList.remove(it.IN_VR),s.ctx.useDefaultFrameBuffer(),i.changeContext(window),i.start(this._renderFrameOnDemand),this.resize(),this._emit(st.VR_END)})}}).VERSION="4.0.0-beta.7",pe=class extends E{constructor(){super(),this.matrix=je(),this.rotation=li(),this.position=$e(0,0,0),this.scale=$e(1,1,1)}updateMatrix(){!function(t,e,i,s){var n=e[0],o=e[1],r=e[2],a=e[3],h=n+n,l=o+o,c=r+r,u=n*h,d=n*l,_=n*c,p=o*l,m=o*c,E=r*c,g=a*h,v=a*l,f=a*c,T=s[0],b=s[1],w=s[2];t[0]=(1-(p+E))*T,t[1]=(d+f)*T,t[2]=(_-v)*T,t[3]=0,t[4]=(d-f)*b,t[5]=(1-(u+E))*b,t[6]=(m+g)*b,t[7]=0,t[8]=(_+v)*w,t[9]=(m-g)*w,t[10]=(1-(u+p))*w,t[11]=0,t[12]=i[0],t[13]=i[1],t[14]=i[2],t[15]=1}(this.matrix,this.rotation,this.position,this.scale)}update(t){this.trigger(at.UPDATE,t)}},me=class{constructor(t){this.position=t.position,this.order=t.order}},Ee={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"},ge={TOP_LEFT:"top-left",TOP_RIGHT:"top-right",MAIN_TOP:"main-top",MAIN_BOTTOM:"main-bottom",MAIN_LEFT:"main-left",MAIN_RIGHT:"main-right"},ve=class extends E{constructor(){super(),this._onHold=({srcEvent:t,isTouch:e})=>{var i;const s=this._bbox;if(!s)return;const n=e?t.touches[0].pageX:t.pageX,o=s.x+(null!==(i=window.scrollX)&&void 0!==i?i:window.pageXOffset),r=It(n,o,o+s.width),a=(r-o)/s.width;this._motion.reset(r),this.thumbEl.classList.add(this._fixedClass),this.trigger(ht.INPUT_START,a)},this._onChange=({delta:t})=>{var e;const i=this._motion,s=this._bbox;if(!s)return;i.setNewEndByDelta(t.x),i.update(1);const n=s.x+(null!==(e=window.scrollX)&&void 0!==e?e:window.pageXOffset),o=(It(i.val,n,n+s.width)-n)/s.width;this.trigger(ht.CHANGE,o)},this._onRelease=()=>{this._bbox&&(this.thumbEl.classList.remove(this._fixedClass),this.trigger(ht.INPUT_END))};const t=document.createElement(W),e=document.createElement(W),i=document.createElement(W),s=document.createElement(W);t.draggable=!1,e.appendChild(s),e.appendChild(i),t.appendChild(e),this.rootEl=t,this.trackEl=e,this.thumbEl=i,this.fillerEl=s,this._mouseInput=new Ht,this._touchInput=new Gt,this._motion=new Ft({duration:1,range:_t,easing:t=>t}),this._bbox={x:0,y:0,width:0,height:0,left:0,right:0,bottom:0,top:0},this._fixedClass=Ee.FIXED}init(t){const e=this._mouseInput,i=this._touchInput;this.rootEl.classList.add(t.RANGE_ROOT),this.trackEl.classList.add(t.RANGE_TRACK),this.thumbEl.classList.add(t.RANGE_THUMB),this.fillerEl.classList.add(t.RANGE_FILLER),this._fixedClass=t.FIXED,e.on(ht.INPUT_START,this._onHold),i.on(ht.INPUT_START,this._onHold),e.on(ht.INPUT_END,this._onRelease),i.on(ht.INPUT_END,this._onRelease),e.on(ht.CHANGE,this._onChange),i.on(ht.CHANGE,this._onChange),e.enable(this.rootEl),i.enable(this.rootEl),this.resize()}destroy(){const t=this._mouseInput,e=this._touchInput;this.rootEl.className="",this.trackEl.className="",this.thumbEl.className="",this.fillerEl.className="",t.off(),e.off(),t.disable(),e.disable()}resize(){this._bbox=this.trackEl.getBoundingClientRect()}updateStyle(t){const e=this._bbox.width,i=It(t,0,1);this.fillerEl.style.width=100*i+"%",this.thumbEl.style.transform=`translateX(${i*e}px)`}},fe=class extends me{get element(){return this._rangeControl.rootEl}constructor({position:t=ge.MAIN_TOP,order:e=9999}={}){super({position:t,order:e}),this._onResize=()=>{this._rangeControl.resize()},this._onTimeUpdate=()=>{const t=this._video;t&&(this._currentTime=t.source.currentTime,this._rangeControl.updateStyle(this._currentTime/this._duration))},this._onDurationChange=()=>{const t=this._video;t&&(this._duration=t.source.duration,this._rangeControl.updateStyle(this._currentTime/this._duration))},this._onHold=t=>{const e=this._video,i=this._controlBar;if(!e||!i)return;const s=e.isPaused();e.source.pause();const n=e.source.duration*t;e.source.currentTime=n,e.source.dispatchEvent(new CustomEvent(gt,{detail:{time:n}})),i.rootEl.classList.add(i.className.FIXED),this._wasPaused=!this._playPromise&&s},this._onControl=t=>{const e=this._video;if(!e)return;const i=e.source.duration*t;e.source.currentTime=i,e.source.dispatchEvent(new CustomEvent(gt,{detail:{time:i}}))},this._onRelease=()=>{const t=this._video,e=this._controlBar;t&&e&&(this._wasPaused||this._playPromise||(this._playPromise=t.source.play().catch(()=>{}),this._playPromise.then(()=>{this._playPromise=null}),e.rootEl.classList.remove(e.className.FIXED))),this._wasPaused=!1},this.position=t,this.order=e,this._controlBar=null,this._rangeControl=new ve,this._video=null,this._wasPaused=!1,this._currentTime=0,this._duration=0,this._playPromise=null}init(t,e){var i;const s=null===(i=t.mesh)||void 0===i?void 0:i.getTexture(),n=this.element,o=this._rangeControl,r=e.className.UNAVAILABLE;s&&s.isVideo()?(n.classList.remove(r),n.classList.add(e.className.PROGRESS_ROOT),t.on(st.RESIZE,this._onResize),s.source.addEventListener(Y.VIDEO_TIME_UPDATE,this._onTimeUpdate),s.source.addEventListener(Y.VIDEO_DURATION_CHANGE,this._onDurationChange),s.source.addEventListener(gt,this._onTimeUpdate),o.init(e.className),o.on(ht.INPUT_START,this._onHold),o.on(ht.CHANGE,this._onControl),o.on(ht.INPUT_END,this._onRelease),this._video=s,this._currentTime=s.source.currentTime,this._duration=s.source.duration,this._controlBar=e,o.updateStyle(this._currentTime/this._duration)):n.classList.add(r)}destroy(t){const e=this._video;t.off(st.RESIZE,this._onResize),e&&(e.source.removeEventListener(Y.VIDEO_TIME_UPDATE,this._onTimeUpdate),e.source.removeEventListener(Y.VIDEO_DURATION_CHANGE,this._onDurationChange),e.source.removeEventListener(gt,this._onTimeUpdate)),this._rangeControl.destroy(),this._video=null,this._playPromise=null}},Te=class extends me{constructor({position:t=ge.MAIN_LEFT,order:e=9999}={}){super({position:t,order:e}),this._onClick=()=>{const t=this._video;t&&(this._paused?t.source.play():t.source.pause())},this._onPlay=()=>{if(!this._controlBar)return;const t=this.element,e=this._controlBar.className;t.classList.add(e.PAUSE_BUTTON),t.classList.remove(e.PLAY_BUTTON),t.title="Pause Video",this._paused=!1},this._onPause=()=>{if(!this._controlBar)return;const t=this.element,e=this._controlBar.className;t.classList.add(e.PLAY_BUTTON),t.classList.remove(e.PAUSE_BUTTON),t.title="Play Video",this._paused=!0},this.element=document.createElement(j),this._video=null,this._paused=!0,this._controlBar=null}init(t,e){var i;const s=this.element,n=null===(i=t.mesh)||void 0===i?void 0:i.getTexture(),o=e.className,r=o.UNAVAILABLE;if(!n||!n.isVideo())return void s.classList.add(r);s.classList.add(o.CONTROLS_BUTTON),s.classList.remove(r);const a=n.isPaused();this._video=n,this._paused=a,this._controlBar=e,a?this._onPause():this._onPlay(),s.addEventListener(Y.CLICK,this._onClick),n.source.addEventListener(Y.VIDEO_PLAY,this._onPlay),n.source.addEventListener(Y.VIDEO_PAUSE,this._onPause)}destroy(){const t=this._video,e=this.element;t&&(e.className="",e.removeEventListener(Y.CLICK,this._onClick),t.source.removeEventListener(Y.VIDEO_PLAY,this._onPlay),t.source.removeEventListener(Y.VIDEO_PAUSE,this._onPause),this._video=null,this._paused=!0,this._controlBar=null)}},be=class extends me{get element(){return this._rootEl}constructor({position:t=ge.MAIN_RIGHT,order:e=9999}={}){super({position:t,order:e}),this._onResize=()=>{this._rangeControl.resize(),this._updateDisplay()},this._onClick=()=>{const t=this._video;t&&!this._rootEl.disabled&&(t.source.muted=!t.source.muted)},this._onVolumeChange=()=>{const t=this._buttonEl,e=this._video,i=this._controlBar;if(!e||!i)return;const s=i.className;e.source.muted||0===e.source.volume?(t.classList.add(s.MUTED_BUTTON),t.classList.remove(s.UNMUTED_BUTTON)):(t.classList.add(s.UNMUTED_BUTTON),t.classList.remove(s.MUTED_BUTTON)),this._updateDisplay()},this._onHold=t=>{const e=this._video,i=this._controlBar;if(!e||!i)return;const s=i.className;e.source.volume=t,this._rootEl.classList.add(s.FIXED),i.containerEl.classList.add(s.FIXED),this._updateDisplay()},this._onChange=t=>{const e=this._video;e&&(e.source.volume=t,e.source.muted=!(t>0),this._updateDisplay())},this._onRelease=()=>{const t=this._controlBar;if(!t)return;const e=t.className;this._rootEl.classList.remove(e.FIXED),t.containerEl.classList.remove(e.FIXED)},this._updateDisplay=()=>{const t=this._video,e=this._rootEl;if(!t)return;if(!t.hasAudio())return void(e.disabled=!0);e.disabled=!1;const i=t.source.muted?0:t.source.volume;this._rangeControl.updateStyle(i)},this._controlBar=null,this._rangeControl=new ve,this._createElements(),this._video=null}init(t,e){var i;const s=null===(i=t.mesh)||void 0===i?void 0:i.getTexture(),n=this._rootEl,o=this._buttonEl,r=this._rangeControl,a=e.className,h=a.UNAVAILABLE;s&&s.isVideo()?(n.classList.remove(h),n.classList.add(a.CONTROLS_BUTTON),n.classList.add(a.VOLUME_ROOT),o.classList.add(a.CONTROLS_BUTTON),s.source.muted?o.classList.add(a.MUTED_BUTTON):o.classList.add(a.UNMUTED_BUTTON),t.on(st.RESIZE,this._onResize),n.addEventListener(Y.TRANSITION_END,this._onResize),o.addEventListener(Y.CLICK,this._onClick),s.source.addEventListener(Y.VIDEO_VOLUME_CHANGE,this._onVolumeChange),s.source.addEventListener(Y.VIDEO_LOADED_DATA,this._updateDisplay),s.source.addEventListener(Y.VIDEO_CAN_PLAYTHROUGH,this._updateDisplay),r.init(a),r.on(ht.INPUT_START,this._onHold),r.on(ht.CHANGE,this._onChange),r.on(ht.INPUT_END,this._onRelease),this._controlBar=e,this._video=s,this._updateDisplay()):n.classList.add(h)}destroy(t){const e=this._video,i=this._buttonEl,s=this._rootEl;s.className="",i.className="",t.off(st.RESIZE,this._onResize),s.removeEventListener(Y.TRANSITION_END,this._onResize),i.removeEventListener(Y.CLICK,this._onClick),e&&(e.source.removeEventListener(Y.VIDEO_VOLUME_CHANGE,this._onVolumeChange),e.source.removeEventListener(Y.VIDEO_LOADED_DATA,this._updateDisplay),e.source.removeEventListener(Y.VIDEO_CAN_PLAYTHROUGH,this._updateDisplay)),this._controlBar=null,this._rangeControl.destroy(),this._video=null}_createElements(){const t=document.createElement(j),e=document.createElement(W);t.appendChild(this._rangeControl.rootEl),t.appendChild(e),t.title="Toggle Mute",this._rootEl=t,this._buttonEl=e}},we=class extends me{constructor({position:t=ge.MAIN_RIGHT,order:e=9999}={}){super({position:t,order:e}),this._onClick=()=>{const t=this._targetEl;t&&(Pt()?this._exitFullscreen():this._requestFullscreen(t))},this._onFullscreenChange=()=>{const t=this.element,e=this._controlBar;if(!e)return;const i=e.className;Pt()?(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))},this.element=document.createElement(j),this.element.title="Toggle Fullscreen",this._controlBar=null,this._targetEl=null}init(t,e){const i=this.element,s=e.className;this._fullscreenAvailable()?(i.classList.add(s.CONTROLS_BUTTON),i.classList.remove(s.UNAVAILABLE),i.addEventListener(Y.CLICK,this._onClick),this._addFullscreenHandlers(),Pt()?i.classList.add(s.FULLSCREEN_EXIT_BUTTON):i.classList.add(s.FULLSCREEN_BUTTON),this._controlBar=e,this._targetEl=t.rootEl):i.classList.add(s.UNAVAILABLE)}destroy(){const t=this.element;t.className="",t.removeEventListener(Y.CLICK,this._onClick),this._removeFullscreenHandlers(),this._controlBar=null,this._targetEl=null}_fullscreenAvailable(){return Q.some(t=>!!document[t])}_requestFullscreen(t){for(const e of Q){const i=t[e];if(i)return void i.call(t)}}_exitFullscreen(){for(const t of tt){const e=document[t];if(e)return void e.call(document)}}_addFullscreenHandlers(){et.forEach(t=>{document.addEventListener(t,this._onFullscreenChange)})}_removeFullscreenHandlers(){et.forEach(t=>{document.removeEventListener(t,this._onFullscreenChange)})}},ye=class extends me{constructor({position:t=ge.MAIN_LEFT,order:e=9999}={}){super({position:t,order:e}),this._onTimeUpdate=()=>{const t=this._video;t&&(this._currentTime=t.source.currentTime,this._updateDisplay())},this._onDurationChange=()=>{const t=this._video;t&&(this._duration=t.source.duration,this._updateDisplay())},this._onCustomTimeChange=t=>{this._currentTime=t.detail.time,this._updateDisplay()},this.element=document.createElement(W),this._video=null,this._currentTime=0,this._duration=0}init(t,e){var i;const s=null===(i=t.mesh)||void 0===i?void 0:i.getTexture(),n=this.element,o=e.className;s&&s.isVideo()?(n.classList.add(o.VIDEO_TIME_DISPLAY),n.classList.remove(o.UNAVAILABLE),s.source.addEventListener(Y.VIDEO_TIME_UPDATE,this._onTimeUpdate),s.source.addEventListener(Y.VIDEO_DURATION_CHANGE,this._onDurationChange),s.source.addEventListener(gt,this._onCustomTimeChange),this._video=s,this._currentTime=s.source.currentTime,this._duration=s.source.duration,this._updateDisplay()):n.classList.add(o.UNAVAILABLE)}destroy(){const t=this._video;t&&(this.element.className="",t.source.removeEventListener(Y.VIDEO_TIME_UPDATE,this._onTimeUpdate),t.source.removeEventListener(Y.VIDEO_DURATION_CHANGE,this._onDurationChange),t.source.removeEventListener(gt,this._onCustomTimeChange),this._video=null)}_updateDisplay(){const t=this._currentTime,e=Math.floor(t/60),i=Math.floor(t-60*e),s=i<10?`0${i}`:i,n=this._duration,o=Math.floor(n/60),r=Math.floor(n-60*o),a=r<10?`0${r}`:r;this.element.innerText=`${e}:${s} / ${o}:${a}`}},Ce=class extends me{constructor({resetCamera:t=!0,position:e=ge.TOP_RIGHT,order:i=9999}={}){super({position:e,order:i}),this._onClick=()=>{const t=this._viewer,e=this.resetCamera;if(!t||!e)return;const{yaw:i=t.initialYaw,pitch:s=t.initialPitch,zoom:n=t.initialZoom,duration:o=500}=St(e);t.camera.animateTo({yaw:i,pitch:s,zoom:n,duration:o})},this._updatePie=({target:t})=>{const e=this._piePathEl,i=this._rangeCircleEl,s=t.camera,n=s.getHorizontalFov(),o=s.getYawRange(s.zoom),r=.5*n,a=24*Math.PI,h=a*n/360,l=a*(s.yaw+r+90)/360;if(e.setAttribute("stroke-dasharray",`${h} ${a-h}`),e.setAttribute("stroke-dashoffset",`${l}`),isFinite(o.min)&&isFinite(o.max)){const t=45*Math.PI,e=(Nt(o.min,-180,180)-r)/360,s=(Nt(o.max,-180,180)+r)/360,n=t*Math.abs(s-e),a=-t*(e-.25);i.setAttribute("stroke-dasharray",`${n} ${t-n}`),i.setAttribute("stroke-dashoffset",`${a}`)}else i.setAttribute("stroke-dasharray",""),i.setAttribute("stroke-dashoffset","")},this.element=document.createElement(W),this.element.title="Reset view",this.resetCamera=t,this._createPieElements(),this._viewer=null}init(t,e){const i=this.element;t.initialized?this._updatePie({target:t}):t.once(st.READY,this._updatePie);const s=e.className.PIEVIEW_ROOT;i.classList.add(s),this.resetCamera&&i.addEventListener(Y.CLICK,this._onClick),t.on(st.VIEW_CHANGE,this._updatePie),this._viewer=t}destroy(t){const e=this.element;e.removeEventListener(Y.CLICK,this._onClick),e.className="",t.off(st.READY,this._updatePie),t.off(st.VIEW_CHANGE,this._updatePie),this._viewer=null}_createPieElements(){const t=this.element,e=document.createElementNS(vt,"svg");e.setAttribute("viewBox","0 0 48 48"),e.setAttribute("width","100%"),e.setAttribute("height","100%");const i=document.createElementNS(vt,"circle");i.setAttribute("stroke","currentColor"),i.setAttribute("fill","transparent"),i.setAttribute("cx","24"),i.setAttribute("cy","24"),i.setAttribute("r","12"),i.setAttribute("stroke-width","24"),e.appendChild(i);const s=document.createElementNS(vt,"circle");s.setAttribute("stroke","currentColor"),s.setAttribute("fill","transparent"),s.setAttribute("cx","24"),s.setAttribute("cy","24"),s.setAttribute("r","22.5"),s.setAttribute("stroke-width","3"),e.appendChild(s),t.appendChild(e),this._piePathEl=i,this._rangeCircleEl=s}},Re=class extends me{constructor({position:t=ge.MAIN_RIGHT,order:e=9999}={}){super({position:t,order:e}),this._onClick=()=>{const t=this._viewer;t&&t.vr.enter()},this.element=document.createElement(j),this.element.title="Enter VR",this._viewer=null}init(t,e){const i=this.element,s=e.className;i.classList.add(s.UNAVAILABLE),i.classList.add(s.VR_BUTTON),i.classList.add(s.CONTROLS_BUTTON),t.vr.isAvailable().then(t=>{t&&i.classList.remove(s.UNAVAILABLE)}),i.addEventListener(Y.CLICK,this._onClick),this._viewer=t}destroy(){const t=this.element;t.className="",t.removeEventListener(Y.CLICK,this._onClick),this._viewer=null}},Oe=class extends me{constructor({position:t=ge.MAIN_RIGHT,order:e=9999}={}){super({position:t,order:e}),this._onClick=()=>{const t=this._viewer,e=this._controlBar;if(!t||!e)return;const i=t.control.gyro;i.enabled?i.disable():$t.requestSensorPermission().then(t=>{t?i.enable():this.element.classList.add(e.className.UNAVAILABLE)})},this._updateStyle=()=>{const t=this.element,e=this._viewer,i=this._controlBar;if(!e||!i)return;const s=e.control.gyro,n=i.className;s.enabled?(t.classList.add(n.GYRO_ENABLED),t.classList.remove(n.GYRO_DISABLED)):(t.classList.add(n.GYRO_DISABLED),t.classList.remove(n.GYRO_ENABLED))},this.element=document.createElement(W),this.element.title="Toggle gyroscope control"}init(t,e){const i=this.element,s=e.className;i.addEventListener(Y.CLICK,this._onClick),i.classList.add(s.CONTROLS_BUTTON),i.classList.add(s.UNAVAILABLE);const n=()=>{i.classList.remove(s.UNAVAILABLE),t.control.gyro.on(ht.ENABLE,this._updateStyle),t.control.gyro.on(ht.DISABLE,this._updateStyle)};Dt()?n():$t.isAvailable().then(t=>{t&&n()}),this._controlBar=e,this._viewer=t,this._updateStyle()}destroy(t){const e=this.element;t.control.gyro.off(ht.ENABLE,this._updateStyle),t.control.gyro.off(ht.DISABLE,this._updateStyle),e.removeEventListener(Y.CLICK,this._onClick),e.className="",this._controlBar=null,this._viewer=null}},Le=class{get enabled(){return!!this._targetEl}get hidden(){return this._controlBar.containerEl.classList.contains(this._hiddenClass)}get _hiddenClass(){return this._controlBar.className.HIDDEN}get _fixedClass(){return this._controlBar.className.FIXED}constructor(t,{initialDelay:e=3e3,delay:i=0,idleDelay:s=3e3}){this._onMouseEnter=()=>{this._isCursorInside=!0,this.show()},this._onMouseLeave=()=>{this._isCursorInside=!1,this._hideAfterDelay()},this._onMouseMove=()=>{this._isFullscreen&&this.showTemporaliy()},this._onHold=t=>{this._isGrabbing=!0,"mouse"===t.pointerType&&(this._isCursorInside=!0),window.addEventListener(Y.MOUSE_UP,this._onRelease),this.show()},this._onRelease=()=>{this._isGrabbing=!1,window.removeEventListener(Y.MOUSE_UP,this._onRelease),this._hideAfterDelay()},this._onVideoPlay=()=>{this._targetEl&&this._controlBar.containerEl.classList.remove(this._fixedClass)},this._onVideoPause=()=>{this._targetEl&&this._controlBar.containerEl.classList.add(this._fixedClass)},this._onFullscreenChange=()=>{this._isFullscreen=Pt(),this._isFullscreen&&this._hideAfterDelay()},this._controlBar=t,this._initialDelay=e,this._delay=i,this._idleDelay=s,this._timer=-1,this._isCursorInside=!1,this._isGrabbing=!1,this._isFullscreen=!1,this._video=null,this._targetEl=null}enable(t){var e;this._targetEl&&this.disable(t);const i=this._initialDelay,s=t.rootEl;this._targetEl=t.rootEl,this._timer=window.setTimeout(()=>{this.hide()},i),s.addEventListener(Y.MOUSE_DOWN,this._onHold),s.addEventListener(Y.MOUSE_ENTER,this._onMouseEnter),s.addEventListener(Y.MOUSE_MOVE,this._onMouseMove),s.addEventListener(Y.MOUSE_LEAVE,this._onMouseLeave),this._addFullscreenHandlers();const n=null===(e=t.mesh)||void 0===e?void 0:e.getTexture();n&&n.isVideo()&&(n.isPaused()&&this._controlBar.containerEl.classList.add(this._fixedClass),n.source.addEventListener(Y.VIDEO_PLAY,this._onVideoPlay),n.source.addEventListener(Y.VIDEO_PAUSE,this._onVideoPause),this._video=n)}disable(t){if(!this._targetEl)return;const e=this._controlBar,i=t.rootEl,s=this._video;i.removeEventListener(Y.MOUSE_DOWN,this._onHold),window.removeEventListener(Y.MOUSE_UP,this._onRelease),i.removeEventListener(Y.MOUSE_ENTER,this._onMouseEnter),i.removeEventListener(Y.MOUSE_MOVE,this._onMouseMove),i.removeEventListener(Y.MOUSE_LEAVE,this._onMouseLeave),this._removeFullscreenHandlers(),window.clearTimeout(this._timer),e.containerEl.classList.remove(this._fixedClass),s&&(s.source.removeEventListener(Y.VIDEO_PLAY,this._onVideoPlay),s.source.removeEventListener(Y.VIDEO_PAUSE,this._onVideoPause)),this._isCursorInside=!1,this._isGrabbing=!1,this._video=null,this._targetEl=null}show(){this._clearHideTimer(),this._controlBar.containerEl.classList.remove(this._hiddenClass)}showTemporaliy(){this.show(),this._hideAfterDelay(this._idleDelay)}hide(){this._clearHideTimer(),this._controlBar.containerEl.classList.add(this._hiddenClass)}_clearHideTimer(){this._timer&&(window.clearTimeout(this._timer),this._timer=-1)}_hideAfterDelay(t=this._delay){this._isGrabbing||!this._isFullscreen&&this._isCursorInside||(this._clearHideTimer(),t<=0?this.hide():this._timer=window.setTimeout(()=>{this.hide()},t))}_addFullscreenHandlers(){et.forEach(t=>{document.addEventListener(t,this._onFullscreenChange)})}_removeFullscreenHandlers(){et.forEach(t=>{document.removeEventListener(t,this._onFullscreenChange)})}},Ie=class{constructor(){this._onKeyDown=t=>{const e=this._video;if(!e)return;t.preventDefault(),t.stopPropagation();const i=e.source,s=null!=t.keyCode?Z[t.keyCode]:$[t.key];switch(s){case"LEFT":case"RIGHT":return this._changeVideoTime(i,"RIGHT"===s);case"UP":case"DOWN":return this._changeVideoVolume(i,"UP"===s)}32!==t.keyCode&&" "!==t.key||this._toggleVideo(e)}}enable(t,e){this._video=e,t.addEventListener(Y.KEY_DOWN,this._onKeyDown,!0)}disable(t){this._video=null,t.removeEventListener(Y.KEY_DOWN,this._onKeyDown,!0)}_changeVideoTime(t,e){t.currentTime+=e?5:-5,t.dispatchEvent(new CustomEvent(gt,{detail:{time:t.currentTime}}))}_changeVideoVolume(t,e){const i=e?.1:-.1;t.muted?t.volume=It(i,0,1):t.volume=It(t.volume+i,0,1),t.volume>0?t.muted=!1:t.muted=!0}_toggleVideo(t){t.isPaused()?t.source.play():t.source.pause()}},Ae=class t{get rootEl(){return this._rootEl}get containerEl(){return this._containerEl}get backgroundEl(){return this._bgEl}get items(){return this._items}get customItems(){return this._customItems}constructor({autoHide:e,showBackground:i,clickToPlay:s=!0,keyboardControls:n=!0,progressBar:o=!0,playButton:r=!0,volumeButton:a=!0,fullscreenButton:h=!0,videoTime:l=!0,pieView:c=!0,vrButton:u=!0,gyroButton:d=!0,className:_={},customItems:p=[]}={}){var m;this._onStaticClick=({target:t,isTouch:e})=>{var i;const s=this._autoHider;if(e){if(!s.enabled)return;s.hidden?s.showTemporaliy():s.hide()}else{if(!this.clickToPlay)return;const e=null===(i=t.mesh)||void 0===i?void 0:i.getTexture();if(!e||!e.isVideo())return;e.isPaused()?e.source.play():e.source.pause()}},this._onNewSrcLoad=({target:t})=>{const e=this._items;this._updateBackground(t),this._updateAutoHide(t),this._updateKeyboardHandler(t),Object.keys(e).forEach(i=>{e[i].forEach(e=>{e.destroy(t,this),e.init(t,this)})})},this.autoHide=e,this.showBackground=i,this.clickToPlay=s,this.keyboardControls=n,this.progressBar=o,this.playButton=r,this.volumeButton=a,this.fullscreenButton=h,this.videoTime=l,this.pieView=c,this.vrButton=u,this.gyroButton=d,this.className=Object.assign(Object.assign({},t.DEFAULT_CLASS),_),this._rootEl=Ct(null!==(m=_.CONTROLS_ROOT)&&void 0!==m?m:t.DEFAULT_CLASS.CONTROLS_ROOT),this._createPositionWrappers(),this._items=Object.keys(t.POSITION).reduce((e,i)=>(e[t.POSITION[i]]=[],e),{}),this._customItems=p,this._autoHider=new Le(this,St(e)),this._videoControl=new Ie,p.forEach(t=>{this._items[t.position].push(t)})}init(t){const e=t.rootEl,i=this._rootEl,s=this._createDefaultItems();this._updateBackground(t),this._updateAutoHide(t),this._updateKeyboardHandler(t),e.appendChild(i),this._addItem(t,s),this._addItem(t,this._customItems),t.on(st.PROJECTION_CHANGE,this._onNewSrcLoad),t.on(st.STATIC_CLICK,this._onStaticClick)}destroy(t){const e=t.rootEl,i=this._rootEl,s=this._items;i.parentElement===e&&e.removeChild(i),Object.keys(s).forEach(e=>{s[e].forEach(e=>{e.destroy(t,this)}),s[e]=[]}),this._clearItemElements(),this._autoHider.disable(t),this._videoControl.disable(e),t.off(st.PROJECTION_CHANGE,this._onNewSrcLoad),t.off(st.STATIC_CLICK,this._onStaticClick)}_addItem(t,e){for(const i of e){const e=this._items[i.position],s=this._wrapperEl[i.position],n=xt(e,t=>t.order>i.order);if(n>=0){const t=e[n].element;e.splice(n,0,i),s.insertBefore(i.element,t)}else e.push(i),s.appendChild(i.element);i.init(t,this)}}_createPositionWrappers(){const e=Object.assign(Object.assign({},t.DEFAULT_CLASS),this.className),i=this._rootEl,s=Ct(e.CONTROLS_BG),n=Ct(e.CONTROLS_FLOAT_LEFT),o=Ct(e.CONTROLS_FLOAT_RIGHT);i.appendChild(n),i.appendChild(o);const r=Ct(e.CONTROLS_MAIN),a=Ct(e.CONTROLS_TOP),h=Ct(e.CONTROLS_BOTTOM),l=Ct(e.CONTROLS_MID),c=Ct(e.CONTROLS_LEFT),u=Ct(e.CONTROLS_RIGHT);l.appendChild(c),l.appendChild(u),r.appendChild(s),r.appendChild(a),r.appendChild(l),r.appendChild(h),i.appendChild(r),this._bgEl=s,this._containerEl=r,this._wrapperEl={[t.POSITION.MAIN_TOP]:a,[t.POSITION.MAIN_LEFT]:c,[t.POSITION.MAIN_RIGHT]:u,[t.POSITION.MAIN_BOTTOM]:h,[t.POSITION.TOP_LEFT]:n,[t.POSITION.TOP_RIGHT]:o}}_clearItemElements(){Object.keys(t.POSITION).map(e=>t.POSITION[e]).map(t=>this._wrapperEl[t]).forEach(t=>{for(;t.firstChild;)t.removeChild(t.firstChild)})}_updateAutoHide(t){var e;const i=this.autoHide,s=this._autoHider;if(null!=i)i?s.enable(t):s.disable(t);else{const i=null===(e=t.mesh)||void 0===e?void 0:e.getTexture();i&&i.isVideo()?s.enable(t):s.disable(t)}}_updateBackground(e){var i,s;const n=this._bgEl,o=this.showBackground,r=null!==(i=this.className.HIDDEN)&&void 0!==i?i:t.DEFAULT_CLASS.HIDDEN;if(null!=o)o?n.classList.remove(r):n.classList.add(r);else{const t=null===(s=e.mesh)||void 0===s?void 0:s.getTexture();t&&t.isVideo()?n.classList.remove(r):n.classList.add(r)}}_updateKeyboardHandler(t){var e;const i=t.rootEl,s=this._videoControl,n=null===(e=t.mesh)||void 0===e?void 0:e.getTexture();this.keyboardControls&&n&&n.isVideo()?s.enable(i,n):s.disable(i)}_createDefaultItems(){const t=[];return this.progressBar&&t.push(new fe(St(this.progressBar))),this.playButton&&t.push(new Te(St(this.playButton))),this.volumeButton&&t.push(new be(St(this.volumeButton))),this.gyroButton&&t.push(new Oe(St(this.gyroButton))),this.vrButton&&t.push(new Re(St(this.vrButton))),this.fullscreenButton&&t.push(new we(St(this.fullscreenButton))),this.videoTime&&t.push(new ye(St(this.videoTime))),this.pieView&&t.push(new Ce(St(this.pieView))),t}},Ae.DEFAULT_CLASS=Ee,Ae.POSITION=ge,Ne=class{constructor({src:t,video:e=!1}){this.src=t,this.video=e}updateCamera(t){t.resetRange()}updateControl(t){t.ignoreZoomScale=!1}},xe=class{constructor(){this.needsUpdate=!0}destroy(t){}},Se=class extends pe{constructor(t,e){super(),this.vao=t,this.program=e}destroy(t){t.releaseVAO(this.vao),t.releaseShaderResources(this.program)}getTexture(){return this.program.uniforms.uTexture.texture}},Me=class{constructor(t,e,i,s){this.program=t.createProgram(e,i),this.uniforms=s,this.uniformLocations=t.getUniformLocations(this.program,s)}},Pe=class{constructor(t,e){this.data=t,this.itemSize=e,this.count=t.length/e}},De=class{constructor(t,e,i){this.vertices=new Pe(new Float32Array(t),3),this.indicies=new Pe(new Uint16Array(e),1),this.uvs=new Pe(new Float32Array(i),2)}},Ue=class extends xe{constructor(t,e){super(),this.texture=e,this._webglTexture=t.createWebGLTexture(e)}destroy(t){this.texture.destroy(),t.deleteTexture(this._webglTexture)}update(t,e,i){const s=this.texture,n=s.isVideo();t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,s.flipY),t.uniform1i(e,0),t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,this._webglTexture),!n&&i?t.texSubImage2D(t.TEXTURE_2D,0,0,0,t.RGBA,t.UNSIGNED_BYTE,s.source):t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,s.source),n||(this.needsUpdate=!1)}},Be="#define GLSLIFY 1\nuniform sampler2D uTexture;varying highp vec2 vUV;void main(){gl_FragColor=texture2D(uTexture,vUV.st);}",ke=class extends De{constructor(){const t=60,e=-.5*Math.PI,i=[],s=[],n=[];let o,r;for(o=0;o<=60;o++){const a=(o/60-.5)*Math.PI,h=Math.sin(a),l=Math.cos(a);for(r=0;r<=t;r++){const a=2*(r/t-.5)*Math.PI+e,c=Math.sin(a),u=Math.cos(a)*l,d=h,_=c*l,p=r/t,m=o/60;if(i.push(p,m),s.push(u,d,_),r!==t&&60!==o){const e=61*o+r,i=e+t+1;n.push(e,e+1,i,i,e+1,i+1)}}}super(s,n,i)}},Fe=class extends Ne{constructor(t){super(t)}createMesh(t,e){const i={uTexture:new Ue(t,e)},s=new ke,n=new Me(t,"#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);}",Be,i);return new Se(t.createVAO(s,n),n)}},Ve=class extends xe{constructor(t){super(),this.val=t}update(t,e){t.uniform1f(e,this.val),this.needsUpdate=!1}},ze=class extends xe{constructor(t){super(),this.val=t}update(t,e){t.uniform4fv(e,this.val.reduce((t,e)=>[...t,...e],[])),this.needsUpdate=!1}},class t extends Ne{constructor(t){super(t),this._mode=t.mode}createMesh(e,i){let s,n;this._mode===t.MODE.LEFT_RIGHT?(s=[.5,1,0,0],n=[.5,1,.5,0]):(s=[1,.5,0,0],n=[1,.5,0,.5]);const o={uTexture:new Ue(e,i),uEye:new Ve(0),uTexScaleOffset:new ze([s,n])},r=new ke,a=new Me(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);}",Be,o);return new Se(e.createVAO(r,a),a)}}.MODE={LEFT_RIGHT:"left_right",TOP_BOTTOM:"top_bottom"},He=u("<canvas class=view360-canvas>"),Ge=u("<video id=view360-video playsinline crossorigin=anonymous style=display:none>"),t("default",()=>{let t;a(()=>{const e=document.getElementById("view360-container"),i=document.getElementById("view360-video");e&&i&&(t=new _e(e,{projection:new Fe({src:i,video:{autoplay:h("video_autoplay")}}),plugins:[new Ae({pieView:{order:0},gyroButton:{position:"top-right",order:1},vrButton:{position:"top-right",order:2}})]}))}),c(()=>t?.destroy());const[e,u]=r(!1);return o(d,{onAutoNextChange:u,get children(){return o(n,{w:"$full",h:"60vh",id:"video360-player",get children(){return o(n,{w:"100%",h:"100%",id:"view360-container",className:"view360-container",get children(){return[He(),(t=Ge(),l(()=>s(t,"src",i.raw_url)),t)];var t}})}})}})})}}});
1
+ System.register(["./store-legacy-CI1UFD5I.js","./video_box-legacy-DJTbgfFE.js"],function(t,e){var i,s,n,o,r,a,h,l,c,u,d,_,p,m,E,g,v,f,T,b,w,y,C,R,O,L,I,A,N,x,S,M,P,D,U,B,k,F,V,z,H,G,Y,W,j,q,K,X,Z,$,Q,J,tt,et,it,st,nt,ot,rt,at,ht,lt,ct,ut,dt,_t,pt,mt,Et,gt,vt,ft,Tt,bt,wt,yt,Ct,Rt,Ot,Lt,It,At,Nt,xt,St,Mt,Pt,Dt,Ut,Bt,kt,Ft,Vt,zt,Ht,Gt,Yt,Wt,jt,qt,Kt,Xt,Zt,$t,Qt,Jt,te,ee,ie,se,ne,oe,re,ae,he,le,ce,ue,de,_e,pe,me,Ee,ge,ve,fe,Te,be,we,ye,Ce,Re,Oe,Le,Ie,Ae,Ne,xe,Se,Me,Pe,De,Ue,Be,ke,Fe,Ve,ze,He,Ge;function Ye(t,e){var i="function"==typeof Symbol&&t[Symbol.iterator];if(!i)return t;var s,n,o=i.call(t),r=[];try{for(;(void 0===e||e-- >0)&&!(s=o.next()).done;)r.push(s.value)}catch(a){n={error:a}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}return r}function We(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(Ye(arguments[e]));return t}function je(){var t=new v(16);return v!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function qe(t,e,i){var s=e[0],n=e[1],o=e[2],r=e[3],a=e[4],h=e[5],l=e[6],c=e[7],u=e[8],d=e[9],_=e[10],p=e[11],m=e[12],E=e[13],g=e[14],v=e[15],f=i[0],T=i[1],b=i[2],w=i[3];return t[0]=f*s+T*a+b*u+w*m,t[1]=f*n+T*h+b*d+w*E,t[2]=f*o+T*l+b*_+w*g,t[3]=f*r+T*c+b*p+w*v,f=i[4],T=i[5],b=i[6],w=i[7],t[4]=f*s+T*a+b*u+w*m,t[5]=f*n+T*h+b*d+w*E,t[6]=f*o+T*l+b*_+w*g,t[7]=f*r+T*c+b*p+w*v,f=i[8],T=i[9],b=i[10],w=i[11],t[8]=f*s+T*a+b*u+w*m,t[9]=f*n+T*h+b*d+w*E,t[10]=f*o+T*l+b*_+w*g,t[11]=f*r+T*c+b*p+w*v,f=i[12],T=i[13],b=i[14],w=i[15],t[12]=f*s+T*a+b*u+w*m,t[13]=f*n+T*h+b*d+w*E,t[14]=f*o+T*l+b*_+w*g,t[15]=f*r+T*c+b*p+w*v,t}function Ke(t,e,i,s,n){var o,r=1/Math.tan(e/2);return t[0]=r/i,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=r,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=n&&n!==1/0?(o=1/(s-n),t[10]=(n+s)*o,t[14]=2*n*s*o):(t[10]=-1,t[14]=-2*s),t}function Xe(){var t=new v(3);return v!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function Ze(t){var e=t[0],i=t[1],s=t[2];return Math.hypot(e,i,s)}function $e(t,e,i){var s=new v(3);return s[0]=t,s[1]=e,s[2]=i,s}function Qe(t,e){var i=e[0],s=e[1],n=e[2],o=i*i+s*s+n*n;return o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t}function Je(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function ti(t,e,i){var s=e[0],n=e[1],o=e[2],r=i[0],a=i[1],h=i[2];return t[0]=n*h-o*a,t[1]=o*r-s*h,t[2]=s*a-n*r,t}function ei(t,e,i){var s=e[0],n=e[1],o=e[2],r=i[3]*s+i[7]*n+i[11]*o+i[15];return r=r||1,t[0]=(i[0]*s+i[4]*n+i[8]*o+i[12])/r,t[1]=(i[1]*s+i[5]*n+i[9]*o+i[13])/r,t[2]=(i[2]*s+i[6]*n+i[10]*o+i[14])/r,t}function ii(t,e,i){var s=i[0],n=i[1],o=i[2],r=i[3],a=e[0],h=e[1],l=e[2],c=n*l-o*h,u=o*a-s*l,d=s*h-n*a,_=n*d-o*u,p=o*c-s*d,m=s*u-n*c,E=2*r;return c*=E,u*=E,d*=E,_*=2,p*=2,m*=2,t[0]=a+c+_,t[1]=h+u+p,t[2]=l+d+m,t}function si(t){var e=new v(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function ni(t,e,i,s){var n=new v(4);return n[0]=t,n[1]=e,n[2]=i,n[3]=s,n}function oi(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function ri(t,e,i,s,n){return t[0]=e,t[1]=i,t[2]=s,t[3]=n,t}function ai(t,e){var i=e[0],s=e[1],n=e[2],o=e[3],r=i*i+s*s+n*n+o*o;return r>0&&(r=1/Math.sqrt(r)),t[0]=i*r,t[1]=s*r,t[2]=n*r,t[3]=o*r,t}function hi(t,e){var i=t[0],s=t[1],n=t[2],o=t[3],r=e[0],a=e[1],h=e[2],l=e[3];return Math.abs(i-r)<=1e-6*Math.max(1,Math.abs(i),Math.abs(r))&&Math.abs(s-a)<=1e-6*Math.max(1,Math.abs(s),Math.abs(a))&&Math.abs(n-h)<=1e-6*Math.max(1,Math.abs(n),Math.abs(h))&&Math.abs(o-l)<=1e-6*Math.max(1,Math.abs(o),Math.abs(l))}function li(){var t=new v(4);return v!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function ci(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t}function ui(t,e,i){var s=e[0],n=e[1],o=e[2],r=e[3],a=i[0],h=i[1],l=i[2],c=i[3];return t[0]=s*c+r*a+n*l-o*h,t[1]=n*c+r*h+o*a-s*l,t[2]=o*c+r*l+s*h-n*a,t[3]=r*c-s*a-n*h-o*l,t}function di(t,e,i){i*=.5;var s=e[0],n=e[1],o=e[2],r=e[3],a=Math.sin(i),h=Math.cos(i);return t[0]=s*h+r*a,t[1]=n*h+o*a,t[2]=o*h-n*a,t[3]=r*h-s*a,t}function _i(t,e,i){i*=.5;var s=e[0],n=e[1],o=e[2],r=e[3],a=Math.sin(i),h=Math.cos(i);return t[0]=s*h-o*a,t[1]=n*h+r*a,t[2]=o*h+s*a,t[3]=r*h-n*a,t}function pi(t,e,i){i*=.5;var s=e[0],n=e[1],o=e[2],r=e[3],a=Math.sin(i),h=Math.cos(i);return t[0]=s*h+n*a,t[1]=n*h-s*a,t[2]=o*h+r*a,t[3]=r*h-o*a,t}function mi(t,e,i,s){var n,o,r,a,h=e[0],l=e[1],c=e[2],u=e[3],d=i[0],_=i[1],p=i[2],m=i[3],E=h*d+l*_+c*p+u*m;return E<0&&(E=-E,d=-d,_=-_,p=-p,m=-m),1-E>1e-6?(n=Math.acos(E),o=Math.sin(n),r=Math.sin((1-s)*n)/o,a=Math.sin(s*n)/o):(r=1-s,a=s),t[0]=r*h+a*d,t[1]=r*l+a*_,t[2]=r*c+a*p,t[3]=r*u+a*m,t}function Ei(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}O(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}function gi(t,e){return t.getAttribute(e)||""}function vi(t){return[].slice.call(t)}function fi(t,e){return void 0===e&&(e="data-"),"loading"in t&&"lazy"===t.getAttribute("loading")||!!t.getAttribute(e+"lazy")}function Ti(t,e,i){S?t.addEventListener(e,i,!1):t.attachEvent?t.attachEvent("on"+e,i):t["on"+e]=i}function bi(t,e,i){t.removeEventListener?t.removeEventListener(e,i,!1):t.detachEvent?t.detachEvent("on"+e,i):t["on"+e]=null}function wi(t,e){var i=t["client"+e]||t["offset"+e];return parseFloat(i||function(t){return(N?window.getComputedStyle(t):t.currentStyle)||{}}(t)[e.toLowerCase()])||0}function yi(t,e,i){var s=vi(t.querySelectorAll(function(){for(var t=0,e=0,i=arguments.length;e<i;e++)t+=arguments[e].length;var s=Array(t),n=0;for(e=0;e<i;e++)for(var o=arguments[e],r=0,a=o.length;r<a;r++,n++)s[n]=o[r];return s}(["["+i+"skip] ["+i+"width]"],e.map(function(t){return["["+i+"skip] "+t,t+"["+i+"skip]","["+i+"width] "+t].join(", ")})).join(", ")));return vi(t.querySelectorAll("["+i+"width], "+e.join(", "))).filter(function(t){return-1===s.indexOf(t)})}function Ci(t,e){!D.length&&Ti(window,"resize",Oi),t.__PREFIX__=e,D.push(t),Ri(t)}function Ri(t,e){void 0===e&&(e="data-");var i=t.__PREFIX__||e,s=parseInt(gi(t,""+i+M),10)||0,n=parseInt(gi(t,""+i+P),10)||0;if(gi(t,i+"fixed")===P){var o=wi(t,"Height")||n;t.style[M]=s/n*o+"px"}else o=function(t){return wi(t,"Width")}(t)||s,t.style[P]=n/s*o+"px"}function Oi(){D.forEach(function(t){Ri(t)})}function Li(t,e,i,s){return new(i||(i=Promise))(function(n,o){function r(t){try{h(s.next(t))}catch(e){o(e)}}function a(t){try{h(s.throw(t))}catch(e){o(e)}}function h(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i(function(t){t(e)})).then(r,a)}h((s=s.apply(t,e||[])).next())})}return{setters:[function(t){i=t.D,s=t.Pi,n=t.Tn,o=t.Zi,r=t.aa,a=t.da,h=t.g,l=t.na,c=t.ua,u=t.zi},function(t){d=t.n}],execute:function(){var e;(_=document.createElement("style")).textContent=".view360-container{touch-action:pan-y;position:relative;overflow:hidden}.view360-canvas{user-select:none;-webkit-user-drag:none;width:100%;height:100%;position:absolute;top:0;left:0}.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.333%}.view360-container.is-2by3{padding-top:150%}.view360-container.is-3by5{padding-top:166.667%}.view360-container.is-9by16{padding-top:177.778%}.view360-container.is-1by2{padding-top:200%}.view360-container.is-1by3{padding-top:300%}.view360-container:fullscreen{padding-top:0}.view360-container:fullscreen{padding-top:0}.view360-controls{pointer-events:none;user-select:none;-webkit-user-drag:none;z-index:1;border:0;width:100%;height:100%;margin:0;padding:0;position:absolute;top:0;left:0}.view360-main.view360-vr-presenting .view360-controls{display:none}.view360-controls-float-left,.view360-controls-float-right{flex-direction:column;display:flex;position:absolute}.view360-controls-float-left{top:0;left:0}.view360-controls-float-right{top:0;right:0}.view360-controls-main{opacity:1;width:100%;transition:none;position:absolute;bottom:0;left:0}.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{background-image:linear-gradient(rgba(50,50,50,0),#323232);width:100%;height:calc(100% + 32px);position:absolute;bottom:0;left:0}.view360-controls-background.view360-controls-hidden{display:none}.view360-controls-mid{flex-direction:row;display:flex;position:relative}.view360-controls-left{flex-direction:row;flex:1;justify-content:flex-start;align-items:center;display:flex}.view360-controls-right,.view360-controls-bottom{flex-direction:row;align-items:center;display:flex}.view360-controls-button{cursor:pointer;box-sizing:border-box;pointer-events:all;opacity:.8;background-color:transparent;background-repeat:no-repeat;background-size:24px 24px;background-origin:content-box;border:0;border-radius:20px;width:40px;height:40px;margin:6px;padding:8px;transition:opacity .25s;display:inline-block;position:relative}.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{vertical-align:top;white-space:nowrap;color:#fff;z-index:1;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;font-size:14px;font-weight:400;display:inline-block}.view360-controls-time:first-child{padding:0 16px}.view360-controls-progress{box-sizing:border-box;flex:1;width:100%;padding:0 16px}.view360-controls-progress:not(:first-child){padding-left:0}.view360-controls-bottom .view360-controls-progress{padding-bottom:20px}.view360-controls-volume{flex-direction:row;align-items:center;transition:width .25s,background-color .25s;display:inline-flex;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{flex-shrink:0;width:24px;height:24px;margin:0;padding:0}.view360-controls-volume:disabled{opacity:.5;pointer-events:none}.view360-controls-volume:disabled *{pointer-events:none}.view360-controls-pie{opacity:.8;pointer-events:all;cursor:pointer;color:#fff;border-radius:18px;width:36px;height:36px;margin:6px;padding:0;transition:opacity .25s;position:relative}.view360-controls-pie>svg{width:100%;height:100%;position:absolute;top:0;left:0}.view360-controls-pie:hover{opacity:1}.view360-range{cursor:pointer;pointer-events:all;touch-action:pan-y;justify-content:center;align-items:center;display:flex;position:relative}.view360-range:hover .view360-range-thumb{opacity:1}.view360-range-track{background-color:rgba(230,230,230,.4);border-radius:4px;width:100%;height:4px;position:relative}.view360-range-filler,.view360-range-load{border-radius:4px;width:0;height:100%;position:absolute;top:0;left:0}.view360-range-filler{background-color:#fff}.view360-range-load{background-color:#757575}.view360-range-thumb{box-sizing:border-box;opacity:0;background-color:#fff;border-radius:50%;width:13px;height:13px;transition:opacity .25s;position:absolute;top:-5px;left:-6.5px}.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;border-radius:15px;width:30px;height:30px;margin:4.5px;padding:6px}.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{border-radius:13.5px;width:27px;height:27px;margin:4.5px;padding:0}}.view360-spinner{background-color:rgba(0,0,0,.15);justify-content:center;align-items:center;width:100%;height:100%;display:flex;position:absolute;top:0;left:0}.view360-spinner-ring{box-sizing:content-box;background-color:transparent;border:10px solid #fff;border-bottom-color:transparent;border-radius:50%;width:64px;height:64px;margin:0;padding:0;animation:1.2s linear infinite view360-spin-animation;top:0;left:0}@keyframes view360-spin-animation{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.view360-container.view360-vr-presenting{z-index:9999;width:100vw;height:100vh;position:fixed;top:0;left:0}.view360-hotspots{pointer-events:none;width:100%;height:100%;position:absolute;top:0;left:0}.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/*$vite$:1*/",document.head.appendChild(_),p=function(t){return void 0===t},m=function(){function t(t,e){var i,s;if(this._canceled=!1,e)try{for(var n=function(t){var e="function"==typeof Symbol&&Symbol.iterator,i=e&&t[e],s=0;if(i)return i.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&s>=t.length&&(t=void 0),{value:t&&t[s++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(Object.keys(e)),o=n.next();!o.done;o=n.next()){var r=o.value;this[r]=e[r]}}catch(a){i={error:a}}finally{try{o&&!o.done&&(s=n.return)&&s.call(n)}finally{if(i)throw i.error}}this.eventType=t}var e=t.prototype;return e.stop=function(){this._canceled=!0},e.isCanceled=function(){return this._canceled},t}(),E=function(){function t(){this._eventHandler={}}var e=t.prototype;return e.trigger=function(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];var s=t instanceof m?t.eventType:t,n=We(this._eventHandler[s]||[]);return n.length<=0||(t instanceof m?(t.currentTarget=this,n.forEach(function(e){e(t)})):n.forEach(function(t){t.apply(void 0,We(e))})),this},e.once=function(t,e){var i=this;if("object"==typeof t&&p(e)){var s=t;for(var n in s)this.once(n,s[n]);return this}if("string"==typeof t&&"function"==typeof e){var o=function(){for(var s=[],n=0;n<arguments.length;n++)s[n]=arguments[n];e.apply(void 0,We(s)),i.off(t,o)};this.on(t,o)}return this},e.hasOn=function(t){return!!this._eventHandler[t]},e.on=function(t,e){if("object"==typeof t&&p(e)){var i=t;for(var s in i)this.on(s,i[s]);return this}if("string"==typeof t&&"function"==typeof e){var n=this._eventHandler[t];p(n)&&(this._eventHandler[t]=[],n=this._eventHandler[t]),n.push(e)}return this},e.off=function(t,e){if(p(t))return this._eventHandler={},this;if(p(e)){if("string"==typeof t)return delete this._eventHandler[t],this;var i=t;for(var s in i)this.off(s,i[s]);return this}var n=this._eventHandler[t];if(n)for(var o=n.length,r=0;r<o;++r)if(n[r]===e){n.splice(r,1),o<=1&&delete this._eventHandler[t];break}return this},t.VERSION="3.0.5",t}(),g=m,v="undefined"!=typeof Float32Array?Float32Array:Array,Math.PI,Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)}),f=Ke,Xe(),function(){var t,e=(t=new v(4),v!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t)}(),T=si,b=ni,w=oi,y=ri,C=ai,R=hi,Xe(),$e(1,0,0),$e(0,1,0),li(),li(),e=new v(9),v!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,function(){var t=function(){var t=new v(2);return v!=Float32Array&&(t[0]=0,t[1]=0),t}()}(),O=function(t,e){return O=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},O(t,e)},L=function(){return L=Object.assign||function(t){for(var e,i=1,s=arguments.length;i<s;i++)for(var n in e=arguments[i])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t},L.apply(this,arguments)},I="undefined"!=typeof window,A=I?window.navigator.userAgent:"",N=!!I&&!!("getComputedStyle"in window),x=/MSIE|Trident|Windows Phone|Edge/.test(A),S=!!I&&!!("addEventListener"in document),M="width",P="height",D=[],B=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}Ei(e,t);var i=e.prototype;return i.setHasLoading=function(t){this.hasLoading=t},i.check=function(){return this.isSkip?(this.onAlreadyReady(),!1):(this.hasDataSize?(Ci(this.element,this.options.prefix),this.onAlreadyPreReady()):this.trigger("requestChildren"),!0)},i.checkElement=function(){return!0},i.destroy=function(){this.clear(),this.trigger("requestDestroy"),this.off()},i.onAlreadyPreReady=function(){t.prototype.onAlreadyPreReady.call(this),this.trigger("reqeustReadyChildren")},e.EVENTS=[],e}(U=function(t){function e(e,i){void 0===i&&(i={});var s=t.call(this)||this;s.isReady=!1,s.isPreReady=!1,s.hasDataSize=!1,s.hasLoading=!1,s.isSkip=!1,s.onCheck=function(t){s.clear(),t&&"error"===t.type&&s.onError(s.element),s.hasLoading&&s.checkElement()||s.onReady()},s.options=L({prefix:"data-"},i),s.element=e;var n=s.options.prefix;return s.hasDataSize=function(t,e){return void 0===e&&(e="data-"),!!t.getAttribute(e+"width")}(e,n),s.isSkip=function(t,e){return void 0===e&&(e="data-"),!!t.getAttribute(e+"skip")}(e,n),s.hasLoading=fi(e,n),s}Ei(e,t);var i=e.prototype;return i.check=function(){return this.isSkip||!this.checkElement()?(this.onAlreadyReady(),!1):(this.hasDataSize&&Ci(this.element,this.options.prefix),(this.hasDataSize||this.hasLoading)&&this.onAlreadyPreReady(),!0)},i.addEvents=function(){var t=this,e=this.element;this.constructor.EVENTS.forEach(function(i){Ti(e,i,t.onCheck)})},i.clear=function(){var t=this,e=this.element;this.constructor.EVENTS.forEach(function(i){bi(e,i,t.onCheck)}),this.removeAutoSizer()},i.destroy=function(){this.clear(),this.off()},i.removeAutoSizer=function(){if(this.hasDataSize){var t=this.options.prefix;!function(t,e){var i=D.indexOf(t);if(!(i<0)){var s=gi(t,e+"fixed");delete t.__PREFIX__,t.style[s===P?M:P]="",D.splice(i,1),!D.length&&bi(window,"resize",Oi)}}(this.element,t)}},i.onError=function(t){this.trigger("error",{element:this.element,target:t})},i.onPreReady=function(){this.isPreReady||(this.isPreReady=!0,this.trigger("preReady",{element:this.element,hasLoading:this.hasLoading,isSkip:this.isSkip}))},i.onReady=function(){var t=this.isPreReady;this.isPreReady=!0,this.isReady||(this.removeAutoSizer(),this.isReady=!0,this.trigger("ready",{element:this.element,withPreReady:!t,hasLoading:this.hasLoading,isSkip:this.isSkip}))},i.onAlreadyError=function(t){var e=this;setTimeout(function(){e.onError(t)})},i.onAlreadyPreReady=function(){var t=this;setTimeout(function(){t.onPreReady()})},i.onAlreadyReady=function(){var t=this;setTimeout(function(){t.onReady()})},e.EVENTS=[],e}(E)),k=function(t){function e(e){void 0===e&&(e={});var i=t.call(this)||this;return i.readyCount=0,i.preReadyCount=0,i.totalCount=0,i.totalErrorCount=0,i.isPreReadyOver=!0,i.elementInfos=[],i.options=L({loaders:{},prefix:"data-"},e),i}Ei(e,t);var i=e.prototype;return i.check=function(t){var e=this,i=this.options.prefix;this.clear(),this.elementInfos=vi(t).map(function(t,s){var n=e.getLoader(t,{prefix:i});return n.check(),n.on("error",function(t){e.onError(s,t.target)}).on("preReady",function(t){var i=e.elementInfos[s];i.hasLoading=t.hasLoading,i.isSkip=t.isSkip;var n=e.checkPreReady(s);e.onPreReadyElement(s),n&&e.onPreReady()}).on("ready",function(t){var i=t.withPreReady,n=t.hasLoading,o=t.isSkip,r=e.elementInfos[s];r.hasLoading=n,r.isSkip=o;var a=i&&e.checkPreReady(s),h=e.checkReady(s);i&&e.onPreReadyElement(s),e.onReadyElement(s),a&&e.onPreReady(),h&&e.onReady()}),{loader:n,element:t,hasLoading:!1,hasError:!1,isPreReady:!1,isReady:!1,isSkip:!1}});var s=this.elementInfos.length;return this.totalCount=s,s||setTimeout(function(){e.onPreReady(),e.onReady()}),this},i.getTotalCount=function(){return this.totalCount},i.isPreReady=function(){return this.elementInfos.every(function(t){return t.isPreReady})},i.isReady=function(){return this.elementInfos.every(function(t){return t.isReady})},i.hasError=function(){return this.totalErrorCount>0},i.clear=function(){this.isPreReadyOver=!1,this.totalCount=0,this.preReadyCount=0,this.readyCount=0,this.totalErrorCount=0,this.elementInfos.forEach(function(t){t.loader&&t.loader.destroy()}),this.elementInfos=[]},i.destroy=function(){this.clear(),this.off()},i.getLoader=function(t,e){var i=this,s=t.tagName.toLowerCase(),n=this.options.loaders,o=e.prefix,r=Object.keys(n);if(n[s])return new n[s](t,e);var a=new B(t,e),h=vi(t.querySelectorAll(r.join(", ")));a.setHasLoading(h.some(function(t){return fi(t,o)}));var l=this.clone().on("error",function(t){a.onError(t.target)}).on("ready",function(){a.onReady()});return a.on("requestChildren",function(){var e=yi(t,r,i.options.prefix);l.check(e).on("preReady",function(t){t.isReady||a.onPreReady()})}).on("reqeustReadyChildren",function(){l.check(h)}).on("requestDestroy",function(){l.destroy()}),a},i.clone=function(){return new e(L({},this.options))},i.checkPreReady=function(t){return this.elementInfos[t].isPreReady=!0,++this.preReadyCount,!(this.preReadyCount<this.totalCount)},i.checkReady=function(t){return this.elementInfos[t].isReady=!0,++this.readyCount,!(this.readyCount<this.totalCount)},i.onError=function(t,e){var i=this.elementInfos[t];i.hasError=!0,this.trigger(new g("error",{element:i.element,index:t,target:e,errorCount:this.getErrorCount(),totalErrorCount:++this.totalErrorCount}))},i.onPreReadyElement=function(t){var e=this.elementInfos[t];this.trigger(new g("preReadyElement",{element:e.element,index:t,preReadyCount:this.preReadyCount,readyCount:this.readyCount,totalCount:this.totalCount,isPreReady:this.isPreReady(),isReady:this.isReady(),hasLoading:e.hasLoading,isSkip:e.isSkip}))},i.onPreReady=function(){this.isPreReadyOver=!0,this.trigger(new g("preReady",{readyCount:this.readyCount,totalCount:this.totalCount,isReady:this.isReady(),hasLoading:this.hasLoading()}))},i.onReadyElement=function(t){var e=this.elementInfos[t];this.trigger(new g("readyElement",{index:t,element:e.element,hasError:e.hasError,errorCount:this.getErrorCount(),totalErrorCount:this.totalErrorCount,preReadyCount:this.preReadyCount,readyCount:this.readyCount,totalCount:this.totalCount,isPreReady:this.isPreReady(),isReady:this.isReady(),hasLoading:e.hasLoading,isPreReadyOver:this.isPreReadyOver,isSkip:e.isSkip}))},i.onReady=function(){this.trigger(new g("ready",{errorCount:this.getErrorCount(),totalErrorCount:this.totalErrorCount,totalCount:this.totalCount}))},i.getErrorCount=function(){return this.elementInfos.filter(function(t){return t.hasError}).length},i.hasLoading=function(){return this.elementInfos.some(function(t){return t.hasLoading})},e}(E),F=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ei(e,t),e.prototype.checkElement=function(){var t=this.element,e=t.getAttribute("src");if(t.complete){if(e)return t.naturalWidth||this.onAlreadyError(t),!1;this.onAlreadyPreReady()}return this.addEvents(),x&&t.setAttribute("src",e),!0},e.EVENTS=["load","error"],e}(U),V=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ei(e,t),e.prototype.checkElement=function(){var t=this.element;return!(t.readyState>=1||(t.error?(this.onAlreadyError(t),1):(this.addEvents(),0)))},e.EVENTS=["loadedmetadata","error"],e}(U),z=function(t){function e(e){return void 0===e&&(e={}),t.call(this,L({loaders:{img:F,video:V}},e))||this}return Ei(e,t),e}(k),H=class t extends Error{constructor(e,i){super(e),Object.setPrototypeOf(this,t.prototype),this.name="View360Error",this.code=i}},G={CODES:{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},MESSAGES:{WRONG_TYPE:(t,e)=>`${typeof t} is not a ${e.map(t=>`"${t}"`).join(" or ")}.`,WRONG_OPTION:(t,e)=>`Bad option: given "${t}" for option "${e}".`,ELEMENT_NOT_FOUND:t=>`Element with selector "${t}" 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:(t,e)=>`Failed linking WebGL program - "${t}\nShader compile Log: ${e}`,INSUFFICIENT_ARGS:(t,e)=>`Insufficient arguments: given "${t}" for "${e}".`}},Y={MOUSE_DOWN:"mousedown",MOUSE_MOVE:"mousemove",MOUSE_UP:"mouseup",TOUCH_START:"touchstart",TOUCH_MOVE:"touchmove",TOUCH_END:"touchend",WHEEL:"wheel",RESIZE:"resize",CONTEXT_MENU:"contextmenu",MOUSE_ENTER:"mouseenter",MOUSE_LEAVE:"mouseleave",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",POINTER_UP:"pointerup",POINTER_CANCEL:"pointercancel",POINTER_ENTER:"pointerenter",POINTER_LEAVE:"pointerleave",KEY_DOWN:"keydown",KEY_UP:"keyup",LOAD:"load",ERROR:"error",CLICK:"click",DOUBLE_CLICK:"dblclick",CONTEXT_CREATE_ERROR:"webglcontextcreationerror",CONTEXT_LOST:"webglcontextlost",CONTEXT_RESTORED:"webglcontextrestored",DEVICE_ORIENTATION:"deviceorientation",DEVICE_MOTION:"devicemotion",ORIENTATION_CHANGE:"orientationchange",VIDEO_PLAY:"play",VIDEO_PAUSE:"pause",VIDEO_LOADED_DATA:"loadeddata",VIDEO_VOLUME_CHANGE:"volumechange",VIDEO_TIME_UPDATE:"timeupdate",VIDEO_DURATION_CHANGE:"durationchange",VIDEO_CAN_PLAYTHROUGH:"canplaythrough",TRANSITION_END:"transitionend",XR_END:"end"},W="div",j="button",function(t){t[t.LEFT=0]="LEFT",t[t.MIDDLE=1]="MIDDLE",t[t.RIGHT=2]="RIGHT"}(q||(q={})),K={GRAB:"grab",GRABBING:"grabbing",NONE:""},X=["LEFT","UP","RIGHT","DOWN"],function(t){t[t.LEFT=37]="LEFT",t[t.UP=38]="UP",t[t.RIGHT=39]="RIGHT",t[t.DOWN=40]="DOWN"}(Z||(Z={})),$={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",DOWN:"ArrowDown"},Q=["requestFullscreen","webkitRequestFullscreen","webkitRequestFullScreen","webkitCancelFullScreen","mozRequestFullScreen","msRequestFullscreen"],J=["fullscreenElement","webkitFullscreenElement","webkitCurrentFullScreenElement","mozFullScreenElement","msFullscreenElement"],tt=["exitFullscreen","webkitExitFullscreen","webkitCancelFullScreen","mozCancelFullScreen","msExitFullscreen"],et=["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],it={CONTAINER:"view360-container",CANVAS:"view360-canvas",CTX_LOST:"view360-ctx-lost",IN_VR:"view360-vr-presenting",HOTSPOT_CONTAINER:"view360-hotspots",HOTSPOT:"view360-hotspot",HOTSPOT_VISIBLE:"view360-hotspot-visible",HOTSPOT_FLIP_X:"view360-hotspot-flip-x",HOTSPOT_FLIP_Y:"view360-hotspot-flip-y"},st={READY:"ready",LOAD_START:"loadStart",LOAD:"load",PROJECTION_CHANGE:"projectionChange",RESIZE:"resize",BEFORE_RENDER:"beforeRender",RENDER:"render",INPUT_START:"inputStart",INPUT_END:"inputEnd",VIEW_CHANGE:"viewChange",STATIC_CLICK:"staticClick",VR_START:"vrStart",VR_END:"vrEnd"},nt={LINEAR:t=>t,SINE_WAVE:t=>Math.sin(t*Math.PI*2),EASE_OUT_CUBIC:t=>1-Math.pow(1-t,3),EASE_OUT_BOUNCE:t=>{const e=7.5625,i=2.75;return t<1/i?e*t*t:t<2/i?e*(t-=1.5/i)*t+.75:t<2.5/i?e*(t-=2.25/i)*t+.9375:e*(t-=2.625/i)*t+.984375}},rt={CHANGE:"change",ANIMATION_END:"animationEnd"},at={UPDATE:"update"},ht={INPUT_START:"inputStart",CHANGE:"change",INPUT_END:"inputEnd",ENABLE:"enable",DISABLE:"disable",STATIC_CLICK:"staticClick"},lt=Math.PI/180,ct=180/Math.PI,ut=nt.EASE_OUT_CUBIC,dt=300,_t={min:-1/0,max:1/0},pt={min:-90,max:90},mt={min:.6,max:10},function(t){t[t.ZERO=0]="ZERO",t[t.CW_90=1]="CW_90",t[t.CCW_90=2]="CCW_90",t[t.CW_180=3]="CW_180"}(Et||(Et={})),gt="view360videotimechange",vt="http://www.w3.org/2000/svg",ft="immersive-vr",Tt="local",bt=null!==(ot=Number.EPSILON)&&void 0!==ot?ot:2220446049250313e-31,wt=t=>"string"==typeof t,yt=t=>!!t&&t.nodeType===Node.ELEMENT_NODE,Ct=(t,e=W)=>{const i=document.createElement(e);return i.classList.add(t),i},Rt=(t,e)=>{let i=null;if(wt(t)){const s=(e||document).querySelector(t);if(!s)return null;i=s}else yt(t)&&(i=t);return i},Ot=(t,e)=>{const i=Rt(t,e);if(!i)throw wt(t)?new H(G.MESSAGES.ELEMENT_NOT_FOUND(t),G.CODES.ELEMENT_NOT_FOUND):new H(G.MESSAGES.WRONG_TYPE(t,["HTMLElement","string"]),G.CODES.WRONG_TYPE);return i},Lt=(t,e)=>{const i=t.querySelector(e);if(!i)throw new H(G.MESSAGES.CANVAS_NOT_FOUND,G.CODES.CANVAS_NOT_FOUND);return i},It=(t,e,i)=>Math.max(Math.min(t,i),e),At=(t,e,i)=>t*(1-i)+e*i,Nt=(t,e,i)=>{const s=Math.abs(i-e);return t<e?t=i-(e-t)%s:t>i&&(t=e+(t-i)%s),t},xt=(t,e)=>{for(let i=0;i<t.length;i++)if(e(t[i]))return i;return-1},St=t=>"object"==typeof t?t:{},Mt=(t,e)=>2*Math.atan(Math.tan(.5*t)/e),Pt=()=>{if(!document)return!1;for(const t of J)if(document[t])return!0;return!1},Dt=()=>window.isSecureContext&&!!DeviceMotionEvent&&"requestPermission"in DeviceMotionEvent,Ut=(t,e)=>Math.tan(lt*t*.5)/Math.tan(lt*e*.5),Bt=(t,e,i,s)=>{ci(t);const n=It(i,-89.99,89.99);return _i(t,t,e*lt),di(t,t,n*lt),pi(t,t,s*lt),t},kt=t=>{const e=t[0],i=t[1],s=t[2],n=t[3],o=e*e+i*i+s*s+n*n,r=e*n-i*s;let a,h;if(r>.499995*o)a=Math.PI/2,h=2*Math.atan2(i,e);else if(r<-.499995*o)a=-Math.PI/2,h=-2*Math.atan2(i,e);else{const e=$e(0,0,1),i=$e(0,1,0);ii(e,e,t),ii(i,i,t);const s=Math.sqrt(e[0]*e[0]+e[2]*e[2]);a=Math.atan2(-e[1],s),h=Math.atan2(e[0],e[2])}return{pitch:It(a*ct,-90,90),yaw:Nt(h*ct,0,360)}},Ft=class{get val(){return this._val}get start(){return this._start}get end(){return this._end}get progress(){return this._progress}get activated(){return this._activated}get duration(){return this._duration}set duration(t){this._duration=t}get loop(){return this._loop}set loop(t){this._loop=t}get range(){return this._range}get easing(){return this._easing}set easing(t){this._easing=t}constructor({duration:t=300,loop:e=!1,range:i={min:0,max:1},easing:s=ut}={}){this._duration=t,this._loop=e,this._range=i,this._easing=s,this._activated=!1,this.reset(0)}update(t){if(!this._activated)return this._val=this._end,0;const e=this._start,i=this._end,s=this._duration,n=this._val,o=this._loop,r=this._progress+t/s;return this._progress=o?Nt(r,0,1):It(r,0,1),this._val=At(e,i,this._easing(this._progress)),!o&&this._progress>=1&&(this._activated=!1),this._val-n}reset(t){const e=this._range,i=It(t,e.min,e.max);this._start=i,this._end=i,this._val=i,this._progress=0,this._activated=!1}add(t){const e=this._range;this._start=It(this._start+t,e.min,e.max),this._end=It(this._end+t,e.min,e.max),this._val=It(this._val+t,e.min,e.max)}setNewEndByDelta(t){const e=this._range;this._start=this._val,this._end=It(this._end+t,e.min,e.max),this._progress=0,this._activated=!0}setRange(t,e){this._start=It(this._start,t,e),this._end=It(this._end,t,e),this._range={min:t,max:e}}},Vt=class{get duration(){return this._motion.duration}set duration(t){this._motion.duration=t}get easing(){return this._motion.easing}set easing(t){this._motion.easing=t}constructor(t,e,i,{duration:s=300,easing:n=ut}={}){this._camera=t,this._motion=new Ft({duration:s,easing:n,range:{min:0,max:1}}),this._from=e,this._to=i,this._finishPromise=new Promise(t=>{this._finish=t}),this._motion.setNewEndByDelta(1)}getFinishPromise(){return this._finishPromise}update(t){const e=this._camera,i=this._from,s=this._to,n=this._motion;n.update(t);const o=n.val,r=li(),a=At(i.zoom,s.zoom,o);mi(r,i.rotation,s.rotation,o),e.rotate(r,a),o>=1&&this._finish()}},zt=class extends E{get aspect(){return this._aspect}get changed(){return this._changed}get yawRange(){return this._initialYawRange}set yawRange(t){this._initialYawRange=t}get pitchRange(){return this._initialPitchRange}set pitchRange(t){this._initialPitchRange=t}get zoomRange(){return this._initialZoomRange}set zoomRange(t){this._initialZoomRange=t}constructor({initialYaw:t,initialPitch:e,initialZoom:i,yawRange:s,pitchRange:n,zoomRange:o,fov:r}){super(),this.yaw=t,this.pitch=e,this.zoom=i,this.rollOffset=0,this.initialYaw=t,this.initialPitch=e,this.initialZoom=i,this.position=Xe(),this.animation=null,this._up=$e(0,1,0),this._aspect=1,this._initialYawRange=s,this._initialPitchRange=n,this._initialZoomRange=o,this._yawRange=s,this._pitchRange=n,this._zoomRange=o,this.quaternion=li(),this._updateQuaternion(),this.viewMatrix=je(),this.projectionMatrix=je(),this.fov=r,this._maxRenderHeight=-1}destroy(){this.off()}resize(t,e){const i=this._aspect;this._aspect=t/e,this._aspect!==i&&this.updateMatrix()}lookAt({yaw:t=this.yaw,pitch:e=this.pitch,zoom:i=this.zoom}){const s=T(this.quaternion),n=this.zoom;this.yaw=Nt(t,0,360),this.pitch=It(e,-90,90),this.zoom=i,this._updateQuaternion();const o=Math.abs(i-n);(!R(this.quaternion,s)||o>=10*bt)&&this.updateMatrix()}rotate(t,e=this.zoom){const i=C(li(),t),s=R(this.quaternion,i);w(this.quaternion,i);const n=this.zoom,{yaw:o,pitch:r}=kt(i);this.yaw=o,this.pitch=r,this.zoom=e;const a=Math.abs(e-n);(!s||a>=10*bt)&&this.updateMatrix()}animateTo({yaw:t=this.yaw,pitch:e=this.pitch,zoom:i=this.zoom,duration:s=0,easing:n=ut}={}){return Li(this,void 0,void 0,function*(){if(this.yaw===t&&this.pitch===e&&this.zoom===i)return;const o={rotation:T(this.quaternion),zoom:this.zoom},r={rotation:Bt(li(),t,e,this.rollOffset),zoom:i},a=new Vt(this,o,r,{duration:s,easing:n}),h=a.getFinishPromise();return this.animation=a,h.then(()=>{this.animation=null,this.trigger(rt.ANIMATION_END,{animation:a})}),h})}restrictYawRange(t,e){this._yawRange={min:t,max:e}}restrictPitchRange(t,e){this._pitchRange={min:t,max:e}}restrictZoomRange(t,e){this._zoomRange={min:t,max:e}}restrictRenderHeight(t){this._maxRenderHeight=t}resetRange(){this._yawRange=this._initialYawRange,this._pitchRange=this._initialPitchRange,this._zoomRange=this._initialZoomRange,this._maxRenderHeight=-1}getYawRange(t){const e=this._yawRange,i=this._maxRenderHeight;if(!e)return _t;const s=.5*this.getHorizontalFov(t);let n=e.min,o=e.max;if(i>0){const t=Mt(s*lt,this._aspect),r=.5*i,a=Math.tan(t),h=Math.sqrt((1+r*r)/(1+a*a)),l=Math.atan(Math.tan(s*lt)*h)*ct;n=e.min+l,o=e.max-l}return n>o&&(n=0,o=0),{min:n,max:o}}getPitchRange(t){const e=this._pitchRange,i=this._maxRenderHeight;if(!e)return pt;let s=e.min,n=e.max;if(i>0){const i=.5*this.getVerticalFov(t);s=e.min+i,n=e.max-i}return s>n&&(s=0,n=0),{min:Math.max(s,-90),max:Math.min(n,90)}}getZoomRange(){var t;const e=null!==(t=this._zoomRange)&&void 0!==t?t:mt,i=this.getHorizontalFov(e.max),s=this.getHorizontalFov(e.min),n=this.getHorizontalFov(this.zoom);return{min:Math.max(i,1),max:Math.min(s,180),current:n}}getHorizontalFov(t=this.zoom){return this._getZoomedHorizontalFov(t)*ct}getVerticalFov(t=this.zoom){const e=this._aspect;return Mt(this._getZoomedHorizontalFov(t),e)*ct}fovToZoom(t){const e=this.fov;return Math.tan(lt*e*.5)/Math.tan(lt*t*.5)}updateMatrix(){const t=this._up,e=this._aspect,i=this.viewMatrix,s=this.projectionMatrix,n=this.position,o=this.quaternion,r=Xe(),a=$e(0,0,-1);ii(a,a,o),ii(r,t,o);const h=Mt(this._getZoomedHorizontalFov(),e);!function(t,e,i,s){var n,o,r,a,h,l,c,u,d,_,p=e[0],m=e[1],E=e[2],g=s[0],v=s[1],f=s[2],T=i[0],b=i[1],w=i[2];Math.abs(p-T)<1e-6&&Math.abs(m-b)<1e-6&&Math.abs(E-w)<1e-6?function(t){t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1}(t):(c=p-T,u=m-b,d=E-w,n=v*(d*=_=1/Math.hypot(c,u,d))-f*(u*=_),o=f*(c*=_)-g*d,r=g*u-v*c,(_=Math.hypot(n,o,r))?(n*=_=1/_,o*=_,r*=_):(n=0,o=0,r=0),a=u*r-d*o,h=d*n-c*r,l=c*o-u*n,(_=Math.hypot(a,h,l))?(a*=_=1/_,h*=_,l*=_):(a=0,h=0,l=0),t[0]=n,t[1]=a,t[2]=c,t[3]=0,t[4]=o,t[5]=h,t[6]=u,t[7]=0,t[8]=r,t[9]=l,t[10]=d,t[11]=0,t[12]=-(n*p+o*m+r*E),t[13]=-(a*p+h*m+l*E),t[14]=-(c*p+u*m+d*E),t[15]=1)}(i,n,a,r),f(s,h,e,.1,100),this._changed=!0}onFrameRender(){this._changed=!1}_updateQuaternion(){Bt(this.quaternion,this.yaw,this.pitch,this.rollOffset)}_getZoomedHorizontalFov(t=this.zoom){return 2*Math.atan(Math.tan(lt*this.fov*.5)/t)}},Ht=class extends E{constructor(){super(),this._onMouseDown=t=>{const e=this._el;e&&t.button===q.LEFT&&(t.preventDefault(),e.focus?e.focus():window.focus(),this._prevPos[0]=t.clientX,this._prevPos[1]=t.clientY,window.addEventListener(Y.MOUSE_MOVE,this._onMouseMove,!1),window.addEventListener(Y.MOUSE_UP,this._onMouseUp,!1),this.trigger(ht.INPUT_START,{srcEvent:t,isTouch:!1,isKeyboard:!1}))},this._onMouseMove=t=>{t.preventDefault();const e=t.clientX,i=t.clientY,s=this._prevPos,n=e-s[0],o=i-s[1];this.trigger(ht.CHANGE,{delta:{x:n,y:o},isTouch:!1,isKeyboard:!1}),s[0]=e,s[1]=i},this._onMouseUp=()=>{this._prevPos[0]=0,this._prevPos[1]=0,window.removeEventListener(Y.MOUSE_MOVE,this._onMouseMove,!1),window.removeEventListener(Y.MOUSE_UP,this._onMouseUp,!1),this.trigger(ht.INPUT_END,{isTouch:!1,isKeyboard:!1,scrolling:!1})},this._el=null,this._prevPos=[0,0]}enable(t){this._el||(t.addEventListener(Y.MOUSE_DOWN,this._onMouseDown),this._el=t)}disable(){const t=this._el;t&&(t.removeEventListener(Y.MOUSE_DOWN,this._onMouseDown),window.removeEventListener(Y.MOUSE_MOVE,this._onMouseMove,!1),window.removeEventListener(Y.MOUSE_UP,this._onMouseUp,!1),this._el=null)}},Gt=class extends E{get scrollable(){return this._scrollable}set scrollable(t){this._scrollable=t}constructor(){super(),this._onTouchStart=t=>{if(t.touches.length>1||this._scrolling)return;const e=t.touches[0];this._isFirstTouch=!0,this._prevPos[0]=e.clientX,this._prevPos[1]=e.clientY,this.trigger(ht.INPUT_START,{srcEvent:t,isTouch:!0,isKeyboard:!1})},this._onTouchMove=t=>{if(t.touches.length>1||this._scrolling)return;const e=t.touches[0],i=this._scrollable,s=this._prevPos,n=e.clientX,o=e.clientY,r=n-s[0],a=o-s[1];if(this._isFirstTouch){if(i&&!Pt()&&Math.abs(a)>Math.abs(r))return void(this._scrolling=!0);this._isFirstTouch=!1}!1!==t.cancelable&&t.preventDefault(),this.trigger(ht.CHANGE,{delta:{x:r,y:a},isTouch:!0,isKeyboard:!1}),s[0]=n,s[1]=o},this._onTouchEnd=t=>{if(0!==t.touches.length)return;const e=t.touches[0],i=this._prevPos;e?(i[0]=e.clientX,i[1]=e.clientY):(i[0]=0,i[1]=0,this.trigger(ht.INPUT_END,{isTouch:!0,isKeyboard:!1,scrolling:this._scrolling})),!1!==t.cancelable&&t.preventDefault(),this._scrolling=!1},this._el=null,this._prevPos=[0,0],this._isFirstTouch=!1,this._scrolling=!1,this._scrollable=!1}enable(t){this._el||(t.addEventListener(Y.TOUCH_START,this._onTouchStart,{passive:!1}),t.addEventListener(Y.TOUCH_MOVE,this._onTouchMove,{passive:!1}),t.addEventListener(Y.TOUCH_END,this._onTouchEnd),this._el=t)}disable(){const t=this._el;t&&(t.removeEventListener(Y.TOUCH_START,this._onTouchStart),t.removeEventListener(Y.TOUCH_MOVE,this._onTouchMove),t.removeEventListener(Y.TOUCH_END,this._onTouchEnd),this._el=null)}},Yt=class extends E{get active(){const t=this._pressed;return t.LEFT||t.UP||t.RIGHT||t.DOWN}constructor(){super(),this._onKeyDown=t=>{if(t.location!==KeyboardEvent.DOM_KEY_LOCATION_STANDARD)return;this._updateKeyPress(t,!0);const e=this._getPressedKeyCount();e<=0||(t.preventDefault(),1!==e||t.repeat||this.trigger(ht.INPUT_START,{srcEvent:t,isTouch:!1,isKeyboard:!0}))},this._onKeyUp=t=>{t.location===KeyboardEvent.DOM_KEY_LOCATION_STANDARD&&(this._updateKeyPress(t,!1),this._getPressedKeyCount()>0||this.trigger(ht.INPUT_END,{isTouch:!1,isKeyboard:!0,scrolling:!1}))},this._el=null,this._clearPressedKeys()}enable(t){this._el||(t.addEventListener(Y.KEY_DOWN,this._onKeyDown),t.addEventListener(Y.KEY_UP,this._onKeyUp),this._el=t,this._clearPressedKeys())}disable(){const t=this._el;t&&(t.removeEventListener(Y.KEY_DOWN,this._onKeyDown),t.removeEventListener(Y.KEY_UP,this._onKeyUp),this._el=null,this._clearPressedKeys())}update(){const t=this._getDeltaByPressedKeys();0===t.x&&0===t.y||this.trigger(ht.CHANGE,{delta:t,isTouch:!1,isKeyboard:!0})}_clearPressedKeys(){this._pressed=X.reduce((t,e)=>Object.assign(Object.assign({},t),{[e]:!1}),{})}_updateKeyPress(t,e){const i=this._pressed,s=null!=t.keyCode?Z[t.keyCode]:$[t.key];s&&(i[s]=e)}_getPressedKeyCount(){return X.filter(t=>this._pressed[t]).length}_getDeltaByPressedKeys(){const t=this._pressed;let e=0,i=0;return t.LEFT&&(e+=1),t.RIGHT&&(e-=1),t.UP&&(i+=1),t.DOWN&&(i-=1),{x:e,y:i}}},Wt=class extends E{get enabled(){return this._enabled}get enableBlocked(){return this._enableBlocked}get animating(){return this._keyboardInput.active||this._xMotion.activated||this._yMotion.activated}get yaw(){return this._xMotion}get pitch(){return this._yMotion}get scrollable(){return this._touchInput.scrollable}set scrollable(t){this._touchInput.scrollable=t}get pointerScale(){return this._pointerScale}set pointerScale(t){this._pointerScale=t}get keyboardScale(){return this._keyboardScale}set keyboardScale(t){this._keyboardScale=t}get duration(){return this._duration}set duration(t){this._duration=t,this._xMotion.duration=t,this._yMotion.duration=t}get easing(){return this._easing}set easing(t){this._easing=t,this._xMotion.easing=t,this._yMotion.easing=t}get disablePitch(){return this._disablePitch}set disablePitch(t){this._disablePitch=t}get disableYaw(){return this._disableYaw}set disableYaw(t){this._disableYaw=t}get disableKeyboard(){return this._disableKeyboard}set disableKeyboard(t){this._disableKeyboard=t}constructor(t,e,{duration:i=300,easing:s=ut,pointerScale:n=[1,1],keyboardScale:o=[1,1],disablePitch:r=!1,disableYaw:a=!1,disableKeyboard:h=!1}={}){super(),this._onInputStart=t=>{this._changedWhileDragging=!1,this.trigger(ht.INPUT_START,Object.assign(Object.assign({},t),{inputType:"rotate"}))},this._onChange=t=>{const e=t.delta,i=1/this._zoomScale,s=this._screenScale,n=this._keyboardScale,o=this._pointerScale;let r;r=t.isKeyboard?[n[0]*i,n[1]*i]:[o[0]*s[0]*i,o[1]*s[1]*i];const a=e.x*r[0],h=e.y*r[1];this._xMotion.setNewEndByDelta(a),this._yMotion.setNewEndByDelta(h),this._changedWhileDragging=!0},this._onInputEnd=t=>{this.trigger(ht.INPUT_END,Object.assign(Object.assign({},t),{inputType:"rotate"})),this._changedWhileDragging||t.isKeyboard||t.scrolling||this.trigger(ht.STATIC_CLICK,{isTouch:t.isTouch}),this._changedWhileDragging=!1},this._controlEl=t,this._pointerScale=n,this._keyboardScale=o,this._duration=i,this._easing=s,this._disablePitch=r,this._disableYaw=a,this._disableKeyboard=h,this._enableBlocked=e,this._mouseInput=new Ht,this._touchInput=new Gt,this._keyboardInput=new Yt,this._xMotion=new Ft({duration:i,range:_t,easing:s}),this._yMotion=new Ft({duration:i,range:pt,easing:s}),this._screenScale=[1,1],this._zoomScale=1,this._enabled=!1,this._changedWhileDragging=!1,this._bindInputs()}destroy(){this.disable(),this._mouseInput.off(),this._touchInput.off(),this._keyboardInput.off(),this.off(),this._changedWhileDragging=!1}update(t){if(!this._enabled)return;const e=this._xMotion,i=this._yMotion,s=this._keyboardInput;this._disableKeyboard||s.update(),this._disablePitch||i.update(t),this._disableYaw||e.update(t)}updateRange(t,e){const i=t.getYawRange(e),s=t.getPitchRange(e);this._xMotion.setRange(i.min,i.max),this._yMotion.setRange(s.min,s.max)}setZoomScale(t){this._zoomScale=t}resize(t,e,i,s){const n=Mt(t*lt,e)*ct;this._screenScale[0]=t/i,this._screenScale[1]=n/s}enable(){if(this._enabled)return;const t=this._controlEl;this._mouseInput.enable(t),this._touchInput.enable(t),this._keyboardInput.enable(t),this._enabled=!0,this._enableBlocked=!1,this.trigger(ht.ENABLE,{control:this,updateCursor:!0})}disable(){this._enabled&&(this._mouseInput.disable(),this._touchInput.disable(),this._keyboardInput.disable(),this._enabled=!1,this.trigger(ht.DISABLE,{updateCursor:!0}))}sync(t){this.updateRange(t,t.zoom),this._xMotion.reset(t.yaw),this._yMotion.reset(t.pitch)}_bindInputs(){const t=this._mouseInput,e=this._touchInput,i=this._keyboardInput;t.on(ht.INPUT_START,this._onInputStart),t.on(ht.CHANGE,this._onChange),t.on(ht.INPUT_END,this._onInputEnd),e.on(ht.INPUT_START,this._onInputStart),e.on(ht.CHANGE,this._onChange),e.on(ht.INPUT_END,this._onInputEnd),i.on(ht.INPUT_START,this._onInputStart),i.on(ht.CHANGE,this._onChange),i.on(ht.INPUT_END,this._onInputEnd)}},jt=class extends E{get scrollable(){return this._scrollable}set scrollable(t){this._scrollable=t}constructor(){super(),this._onWheel=t=>{const e=this._scrollable;if(0===t.deltaY||e)return;t.preventDefault(),t.stopPropagation(),this._inputTimer<0?this.trigger(ht.INPUT_START,{srcEvent:t,isTouch:!1,isKeyboard:!1}):this._clearTimer();const i=this._baseScale*t.deltaY;this.trigger(ht.CHANGE,{delta:i,isTouch:!1,isKeyboard:!1}),this._inputTimer=window.setTimeout(()=>{this.trigger(ht.INPUT_END,{isTouch:!1,isKeyboard:!1,scrolling:!1}),this._inputTimer=-1},dt)},this._el=null,this._baseScale=.04,this._scrollable=!1,this._inputTimer=-1}enable(t){this._el||(t.addEventListener(Y.WHEEL,this._onWheel,{passive:!1,capture:!1}),this._el=t,this._clearTimer())}disable(){const t=this._el;t&&(t.removeEventListener(Y.WHEEL,this._onWheel,!1),this._el=null,this._clearTimer())}_clearTimer(){window.clearTimeout(this._inputTimer),this._inputTimer=-1}},qt=class extends E{constructor(){super(),this._onTouchMove=t=>{const e=t.touches;if(2!==e.length)return;if(!t.cancelable)return;t.preventDefault(),t.stopPropagation();const i=this._prevDistance,s=[e[0].pageX-e[1].pageX,e[0].pageY-e[1].pageY],n=Math.sqrt(s[0]*s[0]+s[1]*s[1])*this._baseScale,o=this._isFirstTouch?0:n-i;this._isFirstTouch&&this.trigger(ht.INPUT_START,{srcEvent:t,isTouch:!0,isKeyboard:!1}),this._prevDistance=n,this._isFirstTouch=!1,this.trigger(ht.CHANGE,{delta:o,isTouch:!0,isKeyboard:!1})},this._onTouchEnd=t=>{0===t.touches.length&&(this._isFirstTouch||this.trigger(ht.INPUT_END,{isTouch:!0,isKeyboard:!1,scrolling:!1}),this._prevDistance=-1,this._isFirstTouch=!0)},this._el=null,this._baseScale=-.2,this._prevDistance=-1,this._isFirstTouch=!0}enable(t){this._el||(t.addEventListener(Y.TOUCH_MOVE,this._onTouchMove,{passive:!1,capture:!1}),t.addEventListener(Y.TOUCH_END,this._onTouchEnd),this._el=t,this._prevDistance=-1,this._isFirstTouch=!0)}disable(){const t=this._el;t&&(t.removeEventListener(Y.TOUCH_MOVE,this._onTouchMove,!1),t.removeEventListener(Y.TOUCH_END,this._onTouchEnd),this._el=null)}},Kt=class extends E{get enabled(){return this._enabled}get enableBlocked(){return this._enableBlocked}get animating(){return this._motion.activated}get zoom(){return this._motion.val}get scrollable(){return this._wheelInput.scrollable}set scrollable(t){this._wheelInput.scrollable=t}get range(){return this._motion.range}get scale(){return this._scale}set scale(t){this._scale=t}get duration(){return this._motion.duration}get easing(){return this._motion.easing}constructor(t,e,{scale:i=1,duration:s=300,easing:n=ut}={}){super(),this._onInputStart=t=>{this.trigger(ht.INPUT_START,Object.assign(Object.assign({},t),{inputType:"zoom"}))},this._onChange=({delta:t})=>{const e=t*this._scale;this._motion.setNewEndByDelta(e)},this._onInputEnd=t=>{this.trigger(ht.INPUT_END,Object.assign(Object.assign({},t),{inputType:"zoom"}))},this._scale=i,this._controlEl=t,this._enableBlocked=e,this._wheelInput=new jt,this._pinchInput=new qt,this._motion=new Ft({duration:s,easing:n,range:_t}),this._enabled=!1,this._bindInputs()}destroy(){this.disable(),this._wheelInput.off(),this._pinchInput.off(),this.off()}update(t){this._enabled&&this._motion.update(t)}enable(){if(this._enabled)return;const t=this._controlEl;this._wheelInput.enable(t),this._pinchInput.enable(t),this._enabled=!0,this._enableBlocked=!1,this.trigger(ht.ENABLE,{control:this,updateCursor:!1})}disable(){this._enabled&&(this._wheelInput.disable(),this._pinchInput.disable(),this._enabled=!1,this.trigger(ht.DISABLE,{updateCursor:!1}))}sync(t){const e=this._motion,i=t.getZoomRange();e.setRange(i.min,i.max),e.reset(i.current)}_bindInputs(){const t=this._wheelInput,e=this._pinchInput;t.on(ht.INPUT_START,this._onInputStart),t.on(ht.CHANGE,this._onChange),t.on(ht.INPUT_END,this._onInputEnd),e.on(ht.INPUT_START,this._onInputStart),e.on(ht.CHANGE,this._onChange),e.on(ht.INPUT_END,this._onInputEnd)}},(Xt={PITCH_DELTA:1,YAW_DELTA_BY_ROLL:2,YAW_DELTA_BY_YAW:3})[Xt.PITCH_DELTA]={targetAxis:[0,1,0],meshPoint:[0,0,1]},Xt[Xt.YAW_DELTA_BY_ROLL]={targetAxis:[0,1,0],meshPoint:[1,0,0]},Xt[Xt.YAW_DELTA_BY_YAW]={targetAxis:[1,0,0],meshPoint:[0,0,1]},Zt=class extends E{get enabled(){return this._enabled}get orientationUpdated(){return this._orientationUpdated}get ignoreRoll(){return this._ignoreRoll}set ignoreRoll(t){this._ignoreRoll=t}constructor(){super(),this._onDeviceOrientation=t=>{const e=this._orientation,{alpha:i,beta:s,gamma:n}=t;null!=i&&null!=s&&null!=n&&(e.alpha=i,e.beta=s,e.gamma=n,this._orientationUpdated=!0,this._needsCalibrate&&(this._needsCalibrate=!1,this._calibrateSensor()))},this._updateScreenOrientation=()=>{window.screen&&window.screen.orientation&&void 0!==window.screen.orientation.angle?this._screenOrientation=screen.orientation.angle:void 0!==window.orientation?this._screenOrientation=window.orientation>=0?window.orientation:360+window.orientation:this._screenOrientation=0},this.quaternion=li(),this._orientation={alpha:0,beta:90,gamma:0},this._yawOrigin=0,this._yawOffset=0,this._orientationUpdated=!1,this._screenOrientation=0,this._needsCalibrate=!0,this._enabled=!1}enable(){this._enabled||(window.addEventListener(Y.DEVICE_ORIENTATION,this._onDeviceOrientation),window.addEventListener(Y.ORIENTATION_CHANGE,this._updateScreenOrientation),this._updateScreenOrientation(),this._orientationUpdated=!1,this._needsCalibrate=!0,this._enabled=!0)}disable(){this._enabled&&(window.removeEventListener(Y.DEVICE_ORIENTATION,this._onDeviceOrientation),window.removeEventListener(Y.ORIENTATION_CHANGE,this._updateScreenOrientation),this._enabled=!1)}update(){this._updateRotation(),this._orientationUpdated=!1}collectDelta(){if(!this._orientationUpdated)return{pitch:0,yaw:0};const t=T(this.quaternion);return this._updateRotation(),this._orientationUpdated=!1,this._toEulerDelta(t,this.quaternion)}setInitialRotation(t){this._yawOrigin=t}_calibrateSensor(){const t=this._yawOrigin,e=this.quaternion;this._yawOffset=0,this._updateRotation();const{yaw:i}=kt(e);this._yawOffset=i-t,this._updateRotation(),this._needsCalibrate=!1}_updateRotation(){const t=this.quaternion,{alpha:e,beta:i,gamma:s}=this._orientation;ci(t),_i(t,t,(e-this._yawOffset)*lt),di(t,t,i*lt),pi(t,t,-s*lt);const n=li(),o=.5*-this._screenOrientation*lt,r=b(-Math.sqrt(.5),0,0,Math.sqrt(.5));y(n,0,Math.sin(o),0,Math.cos(o)),ui(t,t,n),ui(t,t,r),C(t,t)}_toEulerDelta(t,e){return{yaw:this._getDeltaYaw(t,e),pitch:this._getDeltaPitch(t,e)}}_getDeltaYaw(t,e){const i=this._getRotationDelta(t,e,Xt.YAW_DELTA_BY_YAW);return this._getRotationDelta(t,e,Xt.YAW_DELTA_BY_ROLL)*Math.sin(this._extractPitchFromQuat(e))+i}_getDeltaPitch(t,e){return this._getRotationDelta(t,e,Xt.PITCH_DELTA)}_getRotationDelta(t,e,i){const s=$e(Xt[i].targetAxis[0],Xt[i].targetAxis[1],Xt[i].targetAxis[2]),n=Xt[i].meshPoint,o=T(t),r=T(e);C(o,o),C(r,r);let a=$e(0,0,1),h=$e(0,0,1);ii(a,a,o),ii(h,h,r),ii(s,s,r);const l=Je(s,ti(Xe(),a,h))>0?1:-1,c=$e(n[0],n[1],n[2]);let u;u=i!==Xt.YAW_DELTA_BY_YAW?$e(0,l,0):$e(l,0,0),ii(c,c,r),ii(u,u,r);const d=c,_=u,p=Xe();ti(p,d,_),Qe(p,p);const m=p[0],E=p[1],g=p[2];h=$e(n[0],n[1],n[2]),ii(h,h,r),a=$e(n[0],n[1],n[2]),ii(a,a,o);let v=Math.abs(a[0]*m+a[1]*E+a[2]*g);const f=Xe();!function(t,e,i){t[0]=e[0]-i[0],t[1]=e[1]-i[1],t[2]=e[2]-i[2]}(f,a,function(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t}(Xe(),p,v));let b=(f[0]*h[0]+f[1]*h[1]+f[2]*h[2])/(Ze(f)*Ze(h));b>1&&(b=1);const w=Math.acos(b),y=ti(Xe(),h,f);let R;return v=m*y[0]+E*y[1]+g*y[2],R=i!==Xt.YAW_DELTA_BY_YAW?v>0?1:-1:v<0?1:-1,w*R*l*ct}_extractPitchFromQuat(t){const e=$e(0,0,1);return ii(e,e,t),-1*Math.atan2(e[1],Math.sqrt(Math.pow(e[0],2)+Math.pow(e[2],2)))}},$t=class extends E{get enabled(){return this._input.enabled}get enableBlocked(){return this._enableBlocked}get animating(){return this._input.enabled&&this._input.orientationUpdated}get ignoreRoll(){return this._ignoreRoll}set ignoreRoll(t){this._ignoreRoll=t}static isAvailable(){return Li(this,void 0,void 0,function*(){if(!DeviceMotionEvent)return!1;let t;return Promise.race([new Promise(e=>{t=t=>{e(t.rotationRate&&null!=t.rotationRate.alpha)},window.addEventListener(Y.DEVICE_MOTION,t)}),new Promise(t=>{setTimeout(()=>t(!1),1e3)})]).then(e=>(window.removeEventListener(Y.DEVICE_MOTION,t),e))})}static requestSensorPermission(){return Li(this,void 0,void 0,function*(){return!Dt()||DeviceMotionEvent.requestPermission().then(t=>"granted"===t).catch(()=>!1)})}constructor(t,{ignoreRoll:e=!0}={}){super(),this._enableBlocked=t,this._ignoreRoll=e,this._input=new Zt}destroy(){this.disable(),this._input.off(),this.off()}update(t,e,i,s){this._ignoreRoll?this._updateYawPitch(t,e,i,s):this._updateQuaternion(t,s)}enable(){this._input.enabled||(this._input.enable(),this._enableBlocked=!1,this.trigger(ht.ENABLE,{control:this,updateCursor:!1}))}disable(){this._input.enabled&&(this._input.disable(),this.trigger(ht.DISABLE,{updateCursor:!1}))}sync(){}_updateYawPitch(t,e,i,s){const n=this._input;if(!n.enabled)return;const{yaw:o,pitch:r}=n.collectDelta();e.add(o),i.add(r),t.lookAt({yaw:e.val,pitch:i.val,zoom:s})}_updateQuaternion(t,e){const i=this._input;i.enabled&&(i.update(),t.rotate(i.quaternion,e))}},Qt=class{get useGrabCursor(){return this._useGrabCursor}set useGrabCursor(t){t!==this._useGrabCursor&&(this._useGrabCursor=t,t&&this._enabled?this._setCursor(K.GRAB):t||this._setCursor(K.NONE))}get disableContextMenu(){return this._disableContextMenu}set disableContextMenu(t){t!==this._disableContextMenu&&(this._disableContextMenu=t,t&&this._enabled?this._blockContextMenu():t||this._restoreContextMenu())}get scrollable(){return this._rotateControl.scrollable}set scrollable(t){this._rotateControl.scrollable=t}get wheelScrollable(){return this._zoomControl.scrollable}set wheelScrollable(t){this._zoomControl.scrollable=t}get ignoreZoomScale(){return this._ignoreZoomScale}set ignoreZoomScale(t){this._ignoreZoomScale=t}get enabled(){return this._enabled}get rotate(){return this._rotateControl}get zoom(){return this._zoomControl}get gyro(){return this._gyroControl}get animating(){return this._rotateControl.animating||this._zoomControl.animating||this._gyroControl.animating}constructor(t,e,{useGrabCursor:i,scrollable:s,wheelScrollable:n,disableContextMenu:o,rotate:r,zoom:a,gyro:h}){this._preventContextMenu=t=>{t.preventDefault()},this._onInputStart=t=>{this._useGrabCursor&&!t.isKeyboard&&this._setCursor(K.GRABBING)},this._onInputEnd=t=>{this._useGrabCursor&&!t.isKeyboard&&this._setCursor(K.GRAB)},this._onEnable=({control:t,updateCursor:e})=>{e&&this._useGrabCursor&&this._setCursor(K.GRAB),t.sync(this._camera)},this._onDisable=({updateCursor:t})=>{t&&this._setCursor(K.NONE)},this._onCameraAnimationEnd=({animation:t})=>{t.getFinishPromise().then(()=>{this.sync()})},this._useGrabCursor=i,this._disableContextMenu=o,this._camera=e,this._controlEl=t,this._ignoreZoomScale=!1,this._enabled=!1,this._rotateControl=new Wt(t,!r,St(r)),this._zoomControl=new Kt(t,!a,St(a)),this._gyroControl=new $t(!h,St(h)),this._rotateControl.scrollable=s,this._zoomControl.scrollable=n,this._bindEvents()}destroy(){this.disable(),this._rotateControl.destroy(),this._zoomControl.destroy(),this._setCursor(K.NONE)}resize(t,e){const i=this._camera;this._rotateControl.resize(i.fov,i.aspect,t,e)}enable(){return Li(this,void 0,void 0,function*(){this._enabled||(this._rotateControl.enableBlocked||this._rotateControl.enable(),this._zoomControl.enableBlocked||this._zoomControl.enable(),this._gyroControl.enableBlocked||(yield $t.isAvailable())&&this._gyroControl.enable(),this.sync(),this._disableContextMenu&&this._blockContextMenu(),this._enabled=!0)})}disable(){this._enabled&&(this._rotateControl.disable(),this._zoomControl.disable(),this._gyroControl.disable(),this._restoreContextMenu(),this._enabled=!1)}update(t){const e=this._camera,i=this._rotateControl,s=this._zoomControl,n=this._gyroControl;s.update(t);const o=Ut(e.fov,s.zoom),r=this._ignoreZoomScale?1:Math.max(o,1);i.setZoomScale(r),i.updateRange(e,o),i.update(t);const a=i.yaw,h=i.pitch;n.enabled?n.update(e,a,h,o):e.lookAt({yaw:a.val,pitch:h.val,zoom:o})}sync(){const t=this._camera;this._zoomControl.sync(t),this._rotateControl.sync(t)}_blockContextMenu(){this._controlEl.addEventListener(Y.CONTEXT_MENU,this._preventContextMenu)}_restoreContextMenu(){this._controlEl.removeEventListener(Y.CONTEXT_MENU,this._preventContextMenu)}_setCursor(t){(this._useGrabCursor||t===K.NONE)&&(this._controlEl.style.cursor=t)}_bindEvents(){const t=this._rotateControl,e=this._zoomControl;t.on(ht.INPUT_START,this._onInputStart),t.on(ht.INPUT_END,this._onInputEnd),t.on(ht.ENABLE,this._onEnable),t.on(ht.DISABLE,this._onDisable),e.on(ht.ENABLE,this._onEnable),e.on(ht.DISABLE,this._onDisable),this._camera.on(rt.ANIMATION_END,this._onCameraAnimationEnd)}},Jt=class{constructor({width:t,height:e,flipY:i}){this.width=t,this.height=e,this.flipY=i,this.wrapS=WebGLRenderingContext.CLAMP_TO_EDGE,this.wrapT=WebGLRenderingContext.CLAMP_TO_EDGE}destroy(){}isVideo(){return!1}isCube(){return!1}},te=class extends Jt{constructor({source:t,width:e,height:i,flipY:s}){super({width:e,height:i,flipY:s}),this.source=t}},ee=class extends te{destroy(){const t=this.source;t.pause(),t.removeAttribute("src"),t.load()}isVideo(){return!0}isPaused(){const t=this.source;return t.paused||t.ended||t.readyState<=2}hasAudio(){const t=this.source;return t.audioTracks?t.audioTracks.length>0:null!=t.webkitAudioDecodedByteCount?t.webkitAudioDecodedByteCount>0:null==t.mozHasAudio||t.mozHasAudio}},ie=class extends Jt{constructor({sources:t,width:e,height:i,flipY:s}){super({width:e,height:i,flipY:s}),this.sources=t}isCube(){return!0}},se=class{constructor(){this._loadChecker=new z}load(t,e){return Li(this,void 0,void 0,function*(){if(e)return this.loadVideo(t,St(e));if(Array.isArray(t)&&t.length>1)return this.loadCubeImage(t);{const e=Array.isArray(t)?t[0]:t;return this.loadImage(e)}})}loadImage(t){return Li(this,void 0,void 0,function*(){const e=this._toImageArray(t);return this._load(e,t=>{const i=e[0];t(new te({source:i,width:i.naturalWidth,height:i.naturalHeight,flipY:!0}))})})}loadCubeImage(t){return Li(this,void 0,void 0,function*(){const e=this._toImageArray(t);return this._load(e,t=>{t(new ie({sources:e,width:e[0].naturalWidth,height:e[0].naturalHeight,flipY:!1}))})})}loadVideo(t,e){return Li(this,void 0,void 0,function*(){const i=Object.assign({autoplay:!0,muted:!0,loop:!1,volume:1},e),s=this._toVideoElement(t,i);return this._load([s],t=>{const{autoplay:e,muted:n}=i;s.currentTime=0,e&&n&&s.play().catch(()=>{}),t(new ee({source:s,width:s.videoWidth,height:s.videoHeight,flipY:!0}))})})}_load(t,e){const i=this._loadChecker;return new Promise((s,n)=>{i.once("ready",t=>{t.errorCount>0||e(s)}),i.once("error",n),i.check(t)})}_toImageArray(t){return(Array.isArray(t)?t:[t]).map(t=>{if(wt(t)){const e=new Image;return e.crossOrigin="anonymous",e.src=t,e}return t})}_toVideoElement(t,{muted:e,loop:i,volume:s}){if(t instanceof HTMLVideoElement)return t;const n=document.createElement("video");return n.crossOrigin="anonymous",n.playsInline=!0,n.setAttribute("webkit-playsinline",""),n.muted=e,n.volume=s,n.loop=i,Array.isArray(t)?t.forEach(t=>this._appendSourceElement(n,t)):this._appendSourceElement(n,t),n.querySelectorAll("source").length>0&&n.readyState<1&&n.load(),n}_appendSourceElement(t,e){if(e instanceof HTMLSourceElement)return e;const i=document.createElement("source");i.src=e,t.appendChild(i)}},ne=class{constructor(t,e=window){this.maxDeltaTime=t,this._context=e,this._rafId=-1,this._rafTimer=-1,this._lastUpdateTime=-1}start(t){const e=this._context;if(!e||!t)return;if(this._rafId>=0||this._rafTimer>=0)return;const i=(s,n)=>{const o=Date.now();t(Math.min(o-this._lastUpdateTime,1e3*this.maxDeltaTime),n),this._lastUpdateTime=o,this._rafId=e.requestAnimationFrame(i)};this._lastUpdateTime=Date.now(),this._rafId=e.requestAnimationFrame(i)}stop(){this._rafId>=0&&this._context.cancelAnimationFrame(this._rafId),this._rafTimer>=0&&clearTimeout(this._rafTimer),this._rafId=-1,this._rafTimer=-1}changeContext(t){this.stop(),this._context=t}},oe=class{get useResizeObserver(){return this._useResizeObserver}get enabled(){return this._enabled}constructor(t,e){this._skipFirstResize=(()=>{let t=!0;return()=>{t?t=!1:this._onResize()}})(),this._useResizeObserver=t,this._enabled=!1,this._resizeObserver=null,this._onResize=e}enable(t){if(this._enabled&&this.disable(),this._useResizeObserver&&window.ResizeObserver){const e=t.getBoundingClientRect(),i=0!==e.width||0!==e.height,s=new ResizeObserver(i?this._skipFirstResize:this._onResize);s.observe(t),this._resizeObserver=s}else window.addEventListener(Y.RESIZE,this._onResize);return this._enabled=!0,this}disable(){if(!this._enabled)return this;const t=this._resizeObserver;return t?(t.disconnect(),this._resizeObserver=null):window.removeEventListener(Y.RESIZE,this._onResize),this._enabled=!1,this}},re=class{get enabled(){return this._enabled}get enableBlocked(){return this._enableBlocked}get playing(){return this._enabled&&!this._interrupted}get delay(){return this._delay}set delay(t){this._delay=t}get delayOnMouseLeave(){return this._delayOnMouseLeave}set delayOnMouseLeave(t){this._delayOnMouseLeave=t}get speed(){return this._speed}set speed(t){this._speed=t}get pauseOnHover(){return this._pauseOnHover}set pauseOnHover(t){this._pauseOnHover=t}get canInterrupt(){return this._canInterrupt}set canInterrupt(t){this._canInterrupt=t}get disableOnInterrupt(){return this._disableOnInterrupt}set disableOnInterrupt(t){this._disableOnInterrupt=t}constructor(t,e,i){this._onInputStart=()=>{this._canInterrupt&&(this._interrupted=!0,this._clearTimeout())},this._onInputEnd=()=>{this._setUninterruptedAfterDelay(this._delay)},this._onGyroEnable=()=>{this.disable()},this._onMouseEnter=()=>{this._pauseOnHover&&(this._interrupted=!0,this._hovering=!0)},this._onMouseLeave=()=>{this._pauseOnHover&&(this._hovering=!1,this._setUninterruptedAfterDelay(this._delayOnMouseLeave))},this._camera=t.camera,this._control=t.control,this._element=e,this._enabled=!1,this._interrupted=!1,this._interruptionTimer=-1,this._hovering=!1;const{delay:s=2e3,delayOnMouseLeave:n=0,speed:o=1,pauseOnHover:r=!1,canInterrupt:a=!0,disableOnInterrupt:h=!1}=St(i);this._enableBlocked=!i,this._delay=s,this._delayOnMouseLeave=n,this._speed=o,this._pauseOnHover=r,this._canInterrupt=a,this._disableOnInterrupt=h}destroy(){this.disable()}update(t){if(!this._enabled)return;if(this._interrupted)return void(this._disableOnInterrupt&&this.disable());const e=this._camera,i=-this._speed*t/100;e.yaw=Nt(e.yaw+i,0,360)}enable(){const t=this._control,e=this._element;this._enabled||t.gyro.enabled||(t.rotate.on(ht.INPUT_START,this._onInputStart),t.rotate.on(ht.INPUT_END,this._onInputEnd),t.zoom.on(ht.INPUT_START,this._onInputStart),t.zoom.on(ht.INPUT_END,this._onInputEnd),t.gyro.on(ht.ENABLE,this._onGyroEnable),e.addEventListener(Y.MOUSE_ENTER,this._onMouseEnter,!1),e.addEventListener(Y.MOUSE_LEAVE,this._onMouseLeave,!1),this._enabled=!0,this._enableBlocked=!1)}enableAfterDelay(){this.enable(),this._interrupted=!0,this._setUninterruptedAfterDelay(this._delay)}disable(){if(!this._enabled)return;const t=this._control,e=this._element;t.rotate.off(ht.INPUT_START,this._onInputStart),t.rotate.off(ht.INPUT_END,this._onInputEnd),t.zoom.off(ht.INPUT_START,this._onInputStart),t.zoom.off(ht.INPUT_END,this._onInputEnd),t.gyro.off(ht.ENABLE,this._onGyroEnable),e.removeEventListener(Y.MOUSE_ENTER,this._onMouseEnter,!1),e.removeEventListener(Y.MOUSE_LEAVE,this._onMouseLeave,!1),this._enabled=!1,this._interrupted=!1,this._hovering=!1,this._clearTimeout()}_setUninterruptedAfterDelay(t){this._hovering||(this._clearTimeout(),t>0?this._interruptionTimer=window.setTimeout(()=>{this._interrupted=!1,this._interruptionTimer=-1},t):(this._interrupted=!1,this._interruptionTimer=-1))}_clearTimeout(){this._interruptionTimer>=0&&(window.clearTimeout(this._interruptionTimer),this._interruptionTimer=-1)}},ae=class extends E{constructor(t,e={}){super(),this.destroy=()=>{this.exit(),this.off()},this._onSessionEnd=()=>{this.exit(),this.trigger(st.VR_END)},this._xrSession=null,this._xrRefSpace=null,this._ctx=t,this._options=e}isAvailable(){return Li(this,void 0,void 0,function*(){const t=window.navigator.xr;return!!t&&t.isSessionSupported(ft).then(t=>t).catch(()=>!1)})}enter(){return Li(this,void 0,void 0,function*(){const t=this._ctx,e=window.navigator.xr;if(!e)return;yield $t.requestSensorPermission();const i=Object.assign({requiredFeatures:[Tt]},this._options);yield t.makeXRCompatible();const s=yield e.requestSession(ft,i);t.bindXRLayer(s);const n=yield s.requestReferenceSpace(Tt);this._setSession(s,n),this.trigger(st.VR_START,{session:s})})}exit(){const t=this._xrSession;t&&t.end().catch(()=>{}),this._xrSession=null,this._xrRefSpace=null}canRender(t){const e=this._xrRefSpace;return!!e&&!!t.getViewerPose(e)}getEyeParams(t){const e=t.session,i=t.getViewerPose(this._xrRefSpace);if(!i)return null;const s=e.renderState.baseLayer;return s?i.views.map(t=>({viewport:s.getViewport(t),vMatrix:t.transform.inverse.matrix,pMatrix:t.projectionMatrix})):null}_setSession(t,e){this._xrSession=t,this._xrRefSpace=e,t.addEventListener(Y.XR_END,this._onSessionEnd)}},he=class{constructor(t,e){this.element=t,this.position=e}},le=class{constructor(t,e,{zoom:i=!1}){this._containerEl=Rt(`.${it.HOTSPOT_CONTAINER}`,t),this._renderer=e,this._hotspots=[],this._zoom=i}refresh(){const t=this._containerEl;t&&(this._hotspots=[].slice.apply(t.querySelectorAll(`.${it.HOTSPOT}`)).map(t=>this._parseHotspot(t)))}render(t){const e=this._hotspots,i=.5*this._renderer.width,s=.5*this._renderer.height,n=t.zoom,o="translate(-50%, -50%)",r=this._zoom?`scale(${n})`:"";e.forEach(e=>{const n=e.position,a=Xe();if(function(t,e){t[0]=e[0],t[1]=e[1],t[2]=e[2]}(a,n),ei(a,a,t.viewMatrix),ei(a,a,t.projectionMatrix),a[2]>1||a[2]<0)return void e.element.classList.remove(it.HOTSPOT_VISIBLE);const h=function(t,e){var i=new v(2);return i[0]=t,i[1]=e,i}(a[0]*i+i,-a[1]*s+s);e.element.classList.add(it.HOTSPOT_VISIBLE),e.element.style.transform=[o,`translate(${h[0]}px, ${h[1]}px)`,r].join(" ")})}_parseHotspot(t){const e=t.dataset.yaw,i=t.dataset.pitch,s=t.dataset.position;if(e||i){const s=e?parseFloat(e):0,n=i?parseFloat(i):0;return new he(t,this._yawPitchToVec3(s,n))}if(s){const e=s.split(" ").map(t=>parseFloat(t));if(e.length<3)throw new H(G.MESSAGES.INSUFFICIENT_ARGS(s,'hotspot attribute "data-position"'),G.CODES.INSUFFICIENT_ARGS);return new he(t,$e(e[0],e[1],e[2]))}return new he(t,$e(0,0,-1))}_yawPitchToVec3(t,e){const i=t*lt,s=e*lt,n=Xe();return n[1]=Math.sin(s),n[2]=Math.cos(s),n[0]=n[2]*Math.sin(-i),n[2]=-n[2]*Math.cos(-i),n}},ce=class{get count(){return this.geometry.indicies.count}constructor(t,e,i){this.obj=t,this.geometry=e,this.buffers=i}},ue=class{get canvas(){return this._canvas}get maxTextureSize(){return this._maxTextureSize}get isWebGL2(){return this._isWebGL2}get supportVAO(){return this._isWebGL2||!!this._extensions.vao}get lost(){return this._contextLost}get debug(){return this._debug}constructor(t,e){this._onContextLost=()=>{this._canvas.classList.add(it.CTX_LOST),this._contextLost=!0},this._onContextRestore=()=>{this._canvas.classList.remove(it.CTX_LOST),this._contextLost=!1},this._canvas=t,this._contextLost=!1,this._debug=e,this._extensions={vao:null,loseContext:null}}init(){const t=this._canvas,{gl:e,isWebGL2:i}=this._getContext(t);this._gl=e,this._maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE),this._isWebGL2=i,this._isWebGL2||(this._extensions.vao=e.getExtension("OES_vertex_array_object")),this._extensions.loseContext=e.getExtension("WEBGL_lose_context"),t.addEventListener(Y.CONTEXT_LOST,this._onContextLost),t.addEventListener(Y.CONTEXT_RESTORED,this._onContextRestore)}destroy(){const t=this._gl,e=this._canvas;t&&(t.bindBuffer(t.ARRAY_BUFFER,null),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null)),e.removeEventListener(Y.CONTEXT_LOST,this._onContextLost),e.removeEventListener(Y.CONTEXT_RESTORED,this._onContextRestore)}forceLoseContext(){const t=this._extensions.loseContext;t&&t.loseContext()}forceRestoreContext(){const t=this._extensions.loseContext;t&&t.restoreContext()}clear(){const t=this._gl;t.clear(t.COLOR_BUFFER_BIT)}resize(){const t=this._gl;t.viewport(0,0,t.drawingBufferWidth,t.drawingBufferHeight)}viewport(t,e,i,s){this._gl.viewport(t,e,i,s)}createVAO(t,e){const i=this._createNativeVAO(),s=new ce(i,t,{indicies:this._createBuffer(),position:this._createBuffer(),uv:this._createBuffer()});return i&&(this._bindNativeVAO(i),this._supplyGeometryData(s,e),this._bindNativeVAO(null),this._unbindBuffers()),s}draw(t,e){const i=this._gl;t.obj?this._bindNativeVAO(t.obj):this._supplyGeometryData(t,e),i.drawElements(i.TRIANGLES,t.count,i.UNSIGNED_SHORT,0),t.obj?this._bindNativeVAO(null):this._unbindBuffers()}releaseVAO(t){t.obj&&this._deleteNativeVAO(t.obj),this._deleteBuffer(t.buffers.indicies),this._deleteBuffer(t.buffers.position),this._deleteBuffer(t.buffers.uv)}getUniformLocations(t,e){const i=this._gl,s=Object.keys(e).reduce((e,s)=>(e[s]=i.getUniformLocation(t,s),e),{});return Object.assign(Object.assign({},this._getCommonUniformLocations(t)),s)}updateCommonUniforms(t,e,i){const s=this._gl,n=i.uniformLocations,o=t.matrix,r=je();qe(r,e.viewMatrix,o),s.uniformMatrix4fv(n.uMVMatrix,!1,r),s.uniformMatrix4fv(n.uPMatrix,!1,e.projectionMatrix)}updateVRUniforms(t,e,i,s){const n=this._gl,o=t.uniformLocations;n.uniformMatrix4fv(o.uMVMatrix,!1,e),n.uniformMatrix4fv(o.uPMatrix,!1,i),o.uEye&&n.uniform1f(o.uEye,s)}updateUniforms(t){const e=this._gl,i=t.uniforms,s=t.uniformLocations;for(const n in i){const t=i[n],o=s[n];t&&t.needsUpdate&&t.update(e,o,this._isWebGL2)}}releaseShaderResources(t){const e=this._gl,i=t.uniforms;for(const s in i){const t=i[s];t&&t.needsUpdate&&t.destroy(e)}e.deleteProgram(t.program)}useProgram(t){this._gl.useProgram(t.program)}createProgram(t,e){const i=this._gl,s=i.createProgram(),n=this._compileShader(i.VERTEX_SHADER,t),o=this._compileShader(i.FRAGMENT_SHADER,e);if(i.attachShader(s,n),i.attachShader(s,o),i.bindAttribLocation(s,0,"position"),i.bindAttribLocation(s,1,"uv"),i.linkProgram(s),this._debug&&!i.getProgramParameter(s,i.LINK_STATUS)){let t=null;throw i.getShaderParameter(n,i.COMPILE_STATUS)?i.getShaderParameter(o,i.COMPILE_STATUS)||(t=i.getShaderInfoLog(o)):t=i.getShaderInfoLog(n),new H(G.MESSAGES.FAILED_LINKING_PROGRAM(i.getProgramInfoLog(s),t),G.CODES.FAILED_LINKING_PROGRAM)}return i.deleteShader(n),i.deleteShader(o),s}createWebGLTexture(t){const e=this._gl,i=e.createTexture();if(e.bindTexture(e.TEXTURE_2D,i),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,t.wrapS),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,t.wrapT),!t.isVideo()&&this._isWebGL2){const i=e;i.texStorage2D(i.TEXTURE_2D,1,i.RGBA8,t.width,t.height)}return i}createWebGLCubeTexture(t,e){const i=this._gl,s=i.createTexture();if(i.bindTexture(i.TEXTURE_CUBE_MAP,s),i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_MIN_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_MAG_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_WRAP_S,t.wrapS),i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_WRAP_T,t.wrapT),this._isWebGL2){const t=i;t.texStorage2D(t.TEXTURE_CUBE_MAP,1,t.RGBA8,e,e)}return s}makeXRCompatible(){return Li(this,void 0,void 0,function*(){const t=this._gl,e=t.getContextAttributes();e&&!0!==e.xrCompatible&&(yield t.makeXRCompatible())})}bindXRLayer(t){const e=this._gl,i=new XRWebGLLayer(t,e);t.updateRenderState({baseLayer:i})}bindXRFrame(t){const e=this._gl,i=t.session.renderState.baseLayer;e.bindFramebuffer(e.FRAMEBUFFER,i.framebuffer)}useDefaultFrameBuffer(){const t=this._gl;t.bindFramebuffer(t.FRAMEBUFFER,null)}_createBuffer(){return this._gl.createBuffer()}_deleteBuffer(t){return this._gl.deleteBuffer(t)}_createNativeVAO(){const t=this._gl;if(this._isWebGL2)return t.createVertexArray();{const t=this._extensions.vao;return(null==t?void 0:t.createVertexArrayOES())||null}}_bindNativeVAO(t){const e=this._gl;if(this._isWebGL2)e.bindVertexArray(t);else{const e=this._extensions.vao;null==e||e.bindVertexArrayOES(t)}}_deleteNativeVAO(t){const e=this._gl;if(this._isWebGL2)e.deleteVertexArray(t);else{const e=this._extensions.vao;null==e||e.deleteVertexArrayOES(t)}}_supplyGeometryData(t,e){const i=t.geometry;this._supplyIndiciesData(i.indicies,t.buffers.indicies),this._supplyAttributeData(i.vertices,e.program,"position",t.buffers.position),this._supplyAttributeData(i.uvs,e.program,"uv",t.buffers.uv)}_unbindBuffers(){const t=this._gl;t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null),t.bindBuffer(t.ARRAY_BUFFER,null)}_supplyIndiciesData(t,e){const i=this._gl;i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,e),i.bufferData(i.ELEMENT_ARRAY_BUFFER,t.data,i.STATIC_DRAW)}_supplyAttributeData(t,e,i,s){const n=this._gl,o=n.getAttribLocation(e,i);o<0||(n.bindBuffer(n.ARRAY_BUFFER,s),n.bufferData(n.ARRAY_BUFFER,t.data,n.STATIC_DRAW),n.vertexAttribPointer(o,t.itemSize,n.FLOAT,!1,0,0),n.enableVertexAttribArray(o))}_compileShader(t,e){const i=this._gl,s=i.createShader(t);return i.shaderSource(s,e),i.compileShader(s),s}_getCommonUniformLocations(t){const e=this._gl;return{uMVMatrix:e.getUniformLocation(t,"uMVMatrix"),uPMatrix:e.getUniformLocation(t,"uPMatrix")}}_getContext(t){const e=["webgl2","webgl","experimental-webgl","webkit-3d","moz-webgl"];let i=null,s=!1;const n={preserveDrawingBuffer:!1,antialias:!1},o=t=>t.statusMessage;t.addEventListener(Y.CONTEXT_CREATE_ERROR,o);for(const a of e){try{i=t.getContext(a,n),s="webgl2"===a}catch(r){}if(i)break}if(t.removeEventListener(Y.CONTEXT_CREATE_ERROR,o),!i)throw new H(G.MESSAGES.WEBGL_NOT_SUPPORTED,G.CODES.WEBGL_NOT_SUPPORTED);return{gl:i,isWebGL2:s}}},de=class{get canvas(){return this._canvas}get width(){return this._elementSize.x}get height(){return this._elementSize.y}get pixelRatio(){return this._pixelRatio}get aspect(){return this._elementSize.x/this._elementSize.y}constructor(t,e){this._canvas=t,this._elementSize={x:0,y:0},this._pixelRatio=1,this.ctx=new ue(t,e)}destroy(){const t=this._canvas;this.ctx.destroy(),t.width=1,t.height=1}resize(){const t=this._canvas,e=this._elementSize,i=window.devicePixelRatio;e.x=t.clientWidth,e.y=t.clientHeight,t.width=e.x*i,t.height=e.y*i,this._pixelRatio=i,this.ctx.resize()}render(t,e){const i=this.ctx;i.lost||(i.clear(),i.useProgram(t.program),i.updateCommonUniforms(t,e,t.program),t.update({camera:e}),i.updateUniforms(t.program),i.draw(t.vao,t.program))}renderVR(t,e,i){const s=this.ctx,n=e.getEyeParams(i);n&&t&&(s.bindXRFrame(i),s.useProgram(t.program),s.updateUniforms(t.program),n.forEach((e,i)=>{const n=e.viewport,o=qe(je(),e.vMatrix,t.matrix);s.viewport(n.x,n.y,n.width,n.height),s.updateVRUniforms(t.program,o,e.pMatrix,i),s.draw(t.vao,t.program)}))}},(_e=class extends E{get rootEl(){return this._rootEl}get renderer(){return this._renderer}get camera(){return this._camera}get control(){return this._control}get vr(){return this._vr}get hotspot(){return this._hotspot}get plugins(){return this._plugins}get projection(){return this._projection}set projection(t){this._initialized&&t?this.load(t):this._projection=t}get mesh(){return this._mesh}get initialized(){return this._initialized}get autoplay(){return this._autoplay}get autoInit(){return this._autoInit}get autoResize(){return this._autoResize}get canvasSelector(){return this._canvasSelector}get useResizeObserver(){return this._useResizeObserver}get tabIndex(){return this._tabIndex}set tabIndex(t){const e=this._renderer.canvas;this._tabIndex=t,null!=t?e.tabIndex=t:e.removeAttribute("tabindex")}get maxDeltaTime(){return this._animator.maxDeltaTime}set maxDeltaTime(t){this._animator.maxDeltaTime=t}get debug(){return this._debug}set debug(t){this._debug=t}get initialYaw(){return this._camera.initialYaw}set initialYaw(t){this._camera.initialYaw=t}get initialPitch(){return this._camera.initialPitch}set initialPitch(t){this._camera.initialPitch=t}get initialZoom(){return this._camera.initialZoom}set initialZoom(t){this._camera.initialZoom=t}get yawRange(){return this._camera.yawRange}set yawRange(t){this._camera.yawRange=t,this._projection&&this._projection.updateCamera(this._camera)}get pitchRange(){return this._camera.pitchRange}set pitchRange(t){this._camera.pitchRange=t,this._projection&&this._projection.updateCamera(this._camera)}get zoomRange(){return this._camera.zoomRange}set zoomRange(t){this._camera.zoomRange=t,this._projection&&this._projection.updateCamera(this._camera)}get fov(){return this._camera.fov}set fov(t){const e=this._camera,i=this._control;e.fov=t,e.updateMatrix(),i.sync()}get rotate(){return this._control.rotate}get zoom(){return this._control.zoom}get gyro(){return this._control.gyro}get useGrabCursor(){return this._control.useGrabCursor}set useGrabCursor(t){this._control.useGrabCursor=t}get disableContextMenu(){return this._control.disableContextMenu}set disableContextMenu(t){this._control.disableContextMenu=t}get scrollable(){return this._control.scrollable}set scrollable(t){this._control.scrollable=t}get wheelScrollable(){return this._control.wheelScrollable}set wheelScrollable(t){this._control.wheelScrollable=t}constructor(t,{projection:e=null,initialYaw:i=0,initialPitch:s=0,initialZoom:n=1,yawRange:o=null,pitchRange:r=null,zoomRange:a=null,fov:h=90,useGrabCursor:l=!0,disableContextMenu:c=!1,rotate:u=!0,zoom:d=!0,gyro:_=!1,scrollable:p=!0,wheelScrollable:m=!1,autoplay:E=!1,hotspot:g={},autoInit:v=!0,autoResize:f=!0,canvasSelector:T="canvas",useResizeObserver:b=!0,on:w={},plugins:y=[],maxDeltaTime:C=1/30,tabIndex:R=0,debug:O=!1}={}){super(),this.renderFrame=t=>{const e=this._camera,i=this._renderer,s=this._control,n=this._hotspot,o=this._autoplay,r=this._mesh;r&&(this._emit(st.BEFORE_RENDER),o.playing&&(o.update(t),s.sync()),e.animation?e.animation.update(t):s.update(t),i.render(r,e),n.render(e),e.changed&&this._emit(st.VIEW_CHANGE,{yaw:e.yaw,pitch:e.pitch,zoom:e.zoom,quaternion:[e.quaternion[0],e.quaternion[1],e.quaternion[2],e.quaternion[3]]}),e.onFrameRender(),this._emit(st.RENDER))},this._renderFrameOnDemand=t=>{const e=this._camera,i=this._control,s=this._autoplay,n=this._mesh,o=null==n?void 0:n.getTexture();this._initialized&&o&&(e.animation||i.animating||s.playing||o.isVideo())&&this.renderFrame(t)},this._renderVRFrame=(t,e)=>{const i=this._vr,s=this._mesh,n=this._renderer;s&&(this._emit(st.BEFORE_RENDER),n.renderVR(s,i,e),this._emit(st.RENDER))},this._rootEl=Ot(t),this._plugins=y,this._initialized=!1,this._autoInit=v,this._autoResize=f,this._canvasSelector=T,this._useResizeObserver=b,this._tabIndex=R,this._debug=O;const L=Lt(this._rootEl,T);this._renderer=new de(L,O),this._camera=new zt({initialYaw:i,initialPitch:s,initialZoom:n,fov:h,yawRange:o,pitchRange:r,zoomRange:a}),this._control=new Qt(L,this._camera,{useGrabCursor:l,scrollable:p,wheelScrollable:m,disableContextMenu:c,rotate:u,zoom:d,gyro:_}),this._animator=new ne(C),this._autoplay=new re(this,L,E),this._projection=e,this._mesh=null,this._autoResizer=new oe(b,()=>this.resize()),this._vr=new ae(this._renderer.ctx),this._hotspot=new le(this._rootEl,this._renderer,g),this._addEventHandlers(w),e&&v&&this.init()}destroy(){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(t=>t.destroy(this)),this._initialized=!1}init(){return Li(this,void 0,void 0,function*(){if(!this._projection)throw new H(G.MESSAGES.PROVIDE_PROJECTION_FIRST,G.CODES.PROVIDE_PROJECTION_FIRST);const t=this._renderer,e=this._camera,i=this._control,s=this._animator,n=this._hotspot,o=this._projection,r=t.canvas;this._bindComponentEvents(),t.ctx.init(),this._resizeComponents(),e.updateMatrix(),this._autoResize&&this._autoResizer.enable(r),this._autoplay.enableBlocked||this._autoplay.enable(),this._plugins.forEach(t=>{t.init(this)});const a=yield this._loadTexture(o);this._applyProjection(o,a),n.refresh(),s.start(this._renderFrameOnDemand),yield i.enable(),null==this._tabIndex||r.hasAttribute("tabIndex")||(r.tabIndex=this._tabIndex),this._initialized=!0,this.renderFrame(0),this._emit(st.READY)})}load(t){return Li(this,void 0,void 0,function*(){if(!t)return!1;if(this._initialized){const e=yield this._loadTexture(t);this._applyProjection(t,e),this.renderFrame(0)}else this._projection=t,this.init();return!0})}resize(){if(!this._initialized)return;this._resizeComponents(),this.renderFrame(0);const{width:t,height:e}=this._renderer;this._emit(st.RESIZE,{width:t,height:e})}addPlugins(...t){this._initialized&&t.forEach(t=>{t.init(this)}),this._plugins.push(...t)}removePlugins(...t){t.forEach(t=>{const e=this._plugins.indexOf(t);e<0||(t.destroy(this),this._plugins.splice(e,1))})}_emit(t,...e){const i=e?e[0]:{};this.trigger(t,Object.assign({type:t,target:this},i))}_applyProjection(t,e){const i=this._camera,s=this._control,n=this._renderer,o=this._mesh;o&&o.destroy(n.ctx);const r=t.createMesh(n.ctx,e);t.updateCamera(i),t.updateControl(s),this._mesh=r,this._emit(st.PROJECTION_CHANGE,{projection:t})}_loadTexture(t){return Li(this,void 0,void 0,function*(){const e=new se,{src:i,video:s}=t;this._emit(st.LOAD_START,{src:i,video:s});const n=yield e.load(i,s);return this._emit(st.LOAD,{src:i,video:s}),n})}_resizeComponents(){const t=this._renderer,e=this._camera,i=this._control;t.resize(),e.resize(t.width,t.height),i.resize(t.width,t.height)}_addEventHandlers(t){Object.keys(t).forEach(e=>{this.on(e,t[e])})}_bindComponentEvents(){const t=this._rootEl,e=this._control,i=this._animator,s=this._renderer,n=this._vr;[ht.STATIC_CLICK,ht.INPUT_START,ht.INPUT_END].forEach(t=>{e.rotate.on(t,e=>{this._emit(t,e)}),e.zoom.on(t,e=>{this._emit(t,e)})}),n.on(st.VR_START,e=>{t.classList.add(it.IN_VR),i.changeContext(e.session),i.start(this._renderVRFrame),this._emit(st.VR_START)}),n.on(st.VR_END,()=>{t.classList.remove(it.IN_VR),s.ctx.useDefaultFrameBuffer(),i.changeContext(window),i.start(this._renderFrameOnDemand),this.resize(),this._emit(st.VR_END)})}}).VERSION="4.0.0-beta.7",pe=class extends E{constructor(){super(),this.matrix=je(),this.rotation=li(),this.position=$e(0,0,0),this.scale=$e(1,1,1)}updateMatrix(){!function(t,e,i,s){var n=e[0],o=e[1],r=e[2],a=e[3],h=n+n,l=o+o,c=r+r,u=n*h,d=n*l,_=n*c,p=o*l,m=o*c,E=r*c,g=a*h,v=a*l,f=a*c,T=s[0],b=s[1],w=s[2];t[0]=(1-(p+E))*T,t[1]=(d+f)*T,t[2]=(_-v)*T,t[3]=0,t[4]=(d-f)*b,t[5]=(1-(u+E))*b,t[6]=(m+g)*b,t[7]=0,t[8]=(_+v)*w,t[9]=(m-g)*w,t[10]=(1-(u+p))*w,t[11]=0,t[12]=i[0],t[13]=i[1],t[14]=i[2],t[15]=1}(this.matrix,this.rotation,this.position,this.scale)}update(t){this.trigger(at.UPDATE,t)}},me=class{constructor(t){this.position=t.position,this.order=t.order}},Ee={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"},ge={TOP_LEFT:"top-left",TOP_RIGHT:"top-right",MAIN_TOP:"main-top",MAIN_BOTTOM:"main-bottom",MAIN_LEFT:"main-left",MAIN_RIGHT:"main-right"},ve=class extends E{constructor(){super(),this._onHold=({srcEvent:t,isTouch:e})=>{var i;const s=this._bbox;if(!s)return;const n=e?t.touches[0].pageX:t.pageX,o=s.x+(null!==(i=window.scrollX)&&void 0!==i?i:window.pageXOffset),r=It(n,o,o+s.width),a=(r-o)/s.width;this._motion.reset(r),this.thumbEl.classList.add(this._fixedClass),this.trigger(ht.INPUT_START,a)},this._onChange=({delta:t})=>{var e;const i=this._motion,s=this._bbox;if(!s)return;i.setNewEndByDelta(t.x),i.update(1);const n=s.x+(null!==(e=window.scrollX)&&void 0!==e?e:window.pageXOffset),o=(It(i.val,n,n+s.width)-n)/s.width;this.trigger(ht.CHANGE,o)},this._onRelease=()=>{this._bbox&&(this.thumbEl.classList.remove(this._fixedClass),this.trigger(ht.INPUT_END))};const t=document.createElement(W),e=document.createElement(W),i=document.createElement(W),s=document.createElement(W);t.draggable=!1,e.appendChild(s),e.appendChild(i),t.appendChild(e),this.rootEl=t,this.trackEl=e,this.thumbEl=i,this.fillerEl=s,this._mouseInput=new Ht,this._touchInput=new Gt,this._motion=new Ft({duration:1,range:_t,easing:t=>t}),this._bbox={x:0,y:0,width:0,height:0,left:0,right:0,bottom:0,top:0},this._fixedClass=Ee.FIXED}init(t){const e=this._mouseInput,i=this._touchInput;this.rootEl.classList.add(t.RANGE_ROOT),this.trackEl.classList.add(t.RANGE_TRACK),this.thumbEl.classList.add(t.RANGE_THUMB),this.fillerEl.classList.add(t.RANGE_FILLER),this._fixedClass=t.FIXED,e.on(ht.INPUT_START,this._onHold),i.on(ht.INPUT_START,this._onHold),e.on(ht.INPUT_END,this._onRelease),i.on(ht.INPUT_END,this._onRelease),e.on(ht.CHANGE,this._onChange),i.on(ht.CHANGE,this._onChange),e.enable(this.rootEl),i.enable(this.rootEl),this.resize()}destroy(){const t=this._mouseInput,e=this._touchInput;this.rootEl.className="",this.trackEl.className="",this.thumbEl.className="",this.fillerEl.className="",t.off(),e.off(),t.disable(),e.disable()}resize(){this._bbox=this.trackEl.getBoundingClientRect()}updateStyle(t){const e=this._bbox.width,i=It(t,0,1);this.fillerEl.style.width=100*i+"%",this.thumbEl.style.transform=`translateX(${i*e}px)`}},fe=class extends me{get element(){return this._rangeControl.rootEl}constructor({position:t=ge.MAIN_TOP,order:e=9999}={}){super({position:t,order:e}),this._onResize=()=>{this._rangeControl.resize()},this._onTimeUpdate=()=>{const t=this._video;t&&(this._currentTime=t.source.currentTime,this._rangeControl.updateStyle(this._currentTime/this._duration))},this._onDurationChange=()=>{const t=this._video;t&&(this._duration=t.source.duration,this._rangeControl.updateStyle(this._currentTime/this._duration))},this._onHold=t=>{const e=this._video,i=this._controlBar;if(!e||!i)return;const s=e.isPaused();e.source.pause();const n=e.source.duration*t;e.source.currentTime=n,e.source.dispatchEvent(new CustomEvent(gt,{detail:{time:n}})),i.rootEl.classList.add(i.className.FIXED),this._wasPaused=!this._playPromise&&s},this._onControl=t=>{const e=this._video;if(!e)return;const i=e.source.duration*t;e.source.currentTime=i,e.source.dispatchEvent(new CustomEvent(gt,{detail:{time:i}}))},this._onRelease=()=>{const t=this._video,e=this._controlBar;t&&e&&(this._wasPaused||this._playPromise||(this._playPromise=t.source.play().catch(()=>{}),this._playPromise.then(()=>{this._playPromise=null}),e.rootEl.classList.remove(e.className.FIXED))),this._wasPaused=!1},this.position=t,this.order=e,this._controlBar=null,this._rangeControl=new ve,this._video=null,this._wasPaused=!1,this._currentTime=0,this._duration=0,this._playPromise=null}init(t,e){var i;const s=null===(i=t.mesh)||void 0===i?void 0:i.getTexture(),n=this.element,o=this._rangeControl,r=e.className.UNAVAILABLE;s&&s.isVideo()?(n.classList.remove(r),n.classList.add(e.className.PROGRESS_ROOT),t.on(st.RESIZE,this._onResize),s.source.addEventListener(Y.VIDEO_TIME_UPDATE,this._onTimeUpdate),s.source.addEventListener(Y.VIDEO_DURATION_CHANGE,this._onDurationChange),s.source.addEventListener(gt,this._onTimeUpdate),o.init(e.className),o.on(ht.INPUT_START,this._onHold),o.on(ht.CHANGE,this._onControl),o.on(ht.INPUT_END,this._onRelease),this._video=s,this._currentTime=s.source.currentTime,this._duration=s.source.duration,this._controlBar=e,o.updateStyle(this._currentTime/this._duration)):n.classList.add(r)}destroy(t){const e=this._video;t.off(st.RESIZE,this._onResize),e&&(e.source.removeEventListener(Y.VIDEO_TIME_UPDATE,this._onTimeUpdate),e.source.removeEventListener(Y.VIDEO_DURATION_CHANGE,this._onDurationChange),e.source.removeEventListener(gt,this._onTimeUpdate)),this._rangeControl.destroy(),this._video=null,this._playPromise=null}},Te=class extends me{constructor({position:t=ge.MAIN_LEFT,order:e=9999}={}){super({position:t,order:e}),this._onClick=()=>{const t=this._video;t&&(this._paused?t.source.play():t.source.pause())},this._onPlay=()=>{if(!this._controlBar)return;const t=this.element,e=this._controlBar.className;t.classList.add(e.PAUSE_BUTTON),t.classList.remove(e.PLAY_BUTTON),t.title="Pause Video",this._paused=!1},this._onPause=()=>{if(!this._controlBar)return;const t=this.element,e=this._controlBar.className;t.classList.add(e.PLAY_BUTTON),t.classList.remove(e.PAUSE_BUTTON),t.title="Play Video",this._paused=!0},this.element=document.createElement(j),this._video=null,this._paused=!0,this._controlBar=null}init(t,e){var i;const s=this.element,n=null===(i=t.mesh)||void 0===i?void 0:i.getTexture(),o=e.className,r=o.UNAVAILABLE;if(!n||!n.isVideo())return void s.classList.add(r);s.classList.add(o.CONTROLS_BUTTON),s.classList.remove(r);const a=n.isPaused();this._video=n,this._paused=a,this._controlBar=e,a?this._onPause():this._onPlay(),s.addEventListener(Y.CLICK,this._onClick),n.source.addEventListener(Y.VIDEO_PLAY,this._onPlay),n.source.addEventListener(Y.VIDEO_PAUSE,this._onPause)}destroy(){const t=this._video,e=this.element;t&&(e.className="",e.removeEventListener(Y.CLICK,this._onClick),t.source.removeEventListener(Y.VIDEO_PLAY,this._onPlay),t.source.removeEventListener(Y.VIDEO_PAUSE,this._onPause),this._video=null,this._paused=!0,this._controlBar=null)}},be=class extends me{get element(){return this._rootEl}constructor({position:t=ge.MAIN_RIGHT,order:e=9999}={}){super({position:t,order:e}),this._onResize=()=>{this._rangeControl.resize(),this._updateDisplay()},this._onClick=()=>{const t=this._video;t&&!this._rootEl.disabled&&(t.source.muted=!t.source.muted)},this._onVolumeChange=()=>{const t=this._buttonEl,e=this._video,i=this._controlBar;if(!e||!i)return;const s=i.className;e.source.muted||0===e.source.volume?(t.classList.add(s.MUTED_BUTTON),t.classList.remove(s.UNMUTED_BUTTON)):(t.classList.add(s.UNMUTED_BUTTON),t.classList.remove(s.MUTED_BUTTON)),this._updateDisplay()},this._onHold=t=>{const e=this._video,i=this._controlBar;if(!e||!i)return;const s=i.className;e.source.volume=t,this._rootEl.classList.add(s.FIXED),i.containerEl.classList.add(s.FIXED),this._updateDisplay()},this._onChange=t=>{const e=this._video;e&&(e.source.volume=t,e.source.muted=!(t>0),this._updateDisplay())},this._onRelease=()=>{const t=this._controlBar;if(!t)return;const e=t.className;this._rootEl.classList.remove(e.FIXED),t.containerEl.classList.remove(e.FIXED)},this._updateDisplay=()=>{const t=this._video,e=this._rootEl;if(!t)return;if(!t.hasAudio())return void(e.disabled=!0);e.disabled=!1;const i=t.source.muted?0:t.source.volume;this._rangeControl.updateStyle(i)},this._controlBar=null,this._rangeControl=new ve,this._createElements(),this._video=null}init(t,e){var i;const s=null===(i=t.mesh)||void 0===i?void 0:i.getTexture(),n=this._rootEl,o=this._buttonEl,r=this._rangeControl,a=e.className,h=a.UNAVAILABLE;s&&s.isVideo()?(n.classList.remove(h),n.classList.add(a.CONTROLS_BUTTON),n.classList.add(a.VOLUME_ROOT),o.classList.add(a.CONTROLS_BUTTON),s.source.muted?o.classList.add(a.MUTED_BUTTON):o.classList.add(a.UNMUTED_BUTTON),t.on(st.RESIZE,this._onResize),n.addEventListener(Y.TRANSITION_END,this._onResize),o.addEventListener(Y.CLICK,this._onClick),s.source.addEventListener(Y.VIDEO_VOLUME_CHANGE,this._onVolumeChange),s.source.addEventListener(Y.VIDEO_LOADED_DATA,this._updateDisplay),s.source.addEventListener(Y.VIDEO_CAN_PLAYTHROUGH,this._updateDisplay),r.init(a),r.on(ht.INPUT_START,this._onHold),r.on(ht.CHANGE,this._onChange),r.on(ht.INPUT_END,this._onRelease),this._controlBar=e,this._video=s,this._updateDisplay()):n.classList.add(h)}destroy(t){const e=this._video,i=this._buttonEl,s=this._rootEl;s.className="",i.className="",t.off(st.RESIZE,this._onResize),s.removeEventListener(Y.TRANSITION_END,this._onResize),i.removeEventListener(Y.CLICK,this._onClick),e&&(e.source.removeEventListener(Y.VIDEO_VOLUME_CHANGE,this._onVolumeChange),e.source.removeEventListener(Y.VIDEO_LOADED_DATA,this._updateDisplay),e.source.removeEventListener(Y.VIDEO_CAN_PLAYTHROUGH,this._updateDisplay)),this._controlBar=null,this._rangeControl.destroy(),this._video=null}_createElements(){const t=document.createElement(j),e=document.createElement(W);t.appendChild(this._rangeControl.rootEl),t.appendChild(e),t.title="Toggle Mute",this._rootEl=t,this._buttonEl=e}},we=class extends me{constructor({position:t=ge.MAIN_RIGHT,order:e=9999}={}){super({position:t,order:e}),this._onClick=()=>{const t=this._targetEl;t&&(Pt()?this._exitFullscreen():this._requestFullscreen(t))},this._onFullscreenChange=()=>{const t=this.element,e=this._controlBar;if(!e)return;const i=e.className;Pt()?(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))},this.element=document.createElement(j),this.element.title="Toggle Fullscreen",this._controlBar=null,this._targetEl=null}init(t,e){const i=this.element,s=e.className;this._fullscreenAvailable()?(i.classList.add(s.CONTROLS_BUTTON),i.classList.remove(s.UNAVAILABLE),i.addEventListener(Y.CLICK,this._onClick),this._addFullscreenHandlers(),Pt()?i.classList.add(s.FULLSCREEN_EXIT_BUTTON):i.classList.add(s.FULLSCREEN_BUTTON),this._controlBar=e,this._targetEl=t.rootEl):i.classList.add(s.UNAVAILABLE)}destroy(){const t=this.element;t.className="",t.removeEventListener(Y.CLICK,this._onClick),this._removeFullscreenHandlers(),this._controlBar=null,this._targetEl=null}_fullscreenAvailable(){return Q.some(t=>!!document[t])}_requestFullscreen(t){for(const e of Q){const i=t[e];if(i)return void i.call(t)}}_exitFullscreen(){for(const t of tt){const e=document[t];if(e)return void e.call(document)}}_addFullscreenHandlers(){et.forEach(t=>{document.addEventListener(t,this._onFullscreenChange)})}_removeFullscreenHandlers(){et.forEach(t=>{document.removeEventListener(t,this._onFullscreenChange)})}},ye=class extends me{constructor({position:t=ge.MAIN_LEFT,order:e=9999}={}){super({position:t,order:e}),this._onTimeUpdate=()=>{const t=this._video;t&&(this._currentTime=t.source.currentTime,this._updateDisplay())},this._onDurationChange=()=>{const t=this._video;t&&(this._duration=t.source.duration,this._updateDisplay())},this._onCustomTimeChange=t=>{this._currentTime=t.detail.time,this._updateDisplay()},this.element=document.createElement(W),this._video=null,this._currentTime=0,this._duration=0}init(t,e){var i;const s=null===(i=t.mesh)||void 0===i?void 0:i.getTexture(),n=this.element,o=e.className;s&&s.isVideo()?(n.classList.add(o.VIDEO_TIME_DISPLAY),n.classList.remove(o.UNAVAILABLE),s.source.addEventListener(Y.VIDEO_TIME_UPDATE,this._onTimeUpdate),s.source.addEventListener(Y.VIDEO_DURATION_CHANGE,this._onDurationChange),s.source.addEventListener(gt,this._onCustomTimeChange),this._video=s,this._currentTime=s.source.currentTime,this._duration=s.source.duration,this._updateDisplay()):n.classList.add(o.UNAVAILABLE)}destroy(){const t=this._video;t&&(this.element.className="",t.source.removeEventListener(Y.VIDEO_TIME_UPDATE,this._onTimeUpdate),t.source.removeEventListener(Y.VIDEO_DURATION_CHANGE,this._onDurationChange),t.source.removeEventListener(gt,this._onCustomTimeChange),this._video=null)}_updateDisplay(){const t=this._currentTime,e=Math.floor(t/60),i=Math.floor(t-60*e),s=i<10?`0${i}`:i,n=this._duration,o=Math.floor(n/60),r=Math.floor(n-60*o),a=r<10?`0${r}`:r;this.element.innerText=`${e}:${s} / ${o}:${a}`}},Ce=class extends me{constructor({resetCamera:t=!0,position:e=ge.TOP_RIGHT,order:i=9999}={}){super({position:e,order:i}),this._onClick=()=>{const t=this._viewer,e=this.resetCamera;if(!t||!e)return;const{yaw:i=t.initialYaw,pitch:s=t.initialPitch,zoom:n=t.initialZoom,duration:o=500}=St(e);t.camera.animateTo({yaw:i,pitch:s,zoom:n,duration:o})},this._updatePie=({target:t})=>{const e=this._piePathEl,i=this._rangeCircleEl,s=t.camera,n=s.getHorizontalFov(),o=s.getYawRange(s.zoom),r=.5*n,a=24*Math.PI,h=a*n/360,l=a*(s.yaw+r+90)/360;if(e.setAttribute("stroke-dasharray",`${h} ${a-h}`),e.setAttribute("stroke-dashoffset",`${l}`),isFinite(o.min)&&isFinite(o.max)){const t=45*Math.PI,e=(Nt(o.min,-180,180)-r)/360,s=(Nt(o.max,-180,180)+r)/360,n=t*Math.abs(s-e),a=-t*(e-.25);i.setAttribute("stroke-dasharray",`${n} ${t-n}`),i.setAttribute("stroke-dashoffset",`${a}`)}else i.setAttribute("stroke-dasharray",""),i.setAttribute("stroke-dashoffset","")},this.element=document.createElement(W),this.element.title="Reset view",this.resetCamera=t,this._createPieElements(),this._viewer=null}init(t,e){const i=this.element;t.initialized?this._updatePie({target:t}):t.once(st.READY,this._updatePie);const s=e.className.PIEVIEW_ROOT;i.classList.add(s),this.resetCamera&&i.addEventListener(Y.CLICK,this._onClick),t.on(st.VIEW_CHANGE,this._updatePie),this._viewer=t}destroy(t){const e=this.element;e.removeEventListener(Y.CLICK,this._onClick),e.className="",t.off(st.READY,this._updatePie),t.off(st.VIEW_CHANGE,this._updatePie),this._viewer=null}_createPieElements(){const t=this.element,e=document.createElementNS(vt,"svg");e.setAttribute("viewBox","0 0 48 48"),e.setAttribute("width","100%"),e.setAttribute("height","100%");const i=document.createElementNS(vt,"circle");i.setAttribute("stroke","currentColor"),i.setAttribute("fill","transparent"),i.setAttribute("cx","24"),i.setAttribute("cy","24"),i.setAttribute("r","12"),i.setAttribute("stroke-width","24"),e.appendChild(i);const s=document.createElementNS(vt,"circle");s.setAttribute("stroke","currentColor"),s.setAttribute("fill","transparent"),s.setAttribute("cx","24"),s.setAttribute("cy","24"),s.setAttribute("r","22.5"),s.setAttribute("stroke-width","3"),e.appendChild(s),t.appendChild(e),this._piePathEl=i,this._rangeCircleEl=s}},Re=class extends me{constructor({position:t=ge.MAIN_RIGHT,order:e=9999}={}){super({position:t,order:e}),this._onClick=()=>{const t=this._viewer;t&&t.vr.enter()},this.element=document.createElement(j),this.element.title="Enter VR",this._viewer=null}init(t,e){const i=this.element,s=e.className;i.classList.add(s.UNAVAILABLE),i.classList.add(s.VR_BUTTON),i.classList.add(s.CONTROLS_BUTTON),t.vr.isAvailable().then(t=>{t&&i.classList.remove(s.UNAVAILABLE)}),i.addEventListener(Y.CLICK,this._onClick),this._viewer=t}destroy(){const t=this.element;t.className="",t.removeEventListener(Y.CLICK,this._onClick),this._viewer=null}},Oe=class extends me{constructor({position:t=ge.MAIN_RIGHT,order:e=9999}={}){super({position:t,order:e}),this._onClick=()=>{const t=this._viewer,e=this._controlBar;if(!t||!e)return;const i=t.control.gyro;i.enabled?i.disable():$t.requestSensorPermission().then(t=>{t?i.enable():this.element.classList.add(e.className.UNAVAILABLE)})},this._updateStyle=()=>{const t=this.element,e=this._viewer,i=this._controlBar;if(!e||!i)return;const s=e.control.gyro,n=i.className;s.enabled?(t.classList.add(n.GYRO_ENABLED),t.classList.remove(n.GYRO_DISABLED)):(t.classList.add(n.GYRO_DISABLED),t.classList.remove(n.GYRO_ENABLED))},this.element=document.createElement(W),this.element.title="Toggle gyroscope control"}init(t,e){const i=this.element,s=e.className;i.addEventListener(Y.CLICK,this._onClick),i.classList.add(s.CONTROLS_BUTTON),i.classList.add(s.UNAVAILABLE);const n=()=>{i.classList.remove(s.UNAVAILABLE),t.control.gyro.on(ht.ENABLE,this._updateStyle),t.control.gyro.on(ht.DISABLE,this._updateStyle)};Dt()?n():$t.isAvailable().then(t=>{t&&n()}),this._controlBar=e,this._viewer=t,this._updateStyle()}destroy(t){const e=this.element;t.control.gyro.off(ht.ENABLE,this._updateStyle),t.control.gyro.off(ht.DISABLE,this._updateStyle),e.removeEventListener(Y.CLICK,this._onClick),e.className="",this._controlBar=null,this._viewer=null}},Le=class{get enabled(){return!!this._targetEl}get hidden(){return this._controlBar.containerEl.classList.contains(this._hiddenClass)}get _hiddenClass(){return this._controlBar.className.HIDDEN}get _fixedClass(){return this._controlBar.className.FIXED}constructor(t,{initialDelay:e=3e3,delay:i=0,idleDelay:s=3e3}){this._onMouseEnter=()=>{this._isCursorInside=!0,this.show()},this._onMouseLeave=()=>{this._isCursorInside=!1,this._hideAfterDelay()},this._onMouseMove=()=>{this._isFullscreen&&this.showTemporaliy()},this._onHold=t=>{this._isGrabbing=!0,"mouse"===t.pointerType&&(this._isCursorInside=!0),window.addEventListener(Y.MOUSE_UP,this._onRelease),this.show()},this._onRelease=()=>{this._isGrabbing=!1,window.removeEventListener(Y.MOUSE_UP,this._onRelease),this._hideAfterDelay()},this._onVideoPlay=()=>{this._targetEl&&this._controlBar.containerEl.classList.remove(this._fixedClass)},this._onVideoPause=()=>{this._targetEl&&this._controlBar.containerEl.classList.add(this._fixedClass)},this._onFullscreenChange=()=>{this._isFullscreen=Pt(),this._isFullscreen&&this._hideAfterDelay()},this._controlBar=t,this._initialDelay=e,this._delay=i,this._idleDelay=s,this._timer=-1,this._isCursorInside=!1,this._isGrabbing=!1,this._isFullscreen=!1,this._video=null,this._targetEl=null}enable(t){var e;this._targetEl&&this.disable(t);const i=this._initialDelay,s=t.rootEl;this._targetEl=t.rootEl,this._timer=window.setTimeout(()=>{this.hide()},i),s.addEventListener(Y.MOUSE_DOWN,this._onHold),s.addEventListener(Y.MOUSE_ENTER,this._onMouseEnter),s.addEventListener(Y.MOUSE_MOVE,this._onMouseMove),s.addEventListener(Y.MOUSE_LEAVE,this._onMouseLeave),this._addFullscreenHandlers();const n=null===(e=t.mesh)||void 0===e?void 0:e.getTexture();n&&n.isVideo()&&(n.isPaused()&&this._controlBar.containerEl.classList.add(this._fixedClass),n.source.addEventListener(Y.VIDEO_PLAY,this._onVideoPlay),n.source.addEventListener(Y.VIDEO_PAUSE,this._onVideoPause),this._video=n)}disable(t){if(!this._targetEl)return;const e=this._controlBar,i=t.rootEl,s=this._video;i.removeEventListener(Y.MOUSE_DOWN,this._onHold),window.removeEventListener(Y.MOUSE_UP,this._onRelease),i.removeEventListener(Y.MOUSE_ENTER,this._onMouseEnter),i.removeEventListener(Y.MOUSE_MOVE,this._onMouseMove),i.removeEventListener(Y.MOUSE_LEAVE,this._onMouseLeave),this._removeFullscreenHandlers(),window.clearTimeout(this._timer),e.containerEl.classList.remove(this._fixedClass),s&&(s.source.removeEventListener(Y.VIDEO_PLAY,this._onVideoPlay),s.source.removeEventListener(Y.VIDEO_PAUSE,this._onVideoPause)),this._isCursorInside=!1,this._isGrabbing=!1,this._video=null,this._targetEl=null}show(){this._clearHideTimer(),this._controlBar.containerEl.classList.remove(this._hiddenClass)}showTemporaliy(){this.show(),this._hideAfterDelay(this._idleDelay)}hide(){this._clearHideTimer(),this._controlBar.containerEl.classList.add(this._hiddenClass)}_clearHideTimer(){this._timer&&(window.clearTimeout(this._timer),this._timer=-1)}_hideAfterDelay(t=this._delay){this._isGrabbing||!this._isFullscreen&&this._isCursorInside||(this._clearHideTimer(),t<=0?this.hide():this._timer=window.setTimeout(()=>{this.hide()},t))}_addFullscreenHandlers(){et.forEach(t=>{document.addEventListener(t,this._onFullscreenChange)})}_removeFullscreenHandlers(){et.forEach(t=>{document.removeEventListener(t,this._onFullscreenChange)})}},Ie=class{constructor(){this._onKeyDown=t=>{const e=this._video;if(!e)return;t.preventDefault(),t.stopPropagation();const i=e.source,s=null!=t.keyCode?Z[t.keyCode]:$[t.key];switch(s){case"LEFT":case"RIGHT":return this._changeVideoTime(i,"RIGHT"===s);case"UP":case"DOWN":return this._changeVideoVolume(i,"UP"===s)}32!==t.keyCode&&" "!==t.key||this._toggleVideo(e)}}enable(t,e){this._video=e,t.addEventListener(Y.KEY_DOWN,this._onKeyDown,!0)}disable(t){this._video=null,t.removeEventListener(Y.KEY_DOWN,this._onKeyDown,!0)}_changeVideoTime(t,e){t.currentTime+=e?5:-5,t.dispatchEvent(new CustomEvent(gt,{detail:{time:t.currentTime}}))}_changeVideoVolume(t,e){const i=e?.1:-.1;t.muted?t.volume=It(i,0,1):t.volume=It(t.volume+i,0,1),t.volume>0?t.muted=!1:t.muted=!0}_toggleVideo(t){t.isPaused()?t.source.play():t.source.pause()}},Ae=class t{get rootEl(){return this._rootEl}get containerEl(){return this._containerEl}get backgroundEl(){return this._bgEl}get items(){return this._items}get customItems(){return this._customItems}constructor({autoHide:e,showBackground:i,clickToPlay:s=!0,keyboardControls:n=!0,progressBar:o=!0,playButton:r=!0,volumeButton:a=!0,fullscreenButton:h=!0,videoTime:l=!0,pieView:c=!0,vrButton:u=!0,gyroButton:d=!0,className:_={},customItems:p=[]}={}){var m;this._onStaticClick=({target:t,isTouch:e})=>{var i;const s=this._autoHider;if(e){if(!s.enabled)return;s.hidden?s.showTemporaliy():s.hide()}else{if(!this.clickToPlay)return;const e=null===(i=t.mesh)||void 0===i?void 0:i.getTexture();if(!e||!e.isVideo())return;e.isPaused()?e.source.play():e.source.pause()}},this._onNewSrcLoad=({target:t})=>{const e=this._items;this._updateBackground(t),this._updateAutoHide(t),this._updateKeyboardHandler(t),Object.keys(e).forEach(i=>{e[i].forEach(e=>{e.destroy(t,this),e.init(t,this)})})},this.autoHide=e,this.showBackground=i,this.clickToPlay=s,this.keyboardControls=n,this.progressBar=o,this.playButton=r,this.volumeButton=a,this.fullscreenButton=h,this.videoTime=l,this.pieView=c,this.vrButton=u,this.gyroButton=d,this.className=Object.assign(Object.assign({},t.DEFAULT_CLASS),_),this._rootEl=Ct(null!==(m=_.CONTROLS_ROOT)&&void 0!==m?m:t.DEFAULT_CLASS.CONTROLS_ROOT),this._createPositionWrappers(),this._items=Object.keys(t.POSITION).reduce((e,i)=>(e[t.POSITION[i]]=[],e),{}),this._customItems=p,this._autoHider=new Le(this,St(e)),this._videoControl=new Ie,p.forEach(t=>{this._items[t.position].push(t)})}init(t){const e=t.rootEl,i=this._rootEl,s=this._createDefaultItems();this._updateBackground(t),this._updateAutoHide(t),this._updateKeyboardHandler(t),e.appendChild(i),this._addItem(t,s),this._addItem(t,this._customItems),t.on(st.PROJECTION_CHANGE,this._onNewSrcLoad),t.on(st.STATIC_CLICK,this._onStaticClick)}destroy(t){const e=t.rootEl,i=this._rootEl,s=this._items;i.parentElement===e&&e.removeChild(i),Object.keys(s).forEach(e=>{s[e].forEach(e=>{e.destroy(t,this)}),s[e]=[]}),this._clearItemElements(),this._autoHider.disable(t),this._videoControl.disable(e),t.off(st.PROJECTION_CHANGE,this._onNewSrcLoad),t.off(st.STATIC_CLICK,this._onStaticClick)}_addItem(t,e){for(const i of e){const e=this._items[i.position],s=this._wrapperEl[i.position],n=xt(e,t=>t.order>i.order);if(n>=0){const t=e[n].element;e.splice(n,0,i),s.insertBefore(i.element,t)}else e.push(i),s.appendChild(i.element);i.init(t,this)}}_createPositionWrappers(){const e=Object.assign(Object.assign({},t.DEFAULT_CLASS),this.className),i=this._rootEl,s=Ct(e.CONTROLS_BG),n=Ct(e.CONTROLS_FLOAT_LEFT),o=Ct(e.CONTROLS_FLOAT_RIGHT);i.appendChild(n),i.appendChild(o);const r=Ct(e.CONTROLS_MAIN),a=Ct(e.CONTROLS_TOP),h=Ct(e.CONTROLS_BOTTOM),l=Ct(e.CONTROLS_MID),c=Ct(e.CONTROLS_LEFT),u=Ct(e.CONTROLS_RIGHT);l.appendChild(c),l.appendChild(u),r.appendChild(s),r.appendChild(a),r.appendChild(l),r.appendChild(h),i.appendChild(r),this._bgEl=s,this._containerEl=r,this._wrapperEl={[t.POSITION.MAIN_TOP]:a,[t.POSITION.MAIN_LEFT]:c,[t.POSITION.MAIN_RIGHT]:u,[t.POSITION.MAIN_BOTTOM]:h,[t.POSITION.TOP_LEFT]:n,[t.POSITION.TOP_RIGHT]:o}}_clearItemElements(){Object.keys(t.POSITION).map(e=>t.POSITION[e]).map(t=>this._wrapperEl[t]).forEach(t=>{for(;t.firstChild;)t.removeChild(t.firstChild)})}_updateAutoHide(t){var e;const i=this.autoHide,s=this._autoHider;if(null!=i)i?s.enable(t):s.disable(t);else{const i=null===(e=t.mesh)||void 0===e?void 0:e.getTexture();i&&i.isVideo()?s.enable(t):s.disable(t)}}_updateBackground(e){var i,s;const n=this._bgEl,o=this.showBackground,r=null!==(i=this.className.HIDDEN)&&void 0!==i?i:t.DEFAULT_CLASS.HIDDEN;if(null!=o)o?n.classList.remove(r):n.classList.add(r);else{const t=null===(s=e.mesh)||void 0===s?void 0:s.getTexture();t&&t.isVideo()?n.classList.remove(r):n.classList.add(r)}}_updateKeyboardHandler(t){var e;const i=t.rootEl,s=this._videoControl,n=null===(e=t.mesh)||void 0===e?void 0:e.getTexture();this.keyboardControls&&n&&n.isVideo()?s.enable(i,n):s.disable(i)}_createDefaultItems(){const t=[];return this.progressBar&&t.push(new fe(St(this.progressBar))),this.playButton&&t.push(new Te(St(this.playButton))),this.volumeButton&&t.push(new be(St(this.volumeButton))),this.gyroButton&&t.push(new Oe(St(this.gyroButton))),this.vrButton&&t.push(new Re(St(this.vrButton))),this.fullscreenButton&&t.push(new we(St(this.fullscreenButton))),this.videoTime&&t.push(new ye(St(this.videoTime))),this.pieView&&t.push(new Ce(St(this.pieView))),t}},Ae.DEFAULT_CLASS=Ee,Ae.POSITION=ge,Ne=class{constructor({src:t,video:e=!1}){this.src=t,this.video=e}updateCamera(t){t.resetRange()}updateControl(t){t.ignoreZoomScale=!1}},xe=class{constructor(){this.needsUpdate=!0}destroy(t){}},Se=class extends pe{constructor(t,e){super(),this.vao=t,this.program=e}destroy(t){t.releaseVAO(this.vao),t.releaseShaderResources(this.program)}getTexture(){return this.program.uniforms.uTexture.texture}},Me=class{constructor(t,e,i,s){this.program=t.createProgram(e,i),this.uniforms=s,this.uniformLocations=t.getUniformLocations(this.program,s)}},Pe=class{constructor(t,e){this.data=t,this.itemSize=e,this.count=t.length/e}},De=class{constructor(t,e,i){this.vertices=new Pe(new Float32Array(t),3),this.indicies=new Pe(new Uint16Array(e),1),this.uvs=new Pe(new Float32Array(i),2)}},Ue=class extends xe{constructor(t,e){super(),this.texture=e,this._webglTexture=t.createWebGLTexture(e)}destroy(t){this.texture.destroy(),t.deleteTexture(this._webglTexture)}update(t,e,i){const s=this.texture,n=s.isVideo();t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,s.flipY),t.uniform1i(e,0),t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,this._webglTexture),!n&&i?t.texSubImage2D(t.TEXTURE_2D,0,0,0,t.RGBA,t.UNSIGNED_BYTE,s.source):t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,s.source),n||(this.needsUpdate=!1)}},Be="#define GLSLIFY 1\nuniform sampler2D uTexture;varying highp vec2 vUV;void main(){gl_FragColor=texture2D(uTexture,vUV.st);}",ke=class extends De{constructor(){const t=60,e=-.5*Math.PI,i=[],s=[],n=[];let o,r;for(o=0;o<=60;o++){const a=(o/60-.5)*Math.PI,h=Math.sin(a),l=Math.cos(a);for(r=0;r<=t;r++){const a=2*(r/t-.5)*Math.PI+e,c=Math.sin(a),u=Math.cos(a)*l,d=h,_=c*l,p=r/t,m=o/60;if(i.push(p,m),s.push(u,d,_),r!==t&&60!==o){const e=61*o+r,i=e+t+1;n.push(e,e+1,i,i,e+1,i+1)}}}super(s,n,i)}},Fe=class extends Ne{constructor(t){super(t)}createMesh(t,e){const i={uTexture:new Ue(t,e)},s=new ke,n=new Me(t,"#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);}",Be,i);return new Se(t.createVAO(s,n),n)}},Ve=class extends xe{constructor(t){super(),this.val=t}update(t,e){t.uniform1f(e,this.val),this.needsUpdate=!1}},ze=class extends xe{constructor(t){super(),this.val=t}update(t,e){t.uniform4fv(e,this.val.reduce((t,e)=>[...t,...e],[])),this.needsUpdate=!1}},class t extends Ne{constructor(t){super(t),this._mode=t.mode}createMesh(e,i){let s,n;this._mode===t.MODE.LEFT_RIGHT?(s=[.5,1,0,0],n=[.5,1,.5,0]):(s=[1,.5,0,0],n=[1,.5,0,.5]);const o={uTexture:new Ue(e,i),uEye:new Ve(0),uTexScaleOffset:new ze([s,n])},r=new ke,a=new Me(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);}",Be,o);return new Se(e.createVAO(r,a),a)}}.MODE={LEFT_RIGHT:"left_right",TOP_BOTTOM:"top_bottom"},He=u("<canvas class=view360-canvas>"),Ge=u("<video id=view360-video playsinline crossorigin=anonymous style=display:none>"),t("default",()=>{let t;a(()=>{const e=document.getElementById("view360-container"),i=document.getElementById("view360-video");e&&i&&(t=new _e(e,{projection:new Fe({src:i,video:{autoplay:h("video_autoplay")}}),plugins:[new Ae({pieView:{order:0},gyroButton:{position:"top-right",order:1},vrButton:{position:"top-right",order:2}})]}))}),c(()=>t?.destroy());const[e,u]=r(!1);return o(d,{onAutoNextChange:u,get children(){return o(n,{w:"$full",h:"60vh",id:"video360-player",get children(){return o(n,{w:"100%",h:"100%",id:"view360-container",className:"view360-container",get children(){return[He(),(t=Ge(),l(()=>s(t,"src",i.raw_url)),t)];var t}})}})}})})}}});