architwin 1.0.9

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 (274) hide show
  1. package/README.md +530 -0
  2. package/bundle/LICENSE.md +17 -0
  3. package/bundle/css/core.css +21 -0
  4. package/bundle/css/late.css +22 -0
  5. package/bundle/css/showcase.css +406 -0
  6. package/bundle/css/unsupported_browser.css +1 -0
  7. package/bundle/cursors/grab.png +0 -0
  8. package/bundle/cursors/grabbing.png +0 -0
  9. package/bundle/cursors/rbe-default.png +0 -0
  10. package/bundle/cursors/rbe-finish-room.png +0 -0
  11. package/bundle/cursors/rbe-moving.png +0 -0
  12. package/bundle/cursors/rbe-place-door.png +0 -0
  13. package/bundle/cursors/rbe-place-node.png +0 -0
  14. package/bundle/cursors/rbe-place-opening.png +0 -0
  15. package/bundle/cursors/zoom-in.png +0 -0
  16. package/bundle/cursors/zoom-out.png +0 -0
  17. package/bundle/fonts/ibm-plex-sans-100.woff +0 -0
  18. package/bundle/fonts/ibm-plex-sans-100.woff2 +0 -0
  19. package/bundle/fonts/ibm-plex-sans-100italic.woff +0 -0
  20. package/bundle/fonts/ibm-plex-sans-100italic.woff2 +0 -0
  21. package/bundle/fonts/ibm-plex-sans-200.woff +0 -0
  22. package/bundle/fonts/ibm-plex-sans-200.woff2 +0 -0
  23. package/bundle/fonts/ibm-plex-sans-200italic.woff +0 -0
  24. package/bundle/fonts/ibm-plex-sans-200italic.woff2 +0 -0
  25. package/bundle/fonts/ibm-plex-sans-300.woff +0 -0
  26. package/bundle/fonts/ibm-plex-sans-300.woff2 +0 -0
  27. package/bundle/fonts/ibm-plex-sans-300italic.woff +0 -0
  28. package/bundle/fonts/ibm-plex-sans-300italic.woff2 +0 -0
  29. package/bundle/fonts/ibm-plex-sans-500.woff +0 -0
  30. package/bundle/fonts/ibm-plex-sans-500.woff2 +0 -0
  31. package/bundle/fonts/ibm-plex-sans-500italic.woff +0 -0
  32. package/bundle/fonts/ibm-plex-sans-500italic.woff2 +0 -0
  33. package/bundle/fonts/ibm-plex-sans-600.woff +0 -0
  34. package/bundle/fonts/ibm-plex-sans-600.woff2 +0 -0
  35. package/bundle/fonts/ibm-plex-sans-600italic.woff +0 -0
  36. package/bundle/fonts/ibm-plex-sans-600italic.woff2 +0 -0
  37. package/bundle/fonts/ibm-plex-sans-700.woff +0 -0
  38. package/bundle/fonts/ibm-plex-sans-700.woff2 +0 -0
  39. package/bundle/fonts/ibm-plex-sans-700italic.woff +0 -0
  40. package/bundle/fonts/ibm-plex-sans-700italic.woff2 +0 -0
  41. package/bundle/fonts/ibm-plex-sans-italic.woff +0 -0
  42. package/bundle/fonts/ibm-plex-sans-italic.woff2 +0 -0
  43. package/bundle/fonts/ibm-plex-sans-regular.woff +0 -0
  44. package/bundle/fonts/ibm-plex-sans-regular.woff2 +0 -0
  45. package/bundle/fonts/mp-font.svg +2079 -0
  46. package/bundle/fonts/mp-font.woff +0 -0
  47. package/bundle/fonts/mp-font.woff2 +0 -0
  48. package/bundle/fonts/roboto-100.woff +0 -0
  49. package/bundle/fonts/roboto-100.woff2 +0 -0
  50. package/bundle/fonts/roboto-100italic.woff +0 -0
  51. package/bundle/fonts/roboto-100italic.woff2 +0 -0
  52. package/bundle/fonts/roboto-300.woff +0 -0
  53. package/bundle/fonts/roboto-300.woff2 +0 -0
  54. package/bundle/fonts/roboto-300italic.woff +0 -0
  55. package/bundle/fonts/roboto-300italic.woff2 +0 -0
  56. package/bundle/fonts/roboto-500.woff +0 -0
  57. package/bundle/fonts/roboto-500.woff2 +0 -0
  58. package/bundle/fonts/roboto-500italic.woff +0 -0
  59. package/bundle/fonts/roboto-500italic.woff2 +0 -0
  60. package/bundle/fonts/roboto-700.woff +0 -0
  61. package/bundle/fonts/roboto-700.woff2 +0 -0
  62. package/bundle/fonts/roboto-700italic.woff +0 -0
  63. package/bundle/fonts/roboto-700italic.woff2 +0 -0
  64. package/bundle/fonts/roboto-900.woff +0 -0
  65. package/bundle/fonts/roboto-900.woff2 +0 -0
  66. package/bundle/fonts/roboto-900italic.woff +0 -0
  67. package/bundle/fonts/roboto-900italic.woff2 +0 -0
  68. package/bundle/fonts/roboto-italic.woff +0 -0
  69. package/bundle/fonts/roboto-italic.woff2 +0 -0
  70. package/bundle/fonts/roboto-regular.woff +0 -0
  71. package/bundle/fonts/roboto-regular.woff2 +0 -0
  72. package/bundle/images/360_placement_pin_mask.png +0 -0
  73. package/bundle/images/Desktop-help-play-button.svg +1 -0
  74. package/bundle/images/Desktop-help-spacebar.png +0 -0
  75. package/bundle/images/MP-logo_H_lock-RGB_color-black.svg +24 -0
  76. package/bundle/images/NoteColor.png +0 -0
  77. package/bundle/images/chrome.png +0 -0
  78. package/bundle/images/edge.png +0 -0
  79. package/bundle/images/escape.png +0 -0
  80. package/bundle/images/exterior.png +0 -0
  81. package/bundle/images/exterior_hover.png +0 -0
  82. package/bundle/images/firefox.png +0 -0
  83. package/bundle/images/headset-quest-2.png +0 -0
  84. package/bundle/images/interior.png +0 -0
  85. package/bundle/images/interior_hover.png +0 -0
  86. package/bundle/images/login-screen-background.jpg +0 -0
  87. package/bundle/images/matterport-app-icon.svg +9 -0
  88. package/bundle/images/matterport-logo-light.svg +1 -0
  89. package/bundle/images/mattertag-disc-128-free.v1.png +0 -0
  90. package/bundle/images/mobile-help-play-button.svg +1 -0
  91. package/bundle/images/nav_help_360.png +0 -0
  92. package/bundle/images/nav_help_click_inside.png +0 -0
  93. package/bundle/images/nav_help_gesture_drag.png +0 -0
  94. package/bundle/images/nav_help_gesture_drag_two_finger.png +0 -0
  95. package/bundle/images/nav_help_gesture_pinch.png +0 -0
  96. package/bundle/images/nav_help_gesture_position.png +0 -0
  97. package/bundle/images/nav_help_gesture_position_two_finger.png +0 -0
  98. package/bundle/images/nav_help_gesture_tap.png +0 -0
  99. package/bundle/images/nav_help_inside_key.png +0 -0
  100. package/bundle/images/nav_help_keyboard_all.png +0 -0
  101. package/bundle/images/nav_help_keyboard_left_right.png +0 -0
  102. package/bundle/images/nav_help_keyboard_up_down.png +0 -0
  103. package/bundle/images/nav_help_mouse_click.png +0 -0
  104. package/bundle/images/nav_help_mouse_drag_left.png +0 -0
  105. package/bundle/images/nav_help_mouse_drag_right.png +0 -0
  106. package/bundle/images/nav_help_mouse_position_left.png +0 -0
  107. package/bundle/images/nav_help_mouse_position_right.png +0 -0
  108. package/bundle/images/nav_help_mouse_zoom.png +0 -0
  109. package/bundle/images/nav_help_tap_inside.png +0 -0
  110. package/bundle/images/nav_help_zoom_keys.png +0 -0
  111. package/bundle/images/objectColor.png +0 -0
  112. package/bundle/images/outlineBasic1024.png +0 -0
  113. package/bundle/images/outlineBasic2048.png +0 -0
  114. package/bundle/images/outlineBasic4096.png +0 -0
  115. package/bundle/images/outlineBasic512.png +0 -0
  116. package/bundle/images/outlineEnhanced1024.png +0 -0
  117. package/bundle/images/outlineEnhanced2048.png +0 -0
  118. package/bundle/images/outlineEnhanced4096.png +0 -0
  119. package/bundle/images/outlineEnhanced512.png +0 -0
  120. package/bundle/images/pinAnchor.png +0 -0
  121. package/bundle/images/pinIconDefault.png +0 -0
  122. package/bundle/images/safari.png +0 -0
  123. package/bundle/images/scope.svg +3 -0
  124. package/bundle/images/selected_sweep_glow.png +0 -0
  125. package/bundle/images/showcase-password-background.jpg +0 -0
  126. package/bundle/images/surface_grid_planar_256.png +0 -0
  127. package/bundle/images/tagColor.png +0 -0
  128. package/bundle/images/unsupported-browser.jpg +0 -0
  129. package/bundle/images/uv_grid_opengl.jpg +0 -0
  130. package/bundle/images/vert_arrows.png +0 -0
  131. package/bundle/js/136.js +18 -0
  132. package/bundle/js/136.js.LICENSE.txt +20 -0
  133. package/bundle/js/143.js +2 -0
  134. package/bundle/js/143.js.LICENSE.txt +20 -0
  135. package/bundle/js/145.js +2 -0
  136. package/bundle/js/145.js.LICENSE.txt +20 -0
  137. package/bundle/js/189.js +2 -0
  138. package/bundle/js/189.js.LICENSE.txt +20 -0
  139. package/bundle/js/217.js +2 -0
  140. package/bundle/js/217.js.LICENSE.txt +20 -0
  141. package/bundle/js/313.js +2 -0
  142. package/bundle/js/313.js.LICENSE.txt +20 -0
  143. package/bundle/js/316.js +2 -0
  144. package/bundle/js/316.js.LICENSE.txt +27 -0
  145. package/bundle/js/321.js +2 -0
  146. package/bundle/js/321.js.LICENSE.txt +20 -0
  147. package/bundle/js/324.js +2 -0
  148. package/bundle/js/324.js.LICENSE.txt +20 -0
  149. package/bundle/js/325.js +2 -0
  150. package/bundle/js/325.js.LICENSE.txt +20 -0
  151. package/bundle/js/330.js +2 -0
  152. package/bundle/js/330.js.LICENSE.txt +20 -0
  153. package/bundle/js/335.js +2 -0
  154. package/bundle/js/335.js.LICENSE.txt +20 -0
  155. package/bundle/js/376.js +2 -0
  156. package/bundle/js/376.js.LICENSE.txt +20 -0
  157. package/bundle/js/422.js +2 -0
  158. package/bundle/js/422.js.LICENSE.txt +22 -0
  159. package/bundle/js/493.js +2 -0
  160. package/bundle/js/493.js.LICENSE.txt +27 -0
  161. package/bundle/js/512.js +2 -0
  162. package/bundle/js/512.js.LICENSE.txt +20 -0
  163. package/bundle/js/519.js +2 -0
  164. package/bundle/js/519.js.LICENSE.txt +20 -0
  165. package/bundle/js/521.js +2 -0
  166. package/bundle/js/521.js.LICENSE.txt +20 -0
  167. package/bundle/js/525.js +2 -0
  168. package/bundle/js/525.js.LICENSE.txt +20 -0
  169. package/bundle/js/607.js +2 -0
  170. package/bundle/js/607.js.LICENSE.txt +27 -0
  171. package/bundle/js/644.js +2 -0
  172. package/bundle/js/644.js.LICENSE.txt +63 -0
  173. package/bundle/js/648.js +2 -0
  174. package/bundle/js/648.js.LICENSE.txt +20 -0
  175. package/bundle/js/66.js +2 -0
  176. package/bundle/js/66.js.LICENSE.txt +20 -0
  177. package/bundle/js/662.js +2 -0
  178. package/bundle/js/662.js.LICENSE.txt +20 -0
  179. package/bundle/js/668.js +2 -0
  180. package/bundle/js/668.js.LICENSE.txt +20 -0
  181. package/bundle/js/718.js +2 -0
  182. package/bundle/js/718.js.LICENSE.txt +20 -0
  183. package/bundle/js/764.js +2 -0
  184. package/bundle/js/764.js.LICENSE.txt +29 -0
  185. package/bundle/js/833.js +20 -0
  186. package/bundle/js/833.js.LICENSE.txt +20 -0
  187. package/bundle/js/858.js +2 -0
  188. package/bundle/js/858.js.LICENSE.txt +20 -0
  189. package/bundle/js/916.js +2 -0
  190. package/bundle/js/916.js.LICENSE.txt +20 -0
  191. package/bundle/js/924.js +2 -0
  192. package/bundle/js/924.js.LICENSE.txt +20 -0
  193. package/bundle/js/932.js +2 -0
  194. package/bundle/js/932.js.LICENSE.txt +20 -0
  195. package/bundle/js/948.js +2 -0
  196. package/bundle/js/948.js.LICENSE.txt +20 -0
  197. package/bundle/js/958.js +2 -0
  198. package/bundle/js/958.js.LICENSE.txt +20 -0
  199. package/bundle/js/JPEGDecoder.worker.worker.js.LICENSE.txt +29 -0
  200. package/bundle/js/JPEGEncoder.worker.worker.js.LICENSE.txt +29 -0
  201. package/bundle/js/PNGDecoder.worker.worker.js.LICENSE.txt +20 -0
  202. package/bundle/js/PNGEncoder.worker.worker.js.LICENSE.txt +20 -0
  203. package/bundle/js/browser-check.js +2 -0
  204. package/bundle/js/browser-check.js.LICENSE.txt +18 -0
  205. package/bundle/js/showcase.js +6 -0
  206. package/bundle/js/showcase.js.LICENSE.txt +144 -0
  207. package/bundle/locale/messages/strings_de.json +1 -0
  208. package/bundle/locale/messages/strings_es.json +1 -0
  209. package/bundle/locale/messages/strings_fr.json +1 -0
  210. package/bundle/locale/messages/strings_it.json +1 -0
  211. package/bundle/locale/messages/strings_ja.json +1 -0
  212. package/bundle/locale/messages/strings_ko.json +1 -0
  213. package/bundle/locale/messages/strings_nl.json +1 -0
  214. package/bundle/locale/messages/strings_pt.json +1 -0
  215. package/bundle/locale/messages/strings_ru.json +1 -0
  216. package/bundle/locale/messages/strings_zh-CN.json +1 -0
  217. package/bundle/locale/messages/strings_zh-TW.json +1 -0
  218. package/bundle/locale/strings.json +1 -0
  219. package/bundle/sdk/cursors/grab.png +0 -0
  220. package/bundle/sdk/cursors/grabbing.png +0 -0
  221. package/bundle/sdk/cursors/rbe-default.png +0 -0
  222. package/bundle/sdk/cursors/rbe-finish-room.png +0 -0
  223. package/bundle/sdk/cursors/rbe-moving.png +0 -0
  224. package/bundle/sdk/cursors/rbe-place-door.png +0 -0
  225. package/bundle/sdk/cursors/rbe-place-node.png +0 -0
  226. package/bundle/sdk/cursors/rbe-place-opening.png +0 -0
  227. package/bundle/sdk/cursors/zoom-in.png +0 -0
  228. package/bundle/sdk/cursors/zoom-out.png +0 -0
  229. package/bundle/sdk/sandbox.html +1 -0
  230. package/bundle/sdk/sdk-client.js +1 -0
  231. package/bundle/sdk/sdk-interface.js +1 -0
  232. package/bundle/sdk.d.ts +5312 -0
  233. package/bundle/showcase.html +114 -0
  234. package/bundle/terms/terms-de-DE.html +69 -0
  235. package/bundle/terms/terms-en-GB.html +62 -0
  236. package/bundle/terms/terms-en-US.html +62 -0
  237. package/bundle/terms/terms-es-MX.html +66 -0
  238. package/bundle/terms/terms-fr-FR.html +65 -0
  239. package/bundle/terms/terms-it-IT.html +65 -0
  240. package/bundle/terms/terms-ja-JP.html +64 -0
  241. package/bundle/terms/terms-ko-KR.html +65 -0
  242. package/bundle/terms/terms-nl-NL.html +65 -0
  243. package/bundle/terms/terms-pt-BR.html +75 -0
  244. package/bundle/terms/terms-ru-RU.html +72 -0
  245. package/bundle/terms/terms-zh-CN.html +65 -0
  246. package/bundle/terms/terms-zh-TW.html +84 -0
  247. package/bundle/vendors/three/0.146.0/libs/basis/README.md +32 -0
  248. package/bundle/vendors/three/0.146.0/libs/basis/basis_transcoder.js +1 -0
  249. package/bundle/vendors/three/0.146.0/libs/basis/basis_transcoder.wasm +0 -0
  250. package/bundle/vendors/three/0.146.0/libs/basis/no-dynamic-execution.patch +11 -0
  251. package/bundle/vendors/three/0.146.0/libs/draco/README.md +32 -0
  252. package/bundle/vendors/three/0.146.0/libs/draco/draco_decoder.js +1 -0
  253. package/bundle/vendors/three/0.146.0/libs/draco/draco_decoder.wasm +0 -0
  254. package/bundle/vendors/three/0.146.0/libs/draco/draco_encoder.js +1 -0
  255. package/bundle/vendors/three/0.146.0/libs/draco/draco_wasm_wrapper.js +1 -0
  256. package/bundle/vendors/three/0.146.0/libs/draco/gltf/draco_decoder.js +1 -0
  257. package/bundle/vendors/three/0.146.0/libs/draco/gltf/draco_decoder.wasm +0 -0
  258. package/bundle/vendors/three/0.146.0/libs/draco/gltf/draco_encoder.js +1 -0
  259. package/bundle/vendors/three/0.146.0/libs/draco/gltf/draco_wasm_wrapper.js +1 -0
  260. package/bundle/vendors/three/0.146.0/three.cjs +2 -0
  261. package/bundle/vendors/three/0.146.0/three.cjs.LICENSE.txt +5 -0
  262. package/bundle/vendors/three/0.146.0/three.js +2 -0
  263. package/bundle/vendors/three/0.146.0/three.js.LICENSE.txt +5 -0
  264. package/bundle/vendors/three/0.146.0/three.min.js +2 -0
  265. package/bundle/vendors/three/0.146.0/three.min.js.LICENSE.txt +5 -0
  266. package/bundle/vendors/three/0.146.0/three.module.js +2 -0
  267. package/bundle/vendors/three/0.146.0/three.module.js.LICENSE.txt +5 -0
  268. package/bundle/version.txt +1 -0
  269. package/lib/architwin.d.ts +24 -0
  270. package/lib/architwin.min.js +1 -0
  271. package/lib/types.d.ts +123 -0
  272. package/lib/types.js +2 -0
  273. package/package.json +26 -0
  274. package/tsconfig.json +11 -0
@@ -0,0 +1,2 @@
1
+ /*! For license information please see 493.js.LICENSE.txt */
2
+ "use strict";(self.webpackChunkmp_webgl=self.webpackChunkmp_webgl||[]).push([[493],{92327:(e,t,n)=>{n.r(t),n.d(t,{TransformControls:()=>d,TransformControlsGizmo:()=>_,TransformControlsPlane:()=>R});var r=n(81396);const o=new r.Raycaster,i=new r.Vector3,s=new r.Vector3,a=new r.Quaternion,c={X:new r.Vector3(1,0,0),Y:new r.Vector3(0,1,0),Z:new r.Vector3(0,0,1)},l={type:"change"},h={type:"mouseDown"},u={type:"mouseUp",mode:null},p={type:"objectChange"};class d extends r.Object3D{constructor(e,t){super(),void 0===t&&(console.warn('THREE.TransformControls: The second parameter "domElement" is now mandatory.'),t=document),this.isTransformControls=!0,this.visible=!1,this.domElement=t,this.domElement.style.touchAction="none";const n=new _;this._gizmo=n,this.add(n);const o=new R;this._plane=o,this.add(o);const i=this;function s(e,t){let r=t;Object.defineProperty(i,e,{get:function(){return void 0!==r?r:t},set:function(t){r!==t&&(r=t,o[e]=t,n[e]=t,i.dispatchEvent({type:e+"-changed",value:t}),i.dispatchEvent(l))}}),i[e]=t,o[e]=t,n[e]=t}s("camera",e),s("object",void 0),s("enabled",!0),s("axis",null),s("mode","translate"),s("translationSnap",null),s("rotationSnap",null),s("scaleSnap",null),s("space","world"),s("size",1),s("dragging",!1),s("showX",!0),s("showY",!0),s("showZ",!0);const a=new r.Vector3,c=new r.Vector3,h=new r.Quaternion,u=new r.Quaternion,p=new r.Vector3,d=new r.Quaternion,w=new r.Vector3,b=new r.Vector3,x=new r.Vector3,M=new r.Vector3;s("worldPosition",a),s("worldPositionStart",c),s("worldQuaternion",h),s("worldQuaternionStart",u),s("cameraPosition",p),s("cameraQuaternion",d),s("pointStart",w),s("pointEnd",b),s("rotationAxis",x),s("rotationAngle",0),s("eye",M),this._offset=new r.Vector3,this._startNorm=new r.Vector3,this._endNorm=new r.Vector3,this._cameraScale=new r.Vector3,this._parentPosition=new r.Vector3,this._parentQuaternion=new r.Quaternion,this._parentQuaternionInv=new r.Quaternion,this._parentScale=new r.Vector3,this._worldScaleStart=new r.Vector3,this._worldQuaternionInv=new r.Quaternion,this._worldScale=new r.Vector3,this._positionStart=new r.Vector3,this._quaternionStart=new r.Quaternion,this._scaleStart=new r.Vector3,this._getPointer=f.bind(this),this._onPointerDown=g.bind(this),this._onPointerHover=m.bind(this),this._onPointerMove=y.bind(this),this._onPointerUp=v.bind(this),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointermove",this._onPointerHover),this.domElement.addEventListener("pointerup",this._onPointerUp)}updateMatrixWorld(){void 0!==this.object&&(this.object.updateMatrixWorld(),null===this.object.parent?console.error("TransformControls: The attached 3D object must be a part of the scene graph."):this.object.parent.matrixWorld.decompose(this._parentPosition,this._parentQuaternion,this._parentScale),this.object.matrixWorld.decompose(this.worldPosition,this.worldQuaternion,this._worldScale),this._parentQuaternionInv.copy(this._parentQuaternion).invert(),this._worldQuaternionInv.copy(this.worldQuaternion).invert()),this.camera.updateMatrixWorld(),this.camera.matrixWorld.decompose(this.cameraPosition,this.cameraQuaternion,this._cameraScale),this.camera.isOrthographicCamera?this.camera.getWorldDirection(this.eye).negate():this.eye.copy(this.cameraPosition).sub(this.worldPosition).normalize(),super.updateMatrixWorld(this)}pointerHover(e){if(void 0===this.object||!0===this.dragging)return;o.setFromCamera(e,this.camera);const t=w(this._gizmo.picker[this.mode],o);this.axis=t?t.object.name:null}pointerDown(e){if(void 0!==this.object&&!0!==this.dragging&&0===e.button&&null!==this.axis){o.setFromCamera(e,this.camera);const t=w(this._plane,o,!0);t&&(this.object.updateMatrixWorld(),this.object.parent.updateMatrixWorld(),this._positionStart.copy(this.object.position),this._quaternionStart.copy(this.object.quaternion),this._scaleStart.copy(this.object.scale),this.object.matrixWorld.decompose(this.worldPositionStart,this.worldQuaternionStart,this._worldScaleStart),this.pointStart.copy(t.point).sub(this.worldPositionStart)),this.dragging=!0,h.mode=this.mode,this.dispatchEvent(h)}}pointerMove(e){const t=this.axis,n=this.mode,r=this.object;let h=this.space;if("scale"===n?h="local":"E"!==t&&"XYZE"!==t&&"XYZ"!==t||(h="world"),void 0===r||null===t||!1===this.dragging||-1!==e.button)return;o.setFromCamera(e,this.camera);const u=w(this._plane,o,!0);if(u){if(this.pointEnd.copy(u.point).sub(this.worldPositionStart),"translate"===n)this._offset.copy(this.pointEnd).sub(this.pointStart),"local"===h&&"XYZ"!==t&&this._offset.applyQuaternion(this._worldQuaternionInv),-1===t.indexOf("X")&&(this._offset.x=0),-1===t.indexOf("Y")&&(this._offset.y=0),-1===t.indexOf("Z")&&(this._offset.z=0),"local"===h&&"XYZ"!==t?this._offset.applyQuaternion(this._quaternionStart).divide(this._parentScale):this._offset.applyQuaternion(this._parentQuaternionInv).divide(this._parentScale),r.position.copy(this._offset).add(this._positionStart),this.translationSnap&&("local"===h&&(r.position.applyQuaternion(a.copy(this._quaternionStart).invert()),-1!==t.search("X")&&(r.position.x=Math.round(r.position.x/this.translationSnap)*this.translationSnap),-1!==t.search("Y")&&(r.position.y=Math.round(r.position.y/this.translationSnap)*this.translationSnap),-1!==t.search("Z")&&(r.position.z=Math.round(r.position.z/this.translationSnap)*this.translationSnap),r.position.applyQuaternion(this._quaternionStart)),"world"===h&&(r.parent&&r.position.add(i.setFromMatrixPosition(r.parent.matrixWorld)),-1!==t.search("X")&&(r.position.x=Math.round(r.position.x/this.translationSnap)*this.translationSnap),-1!==t.search("Y")&&(r.position.y=Math.round(r.position.y/this.translationSnap)*this.translationSnap),-1!==t.search("Z")&&(r.position.z=Math.round(r.position.z/this.translationSnap)*this.translationSnap),r.parent&&r.position.sub(i.setFromMatrixPosition(r.parent.matrixWorld))));else if("scale"===n){if(-1!==t.search("XYZ")){let e=this.pointEnd.length()/this.pointStart.length();this.pointEnd.dot(this.pointStart)<0&&(e*=-1),s.set(e,e,e)}else i.copy(this.pointStart),s.copy(this.pointEnd),i.applyQuaternion(this._worldQuaternionInv),s.applyQuaternion(this._worldQuaternionInv),s.divide(i),-1===t.search("X")&&(s.x=1),-1===t.search("Y")&&(s.y=1),-1===t.search("Z")&&(s.z=1);r.scale.copy(this._scaleStart).multiply(s),this.scaleSnap&&(-1!==t.search("X")&&(r.scale.x=Math.round(r.scale.x/this.scaleSnap)*this.scaleSnap||this.scaleSnap),-1!==t.search("Y")&&(r.scale.y=Math.round(r.scale.y/this.scaleSnap)*this.scaleSnap||this.scaleSnap),-1!==t.search("Z")&&(r.scale.z=Math.round(r.scale.z/this.scaleSnap)*this.scaleSnap||this.scaleSnap))}else if("rotate"===n){this._offset.copy(this.pointEnd).sub(this.pointStart);const e=20/this.worldPosition.distanceTo(i.setFromMatrixPosition(this.camera.matrixWorld));"E"===t?(this.rotationAxis.copy(this.eye),this.rotationAngle=this.pointEnd.angleTo(this.pointStart),this._startNorm.copy(this.pointStart).normalize(),this._endNorm.copy(this.pointEnd).normalize(),this.rotationAngle*=this._endNorm.cross(this._startNorm).dot(this.eye)<0?1:-1):"XYZE"===t?(this.rotationAxis.copy(this._offset).cross(this.eye).normalize(),this.rotationAngle=this._offset.dot(i.copy(this.rotationAxis).cross(this.eye))*e):"X"!==t&&"Y"!==t&&"Z"!==t||(this.rotationAxis.copy(c[t]),i.copy(c[t]),"local"===h&&i.applyQuaternion(this.worldQuaternion),this.rotationAngle=this._offset.dot(i.cross(this.eye).normalize())*e),this.rotationSnap&&(this.rotationAngle=Math.round(this.rotationAngle/this.rotationSnap)*this.rotationSnap),"local"===h&&"E"!==t&&"XYZE"!==t?(r.quaternion.copy(this._quaternionStart),r.quaternion.multiply(a.setFromAxisAngle(this.rotationAxis,this.rotationAngle)).normalize()):(this.rotationAxis.applyQuaternion(this._parentQuaternionInv),r.quaternion.copy(a.setFromAxisAngle(this.rotationAxis,this.rotationAngle)),r.quaternion.multiply(this._quaternionStart).normalize())}this.dispatchEvent(l),this.dispatchEvent(p)}}pointerUp(e){0===e.button&&(this.dragging&&null!==this.axis&&(u.mode=this.mode,this.dispatchEvent(u)),this.dragging=!1,this.axis=null)}dispose(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerHover),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.traverse((function(e){e.geometry&&e.geometry.dispose(),e.material&&e.material.dispose()}))}attach(e){return this.object=e,this.visible=!0,this}detach(){return this.object=void 0,this.visible=!1,this.axis=null,this}reset(){this.enabled&&this.dragging&&(this.object.position.copy(this._positionStart),this.object.quaternion.copy(this._quaternionStart),this.object.scale.copy(this._scaleStart),this.dispatchEvent(l),this.dispatchEvent(p),this.pointStart.copy(this.pointEnd))}getRaycaster(){return o}getMode(){return this.mode}setMode(e){this.mode=e}setTranslationSnap(e){this.translationSnap=e}setRotationSnap(e){this.rotationSnap=e}setScaleSnap(e){this.scaleSnap=e}setSize(e){this.size=e}setSpace(e){this.space=e}}function f(e){if(this.domElement.ownerDocument.pointerLockElement)return{x:0,y:0,button:e.button};{const t=this.domElement.getBoundingClientRect();return{x:(e.clientX-t.left)/t.width*2-1,y:-(e.clientY-t.top)/t.height*2+1,button:e.button}}}function m(e){if(this.enabled)switch(e.pointerType){case"mouse":case"pen":this.pointerHover(this._getPointer(e))}}function g(e){this.enabled&&(document.pointerLockElement||this.domElement.setPointerCapture(e.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.pointerHover(this._getPointer(e)),this.pointerDown(this._getPointer(e)))}function y(e){this.enabled&&this.pointerMove(this._getPointer(e))}function v(e){this.enabled&&(this.domElement.releasePointerCapture(e.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.pointerUp(this._getPointer(e)))}function w(e,t,n){const r=t.intersectObject(e,!0);for(let e=0;e<r.length;e++)if(r[e].object.visible||n)return r[e];return!1}const b=new r.Euler,x=new r.Vector3(0,1,0),M=new r.Vector3(0,0,0),A=new r.Matrix4,k=new r.Quaternion,T=new r.Quaternion,I=new r.Vector3,N=new r.Matrix4,E=new r.Vector3(1,0,0),C=new r.Vector3(0,1,0),P=new r.Vector3(0,0,1),S=new r.Vector3,L=new r.Vector3,F=new r.Vector3;class _ extends r.Object3D{constructor(){super(),this.isTransformControlsGizmo=!0,this.type="TransformControlsGizmo";const e=new r.MeshBasicMaterial({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),t=new r.LineBasicMaterial({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),n=e.clone();n.opacity=.15;const o=t.clone();o.opacity=.5;const i=e.clone();i.color.setHex(16711680);const s=e.clone();s.color.setHex(65280);const a=e.clone();a.color.setHex(255);const c=e.clone();c.color.setHex(16711680),c.opacity=.5;const l=e.clone();l.color.setHex(65280),l.opacity=.5;const h=e.clone();h.color.setHex(255),h.opacity=.5;const u=e.clone();u.opacity=.25;const p=e.clone();p.color.setHex(16776960),p.opacity=.25;e.clone().color.setHex(16776960);const d=e.clone();d.color.setHex(7895160);const f=new r.CylinderGeometry(0,.04,.1,12);f.translate(0,.05,0);const m=new r.BoxGeometry(.08,.08,.08);m.translate(0,.04,0);const g=new r.BufferGeometry;g.setAttribute("position",new r.Float32BufferAttribute([0,0,0,1,0,0],3));const y=new r.CylinderGeometry(.0075,.0075,.5,3);function v(e,t){const n=new r.TorusGeometry(e,.0075,3,64,t*Math.PI*2);return n.rotateY(Math.PI/2),n.rotateX(Math.PI/2),n}y.translate(0,.25,0);const w={X:[[new r.Mesh(f,i),[.5,0,0],[0,0,-Math.PI/2]],[new r.Mesh(f,i),[-.5,0,0],[0,0,Math.PI/2]],[new r.Mesh(y,i),[0,0,0],[0,0,-Math.PI/2]]],Y:[[new r.Mesh(f,s),[0,.5,0]],[new r.Mesh(f,s),[0,-.5,0],[Math.PI,0,0]],[new r.Mesh(y,s)]],Z:[[new r.Mesh(f,a),[0,0,.5],[Math.PI/2,0,0]],[new r.Mesh(f,a),[0,0,-.5],[-Math.PI/2,0,0]],[new r.Mesh(y,a),null,[Math.PI/2,0,0]]],XYZ:[[new r.Mesh(new r.OctahedronGeometry(.1,0),u.clone()),[0,0,0]]],XY:[[new r.Mesh(new r.BoxGeometry(.15,.15,.01),h.clone()),[.15,.15,0]]],YZ:[[new r.Mesh(new r.BoxGeometry(.15,.15,.01),c.clone()),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new r.Mesh(new r.BoxGeometry(.15,.15,.01),l.clone()),[.15,0,.15],[-Math.PI/2,0,0]]]},b={X:[[new r.Mesh(new r.CylinderGeometry(.2,0,.6,4),n),[.3,0,0],[0,0,-Math.PI/2]],[new r.Mesh(new r.CylinderGeometry(.2,0,.6,4),n),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new r.Mesh(new r.CylinderGeometry(.2,0,.6,4),n),[0,.3,0]],[new r.Mesh(new r.CylinderGeometry(.2,0,.6,4),n),[0,-.3,0],[0,0,Math.PI]]],Z:[[new r.Mesh(new r.CylinderGeometry(.2,0,.6,4),n),[0,0,.3],[Math.PI/2,0,0]],[new r.Mesh(new r.CylinderGeometry(.2,0,.6,4),n),[0,0,-.3],[-Math.PI/2,0,0]]],XYZ:[[new r.Mesh(new r.OctahedronGeometry(.2,0),n)]],XY:[[new r.Mesh(new r.BoxGeometry(.2,.2,.01),n),[.15,.15,0]]],YZ:[[new r.Mesh(new r.BoxGeometry(.2,.2,.01),n),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new r.Mesh(new r.BoxGeometry(.2,.2,.01),n),[.15,0,.15],[-Math.PI/2,0,0]]]},x={START:[[new r.Mesh(new r.OctahedronGeometry(.01,2),o),null,null,null,"helper"]],END:[[new r.Mesh(new r.OctahedronGeometry(.01,2),o),null,null,null,"helper"]],DELTA:[[new r.Line(function(){const e=new r.BufferGeometry;return e.setAttribute("position",new r.Float32BufferAttribute([0,0,0,1,1,1],3)),e}(),o),null,null,null,"helper"]],X:[[new r.Line(g,o.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new r.Line(g,o.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new r.Line(g,o.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]},M={XYZE:[[new r.Mesh(v(.5,1),d),null,[0,Math.PI/2,0]]],X:[[new r.Mesh(v(.5,.5),i)]],Y:[[new r.Mesh(v(.5,.5),s),null,[0,0,-Math.PI/2]]],Z:[[new r.Mesh(v(.5,.5),a),null,[0,Math.PI/2,0]]],E:[[new r.Mesh(v(.75,1),p),null,[0,Math.PI/2,0]]]},A={AXIS:[[new r.Line(g,o.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]]},k={XYZE:[[new r.Mesh(new r.SphereGeometry(.25,10,8),n)]],X:[[new r.Mesh(new r.TorusGeometry(.5,.1,4,24),n),[0,0,0],[0,-Math.PI/2,-Math.PI/2]]],Y:[[new r.Mesh(new r.TorusGeometry(.5,.1,4,24),n),[0,0,0],[Math.PI/2,0,0]]],Z:[[new r.Mesh(new r.TorusGeometry(.5,.1,4,24),n),[0,0,0],[0,0,-Math.PI/2]]],E:[[new r.Mesh(new r.TorusGeometry(.75,.1,2,24),n)]]},T={X:[[new r.Mesh(m,i),[.5,0,0],[0,0,-Math.PI/2]],[new r.Mesh(y,i),[0,0,0],[0,0,-Math.PI/2]],[new r.Mesh(m,i),[-.5,0,0],[0,0,Math.PI/2]]],Y:[[new r.Mesh(m,s),[0,.5,0]],[new r.Mesh(y,s)],[new r.Mesh(m,s),[0,-.5,0],[0,0,Math.PI]]],Z:[[new r.Mesh(m,a),[0,0,.5],[Math.PI/2,0,0]],[new r.Mesh(y,a),[0,0,0],[Math.PI/2,0,0]],[new r.Mesh(m,a),[0,0,-.5],[-Math.PI/2,0,0]]],XY:[[new r.Mesh(new r.BoxGeometry(.15,.15,.01),h),[.15,.15,0]]],YZ:[[new r.Mesh(new r.BoxGeometry(.15,.15,.01),c),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new r.Mesh(new r.BoxGeometry(.15,.15,.01),l),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new r.Mesh(new r.BoxGeometry(.1,.1,.1),u.clone())]]},I={X:[[new r.Mesh(new r.CylinderGeometry(.2,0,.6,4),n),[.3,0,0],[0,0,-Math.PI/2]],[new r.Mesh(new r.CylinderGeometry(.2,0,.6,4),n),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new r.Mesh(new r.CylinderGeometry(.2,0,.6,4),n),[0,.3,0]],[new r.Mesh(new r.CylinderGeometry(.2,0,.6,4),n),[0,-.3,0],[0,0,Math.PI]]],Z:[[new r.Mesh(new r.CylinderGeometry(.2,0,.6,4),n),[0,0,.3],[Math.PI/2,0,0]],[new r.Mesh(new r.CylinderGeometry(.2,0,.6,4),n),[0,0,-.3],[-Math.PI/2,0,0]]],XY:[[new r.Mesh(new r.BoxGeometry(.2,.2,.01),n),[.15,.15,0]]],YZ:[[new r.Mesh(new r.BoxGeometry(.2,.2,.01),n),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new r.Mesh(new r.BoxGeometry(.2,.2,.01),n),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new r.Mesh(new r.BoxGeometry(.2,.2,.2),n),[0,0,0]]]},N={X:[[new r.Line(g,o.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new r.Line(g,o.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new r.Line(g,o.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]};function E(e){const t=new r.Object3D;for(const n in e)for(let r=e[n].length;r--;){const o=e[n][r][0].clone(),i=e[n][r][1],s=e[n][r][2],a=e[n][r][3],c=e[n][r][4];o.name=n,o.tag=c,i&&o.position.set(i[0],i[1],i[2]),s&&o.rotation.set(s[0],s[1],s[2]),a&&o.scale.set(a[0],a[1],a[2]),o.updateMatrix();const l=o.geometry.clone();l.applyMatrix4(o.matrix),o.geometry=l,o.renderOrder=1/0,o.position.set(0,0,0),o.rotation.set(0,0,0),o.scale.set(1,1,1),t.add(o)}return t}this.gizmo={},this.picker={},this.helper={},this.add(this.gizmo.translate=E(w)),this.add(this.gizmo.rotate=E(M)),this.add(this.gizmo.scale=E(T)),this.add(this.picker.translate=E(b)),this.add(this.picker.rotate=E(k)),this.add(this.picker.scale=E(I)),this.add(this.helper.translate=E(x)),this.add(this.helper.rotate=E(A)),this.add(this.helper.scale=E(N)),this.picker.translate.visible=!1,this.picker.rotate.visible=!1,this.picker.scale.visible=!1}updateMatrixWorld(e){const t="local"===("scale"===this.mode?"local":this.space)?this.worldQuaternion:T;this.gizmo.translate.visible="translate"===this.mode,this.gizmo.rotate.visible="rotate"===this.mode,this.gizmo.scale.visible="scale"===this.mode,this.helper.translate.visible="translate"===this.mode,this.helper.rotate.visible="rotate"===this.mode,this.helper.scale.visible="scale"===this.mode;let n=[];n=n.concat(this.picker[this.mode].children),n=n.concat(this.gizmo[this.mode].children),n=n.concat(this.helper[this.mode].children);for(let e=0;e<n.length;e++){const r=n[e];let o;if(r.visible=!0,r.rotation.set(0,0,0),r.position.copy(this.worldPosition),o=this.camera.isOrthographicCamera?(this.camera.top-this.camera.bottom)/this.camera.zoom:this.worldPosition.distanceTo(this.cameraPosition)*Math.min(1.9*Math.tan(Math.PI*this.camera.fov/360)/this.camera.zoom,7),r.scale.set(1,1,1).multiplyScalar(o*this.size/4),"helper"!==r.tag){if(r.quaternion.copy(t),"translate"===this.mode||"scale"===this.mode){const e=.99,n=.2;"X"===r.name&&Math.abs(x.copy(E).applyQuaternion(t).dot(this.eye))>e&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),"Y"===r.name&&Math.abs(x.copy(C).applyQuaternion(t).dot(this.eye))>e&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),"Z"===r.name&&Math.abs(x.copy(P).applyQuaternion(t).dot(this.eye))>e&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),"XY"===r.name&&Math.abs(x.copy(P).applyQuaternion(t).dot(this.eye))<n&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),"YZ"===r.name&&Math.abs(x.copy(E).applyQuaternion(t).dot(this.eye))<n&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),"XZ"===r.name&&Math.abs(x.copy(C).applyQuaternion(t).dot(this.eye))<n&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1)}else"rotate"===this.mode&&(k.copy(t),x.copy(this.eye).applyQuaternion(a.copy(t).invert()),-1!==r.name.search("E")&&r.quaternion.setFromRotationMatrix(A.lookAt(this.eye,M,C)),"X"===r.name&&(a.setFromAxisAngle(E,Math.atan2(-x.y,x.z)),a.multiplyQuaternions(k,a),r.quaternion.copy(a)),"Y"===r.name&&(a.setFromAxisAngle(C,Math.atan2(x.x,x.z)),a.multiplyQuaternions(k,a),r.quaternion.copy(a)),"Z"===r.name&&(a.setFromAxisAngle(P,Math.atan2(x.y,x.x)),a.multiplyQuaternions(k,a),r.quaternion.copy(a)));r.visible=r.visible&&(-1===r.name.indexOf("X")||this.showX),r.visible=r.visible&&(-1===r.name.indexOf("Y")||this.showY),r.visible=r.visible&&(-1===r.name.indexOf("Z")||this.showZ),r.visible=r.visible&&(-1===r.name.indexOf("E")||this.showX&&this.showY&&this.showZ),r.material._color=r.material._color||r.material.color.clone(),r.material._opacity=r.material._opacity||r.material.opacity,r.material.color.copy(r.material._color),r.material.opacity=r.material._opacity,this.enabled&&this.axis&&(r.name===this.axis||this.axis.split("").some((function(e){return r.name===e})))&&(r.material.color.setHex(16776960),r.material.opacity=1)}else r.visible=!1,"AXIS"===r.name?(r.position.copy(this.worldPositionStart),r.visible=!!this.axis,"X"===this.axis&&(a.setFromEuler(b.set(0,0,0)),r.quaternion.copy(t).multiply(a),Math.abs(x.copy(E).applyQuaternion(t).dot(this.eye))>.9&&(r.visible=!1)),"Y"===this.axis&&(a.setFromEuler(b.set(0,0,Math.PI/2)),r.quaternion.copy(t).multiply(a),Math.abs(x.copy(C).applyQuaternion(t).dot(this.eye))>.9&&(r.visible=!1)),"Z"===this.axis&&(a.setFromEuler(b.set(0,Math.PI/2,0)),r.quaternion.copy(t).multiply(a),Math.abs(x.copy(P).applyQuaternion(t).dot(this.eye))>.9&&(r.visible=!1)),"XYZE"===this.axis&&(a.setFromEuler(b.set(0,Math.PI/2,0)),x.copy(this.rotationAxis),r.quaternion.setFromRotationMatrix(A.lookAt(M,x,C)),r.quaternion.multiply(a),r.visible=this.dragging),"E"===this.axis&&(r.visible=!1)):"START"===r.name?(r.position.copy(this.worldPositionStart),r.visible=this.dragging):"END"===r.name?(r.position.copy(this.worldPosition),r.visible=this.dragging):"DELTA"===r.name?(r.position.copy(this.worldPositionStart),r.quaternion.copy(this.worldQuaternionStart),i.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),i.applyQuaternion(this.worldQuaternionStart.clone().invert()),r.scale.copy(i),r.visible=this.dragging):(r.quaternion.copy(t),this.dragging?r.position.copy(this.worldPositionStart):r.position.copy(this.worldPosition),this.axis&&(r.visible=-1!==this.axis.search(r.name)))}super.updateMatrixWorld(e)}}class R extends r.Mesh{constructor(){super(new r.PlaneGeometry(1e5,1e5,2,2),new r.MeshBasicMaterial({visible:!1,wireframe:!0,side:r.DoubleSide,transparent:!0,opacity:.1,toneMapped:!1})),this.isTransformControlsPlane=!0,this.type="TransformControlsPlane"}updateMatrixWorld(e){let t=this.space;switch(this.position.copy(this.worldPosition),"scale"===this.mode&&(t="local"),S.copy(E).applyQuaternion("local"===t?this.worldQuaternion:T),L.copy(C).applyQuaternion("local"===t?this.worldQuaternion:T),F.copy(P).applyQuaternion("local"===t?this.worldQuaternion:T),x.copy(L),this.mode){case"translate":case"scale":switch(this.axis){case"X":x.copy(this.eye).cross(S),I.copy(S).cross(x);break;case"Y":x.copy(this.eye).cross(L),I.copy(L).cross(x);break;case"Z":x.copy(this.eye).cross(F),I.copy(F).cross(x);break;case"XY":I.copy(F);break;case"YZ":I.copy(S);break;case"XZ":x.copy(F),I.copy(L);break;case"XYZ":case"E":I.set(0,0,0)}break;case"rotate":default:I.set(0,0,0)}0===I.length()?this.quaternion.copy(this.cameraQuaternion):(N.lookAt(i.set(0,0,0),I,x),this.quaternion.setFromRotationMatrix(N)),super.updateMatrixWorld(e)}}},4103:(e,t,n)=>{n.r(t),n.d(t,{NURBSCurve:()=>i});var r=n(81396),o=n(26200);class i extends r.Curve{constructor(e,t,n,o,i){super(),this.degree=e,this.knots=t,this.controlPoints=[],this.startKnot=o||0,this.endKnot=i||this.knots.length-1;for(let e=0;e<n.length;++e){const t=n[e];this.controlPoints[e]=new r.Vector4(t.x,t.y,t.z,t.w)}}getPoint(e,t=new r.Vector3){const n=t,i=this.knots[this.startKnot]+e*(this.knots[this.endKnot]-this.knots[this.startKnot]),s=o.calcBSplinePoint(this.degree,this.knots,this.controlPoints,i);return 1!==s.w&&s.divideScalar(s.w),n.set(s.x,s.y,s.z)}getTangent(e,t=new r.Vector3){const n=t,i=this.knots[0]+e*(this.knots[this.knots.length-1]-this.knots[0]),s=o.calcNURBSDerivatives(this.degree,this.knots,this.controlPoints,i,1);return n.copy(s[1]).normalize(),n}}},26200:(e,t,n)=>{n.r(t),n.d(t,{calcBSplineDerivatives:()=>c,calcBSplinePoint:()=>s,calcBasisFunctionDerivatives:()=>a,calcBasisFunctions:()=>i,calcKoverI:()=>l,calcNURBSDerivatives:()=>u,calcRationalCurveDerivatives:()=>h,calcSurfacePoint:()=>p,findSpan:()=>o});var r=n(81396);function o(e,t,n){const r=n.length-e-1;if(t>=n[r])return r-1;if(t<=n[e])return e;let o=e,i=r,s=Math.floor((o+i)/2);for(;t<n[s]||t>=n[s+1];)t<n[s]?i=s:o=s,s=Math.floor((o+i)/2);return s}function i(e,t,n,r){const o=[],i=[],s=[];o[0]=1;for(let a=1;a<=n;++a){i[a]=t-r[e+1-a],s[a]=r[e+a]-t;let n=0;for(let e=0;e<a;++e){const t=s[e+1],r=i[a-e],c=o[e]/(t+r);o[e]=n+t*c,n=r*c}o[a]=n}return o}function s(e,t,n,s){const a=o(e,s,t),c=i(a,s,e,t),l=new r.Vector4(0,0,0,0);for(let t=0;t<=e;++t){const r=n[a-e+t],o=c[t],i=r.w*o;l.x+=r.x*i,l.y+=r.y*i,l.z+=r.z*i,l.w+=r.w*o}return l}function a(e,t,n,r,o){const i=[];for(let e=0;e<=n;++e)i[e]=0;const s=[];for(let e=0;e<=r;++e)s[e]=i.slice(0);const a=[];for(let e=0;e<=n;++e)a[e]=i.slice(0);a[0][0]=1;const c=i.slice(0),l=i.slice(0);for(let r=1;r<=n;++r){c[r]=t-o[e+1-r],l[r]=o[e+r]-t;let n=0;for(let e=0;e<r;++e){const t=l[e+1],o=c[r-e];a[r][e]=t+o;const i=a[e][r-1]/a[r][e];a[e][r]=n+t*i,n=o*i}a[r][r]=n}for(let e=0;e<=n;++e)s[0][e]=a[e][n];for(let e=0;e<=n;++e){let t=0,o=1;const c=[];for(let e=0;e<=n;++e)c[e]=i.slice(0);c[0][0]=1;for(let i=1;i<=r;++i){let r=0;const l=e-i,h=n-i;e>=i&&(c[o][0]=c[t][0]/a[h+1][l],r=c[o][0]*a[l][h]);const u=e-1<=h?i-1:n-e;for(let e=l>=-1?1:-l;e<=u;++e)c[o][e]=(c[t][e]-c[t][e-1])/a[h+1][l+e],r+=c[o][e]*a[l+e][h];e<=h&&(c[o][i]=-c[t][i-1]/a[h+1][e],r+=c[o][i]*a[e][h]),s[i][e]=r;const p=t;t=o,o=p}}let h=n;for(let e=1;e<=r;++e){for(let t=0;t<=n;++t)s[e][t]*=h;h*=n-e}return s}function c(e,t,n,i,s){const c=s<e?s:e,l=[],h=o(e,i,t),u=a(h,i,e,c,t),p=[];for(let e=0;e<n.length;++e){const t=n[e].clone(),r=t.w;t.x*=r,t.y*=r,t.z*=r,p[e]=t}for(let t=0;t<=c;++t){const n=p[h-e].clone().multiplyScalar(u[t][0]);for(let r=1;r<=e;++r)n.add(p[h-e+r].clone().multiplyScalar(u[t][r]));l[t]=n}for(let e=c+1;e<=s+1;++e)l[e]=new r.Vector4(0,0,0);return l}function l(e,t){let n=1;for(let t=2;t<=e;++t)n*=t;let r=1;for(let e=2;e<=t;++e)r*=e;for(let n=2;n<=e-t;++n)r*=n;return n/r}function h(e){const t=e.length,n=[],o=[];for(let i=0;i<t;++i){const t=e[i];n[i]=new r.Vector3(t.x,t.y,t.z),o[i]=t.w}const i=[];for(let e=0;e<t;++e){const t=n[e].clone();for(let n=1;n<=e;++n)t.sub(i[e-n].clone().multiplyScalar(l(e,n)*o[n]));i[e]=t.divideScalar(o[0])}return i}function u(e,t,n,r,o){return h(c(e,t,n,r,o))}function p(e,t,n,s,a,c,l,h){const u=o(e,c,n),p=o(t,l,s),d=i(u,c,e,n),f=i(p,l,t,s),m=[];for(let n=0;n<=t;++n){m[n]=new r.Vector4(0,0,0,0);for(let r=0;r<=e;++r){const o=a[u-e+r][p-t+n].clone(),i=o.w;o.x*=i,o.y*=i,o.z*=i,m[n].add(o.multiplyScalar(d[r]))}}const g=new r.Vector4(0,0,0,0);for(let e=0;e<=t;++e)g.add(m[e].multiplyScalar(f[e]));g.divideScalar(g.w),h.set(g.x,g.y,g.z)}},78646:(e,t,n)=>{n.r(t),n.d(t,{AsyncCompress:()=>Se,AsyncDecompress:()=>We,AsyncDeflate:()=>Ae,AsyncGunzip:()=>Re,AsyncGzip:()=>Se,AsyncInflate:()=>Ne,AsyncUnzipInflate:()=>bt,AsyncUnzlib:()=>Ge,AsyncZipDeflate:()=>ft,AsyncZlib:()=>je,Compress:()=>Pe,DecodeUTF8:()=>tt,Decompress:()=>qe,Deflate:()=>Me,EncodeUTF8:()=>nt,Gunzip:()=>_e,Gzip:()=>Pe,Inflate:()=>Ie,Unzip:()=>xt,UnzipInflate:()=>wt,UnzipPassThrough:()=>vt,Unzlib:()=>Ue,Zip:()=>mt,ZipDeflate:()=>dt,ZipPassThrough:()=>pt,Zlib:()=>Be,compress:()=>Le,compressSync:()=>Fe,decompress:()=>Ze,decompressSync:()=>Qe,deflate:()=>ke,deflateSync:()=>Te,gunzip:()=>Oe,gunzipSync:()=>De,gzip:()=>Le,gzipSync:()=>Fe,inflate:()=>Ee,inflateSync:()=>Ce,strFromU8:()=>ot,strToU8:()=>rt,unzip:()=>Mt,unzipSync:()=>At,unzlib:()=>Xe,unzlibSync:()=>He,zip:()=>gt,zipSync:()=>yt,zlib:()=>ze,zlibSync:()=>Ve});var r={},o=function(e){return URL.createObjectURL(new Blob([e],{type:"text/javascript"}))},i=function(e){return new Worker(e)};try{URL.revokeObjectURL(o(""))}catch(e){o=function(e){return"data:application/javascript;charset=UTF-8,"+encodeURI(e)},i=function(e){return new Worker(e,{type:"module"})}}var s=Uint8Array,a=Uint16Array,c=Uint32Array,l=new s([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),h=new s([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),u=new s([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),p=function(e,t){for(var n=new a(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];var o=new c(n[30]);for(r=1;r<30;++r)for(var i=n[r];i<n[r+1];++i)o[i]=i-n[r]<<5|r;return[n,o]},d=p(l,2),f=d[0],m=d[1];f[28]=258,m[258]=28;for(var g=p(h,0),y=g[0],v=g[1],w=new a(32768),b=0;b<32768;++b){var x=(43690&b)>>>1|(21845&b)<<1;x=(61680&(x=(52428&x)>>>2|(13107&x)<<2))>>>4|(3855&x)<<4,w[b]=((65280&x)>>>8|(255&x)<<8)>>>1}var M=function(e,t,n){for(var r=e.length,o=0,i=new a(t);o<r;++o)++i[e[o]-1];var s,c=new a(t);for(o=0;o<t;++o)c[o]=c[o-1]+i[o-1]<<1;if(n){s=new a(1<<t);var l=15-t;for(o=0;o<r;++o)if(e[o])for(var h=o<<4|e[o],u=t-e[o],p=c[e[o]-1]++<<u,d=p|(1<<u)-1;p<=d;++p)s[w[p]>>>l]=h}else for(s=new a(r),o=0;o<r;++o)e[o]&&(s[o]=w[c[e[o]-1]++]>>>15-e[o]);return s},A=new s(288);for(b=0;b<144;++b)A[b]=8;for(b=144;b<256;++b)A[b]=9;for(b=256;b<280;++b)A[b]=7;for(b=280;b<288;++b)A[b]=8;var k=new s(32);for(b=0;b<32;++b)k[b]=5;var T=M(A,9,0),I=M(A,9,1),N=M(k,5,0),E=M(k,5,1),C=function(e){for(var t=e[0],n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t},P=function(e,t,n){var r=t/8|0;return(e[r]|e[r+1]<<8)>>(7&t)&n},S=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(7&t)},L=function(e){return(e/8|0)+(7&e&&1)},F=function(e,t,n){(null==t||t<0)&&(t=0),(null==n||n>e.length)&&(n=e.length);var r=new(e instanceof a?a:e instanceof c?c:s)(n-t);return r.set(e.subarray(t,n)),r},_=function(e,t,n){var r=e.length;if(!r||n&&!n.l&&r<5)return t||new s(0);var o=!t||n,i=!n||n.i;n||(n={}),t||(t=new s(3*r));var a=function(e){var n=t.length;if(e>n){var r=new s(Math.max(2*n,e));r.set(t),t=r}},c=n.f||0,p=n.p||0,d=n.b||0,m=n.l,g=n.d,v=n.m,w=n.n,b=8*r;do{if(!m){n.f=c=P(e,p,1);var x=P(e,p+1,3);if(p+=3,!x){var A=e[(V=L(p)+4)-4]|e[V-3]<<8,k=V+A;if(k>r){if(i)throw"unexpected EOF";break}o&&a(d+A),t.set(e.subarray(V,k),d),n.b=d+=A,n.p=p=8*k;continue}if(1==x)m=I,g=E,v=9,w=5;else{if(2!=x)throw"invalid block type";var T=P(e,p,31)+257,N=P(e,p+10,15)+4,_=T+P(e,p+5,31)+1;p+=14;for(var R=new s(_),O=new s(19),D=0;D<N;++D)O[u[D]]=P(e,p+3*D,7);p+=3*N;var B=C(O),j=(1<<B)-1,z=M(O,B,1);for(D=0;D<_;){var V,U=z[P(e,p,j)];if(p+=15&U,(V=U>>>4)<16)R[D++]=V;else{var G=0,X=0;for(16==V?(X=3+P(e,p,3),p+=2,G=R[D-1]):17==V?(X=3+P(e,p,7),p+=3):18==V&&(X=11+P(e,p,127),p+=7);X--;)R[D++]=G}}var H=R.subarray(0,T),q=R.subarray(T);v=C(H),w=C(q),m=M(H,v,1),g=M(q,w,1)}if(p>b){if(i)throw"unexpected EOF";break}}o&&a(d+131072);for(var W=(1<<v)-1,Z=(1<<w)-1,Q=p;;Q=p){var Y=(G=m[S(e,p)&W])>>>4;if((p+=15&G)>b){if(i)throw"unexpected EOF";break}if(!G)throw"invalid length/literal";if(Y<256)t[d++]=Y;else{if(256==Y){Q=p,m=null;break}var K=Y-254;if(Y>264){var J=l[D=Y-257];K=P(e,p,(1<<J)-1)+f[D],p+=J}var $=g[S(e,p)&Z],ee=$>>>4;if(!$)throw"invalid distance";p+=15&$;q=y[ee];if(ee>3){J=h[ee];q+=S(e,p)&(1<<J)-1,p+=J}if(p>b){if(i)throw"unexpected EOF";break}o&&a(d+131072);for(var te=d+K;d<te;d+=4)t[d]=t[d-q],t[d+1]=t[d+1-q],t[d+2]=t[d+2-q],t[d+3]=t[d+3-q];d=te}}n.l=m,n.p=Q,n.b=d,m&&(c=1,n.m=v,n.d=g,n.n=w)}while(!c);return d==t.length?t:F(t,0,d)},R=function(e,t,n){n<<=7&t;var r=t/8|0;e[r]|=n,e[r+1]|=n>>>8},O=function(e,t,n){n<<=7&t;var r=t/8|0;e[r]|=n,e[r+1]|=n>>>8,e[r+2]|=n>>>16},D=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var o=n.length,i=n.slice();if(!o)return[X,0];if(1==o){var c=new s(n[0].s+1);return c[n[0].s]=1,[c,1]}n.sort((function(e,t){return e.f-t.f})),n.push({s:-1,f:25001});var l=n[0],h=n[1],u=0,p=1,d=2;for(n[0]={s:-1,f:l.f+h.f,l:l,r:h};p!=o-1;)l=n[n[u].f<n[d].f?u++:d++],h=n[u!=p&&n[u].f<n[d].f?u++:d++],n[p++]={s:-1,f:l.f+h.f,l:l,r:h};var f=i[0].s;for(r=1;r<o;++r)i[r].s>f&&(f=i[r].s);var m=new a(f+1),g=B(n[p-1],m,0);if(g>t){r=0;var y=0,v=g-t,w=1<<v;for(i.sort((function(e,t){return m[t.s]-m[e.s]||e.f-t.f}));r<o;++r){var b=i[r].s;if(!(m[b]>t))break;y+=w-(1<<g-m[b]),m[b]=t}for(y>>>=v;y>0;){var x=i[r].s;m[x]<t?y-=1<<t-m[x]++-1:++r}for(;r>=0&&y;--r){var M=i[r].s;m[M]==t&&(--m[M],++y)}g=t}return[new s(m),g]},B=function(e,t,n){return-1==e.s?Math.max(B(e.l,t,n+1),B(e.r,t,n+1)):t[e.s]=n},j=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new a(++t),r=0,o=e[0],i=1,s=function(e){n[r++]=e},c=1;c<=t;++c)if(e[c]==o&&c!=t)++i;else{if(!o&&i>2){for(;i>138;i-=138)s(32754);i>2&&(s(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(s(o),--i;i>6;i-=6)s(8304);i>2&&(s(i-3<<5|8208),i=0)}for(;i--;)s(o);i=1,o=e[c]}return[n.subarray(0,r),t]},z=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},V=function(e,t,n){var r=n.length,o=L(t+2);e[o]=255&r,e[o+1]=r>>>8,e[o+2]=255^e[o],e[o+3]=255^e[o+1];for(var i=0;i<r;++i)e[o+i+4]=n[i];return 8*(o+4+r)},U=function(e,t,n,r,o,i,s,c,p,d,f){R(t,f++,n),++o[256];for(var m=D(o,15),g=m[0],y=m[1],v=D(i,15),w=v[0],b=v[1],x=j(g),I=x[0],E=x[1],C=j(w),P=C[0],S=C[1],L=new a(19),F=0;F<I.length;++F)L[31&I[F]]++;for(F=0;F<P.length;++F)L[31&P[F]]++;for(var _=D(L,7),B=_[0],U=_[1],G=19;G>4&&!B[u[G-1]];--G);var X,H,q,W,Z=d+5<<3,Q=z(o,A)+z(i,k)+s,Y=z(o,g)+z(i,w)+s+14+3*G+z(L,B)+(2*L[16]+3*L[17]+7*L[18]);if(Z<=Q&&Z<=Y)return V(t,f,e.subarray(p,p+d));if(R(t,f,1+(Y<Q)),f+=2,Y<Q){X=M(g,y,0),H=g,q=M(w,b,0),W=w;var K=M(B,U,0);R(t,f,E-257),R(t,f+5,S-1),R(t,f+10,G-4),f+=14;for(F=0;F<G;++F)R(t,f+3*F,B[u[F]]);f+=3*G;for(var J=[I,P],$=0;$<2;++$){var ee=J[$];for(F=0;F<ee.length;++F){var te=31&ee[F];R(t,f,K[te]),f+=B[te],te>15&&(R(t,f,ee[F]>>>5&127),f+=ee[F]>>>12)}}}else X=T,H=A,q=N,W=k;for(F=0;F<c;++F)if(r[F]>255){te=r[F]>>>18&31;O(t,f,X[te+257]),f+=H[te+257],te>7&&(R(t,f,r[F]>>>23&31),f+=l[te]);var ne=31&r[F];O(t,f,q[ne]),f+=W[ne],ne>3&&(O(t,f,r[F]>>>5&8191),f+=h[ne])}else O(t,f,X[r[F]]),f+=H[r[F]];return O(t,f,X[256]),f+H[256]},G=new c([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),X=new s(0),H=function(e,t,n,r,o,i){var u=e.length,p=new s(r+u+5*(1+Math.ceil(u/7e3))+o),d=p.subarray(r,p.length-o),f=0;if(!t||u<8)for(var g=0;g<=u;g+=65535){var y=g+65535;y<u?f=V(d,f,e.subarray(g,y)):(d[g]=i,f=V(d,f,e.subarray(g,u)))}else{for(var w=G[t-1],b=w>>>13,x=8191&w,M=(1<<n)-1,A=new a(32768),k=new a(M+1),T=Math.ceil(n/3),I=2*T,N=function(t){return(e[t]^e[t+1]<<T^e[t+2]<<I)&M},E=new c(25e3),C=new a(288),P=new a(32),S=0,_=0,R=(g=0,0),O=0,D=0;g<u;++g){var B=N(g),j=32767&g,z=k[B];if(A[j]=z,k[B]=j,O<=g){var H=u-g;if((S>7e3||R>24576)&&H>423){f=U(e,d,0,E,C,P,_,R,D,g-D,f),R=S=_=0,D=g;for(var q=0;q<286;++q)C[q]=0;for(q=0;q<30;++q)P[q]=0}var W=2,Z=0,Q=x,Y=j-z&32767;if(H>2&&B==N(g-Y))for(var K=Math.min(b,H)-1,J=Math.min(32767,g),$=Math.min(258,H);Y<=J&&--Q&&j!=z;){if(e[g+W]==e[g+W-Y]){for(var ee=0;ee<$&&e[g+ee]==e[g+ee-Y];++ee);if(ee>W){if(W=ee,Z=Y,ee>K)break;var te=Math.min(Y,ee-2),ne=0;for(q=0;q<te;++q){var re=g-Y+q+32768&32767,oe=re-A[re]+32768&32767;oe>ne&&(ne=oe,z=re)}}}Y+=(j=z)-(z=A[j])+32768&32767}if(Z){E[R++]=268435456|m[W]<<18|v[Z];var ie=31&m[W],se=31&v[Z];_+=l[ie]+h[se],++C[257+ie],++P[se],O=g+W,++S}else E[R++]=e[g],++C[e[g]]}}f=U(e,d,i,E,C,P,_,R,D,g-D,f),!i&&7&f&&(f=V(d,f+1,X))}return F(p,0,r+L(f)+o)},q=function(){for(var e=new c(256),t=0;t<256;++t){for(var n=t,r=9;--r;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e}(),W=function(){var e=-1;return{p:function(t){for(var n=e,r=0;r<t.length;++r)n=q[255&n^t[r]]^n>>>8;e=n},d:function(){return~e}}},Z=function(){var e=1,t=0;return{p:function(n){for(var r=e,o=t,i=n.length,s=0;s!=i;){for(var a=Math.min(s+2655,i);s<a;++s)o+=r+=n[s];r=(65535&r)+15*(r>>16),o=(65535&o)+15*(o>>16)}e=r,t=o},d:function(){return(255&(e%=65521))<<24|e>>>8<<16|(255&(t%=65521))<<8|t>>>8}}},Q=function(e,t,n,r,o){return H(e,null==t.level?6:t.level,null==t.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,n,r,!o)},Y=function(e,t){var n={};for(var r in e)n[r]=e[r];for(var r in t)n[r]=t[r];return n},K=function(e,t,n){for(var r=e(),o=e.toString(),i=o.slice(o.indexOf("[")+1,o.lastIndexOf("]")).replace(/ /g,"").split(","),s=0;s<r.length;++s){var a=r[s],c=i[s];if("function"==typeof a){t+=";"+c+"=";var l=a.toString();if(a.prototype)if(-1!=l.indexOf("[native code]")){var h=l.indexOf(" ",8)+1;t+=l.slice(h,l.indexOf("(",h))}else for(var u in t+=l,a.prototype)t+=";"+c+".prototype."+u+"="+a.prototype[u].toString();else t+=l}else n[c]=a}return[t,n]},J=[],$=function(e,t,n,l){var h;if(!J[n]){for(var u="",p={},d=e.length-1,f=0;f<d;++f)u=(h=K(e[f],u,p))[0],p=h[1];J[n]=K(e[d],u,p)}var m=Y({},J[n][1]);return function(e,t,n,s,a){var c=i(r[t]||(r[t]=o(e)));return c.onerror=function(e){return a(e.error,null)},c.onmessage=function(e){return a(null,e.data)},c.postMessage(n,s),c}(J[n][0]+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+t.toString()+"}",n,m,function(e){var t=[];for(var n in e)(e[n]instanceof s||e[n]instanceof a||e[n]instanceof c)&&t.push((e[n]=new e[n].constructor(e[n])).buffer);return t}(m),l)},ee=function(){return[s,a,c,l,h,u,f,y,I,E,w,M,C,P,S,L,F,_,Ce,se,ae]},te=function(){return[s,a,c,l,h,u,m,v,T,A,N,k,w,G,X,M,R,O,D,B,j,z,V,U,L,F,H,Q,Te,se]},ne=function(){return[me,ve,fe,W,q]},re=function(){return[ge,ye]},oe=function(){return[we,fe,Z]},ie=function(){return[be]},se=function(e){return postMessage(e,[e.buffer])},ae=function(e){return e&&e.size&&new s(e.size)},ce=function(e,t,n,r,o,i){var s=$(n,r,o,(function(e,t){s.terminate(),i(e,t)}));return s.postMessage([e,t],t.consume?[e.buffer]:[]),function(){s.terminate()}},le=function(e){return e.ondata=function(e,t){return postMessage([e,t],[e.buffer])},function(t){return e.push(t.data[0],t.data[1])}},he=function(e,t,n,r,o){var i,s=$(e,r,o,(function(e,n){e?(s.terminate(),t.ondata.call(t,e)):(n[1]&&s.terminate(),t.ondata.call(t,e,n[0],n[1]))}));s.postMessage(n),t.push=function(e,n){if(i)throw"stream finished";if(!t.ondata)throw"no stream handler";s.postMessage([e,i=n],[e.buffer])},t.terminate=function(){s.terminate()}},ue=function(e,t){return e[t]|e[t+1]<<8},pe=function(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0},de=function(e,t){return pe(e,t)+4294967296*pe(e,t+4)},fe=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8},me=function(e,t){var n=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:9==t.level?2:0,e[9]=3,0!=t.mtime&&fe(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),n){e[3]=8;for(var r=0;r<=n.length;++r)e[r+10]=n.charCodeAt(r)}},ge=function(e){if(31!=e[0]||139!=e[1]||8!=e[2])throw"invalid gzip data";var t=e[3],n=10;4&t&&(n+=e[10]|2+(e[11]<<8));for(var r=(t>>3&1)+(t>>4&1);r>0;r-=!e[n++]);return n+(2&t)},ye=function(e){var t=e.length;return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0},ve=function(e){return 10+(e.filename&&e.filename.length+1||0)},we=function(e,t){var n=t.level,r=0==n?0:n<6?1:9==n?3:2;e[0]=120,e[1]=r<<6|(r?32-2*r:1)},be=function(e){if(8!=(15&e[0])||e[0]>>>4>7||(e[0]<<8|e[1])%31)throw"invalid zlib data";if(32&e[1])throw"invalid zlib data: preset dictionaries not supported"};function xe(e,t){return t||"function"!=typeof e||(t=e,e={}),this.ondata=t,e}var Me=function(){function e(e,t){t||"function"!=typeof e||(t=e,e={}),this.ondata=t,this.o=e||{}}return e.prototype.p=function(e,t){this.ondata(Q(e,this.o,0,0,!t),t)},e.prototype.push=function(e,t){if(this.d)throw"stream finished";if(!this.ondata)throw"no stream handler";this.d=t,this.p(e,t||!1)},e}(),Ae=function(){return function(e,t){he([te,function(){return[le,Me]}],this,xe.call(this,e,t),(function(e){var t=new Me(e.data);onmessage=le(t)}),6)}}();function ke(e,t,n){if(n||(n=t,t={}),"function"!=typeof n)throw"no callback";return ce(e,t,[te],(function(e){return se(Te(e.data[0],e.data[1]))}),0,n)}function Te(e,t){return Q(e,t||{},0,0)}var Ie=function(){function e(e){this.s={},this.p=new s(0),this.ondata=e}return e.prototype.e=function(e){if(this.d)throw"stream finished";if(!this.ondata)throw"no stream handler";var t=this.p.length,n=new s(t+e.length);n.set(this.p),n.set(e,t),this.p=n},e.prototype.c=function(e){this.d=this.s.i=e||!1;var t=this.s.b,n=_(this.p,this.o,this.s);this.ondata(F(n,t,this.s.b),this.d),this.o=F(n,this.s.b-32768),this.s.b=this.o.length,this.p=F(this.p,this.s.p/8|0),this.s.p&=7},e.prototype.push=function(e,t){this.e(e),this.c(t)},e}(),Ne=function(){return function(e){this.ondata=e,he([ee,function(){return[le,Ie]}],this,0,(function(){var e=new Ie;onmessage=le(e)}),7)}}();function Ee(e,t,n){if(n||(n=t,t={}),"function"!=typeof n)throw"no callback";return ce(e,t,[ee],(function(e){return se(Ce(e.data[0],ae(e.data[1])))}),1,n)}function Ce(e,t){return _(e,t)}var Pe=function(){function e(e,t){this.c=W(),this.l=0,this.v=1,Me.call(this,e,t)}return e.prototype.push=function(e,t){Me.prototype.push.call(this,e,t)},e.prototype.p=function(e,t){this.c.p(e),this.l+=e.length;var n=Q(e,this.o,this.v&&ve(this.o),t&&8,!t);this.v&&(me(n,this.o),this.v=0),t&&(fe(n,n.length-8,this.c.d()),fe(n,n.length-4,this.l)),this.ondata(n,t)},e}(),Se=function(){return function(e,t){he([te,ne,function(){return[le,Me,Pe]}],this,xe.call(this,e,t),(function(e){var t=new Pe(e.data);onmessage=le(t)}),8)}}();function Le(e,t,n){if(n||(n=t,t={}),"function"!=typeof n)throw"no callback";return ce(e,t,[te,ne,function(){return[Fe]}],(function(e){return se(Fe(e.data[0],e.data[1]))}),2,n)}function Fe(e,t){t||(t={});var n=W(),r=e.length;n.p(e);var o=Q(e,t,ve(t),8),i=o.length;return me(o,t),fe(o,i-8,n.d()),fe(o,i-4,r),o}var _e=function(){function e(e){this.v=1,Ie.call(this,e)}return e.prototype.push=function(e,t){if(Ie.prototype.e.call(this,e),this.v){var n=this.p.length>3?ge(this.p):4;if(n>=this.p.length&&!t)return;this.p=this.p.subarray(n),this.v=0}if(t){if(this.p.length<8)throw"invalid gzip stream";this.p=this.p.subarray(0,-8)}Ie.prototype.c.call(this,t)},e}(),Re=function(){return function(e){this.ondata=e,he([ee,re,function(){return[le,Ie,_e]}],this,0,(function(){var e=new _e;onmessage=le(e)}),9)}}();function Oe(e,t,n){if(n||(n=t,t={}),"function"!=typeof n)throw"no callback";return ce(e,t,[ee,re,function(){return[De]}],(function(e){return se(De(e.data[0]))}),3,n)}function De(e,t){return _(e.subarray(ge(e),-8),t||new s(ye(e)))}var Be=function(){function e(e,t){this.c=Z(),this.v=1,Me.call(this,e,t)}return e.prototype.push=function(e,t){Me.prototype.push.call(this,e,t)},e.prototype.p=function(e,t){this.c.p(e);var n=Q(e,this.o,this.v&&2,t&&4,!t);this.v&&(we(n,this.o),this.v=0),t&&fe(n,n.length-4,this.c.d()),this.ondata(n,t)},e}(),je=function(){return function(e,t){he([te,oe,function(){return[le,Me,Be]}],this,xe.call(this,e,t),(function(e){var t=new Be(e.data);onmessage=le(t)}),10)}}();function ze(e,t,n){if(n||(n=t,t={}),"function"!=typeof n)throw"no callback";return ce(e,t,[te,oe,function(){return[Ve]}],(function(e){return se(Ve(e.data[0],e.data[1]))}),4,n)}function Ve(e,t){t||(t={});var n=Z();n.p(e);var r=Q(e,t,2,4);return we(r,t),fe(r,r.length-4,n.d()),r}var Ue=function(){function e(e){this.v=1,Ie.call(this,e)}return e.prototype.push=function(e,t){if(Ie.prototype.e.call(this,e),this.v){if(this.p.length<2&&!t)return;this.p=this.p.subarray(2),this.v=0}if(t){if(this.p.length<4)throw"invalid zlib stream";this.p=this.p.subarray(0,-4)}Ie.prototype.c.call(this,t)},e}(),Ge=function(){return function(e){this.ondata=e,he([ee,ie,function(){return[le,Ie,Ue]}],this,0,(function(){var e=new Ue;onmessage=le(e)}),11)}}();function Xe(e,t,n){if(n||(n=t,t={}),"function"!=typeof n)throw"no callback";return ce(e,t,[ee,ie,function(){return[He]}],(function(e){return se(He(e.data[0],ae(e.data[1])))}),5,n)}function He(e,t){return _((be(e),e.subarray(2,-4)),t)}var qe=function(){function e(e){this.G=_e,this.I=Ie,this.Z=Ue,this.ondata=e}return e.prototype.push=function(e,t){if(!this.ondata)throw"no stream handler";if(this.s)this.s.push(e,t);else{if(this.p&&this.p.length){var n=new s(this.p.length+e.length);n.set(this.p),n.set(e,this.p.length)}else this.p=e;if(this.p.length>2){var r=this,o=function(){r.ondata.apply(r,arguments)};this.s=31==this.p[0]&&139==this.p[1]&&8==this.p[2]?new this.G(o):8!=(15&this.p[0])||this.p[0]>>4>7||(this.p[0]<<8|this.p[1])%31?new this.I(o):new this.Z(o),this.s.push(this.p,t),this.p=null}}},e}(),We=function(){function e(e){this.G=Re,this.I=Ne,this.Z=Ge,this.ondata=e}return e.prototype.push=function(e,t){qe.prototype.push.call(this,e,t)},e}();function Ze(e,t,n){if(n||(n=t,t={}),"function"!=typeof n)throw"no callback";return 31==e[0]&&139==e[1]&&8==e[2]?Oe(e,t,n):8!=(15&e[0])||e[0]>>4>7||(e[0]<<8|e[1])%31?Ee(e,t,n):Xe(e,t,n)}function Qe(e,t){return 31==e[0]&&139==e[1]&&8==e[2]?De(e,t):8!=(15&e[0])||e[0]>>4>7||(e[0]<<8|e[1])%31?Ce(e,t):He(e,t)}var Ye=function(e,t,n,r){for(var o in e){var i=e[o],a=t+o;i instanceof s?n[a]=[i,r]:Array.isArray(i)?n[a]=[i[0],Y(r,i[1])]:Ye(i,a+"/",n,r)}},Ke="undefined"!=typeof TextEncoder&&new TextEncoder,Je="undefined"!=typeof TextDecoder&&new TextDecoder,$e=0;try{Je.decode(X,{stream:!0}),$e=1}catch(e){}var et=function(e){for(var t="",n=0;;){var r=e[n++],o=(r>127)+(r>223)+(r>239);if(n+o>e.length)return[t,F(e,n-1)];o?3==o?(r=((15&r)<<18|(63&e[n++])<<12|(63&e[n++])<<6|63&e[n++])-65536,t+=String.fromCharCode(55296|r>>10,56320|1023&r)):t+=1&o?String.fromCharCode((31&r)<<6|63&e[n++]):String.fromCharCode((15&r)<<12|(63&e[n++])<<6|63&e[n++]):t+=String.fromCharCode(r)}},tt=function(){function e(e){this.ondata=e,$e?this.t=new TextDecoder:this.p=X}return e.prototype.push=function(e,t){if(!this.ondata)throw"no callback";if(t=!!t,this.t){if(this.ondata(this.t.decode(e,{stream:!0}),t),t){if(this.t.decode().length)throw"invalid utf-8 data";this.t=null}}else{if(!this.p)throw"stream finished";var n=new s(this.p.length+e.length);n.set(this.p),n.set(e,this.p.length);var r=et(n),o=r[0],i=r[1];if(t){if(i.length)throw"invalid utf-8 data";this.p=null}else this.p=i;this.ondata(o,t)}},e}(),nt=function(){function e(e){this.ondata=e}return e.prototype.push=function(e,t){if(!this.ondata)throw"no callback";if(this.d)throw"stream finished";this.ondata(rt(e),this.d=t||!1)},e}();function rt(e,t){if(t){for(var n=new s(e.length),r=0;r<e.length;++r)n[r]=e.charCodeAt(r);return n}if(Ke)return Ke.encode(e);var o=e.length,i=new s(e.length+(e.length>>1)),a=0,c=function(e){i[a++]=e};for(r=0;r<o;++r){if(a+5>i.length){var l=new s(a+8+(o-r<<1));l.set(i),i=l}var h=e.charCodeAt(r);h<128||t?c(h):h<2048?(c(192|h>>6),c(128|63&h)):h>55295&&h<57344?(c(240|(h=65536+(1047552&h)|1023&e.charCodeAt(++r))>>18),c(128|h>>12&63),c(128|h>>6&63),c(128|63&h)):(c(224|h>>12),c(128|h>>6&63),c(128|63&h))}return F(i,0,a)}function ot(e,t){if(t){for(var n="",r=0;r<e.length;r+=16384)n+=String.fromCharCode.apply(null,e.subarray(r,r+16384));return n}if(Je)return Je.decode(e);var o=et(e),i=o[0];if(o[1].length)throw"invalid utf-8 data";return i}var it=function(e){return 1==e?3:e<6?2:9==e?1:0},st=function(e,t){return t+30+ue(e,t+26)+ue(e,t+28)},at=function(e,t,n){var r=ue(e,t+28),o=ot(e.subarray(t+46,t+46+r),!(2048&ue(e,t+8))),i=t+46+r,s=pe(e,t+20),a=n&&4294967295==s?ct(e,i):[s,pe(e,t+24),pe(e,t+42)],c=a[0],l=a[1],h=a[2];return[ue(e,t+10),c,l,o,i+ue(e,t+30)+ue(e,t+32),h]},ct=function(e,t){for(;1!=ue(e,t);t+=4+ue(e,t+2));return[de(e,t+12),de(e,t+4),de(e,t+20)]},lt=function(e){var t=0;if(e)for(var n in e){var r=e[n].length;if(r>65535)throw"extra field too long";t+=r+4}return t},ht=function(e,t,n,r,o,i,s,a){var c=r.length,l=n.extra,h=a&&a.length,u=lt(l);fe(e,t,null!=s?33639248:67324752),t+=4,null!=s&&(e[t++]=20,e[t++]=n.os),e[t]=20,t+=2,e[t++]=n.flag<<1|(null==i&&8),e[t++]=o&&8,e[t++]=255&n.compression,e[t++]=n.compression>>8;var p=new Date(null==n.mtime?Date.now():n.mtime),d=p.getFullYear()-1980;if(d<0||d>119)throw"date not in range 1980-2099";if(fe(e,t,d<<25|p.getMonth()+1<<21|p.getDate()<<16|p.getHours()<<11|p.getMinutes()<<5|p.getSeconds()>>>1),t+=4,null!=i&&(fe(e,t,n.crc),fe(e,t+4,i),fe(e,t+8,n.size)),fe(e,t+12,c),fe(e,t+14,u),t+=16,null!=s&&(fe(e,t,h),fe(e,t+6,n.attrs),fe(e,t+10,s),t+=14),e.set(r,t),t+=c,u)for(var f in l){var m=l[f],g=m.length;fe(e,t,+f),fe(e,t+2,g),e.set(m,t+4),t+=4+g}return h&&(e.set(a,t),t+=h),t},ut=function(e,t,n,r,o){fe(e,t,101010256),fe(e,t+8,n),fe(e,t+10,n),fe(e,t+12,r),fe(e,t+16,o)},pt=function(){function e(e){this.filename=e,this.c=W(),this.size=0,this.compression=0}return e.prototype.process=function(e,t){this.ondata(null,e,t)},e.prototype.push=function(e,t){if(!this.ondata)throw"no callback - add to ZIP archive before pushing";this.c.p(e),this.size+=e.length,t&&(this.crc=this.c.d()),this.process(e,t||!1)},e}(),dt=function(){function e(e,t){var n=this;t||(t={}),pt.call(this,e),this.d=new Me(t,(function(e,t){n.ondata(null,e,t)})),this.compression=8,this.flag=it(t.level)}return e.prototype.process=function(e,t){try{this.d.push(e,t)}catch(e){this.ondata(e,null,t)}},e.prototype.push=function(e,t){pt.prototype.push.call(this,e,t)},e}(),ft=function(){function e(e,t){var n=this;t||(t={}),pt.call(this,e),this.d=new Ae(t,(function(e,t,r){n.ondata(e,t,r)})),this.compression=8,this.flag=it(t.level),this.terminate=this.d.terminate}return e.prototype.process=function(e,t){this.d.push(e,t)},e.prototype.push=function(e,t){pt.prototype.push.call(this,e,t)},e}(),mt=function(){function e(e){this.ondata=e,this.u=[],this.d=1}return e.prototype.add=function(e){var t=this;if(2&this.d)throw"stream finished";var n=rt(e.filename),r=n.length,o=e.comment,i=o&&rt(o),a=r!=e.filename.length||i&&o.length!=i.length,c=r+lt(e.extra)+30;if(r>65535)throw"filename too long";var l=new s(c);ht(l,0,e,n,a);var h=[l],u=function(){for(var e=0,n=h;e<n.length;e++){var r=n[e];t.ondata(null,r,!1)}h=[]},p=this.d;this.d=0;var d=this.u.length,f=Y(e,{f:n,u:a,o:i,t:function(){e.terminate&&e.terminate()},r:function(){if(u(),p){var e=t.u[d+1];e?e.r():t.d=1}p=1}}),m=0;e.ondata=function(n,r,o){if(n)t.ondata(n,r,o),t.terminate();else if(m+=r.length,h.push(r),o){var i=new s(16);fe(i,0,134695760),fe(i,4,e.crc),fe(i,8,m),fe(i,12,e.size),h.push(i),f.c=m,f.b=c+m+16,f.crc=e.crc,f.size=e.size,p&&f.r(),p=1}else p&&u()},this.u.push(f)},e.prototype.end=function(){var e=this;if(2&this.d){if(1&this.d)throw"stream finishing";throw"stream finished"}this.d?this.e():this.u.push({r:function(){1&e.d&&(e.u.splice(-1,1),e.e())},t:function(){}}),this.d=3},e.prototype.e=function(){for(var e=0,t=0,n=0,r=0,o=this.u;r<o.length;r++){n+=46+(l=o[r]).f.length+lt(l.extra)+(l.o?l.o.length:0)}for(var i=new s(n+22),a=0,c=this.u;a<c.length;a++){var l=c[a];ht(i,e,l,l.f,l.u,l.c,t,l.o),e+=46+l.f.length+lt(l.extra)+(l.o?l.o.length:0),t+=l.b}ut(i,e,this.u.length,n,t),this.ondata(null,i,!0),this.d=2},e.prototype.terminate=function(){for(var e=0,t=this.u;e<t.length;e++){t[e].t()}this.d=2},e}();function gt(e,t,n){if(n||(n=t,t={}),"function"!=typeof n)throw"no callback";var r={};Ye(e,"",r,t);var o=Object.keys(r),i=o.length,a=0,c=0,l=i,h=new Array(i),u=[],p=function(){for(var e=0;e<u.length;++e)u[e]()},d=function(){var e=new s(c+22),t=a,r=c-a;c=0;for(var o=0;o<l;++o){var i=h[o];try{var u=i.c.length;ht(e,c,i,i.f,i.u,u);var p=30+i.f.length+lt(i.extra),d=c+p;e.set(i.c,d),ht(e,a,i,i.f,i.u,u,c,i.m),a+=16+p+(i.m?i.m.length:0),c=d+u}catch(e){return n(e,null)}}ut(e,a,h.length,r,t),n(null,e)};i||d();for(var f=function(e){var t=o[e],s=r[t],l=s[0],f=s[1],m=W(),g=l.length;m.p(l);var y=rt(t),v=y.length,w=f.comment,b=w&&rt(w),x=b&&b.length,M=lt(f.extra),A=0==f.level?0:8,k=function(r,o){if(r)p(),n(r,null);else{var s=o.length;h[e]=Y(f,{size:g,crc:m.d(),c:o,f:y,m:b,u:v!=t.length||b&&w.length!=x,compression:A}),a+=30+v+M+s,c+=76+2*(v+M)+(x||0)+s,--i||d()}};if(v>65535&&k("filename too long",null),A)if(g<16e4)try{k(null,Te(l,f))}catch(e){k(e,null)}else u.push(ke(l,f,k));else k(null,l)},m=0;m<l;++m)f(m);return p}function yt(e,t){t||(t={});var n={},r=[];Ye(e,"",n,t);var o=0,i=0;for(var a in n){var c=n[a],l=c[0],h=c[1],u=0==h.level?0:8,p=(k=rt(a)).length,d=h.comment,f=d&&rt(d),m=f&&f.length,g=lt(h.extra);if(p>65535)throw"filename too long";var y=u?Te(l,h):l,v=y.length,w=W();w.p(l),r.push(Y(h,{size:l.length,crc:w.d(),c:y,f:k,m:f,u:p!=a.length||f&&d.length!=m,o:o,compression:u})),o+=30+p+g+v,i+=76+2*(p+g)+(m||0)+v}for(var b=new s(i+22),x=o,M=i-o,A=0;A<r.length;++A){var k=r[A];ht(b,k.o,k,k.f,k.u,k.c.length);var T=30+k.f.length+lt(k.extra);b.set(k.c,k.o+T),ht(b,o,k,k.f,k.u,k.c.length,k.o,k.m),o+=16+T+(k.m?k.m.length:0)}return ut(b,o,r.length,M,x),b}var vt=function(){function e(){}return e.prototype.push=function(e,t){this.ondata(null,e,t)},e.compression=0,e}(),wt=function(){function e(){var e=this;this.i=new Ie((function(t,n){e.ondata(null,t,n)}))}return e.prototype.push=function(e,t){try{this.i.push(e,t)}catch(n){this.ondata(n,e,t)}},e.compression=8,e}(),bt=function(){function e(e,t){var n=this;t<32e4?this.i=new Ie((function(e,t){n.ondata(null,e,t)})):(this.i=new Ne((function(e,t,r){n.ondata(e,t,r)})),this.terminate=this.i.terminate)}return e.prototype.push=function(e,t){this.i.terminate&&(e=F(e,0)),this.i.push(e,t)},e.compression=8,e}(),xt=function(){function e(e){this.onfile=e,this.k=[],this.o={0:vt},this.p=X}return e.prototype.push=function(e,t){var n=this;if(!this.onfile)throw"no callback";if(!this.p)throw"stream finished";if(this.c>0){var r=Math.min(this.c,e.length),o=e.subarray(0,r);if(this.c-=r,this.d?this.d.push(o,!this.c):this.k[0].push(o),(e=e.subarray(r)).length)return this.push(e,t)}else{var i=0,a=0,c=void 0,l=void 0;this.p.length?e.length?((l=new s(this.p.length+e.length)).set(this.p),l.set(e,this.p.length)):l=this.p:l=e;for(var h=l.length,u=this.c,p=u&&this.d,d=function(){var e,t=pe(l,a);if(67324752==t){i=1,c=a,f.d=null,f.c=0;var r=ue(l,a+6),o=ue(l,a+8),s=2048&r,p=8&r,d=ue(l,a+26),m=ue(l,a+28);if(h>a+30+d+m){var g=[];f.k.unshift(g),i=2;var y,v=pe(l,a+18),w=pe(l,a+22),b=ot(l.subarray(a+30,a+=30+d),!s);4294967295==v?(e=p?[-2]:ct(l,a),v=e[0],w=e[1]):p&&(v=-1),a+=m,f.c=v;var x={name:b,compression:o,start:function(){if(!x.ondata)throw"no callback";if(v){var e=n.o[o];if(!e)throw"unknown compression type "+o;(y=v<0?new e(b):new e(b,v,w)).ondata=function(e,t,n){x.ondata(e,t,n)};for(var t=0,r=g;t<r.length;t++){var i=r[t];y.push(i,!1)}n.k[0]==g&&n.c?n.d=y:y.push(X,!0)}else x.ondata(null,X,!0)},terminate:function(){y&&y.terminate&&y.terminate()}};v>=0&&(x.size=v,x.originalSize=w),f.onfile(x)}return"break"}if(u){if(134695760==t)return c=a+=12+(-2==u&&8),i=3,f.c=0,"break";if(33639248==t)return c=a-=4,i=3,f.c=0,"break"}},f=this;a<h-4;++a){if("break"===d())break}if(this.p=X,u<0){var m=i?l.subarray(0,c-12-(-2==u&&8)-(134695760==pe(l,c-16)&&4)):l.subarray(0,a);p?p.push(m,!!i):this.k[+(2==i)].push(m)}if(2&i)return this.push(l.subarray(a),t);this.p=l.subarray(a)}if(t){if(this.c)throw"invalid zip file";this.p=null}},e.prototype.register=function(e){this.o[e.compression]=e},e}();function Mt(e,t){if("function"!=typeof t)throw"no callback";for(var n=[],r=function(){for(var e=0;e<n.length;++e)n[e]()},o={},i=e.length-22;101010256!=pe(e,i);--i)if(!i||e.length-i>65558)return void t("invalid zip file",null);var a=ue(e,i+8);a||t(null,{});var c=a,l=pe(e,i+16),h=4294967295==l;if(h){if(i=pe(e,i-12),101075792!=pe(e,i))return void t("invalid zip file",null);c=a=pe(e,i+32),l=pe(e,i+48)}for(var u=function(i){var c=at(e,l,h),u=c[0],p=c[1],d=c[2],f=c[3],m=c[4],g=c[5],y=st(e,g);l=m;var v=function(e,n){e?(r(),t(e,null)):(o[f]=n,--a||t(null,o))};if(u)if(8==u){var w=e.subarray(y,y+p);if(p<32e4)try{v(null,Ce(w,new s(d)))}catch(e){v(e,null)}else n.push(Ee(w,{size:d},v))}else v("unknown compression type "+u,null);else v(null,F(e,y,y+p))},p=0;p<c;++p)u();return r}function At(e){for(var t={},n=e.length-22;101010256!=pe(e,n);--n)if(!n||e.length-n>65558)throw"invalid zip file";var r=ue(e,n+8);if(!r)return{};var o=pe(e,n+16),i=4294967295==o;if(i){if(n=pe(e,n-12),101075792!=pe(e,n))throw"invalid zip file";r=pe(e,n+32),o=pe(e,n+48)}for(var a=0;a<r;++a){var c=at(e,o,i),l=c[0],h=c[1],u=c[2],p=c[3],d=c[4],f=c[5],m=st(e,f);if(o=d,l){if(8!=l)throw"unknown compression type "+l;t[p]=Ce(e.subarray(m,m+h),new s(u))}else t[p]=F(e,m,m+h)}return t}},69706:(e,t,n)=>{n.r(t),n.d(t,{ColladaLoader:()=>i});var r=n(81396),o=n(20650);class i extends r.Loader{constructor(e){super(e)}load(e,t,n,o){const i=this,s=""===i.path?r.LoaderUtils.extractUrlBase(e):i.path,a=new r.FileLoader(i.manager);a.setPath(i.path),a.setRequestHeader(i.requestHeader),a.setWithCredentials(i.withCredentials),a.load(e,(function(n){try{t(i.parse(n,s))}catch(t){o?o(t):console.error(t),i.manager.itemError(e)}}),n,o)}parse(e,t){function n(e,t){const n=[],r=e.childNodes;for(let e=0,o=r.length;e<o;e++){const o=r[e];o.nodeName===t&&n.push(o)}return n}function i(e){if(0===e.length)return[];const t=e.trim().split(/\s+/),n=new Array(t.length);for(let e=0,r=t.length;e<r;e++)n[e]=t[e];return n}function s(e){if(0===e.length)return[];const t=e.trim().split(/\s+/),n=new Array(t.length);for(let e=0,r=t.length;e<r;e++)n[e]=parseFloat(t[e]);return n}function a(e){if(0===e.length)return[];const t=e.trim().split(/\s+/),n=new Array(t.length);for(let e=0,r=t.length;e<r;e++)n[e]=parseInt(t[e]);return n}function c(e){return e.substring(1)}function l(e){return 0===Object.keys(e).length}function h(e){return void 0!==e&&!0===e.hasAttribute("meter")?parseFloat(e.getAttribute("meter")):1}function u(e){return void 0!==e?e.textContent:"Y_UP"}function p(e,t,r,o){const i=n(e,t)[0];if(void 0!==i){const e=n(i,r);for(let t=0;t<e.length;t++)o(e[t])}}function d(e,t){for(const n in e){e[n].build=t(e[n])}}function f(e,t){return void 0!==e.build||(e.build=t(e)),e.build}function m(e){const t={inputs:{}};for(let n=0,r=e.childNodes.length;n<r;n++){const r=e.childNodes[n];if(1===r.nodeType)switch(r.nodeName){case"input":const e=c(r.getAttribute("source")),n=r.getAttribute("semantic");t.inputs[n]=e}}return t}function g(e){const t={};let n=e.getAttribute("target").split("/");const r=n.shift();let o=n.shift();const i=-1!==o.indexOf("("),s=-1!==o.indexOf(".");if(s)n=o.split("."),o=n.shift(),t.member=n.shift();else if(i){const e=o.split("(");o=e.shift();for(let t=0;t<e.length;t++)e[t]=parseInt(e[t].replace(/\)/,""));t.indices=e}return t.id=r,t.sid=o,t.arraySyntax=i,t.memberSyntax=s,t.sampler=c(e.getAttribute("source")),t}function y(e){const t=[],n=e.channels,r=e.samplers,o=e.sources;for(const e in n)if(n.hasOwnProperty(e)){const i=n[e],s=r[i.sampler],a=s.inputs.INPUT,c=s.inputs.OUTPUT;A(w(i,o[a],o[c]),t)}return t}function v(e){return f(Je.animations[e],y)}function w(e,t,n){const r=Je.nodes[e.id],o=Be(r.id),i=r.transforms[e.sid],s=r.matrix.clone().transpose();let a,c,l,h,u,p;const d={};switch(i){case"matrix":for(l=0,h=t.array.length;l<h;l++)if(a=t.array[l],c=l*n.stride,void 0===d[a]&&(d[a]={}),!0===e.arraySyntax){const t=n.array[c],r=e.indices[0]+4*e.indices[1];d[a][r]=t}else for(u=0,p=n.stride;u<p;u++)d[a][u]=n.array[c+u];break;case"translate":case"rotate":case"scale":console.warn('THREE.ColladaLoader: Animation transform type "%s" not yet implemented.',i)}const f=function(e,t){const n=[];for(const t in e)n.push({time:parseFloat(t),value:e[t]});n.sort(r);for(let e=0;e<16;e++)k(n,e,t.elements[e]);return n;function r(e,t){return e.time-t.time}}(d,s);return{name:o.uuid,keyframes:f}}const b=new r.Vector3,x=new r.Vector3,M=new r.Quaternion;function A(e,t){const n=e.keyframes,o=e.name,i=[],s=[],a=[],c=[];for(let e=0,t=n.length;e<t;e++){const t=n[e],r=t.time,o=t.value;Ne.fromArray(o).transpose(),Ne.decompose(b,M,x),i.push(r),s.push(b.x,b.y,b.z),a.push(M.x,M.y,M.z,M.w),c.push(x.x,x.y,x.z)}return s.length>0&&t.push(new r.VectorKeyframeTrack(o+".position",i,s)),a.length>0&&t.push(new r.QuaternionKeyframeTrack(o+".quaternion",i,a)),c.length>0&&t.push(new r.VectorKeyframeTrack(o+".scale",i,c)),t}function k(e,t,n){let r,o,i,s=!0;for(o=0,i=e.length;o<i;o++)r=e[o],void 0===r.value[t]?r.value[t]=null:s=!1;if(!0===s)for(o=0,i=e.length;o<i;o++)r=e[o],r.value[t]=n;else!function(e,t){let n,r;for(let o=0,i=e.length;o<i;o++){const i=e[o];if(null===i.value[t]){if(n=T(e,o,t),r=I(e,o,t),null===n){i.value[t]=r.value[t];continue}if(null===r){i.value[t]=n.value[t];continue}N(i,n,r,t)}}}(e,t)}function T(e,t,n){for(;t>=0;){const r=e[t];if(null!==r.value[n])return r;t--}return null}function I(e,t,n){for(;t<e.length;){const r=e[t];if(null!==r.value[n])return r;t++}return null}function N(e,t,n,r){n.time-t.time!=0?e.value[r]=(e.time-t.time)*(n.value[r]-t.value[r])/(n.time-t.time)+t.value[r]:e.value[r]=t.value[r]}function E(e){const t=[],n=e.name,o=e.end-e.start||-1,i=e.animations;for(let e=0,n=i.length;e<n;e++){const n=v(i[e]);for(let e=0,r=n.length;e<r;e++)t.push(n[e])}return new r.AnimationClip(n,o,t)}function C(e){return f(Je.clips[e],E)}function P(e){const t={sources:{}};for(let n=0,r=e.childNodes.length;n<r;n++){const r=e.childNodes[n];if(1===r.nodeType)switch(r.nodeName){case"bind_shape_matrix":t.bindShapeMatrix=s(r.textContent);break;case"source":const e=r.getAttribute("id");t.sources[e]=ae(r);break;case"joints":t.joints=S(r);break;case"vertex_weights":t.vertexWeights=L(r)}}return t}function S(e){const t={inputs:{}};for(let n=0,r=e.childNodes.length;n<r;n++){const r=e.childNodes[n];if(1===r.nodeType)switch(r.nodeName){case"input":const e=r.getAttribute("semantic"),n=c(r.getAttribute("source"));t.inputs[e]=n}}return t}function L(e){const t={inputs:{}};for(let n=0,r=e.childNodes.length;n<r;n++){const r=e.childNodes[n];if(1===r.nodeType)switch(r.nodeName){case"input":const e=r.getAttribute("semantic"),n=c(r.getAttribute("source")),o=parseInt(r.getAttribute("offset"));t.inputs[e]={id:n,offset:o};break;case"vcount":t.vcount=a(r.textContent);break;case"v":t.v=a(r.textContent)}}return t}function F(e){const t={id:e.id},n=Je.geometries[t.id];return void 0!==e.skin&&(t.skin=function(e){const t=4,n={joints:[],indices:{array:[],stride:t},weights:{array:[],stride:t}},o=e.sources,i=e.vertexWeights,s=i.vcount,a=i.v,c=i.inputs.JOINT.offset,l=i.inputs.WEIGHT.offset,h=e.sources[e.joints.inputs.JOINT],u=e.sources[e.joints.inputs.INV_BIND_MATRIX],p=o[i.inputs.WEIGHT.id].array;let d,f,m,g=0;for(d=0,m=s.length;d<m;d++){const e=s[d],r=[];for(f=0;f<e;f++){const e=a[g+c],t=p[a[g+l]];r.push({index:e,weight:t}),g+=2}for(r.sort(y),f=0;f<t;f++){const e=r[f];void 0!==e?(n.indices.array.push(e.index),n.weights.array.push(e.weight)):(n.indices.array.push(0),n.weights.array.push(0))}}e.bindShapeMatrix?n.bindMatrix=(new r.Matrix4).fromArray(e.bindShapeMatrix).transpose():n.bindMatrix=(new r.Matrix4).identity();for(d=0,m=h.array.length;d<m;d++){const e=h.array[d],t=(new r.Matrix4).fromArray(u.array,d*u.stride).transpose();n.joints.push({name:e,boneInverse:t})}return n;function y(e,t){return t.weight-e.weight}}(e.skin),n.sources.skinIndices=t.skin.indices,n.sources.skinWeights=t.skin.weights),t}function _(e){return void 0!==e.build?e.build:e.init_from}function R(e){const t=Je.images[e];return void 0!==t?f(t,_):(console.warn("THREE.ColladaLoader: Couldn't find image with ID:",e),null)}function O(e){const t={surfaces:{},samplers:{}};for(let n=0,r=e.childNodes.length;n<r;n++){const r=e.childNodes[n];if(1===r.nodeType)switch(r.nodeName){case"newparam":D(r,t);break;case"technique":t.technique=z(r);break;case"extra":t.extra=q(r)}}return t}function D(e,t){const n=e.getAttribute("sid");for(let r=0,o=e.childNodes.length;r<o;r++){const o=e.childNodes[r];if(1===o.nodeType)switch(o.nodeName){case"surface":t.surfaces[n]=B(o);break;case"sampler2D":t.samplers[n]=j(o)}}}function B(e){const t={};for(let n=0,r=e.childNodes.length;n<r;n++){const r=e.childNodes[n];if(1===r.nodeType)switch(r.nodeName){case"init_from":t.init_from=r.textContent}}return t}function j(e){const t={};for(let n=0,r=e.childNodes.length;n<r;n++){const r=e.childNodes[n];if(1===r.nodeType)switch(r.nodeName){case"source":t.source=r.textContent}}return t}function z(e){const t={};for(let n=0,r=e.childNodes.length;n<r;n++){const r=e.childNodes[n];if(1===r.nodeType)switch(r.nodeName){case"constant":case"lambert":case"blinn":case"phong":t.type=r.nodeName,t.parameters=V(r);break;case"extra":t.extra=q(r)}}return t}function V(e){const t={};for(let n=0,r=e.childNodes.length;n<r;n++){const r=e.childNodes[n];if(1===r.nodeType)switch(r.nodeName){case"emission":case"diffuse":case"specular":case"bump":case"ambient":case"shininess":case"transparency":t[r.nodeName]=U(r);break;case"transparent":t[r.nodeName]={opaque:r.hasAttribute("opaque")?r.getAttribute("opaque"):"A_ONE",data:U(r)}}}return t}function U(e){const t={};for(let n=0,r=e.childNodes.length;n<r;n++){const r=e.childNodes[n];if(1===r.nodeType)switch(r.nodeName){case"color":t[r.nodeName]=s(r.textContent);break;case"float":t[r.nodeName]=parseFloat(r.textContent);break;case"texture":t[r.nodeName]={id:r.getAttribute("texture"),extra:G(r)}}}return t}function G(e){const t={technique:{}};for(let n=0,r=e.childNodes.length;n<r;n++){const r=e.childNodes[n];if(1===r.nodeType)switch(r.nodeName){case"extra":X(r,t)}}return t}function X(e,t){for(let n=0,r=e.childNodes.length;n<r;n++){const r=e.childNodes[n];if(1===r.nodeType)switch(r.nodeName){case"technique":H(r,t)}}}function H(e,t){for(let n=0,r=e.childNodes.length;n<r;n++){const r=e.childNodes[n];if(1===r.nodeType)switch(r.nodeName){case"repeatU":case"repeatV":case"offsetU":case"offsetV":t.technique[r.nodeName]=parseFloat(r.textContent);break;case"wrapU":case"wrapV":"TRUE"===r.textContent.toUpperCase()?t.technique[r.nodeName]=1:"FALSE"===r.textContent.toUpperCase()?t.technique[r.nodeName]=0:t.technique[r.nodeName]=parseInt(r.textContent);break;case"bump":t[r.nodeName]=Z(r)}}}function q(e){const t={};for(let n=0,r=e.childNodes.length;n<r;n++){const r=e.childNodes[n];if(1===r.nodeType)switch(r.nodeName){case"technique":t.technique=W(r)}}return t}function W(e){const t={};for(let n=0,r=e.childNodes.length;n<r;n++){const r=e.childNodes[n];if(1===r.nodeType)switch(r.nodeName){case"double_sided":t[r.nodeName]=parseInt(r.textContent);break;case"bump":t[r.nodeName]=Z(r)}}return t}function Z(e){const t={};for(let n=0,r=e.childNodes.length;n<r;n++){const r=e.childNodes[n];if(1===r.nodeType)switch(r.nodeName){case"texture":t[r.nodeName]={id:r.getAttribute("texture"),texcoord:r.getAttribute("texcoord"),extra:G(r)}}}return t}function Q(e){return e}function Y(e){const t=(n=e.url,f(Je.effects[n],Q));var n;const o=t.profile.technique;let i;switch(o.type){case"phong":case"blinn":i=new r.MeshPhongMaterial;break;case"lambert":i=new r.MeshLambertMaterial;break;default:i=new r.MeshBasicMaterial}function s(e,n=null){const o=t.profile.samplers[e.id];let i=null;if(void 0!==o){i=R(t.profile.surfaces[o.source].init_from)}else console.warn("THREE.ColladaLoader: Undefined sampler. Access image directly (see #12530)."),i=R(e.id);if(null!==i){const t=function(e){let t,n=e.slice(2+(e.lastIndexOf(".")-1>>>0));switch(n=n.toLowerCase(),n){case"tga":t=We;break;default:t=qe}return t}(i);if(void 0!==t){const o=t.load(i),s=e.extra;if(void 0!==s&&void 0!==s.technique&&!1===l(s.technique)){const e=s.technique;o.wrapS=e.wrapU?r.RepeatWrapping:r.ClampToEdgeWrapping,o.wrapT=e.wrapV?r.RepeatWrapping:r.ClampToEdgeWrapping,o.offset.set(e.offsetU||0,e.offsetV||0),o.repeat.set(e.repeatU||1,e.repeatV||1)}else o.wrapS=r.RepeatWrapping,o.wrapT=r.RepeatWrapping;return null!==n&&(o.encoding=n),o}return console.warn("THREE.ColladaLoader: Loader for texture %s not found.",i),null}return console.warn("THREE.ColladaLoader: Couldn't create texture with ID:",e.id),null}i.name=e.name||"";const a=o.parameters;for(const e in a){const t=a[e];switch(e){case"diffuse":t.color&&i.color.fromArray(t.color),t.texture&&(i.map=s(t.texture,r.sRGBEncoding));break;case"specular":t.color&&i.specular&&i.specular.fromArray(t.color),t.texture&&(i.specularMap=s(t.texture));break;case"bump":t.texture&&(i.normalMap=s(t.texture));break;case"ambient":t.texture&&(i.lightMap=s(t.texture,r.sRGBEncoding));break;case"shininess":t.float&&i.shininess&&(i.shininess=t.float);break;case"emission":t.color&&i.emissive&&i.emissive.fromArray(t.color),t.texture&&(i.emissiveMap=s(t.texture,r.sRGBEncoding))}}i.color.convertSRGBToLinear(),i.specular&&i.specular.convertSRGBToLinear(),i.emissive&&i.emissive.convertSRGBToLinear();let c=a.transparent,h=a.transparency;if(void 0===h&&c&&(h={float:1}),void 0===c&&h&&(c={opaque:"A_ONE",data:{color:[1,1,1,1]}}),c&&h)if(c.data.texture)i.transparent=!0;else{const e=c.data.color;switch(c.opaque){case"A_ONE":i.opacity=e[3]*h.float;break;case"RGB_ZERO":i.opacity=1-e[0]*h.float;break;case"A_ZERO":i.opacity=1-e[3]*h.float;break;case"RGB_ONE":i.opacity=e[0]*h.float;break;default:console.warn('THREE.ColladaLoader: Invalid opaque type "%s" of transparent tag.',c.opaque)}i.opacity<1&&(i.transparent=!0)}if(void 0!==o.extra&&void 0!==o.extra.technique){const e=o.extra.technique;for(const t in e){const n=e[t];switch(t){case"double_sided":i.side=1===n?r.DoubleSide:r.FrontSide;break;case"bump":i.normalMap=s(n.texture),i.normalScale=new r.Vector2(1,1)}}}return i}function K(e){return f(Je.materials[e],Y)}function J(e){for(let t=0;t<e.childNodes.length;t++){const n=e.childNodes[t];switch(n.nodeName){case"technique_common":return $(n)}}return{}}function $(e){const t={};for(let n=0;n<e.childNodes.length;n++){const r=e.childNodes[n];switch(r.nodeName){case"perspective":case"orthographic":t.technique=r.nodeName,t.parameters=ee(r)}}return t}function ee(e){const t={};for(let n=0;n<e.childNodes.length;n++){const r=e.childNodes[n];switch(r.nodeName){case"xfov":case"yfov":case"xmag":case"ymag":case"znear":case"zfar":case"aspect_ratio":t[r.nodeName]=parseFloat(r.textContent)}}return t}function te(e){let t;switch(e.optics.technique){case"perspective":t=new r.PerspectiveCamera(e.optics.parameters.yfov,e.optics.parameters.aspect_ratio,e.optics.parameters.znear,e.optics.parameters.zfar);break;case"orthographic":let n=e.optics.parameters.ymag,o=e.optics.parameters.xmag;const i=e.optics.parameters.aspect_ratio;o=void 0===o?n*i:o,n=void 0===n?o/i:n,o*=.5,n*=.5,t=new r.OrthographicCamera(-o,o,n,-n,e.optics.parameters.znear,e.optics.parameters.zfar);break;default:t=new r.PerspectiveCamera}return t.name=e.name||"",t}function ne(e){const t=Je.cameras[e];return void 0!==t?f(t,te):(console.warn("THREE.ColladaLoader: Couldn't find camera with ID:",e),null)}function re(e){const t={};for(let n=0,r=e.childNodes.length;n<r;n++){const r=e.childNodes[n];if(1===r.nodeType)switch(r.nodeName){case"directional":case"point":case"spot":case"ambient":t.technique=r.nodeName,t.parameters=oe(r)}}return t}function oe(e){const t={};for(let n=0,o=e.childNodes.length;n<o;n++){const o=e.childNodes[n];if(1===o.nodeType)switch(o.nodeName){case"color":const e=s(o.textContent);t.color=(new r.Color).fromArray(e).convertSRGBToLinear();break;case"falloff_angle":t.falloffAngle=parseFloat(o.textContent);break;case"quadratic_attenuation":const n=parseFloat(o.textContent);t.distance=n?Math.sqrt(1/n):0}}return t}function ie(e){let t;switch(e.technique){case"directional":t=new r.DirectionalLight;break;case"point":t=new r.PointLight;break;case"spot":t=new r.SpotLight;break;case"ambient":t=new r.AmbientLight}return e.parameters.color&&t.color.copy(e.parameters.color),e.parameters.distance&&(t.distance=e.parameters.distance),t}function se(e){const t=Je.lights[e];return void 0!==t?f(t,ie):(console.warn("THREE.ColladaLoader: Couldn't find light with ID:",e),null)}function ae(e){const t={array:[],stride:3};for(let r=0;r<e.childNodes.length;r++){const o=e.childNodes[r];if(1===o.nodeType)switch(o.nodeName){case"float_array":t.array=s(o.textContent);break;case"Name_array":t.array=i(o.textContent);break;case"technique_common":const e=n(o,"accessor")[0];void 0!==e&&(t.stride=parseInt(e.getAttribute("stride")))}}return t}function ce(e){const t={};for(let n=0;n<e.childNodes.length;n++){const r=e.childNodes[n];1===r.nodeType&&(t[r.getAttribute("semantic")]=c(r.getAttribute("source")))}return t}function le(e){const t={type:e.nodeName,material:e.getAttribute("material"),count:parseInt(e.getAttribute("count")),inputs:{},stride:0,hasUV:!1};for(let n=0,r=e.childNodes.length;n<r;n++){const r=e.childNodes[n];if(1===r.nodeType)switch(r.nodeName){case"input":const e=c(r.getAttribute("source")),n=r.getAttribute("semantic"),o=parseInt(r.getAttribute("offset")),i=parseInt(r.getAttribute("set")),s=i>0?n+i:n;t.inputs[s]={id:e,offset:o},t.stride=Math.max(t.stride,o+1),"TEXCOORD"===n&&(t.hasUV=!0);break;case"vcount":t.vcount=a(r.textContent);break;case"p":t.p=a(r.textContent)}}return t}function he(e){let t=0;for(let n=0,r=e.length;n<r;n++){!0===e[n].hasUV&&t++}t>0&&t<e.length&&(e.uvsNeedsFix=!0)}function ue(e){const t={},n=e.sources,r=e.vertices,o=e.primitives;if(0===o.length)return{};const i=function(e){const t={};for(let n=0;n<e.length;n++){const r=e[n];void 0===t[r.type]&&(t[r.type]=[]),t[r.type].push(r)}return t}(o);for(const e in i){const o=i[e];he(o),t[e]=pe(o,n,r)}return t}function pe(e,t,n){const o={},i={array:[],stride:0},s={array:[],stride:0},a={array:[],stride:0},c={array:[],stride:0},l={array:[],stride:0},h=[],u=4,p=[],d=4,f=new r.BufferGeometry,m=[];let g=0;for(let r=0;r<e.length;r++){const o=e[r],u=o.inputs;let d=0;switch(o.type){case"lines":case"linestrips":d=2*o.count;break;case"triangles":d=3*o.count;break;case"polylist":for(let e=0;e<o.count;e++){const t=o.vcount[e];switch(t){case 3:d+=3;break;case 4:d+=6;break;default:d+=3*(t-2)}}break;default:console.warn("THREE.ColladaLoader: Unknow primitive type:",o.type)}f.addGroup(g,d,r),g+=d,o.material&&m.push(o.material);for(const r in u){const d=u[r];switch(r){case"VERTEX":for(const r in n){const u=n[r];switch(r){case"POSITION":const n=i.array.length;if(de(o,t[u],d.offset,i.array),i.stride=t[u].stride,t.skinWeights&&t.skinIndices&&(de(o,t.skinIndices,d.offset,h),de(o,t.skinWeights,d.offset,p)),!1===o.hasUV&&!0===e.uvsNeedsFix){const e=(i.array.length-n)/i.stride;for(let t=0;t<e;t++)a.array.push(0,0)}break;case"NORMAL":de(o,t[u],d.offset,s.array),s.stride=t[u].stride;break;case"COLOR":de(o,t[u],d.offset,l.array),l.stride=t[u].stride;break;case"TEXCOORD":de(o,t[u],d.offset,a.array),a.stride=t[u].stride;break;case"TEXCOORD1":de(o,t[u],d.offset,c.array),a.stride=t[u].stride;break;default:console.warn('THREE.ColladaLoader: Semantic "%s" not handled in geometry build process.',r)}}break;case"NORMAL":de(o,t[d.id],d.offset,s.array),s.stride=t[d.id].stride;break;case"COLOR":de(o,t[d.id],d.offset,l.array,!0),l.stride=t[d.id].stride;break;case"TEXCOORD":de(o,t[d.id],d.offset,a.array),a.stride=t[d.id].stride;break;case"TEXCOORD1":de(o,t[d.id],d.offset,c.array),c.stride=t[d.id].stride}}}return i.array.length>0&&f.setAttribute("position",new r.Float32BufferAttribute(i.array,i.stride)),s.array.length>0&&f.setAttribute("normal",new r.Float32BufferAttribute(s.array,s.stride)),l.array.length>0&&f.setAttribute("color",new r.Float32BufferAttribute(l.array,l.stride)),a.array.length>0&&f.setAttribute("uv",new r.Float32BufferAttribute(a.array,a.stride)),c.array.length>0&&f.setAttribute("uv2",new r.Float32BufferAttribute(c.array,c.stride)),h.length>0&&f.setAttribute("skinIndex",new r.Float32BufferAttribute(h,u)),p.length>0&&f.setAttribute("skinWeight",new r.Float32BufferAttribute(p,d)),o.data=f,o.type=e[0].type,o.materialKeys=m,o}function de(e,t,n,r,o=!1){const i=e.p,s=e.stride,a=e.vcount;function c(e){let t=i[e+n]*h;const s=t+h;for(;t<s;t++)r.push(l[t]);if(o){const e=r.length-h-1;Ze.setRGB(r[e+0],r[e+1],r[e+2]).convertSRGBToLinear(),r[e+0]=Ze.r,r[e+1]=Ze.g,r[e+2]=Ze.b}}const l=t.array,h=t.stride;if(void 0!==e.vcount){let e=0;for(let t=0,n=a.length;t<n;t++){const n=a[t];if(4===n){const t=e+1*s,n=e+2*s,r=e+3*s;c(e+0*s),c(t),c(r),c(t),c(n),c(r)}else if(3===n){const t=e+1*s,n=e+2*s;c(e+0*s),c(t),c(n)}else if(n>4)for(let t=1,r=n-2;t<=r;t++){const n=e+s*t,r=e+s*(t+1);c(e+0*s),c(n),c(r)}e+=s*n}}else for(let e=0,t=i.length;e<t;e+=s)c(e)}function fe(e){return f(Je.geometries[e],ue)}function me(e){return void 0!==e.build?e.build:e}function ge(e,t){for(let n=0;n<e.childNodes.length;n++){const r=e.childNodes[n];if(1===r.nodeType)switch(r.nodeName){case"joint":t.joints[r.getAttribute("sid")]=ye(r);break;case"link":t.links.push(we(r))}}}function ye(e){let t;for(let n=0;n<e.childNodes.length;n++){const r=e.childNodes[n];if(1===r.nodeType)switch(r.nodeName){case"prismatic":case"revolute":t=ve(r)}}return t}function ve(e){const t={sid:e.getAttribute("sid"),name:e.getAttribute("name")||"",axis:new r.Vector3,limits:{min:0,max:0},type:e.nodeName,static:!1,zeroPosition:0,middlePosition:0};for(let n=0;n<e.childNodes.length;n++){const r=e.childNodes[n];if(1===r.nodeType)switch(r.nodeName){case"axis":const e=s(r.textContent);t.axis.fromArray(e);break;case"limits":const n=r.getElementsByTagName("max")[0],o=r.getElementsByTagName("min")[0];t.limits.max=parseFloat(n.textContent),t.limits.min=parseFloat(o.textContent)}}return t.limits.min>=t.limits.max&&(t.static=!0),t.middlePosition=(t.limits.min+t.limits.max)/2,t}function we(e){const t={sid:e.getAttribute("sid"),name:e.getAttribute("name")||"",attachments:[],transforms:[]};for(let n=0;n<e.childNodes.length;n++){const r=e.childNodes[n];if(1===r.nodeType)switch(r.nodeName){case"attachment_full":t.attachments.push(be(r));break;case"matrix":case"translate":case"rotate":t.transforms.push(xe(r))}}return t}function be(e){const t={joint:e.getAttribute("joint").split("/").pop(),transforms:[],links:[]};for(let n=0;n<e.childNodes.length;n++){const r=e.childNodes[n];if(1===r.nodeType)switch(r.nodeName){case"link":t.links.push(we(r));break;case"matrix":case"translate":case"rotate":t.transforms.push(xe(r))}}return t}function xe(e){const t={type:e.nodeName},n=s(e.textContent);switch(t.type){case"matrix":t.obj=new r.Matrix4,t.obj.fromArray(n).transpose();break;case"translate":t.obj=new r.Vector3,t.obj.fromArray(n);break;case"rotate":t.obj=new r.Vector3,t.obj.fromArray(n),t.angle=r.MathUtils.degToRad(n[3])}return t}function Me(e,t){for(let n=0;n<e.childNodes.length;n++){const r=e.childNodes[n];if(1===r.nodeType)switch(r.nodeName){case"technique_common":Ae(r,t)}}}function Ae(e,t){for(let n=0;n<e.childNodes.length;n++){const r=e.childNodes[n];if(1===r.nodeType)switch(r.nodeName){case"inertia":t.inertia=s(r.textContent);break;case"mass":t.mass=s(r.textContent)[0]}}}function ke(e){const t={target:e.getAttribute("target").split("/").pop()};for(let n=0;n<e.childNodes.length;n++){const r=e.childNodes[n];if(1===r.nodeType)switch(r.nodeName){case"axis":const e=r.getElementsByTagName("param")[0];t.axis=e.textContent;const n=t.axis.split("inst_").pop().split("axis")[0];t.jointIndex=n.substring(0,n.length-1)}}return t}function Te(e){return void 0!==e.build?e.build:e}function Ie(e){const t=[],n=Ue.querySelector('[id="'+e.id+'"]');for(let e=0;e<n.childNodes.length;e++){const o=n.childNodes[e];if(1!==o.nodeType)continue;let i,a;switch(o.nodeName){case"matrix":i=s(o.textContent);const e=(new r.Matrix4).fromArray(i).transpose();t.push({sid:o.getAttribute("sid"),type:o.nodeName,obj:e});break;case"translate":case"scale":i=s(o.textContent),a=(new r.Vector3).fromArray(i),t.push({sid:o.getAttribute("sid"),type:o.nodeName,obj:a});break;case"rotate":i=s(o.textContent),a=(new r.Vector3).fromArray(i);const n=r.MathUtils.degToRad(i[3]);t.push({sid:o.getAttribute("sid"),type:o.nodeName,obj:a,angle:n})}}return t}const Ne=new r.Matrix4,Ee=new r.Vector3;function Ce(e){const t={name:e.getAttribute("name")||"",type:e.getAttribute("type"),id:e.getAttribute("id"),sid:e.getAttribute("sid"),matrix:new r.Matrix4,nodes:[],instanceCameras:[],instanceControllers:[],instanceLights:[],instanceGeometries:[],instanceNodes:[],transforms:{}};for(let n=0;n<e.childNodes.length;n++){const o=e.childNodes[n];if(1!==o.nodeType)continue;let i;switch(o.nodeName){case"node":t.nodes.push(o.getAttribute("id")),Ce(o);break;case"instance_camera":t.instanceCameras.push(c(o.getAttribute("url")));break;case"instance_controller":t.instanceControllers.push(Pe(o));break;case"instance_light":t.instanceLights.push(c(o.getAttribute("url")));break;case"instance_geometry":t.instanceGeometries.push(Pe(o));break;case"instance_node":t.instanceNodes.push(c(o.getAttribute("url")));break;case"matrix":i=s(o.textContent),t.matrix.multiply(Ne.fromArray(i).transpose()),t.transforms[o.getAttribute("sid")]=o.nodeName;break;case"translate":i=s(o.textContent),Ee.fromArray(i),t.matrix.multiply(Ne.makeTranslation(Ee.x,Ee.y,Ee.z)),t.transforms[o.getAttribute("sid")]=o.nodeName;break;case"rotate":i=s(o.textContent);const e=r.MathUtils.degToRad(i[3]);t.matrix.multiply(Ne.makeRotationAxis(Ee.fromArray(i),e)),t.transforms[o.getAttribute("sid")]=o.nodeName;break;case"scale":i=s(o.textContent),t.matrix.scale(Ee.fromArray(i)),t.transforms[o.getAttribute("sid")]=o.nodeName;break;case"extra":break;default:console.log(o)}}return De(t.id)?console.warn("THREE.ColladaLoader: There is already a node with ID %s. Exclude current node from further processing.",t.id):Je.nodes[t.id]=t,t}function Pe(e){const t={id:c(e.getAttribute("url")),materials:{},skeletons:[]};for(let n=0;n<e.childNodes.length;n++){const r=e.childNodes[n];switch(r.nodeName){case"bind_material":const e=r.getElementsByTagName("instance_material");for(let n=0;n<e.length;n++){const r=e[n],o=r.getAttribute("symbol"),i=r.getAttribute("target");t.materials[o]=c(i)}break;case"skeleton":t.skeletons.push(c(r.textContent))}}return t}function Se(e,t){const n=[],o=[];let i,s,a;for(i=0;i<e.length;i++){const r=e[i];let o;if(De(r))o=Be(r),Le(o,t,n);else if(c=r,void 0!==Je.visualScenes[c]){const e=Je.visualScenes[r].children;for(let r=0;r<e.length;r++){const o=e[r];if("JOINT"===o.type){Le(Be(o.id),t,n)}}}else console.error("THREE.ColladaLoader: Unable to find root bone of skeleton with ID:",r)}var c;for(i=0;i<t.length;i++)for(s=0;s<n.length;s++)if(a=n[s],a.bone.name===t[i].name){o[i]=a,a.processed=!0;break}for(i=0;i<n.length;i++)a=n[i],!1===a.processed&&(o.push(a),a.processed=!0);const l=[],h=[];for(i=0;i<o.length;i++)a=o[i],l.push(a.bone),h.push(a.boneInverse);return new r.Skeleton(l,h)}function Le(e,t,n){e.traverse((function(e){if(!0===e.isBone){let o;for(let n=0;n<t.length;n++){const r=t[n];if(r.name===e.name){o=r.boneInverse;break}}void 0===o&&(o=new r.Matrix4),n.push({bone:e,boneInverse:o,processed:!1})}}))}function Fe(e){const t=[],n=e.matrix,o=e.nodes,i=e.type,s=e.instanceCameras,a=e.instanceControllers,c=e.instanceLights,l=e.instanceGeometries,h=e.instanceNodes;for(let e=0,n=o.length;e<n;e++)t.push(Be(o[e]));for(let e=0,n=s.length;e<n;e++){const n=ne(s[e]);null!==n&&t.push(n.clone())}for(let e=0,n=a.length;e<n;e++){const n=a[e],r=(u=n.id,f(Je.controllers[u],F)),o=Oe(fe(r.id),n.materials),i=Se(n.skeletons,r.skin.joints);for(let e=0,n=o.length;e<n;e++){const n=o[e];n.isSkinnedMesh&&(n.bind(i,r.skin.bindMatrix),n.normalizeSkinWeights()),t.push(n)}}var u;for(let e=0,n=c.length;e<n;e++){const n=se(c[e]);null!==n&&t.push(n.clone())}for(let e=0,n=l.length;e<n;e++){const n=l[e],r=Oe(fe(n.id),n.materials);for(let e=0,n=r.length;e<n;e++)t.push(r[e])}for(let e=0,n=h.length;e<n;e++)t.push(Be(h[e]).clone());let p;if(0===o.length&&1===t.length)p=t[0];else{p="JOINT"===i?new r.Bone:new r.Group;for(let e=0;e<t.length;e++)p.add(t[e])}return p.name="JOINT"===i?e.sid:e.name,p.matrix.copy(n),p.matrix.decompose(p.position,p.quaternion,p.scale),p}const _e=new r.MeshBasicMaterial({color:16711935});function Re(e,t){const n=[];for(let r=0,o=e.length;r<o;r++){const o=t[e[r]];void 0===o?(console.warn("THREE.ColladaLoader: Material with key %s not found. Apply fallback material.",e[r]),n.push(_e)):n.push(K(o))}return n}function Oe(e,t){const n=[];for(const o in e){const i=e[o],s=Re(i.materialKeys,t);0===s.length&&("lines"===o||"linestrips"===o?s.push(new r.LineBasicMaterial):s.push(new r.MeshPhongMaterial));const a=void 0!==i.data.attributes.skinIndex,c=1===s.length?s[0]:s;let l;switch(o){case"lines":l=new r.LineSegments(i.data,c);break;case"linestrips":l=new r.Line(i.data,c);break;case"triangles":case"polylist":l=a?new r.SkinnedMesh(i.data,c):new r.Mesh(i.data,c)}n.push(l)}return n}function De(e){return void 0!==Je.nodes[e]}function Be(e){return f(Je.nodes[e],Fe)}function je(e){const t=new r.Group;t.name=e.name;const n=e.children;for(let e=0;e<n.length;e++){const r=n[e];t.add(Be(r.id))}return t}function ze(e){return f(Je.visualScenes[e],je)}if(0===e.length)return{scene:new r.Scene};const Ve=(new DOMParser).parseFromString(e,"application/xml"),Ue=n(Ve,"COLLADA")[0],Ge=Ve.getElementsByTagName("parsererror")[0];if(void 0!==Ge){const e=n(Ge,"div")[0];let t;return t=e?e.textContent:function(e){let t="";const n=[e];for(;n.length;){const e=n.shift();e.nodeType===Node.TEXT_NODE?t+=e.textContent:(t+="\n",n.push.apply(n,e.childNodes))}return t.trim()}(Ge),console.error("THREE.ColladaLoader: Failed to parse collada file.\n",t),null}const Xe=Ue.getAttribute("version");console.log("THREE.ColladaLoader: File version",Xe);const He=function(e){return{unit:h(n(e,"unit")[0]),upAxis:u(n(e,"up_axis")[0])}}(n(Ue,"asset")[0]),qe=new r.TextureLoader(this.manager);let We;qe.setPath(this.resourcePath||t).setCrossOrigin(this.crossOrigin),o.TGALoader&&(We=new o.TGALoader(this.manager),We.setPath(this.resourcePath||t));const Ze=new r.Color,Qe=[];let Ye={},Ke=0;const Je={animations:{},clips:{},controllers:{},images:{},effects:{},materials:{},cameras:{},lights:{},geometries:{},nodes:{},visualScenes:{},kinematicsModels:{},physicsModels:{},kinematicsScenes:{}};p(Ue,"library_animations","animation",(function e(t){const n={sources:{},samplers:{},channels:{}};let o=!1;for(let r=0,i=t.childNodes.length;r<i;r++){const i=t.childNodes[r];if(1!==i.nodeType)continue;let s;switch(i.nodeName){case"source":s=i.getAttribute("id"),n.sources[s]=ae(i);break;case"sampler":s=i.getAttribute("id"),n.samplers[s]=m(i);break;case"channel":s=i.getAttribute("target"),n.channels[s]=g(i);break;case"animation":e(i),o=!0;break;default:console.log(i)}}!1===o&&(Je.animations[t.getAttribute("id")||r.MathUtils.generateUUID()]=n)})),p(Ue,"library_animation_clips","animation_clip",(function(e){const t={name:e.getAttribute("id")||"default",start:parseFloat(e.getAttribute("start")||0),end:parseFloat(e.getAttribute("end")||0),animations:[]};for(let n=0,r=e.childNodes.length;n<r;n++){const r=e.childNodes[n];if(1===r.nodeType)switch(r.nodeName){case"instance_animation":t.animations.push(c(r.getAttribute("url")))}}Je.clips[e.getAttribute("id")]=t})),p(Ue,"library_controllers","controller",(function(e){const t={};for(let n=0,r=e.childNodes.length;n<r;n++){const r=e.childNodes[n];if(1===r.nodeType)switch(r.nodeName){case"skin":t.id=c(r.getAttribute("source")),t.skin=P(r);break;case"morph":t.id=c(r.getAttribute("source")),console.warn("THREE.ColladaLoader: Morph target animation not supported yet.")}}Je.controllers[e.getAttribute("id")]=t})),p(Ue,"library_images","image",(function(e){const t={init_from:n(e,"init_from")[0].textContent};Je.images[e.getAttribute("id")]=t})),p(Ue,"library_effects","effect",(function(e){const t={};for(let n=0,r=e.childNodes.length;n<r;n++){const r=e.childNodes[n];if(1===r.nodeType)switch(r.nodeName){case"profile_COMMON":t.profile=O(r)}}Je.effects[e.getAttribute("id")]=t})),p(Ue,"library_materials","material",(function(e){const t={name:e.getAttribute("name")};for(let n=0,r=e.childNodes.length;n<r;n++){const r=e.childNodes[n];if(1===r.nodeType)switch(r.nodeName){case"instance_effect":t.url=c(r.getAttribute("url"))}}Je.materials[e.getAttribute("id")]=t})),p(Ue,"library_cameras","camera",(function(e){const t={name:e.getAttribute("name")};for(let n=0,r=e.childNodes.length;n<r;n++){const r=e.childNodes[n];if(1===r.nodeType)switch(r.nodeName){case"optics":t.optics=J(r)}}Je.cameras[e.getAttribute("id")]=t})),p(Ue,"library_lights","light",(function(e){let t={};for(let n=0,r=e.childNodes.length;n<r;n++){const r=e.childNodes[n];if(1===r.nodeType)switch(r.nodeName){case"technique_common":t=re(r)}}Je.lights[e.getAttribute("id")]=t})),p(Ue,"library_geometries","geometry",(function(e){const t={name:e.getAttribute("name"),sources:{},vertices:{},primitives:[]},r=n(e,"mesh")[0];if(void 0!==r){for(let e=0;e<r.childNodes.length;e++){const n=r.childNodes[e];if(1!==n.nodeType)continue;const o=n.getAttribute("id");switch(n.nodeName){case"source":t.sources[o]=ae(n);break;case"vertices":t.vertices=ce(n);break;case"polygons":console.warn("THREE.ColladaLoader: Unsupported primitive type: ",n.nodeName);break;case"lines":case"linestrips":case"polylist":case"triangles":t.primitives.push(le(n));break;default:console.log(n)}}Je.geometries[e.getAttribute("id")]=t}})),p(Ue,"library_nodes","node",Ce),p(Ue,"library_visual_scenes","visual_scene",(function(e){const t={name:e.getAttribute("name"),children:[]};!function(e){const t=e.getElementsByTagName("node");for(let e=0;e<t.length;e++){const n=t[e];!1===n.hasAttribute("id")&&n.setAttribute("id","three_default_"+Ke++)}}(e);const r=n(e,"node");for(let e=0;e<r.length;e++)t.children.push(Ce(r[e]));Je.visualScenes[e.getAttribute("id")]=t})),p(Ue,"library_kinematics_models","kinematics_model",(function(e){const t={name:e.getAttribute("name")||"",joints:{},links:[]};for(let n=0;n<e.childNodes.length;n++){const r=e.childNodes[n];if(1===r.nodeType)switch(r.nodeName){case"technique_common":ge(r,t)}}Je.kinematicsModels[e.getAttribute("id")]=t})),p(Ue,"library_physics_models","physics_model",(function(e){const t={name:e.getAttribute("name")||"",rigidBodies:{}};for(let n=0;n<e.childNodes.length;n++){const r=e.childNodes[n];if(1===r.nodeType)switch(r.nodeName){case"rigid_body":t.rigidBodies[r.getAttribute("name")]={},Me(r,t.rigidBodies[r.getAttribute("name")])}}Je.physicsModels[e.getAttribute("id")]=t})),p(Ue,"scene","instance_kinematics_scene",(function(e){const t={bindJointAxis:[]};for(let n=0;n<e.childNodes.length;n++){const r=e.childNodes[n];if(1===r.nodeType)switch(r.nodeName){case"bind_joint_axis":t.bindJointAxis.push(ke(r))}}Je.kinematicsScenes[c(e.getAttribute("url"))]=t})),d(Je.animations,y),d(Je.clips,E),d(Je.controllers,F),d(Je.images,_),d(Je.effects,Q),d(Je.materials,Y),d(Je.cameras,te),d(Je.lights,ie),d(Je.geometries,ue),d(Je.visualScenes,je),function(){const e=Je.clips;if(!0===l(e)){if(!1===l(Je.animations)){const e=[];for(const t in Je.animations){const n=v(t);for(let t=0,r=n.length;t<r;t++)e.push(n[t])}Qe.push(new r.AnimationClip("default",-1,e))}}else for(const t in e)Qe.push(C(t))}(),function(){const e=Object.keys(Je.kinematicsModels)[0],t=Object.keys(Je.kinematicsScenes)[0],n=Object.keys(Je.visualScenes)[0];if(void 0===e||void 0===t)return;const o=(i=e,f(Je.kinematicsModels[i],me));var i;const s=function(e){return f(Je.kinematicsScenes[e],Te)}(t),a=ze(n),c=s.bindJointAxis,l={};for(let e=0,t=c.length;e<t;e++){const t=c[e],n=Ue.querySelector('[sid="'+t.target+'"]');if(n){const e=n.parentElement;h(t.jointIndex,e)}}function h(e,t){const n=t.getAttribute("name"),r=o.joints[e];a.traverse((function(o){o.name===n&&(l[e]={object:o,transforms:Ie(t),joint:r,position:r.zeroPosition})}))}const u=new r.Matrix4;Ye={joints:o&&o.joints,getJointValue:function(e){const t=l[e];if(t)return t.position;console.warn("THREE.ColladaLoader: Joint "+e+" doesn't exist.")},setJointValue:function(e,t){const n=l[e];if(n){const o=n.joint;if(t>o.limits.max||t<o.limits.min)console.warn("THREE.ColladaLoader: Joint "+e+" value "+t+" outside of limits (min: "+o.limits.min+", max: "+o.limits.max+").");else if(o.static)console.warn("THREE.ColladaLoader: Joint "+e+" is static.");else{const i=n.object,s=o.axis,a=n.transforms;Ne.identity();for(let n=0;n<a.length;n++){const i=a[n];if(i.sid&&-1!==i.sid.indexOf(e))switch(o.type){case"revolute":Ne.multiply(u.makeRotationAxis(s,r.MathUtils.degToRad(t)));break;case"prismatic":Ne.multiply(u.makeTranslation(s.x*t,s.y*t,s.z*t));break;default:console.warn("THREE.ColladaLoader: Unknown joint type: "+o.type)}else switch(i.type){case"matrix":Ne.multiply(i.obj);break;case"translate":Ne.multiply(u.makeTranslation(i.obj.x,i.obj.y,i.obj.z));break;case"scale":Ne.scale(i.obj);break;case"rotate":Ne.multiply(u.makeRotationAxis(i.obj,i.angle))}}i.matrix.copy(Ne),i.matrix.decompose(i.position,i.quaternion,i.scale),l[e].position=t}}else console.log("THREE.ColladaLoader: "+e+" does not exist.")}}}();const $e=function(e){return ze(c(n(e,"instance_visual_scene")[0].getAttribute("url")))}(n(Ue,"scene")[0]);return $e.animations=Qe,"Z_UP"===He.upAxis&&(console.warn("THREE.ColladaLoader: You are loading an asset with a Z-UP coordinate system. The loader just rotates the asset to transform it into Y-UP. The vertex data are not converted, see #24289."),$e.quaternion.setFromEuler(new r.Euler(-Math.PI/2,0,0))),$e.scale.multiplyScalar(He.unit),{get animations(){return console.warn("THREE.ColladaLoader: Please access animations over scene.animations now."),Qe},kinematics:Ye,library:Je,scene:$e}}}},62515:(e,t,n)=>{n.r(t),n.d(t,{FBXLoader:()=>l});var r=n(81396),o=n(78646),i=n(4103);let s,a,c;class l extends r.Loader{constructor(e){super(e)}load(e,t,n,o){const i=this,s=""===i.path?r.LoaderUtils.extractUrlBase(e):i.path,a=new r.FileLoader(this.manager);a.setPath(i.path),a.setResponseType("arraybuffer"),a.setRequestHeader(i.requestHeader),a.setWithCredentials(i.withCredentials),a.load(e,(function(n){try{t(i.parse(n,s))}catch(t){o?o(t):console.error(t),i.manager.itemError(e)}}),n,o)}parse(e,t){if(function(e){const t="Kaydara FBX Binary \0";return e.byteLength>=t.length&&t===I(e,0,t.length)}(e))s=(new f).parse(e);else{const t=I(e);if(!function(e){const t=["K","a","y","d","a","r","a","\\","F","B","X","\\","B","i","n","a","r","y","\\","\\"];let n=0;function r(t){const r=e[t-1];return e=e.slice(n+t),n++,r}for(let e=0;e<t.length;++e){if(r(1)===t[e])return!1}return!0}(t))throw new Error("THREE.FBXLoader: Unknown format.");if(y(t)<7e3)throw new Error("THREE.FBXLoader: FBX version not supported, FileVersion: "+y(t));s=(new d).parse(t)}const n=new r.TextureLoader(this.manager).setPath(this.resourcePath||t).setCrossOrigin(this.crossOrigin);return new h(n,this.manager).parse(s)}}class h{constructor(e,t){this.textureLoader=e,this.manager=t}parse(){a=this.parseConnections();const e=this.parseImages(),t=this.parseTextures(e),n=this.parseMaterials(t),r=this.parseDeformers(),o=(new u).parse(r);return this.parseScene(r,o,n),c}parseConnections(){const e=new Map;if("Connections"in s){s.Connections.connections.forEach((function(t){const n=t[0],r=t[1],o=t[2];e.has(n)||e.set(n,{parents:[],children:[]});const i={ID:r,relationship:o};e.get(n).parents.push(i),e.has(r)||e.set(r,{parents:[],children:[]});const s={ID:n,relationship:o};e.get(r).children.push(s)}))}return e}parseImages(){const e={},t={};if("Video"in s.Objects){const n=s.Objects.Video;for(const r in n){const o=n[r];if(e[parseInt(r)]=o.RelativeFilename||o.Filename,"Content"in o){const e=o.Content instanceof ArrayBuffer&&o.Content.byteLength>0,i="string"==typeof o.Content&&""!==o.Content;if(e||i){const e=this.parseImage(n[r]);t[o.RelativeFilename||o.Filename]=e}}}}for(const n in e){const r=e[n];void 0!==t[r]?e[n]=t[r]:e[n]=e[n].split("\\").pop()}return e}parseImage(e){const t=e.Content,n=e.RelativeFilename||e.Filename,r=n.slice(n.lastIndexOf(".")+1).toLowerCase();let o;switch(r){case"bmp":o="image/bmp";break;case"jpg":case"jpeg":o="image/jpeg";break;case"png":o="image/png";break;case"tif":o="image/tiff";break;case"tga":null===this.manager.getHandler(".tga")&&console.warn("FBXLoader: TGA loader not found, skipping ",n),o="image/tga";break;default:return void console.warn('FBXLoader: Image type "'+r+'" is not supported.')}if("string"==typeof t)return"data:"+o+";base64,"+t;{const e=new Uint8Array(t);return window.URL.createObjectURL(new Blob([e],{type:o}))}}parseTextures(e){const t=new Map;if("Texture"in s.Objects){const n=s.Objects.Texture;for(const r in n){const o=this.parseTexture(n[r],e);t.set(parseInt(r),o)}}return t}parseTexture(e,t){const n=this.loadTexture(e,t);n.ID=e.id,n.name=e.attrName;const o=e.WrapModeU,i=e.WrapModeV,s=void 0!==o?o.value:0,a=void 0!==i?i.value:0;if(n.wrapS=0===s?r.RepeatWrapping:r.ClampToEdgeWrapping,n.wrapT=0===a?r.RepeatWrapping:r.ClampToEdgeWrapping,"Scaling"in e){const t=e.Scaling.value;n.repeat.x=t[0],n.repeat.y=t[1]}if("Translation"in e){const t=e.Translation.value;n.offset.x=t[0],n.offset.y=t[1]}return n}loadTexture(e,t){let n;const o=this.textureLoader.path,i=a.get(e.id).children;let s;void 0!==i&&i.length>0&&void 0!==t[i[0].ID]&&(n=t[i[0].ID],0!==n.indexOf("blob:")&&0!==n.indexOf("data:")||this.textureLoader.setPath(void 0));const c=e.FileName.slice(-3).toLowerCase();if("tga"===c){const t=this.manager.getHandler(".tga");null===t?(console.warn("FBXLoader: TGA loader not found, creating placeholder texture for",e.RelativeFilename),s=new r.Texture):(t.setPath(this.textureLoader.path),s=t.load(n))}else"psd"===c?(console.warn("FBXLoader: PSD textures are not supported, creating placeholder texture for",e.RelativeFilename),s=new r.Texture):s=this.textureLoader.load(n);return this.textureLoader.setPath(o),s}parseMaterials(e){const t=new Map;if("Material"in s.Objects){const n=s.Objects.Material;for(const r in n){const o=this.parseMaterial(n[r],e);null!==o&&t.set(parseInt(r),o)}}return t}parseMaterial(e,t){const n=e.id,o=e.attrName;let i=e.ShadingModel;if("object"==typeof i&&(i=i.value),!a.has(n))return null;const s=this.parseParameters(e,t,n);let c;switch(i.toLowerCase()){case"phong":c=new r.MeshPhongMaterial;break;case"lambert":c=new r.MeshLambertMaterial;break;default:console.warn('THREE.FBXLoader: unknown material type "%s". Defaulting to MeshPhongMaterial.',i),c=new r.MeshPhongMaterial}return c.setValues(s),c.name=o,c}parseParameters(e,t,n){const o={};e.BumpFactor&&(o.bumpScale=e.BumpFactor.value),e.Diffuse?o.color=(new r.Color).fromArray(e.Diffuse.value):!e.DiffuseColor||"Color"!==e.DiffuseColor.type&&"ColorRGB"!==e.DiffuseColor.type||(o.color=(new r.Color).fromArray(e.DiffuseColor.value)),e.DisplacementFactor&&(o.displacementScale=e.DisplacementFactor.value),e.Emissive?o.emissive=(new r.Color).fromArray(e.Emissive.value):!e.EmissiveColor||"Color"!==e.EmissiveColor.type&&"ColorRGB"!==e.EmissiveColor.type||(o.emissive=(new r.Color).fromArray(e.EmissiveColor.value)),e.EmissiveFactor&&(o.emissiveIntensity=parseFloat(e.EmissiveFactor.value)),e.Opacity&&(o.opacity=parseFloat(e.Opacity.value)),o.opacity<1&&(o.transparent=!0),e.ReflectionFactor&&(o.reflectivity=e.ReflectionFactor.value),e.Shininess&&(o.shininess=e.Shininess.value),e.Specular?o.specular=(new r.Color).fromArray(e.Specular.value):e.SpecularColor&&"Color"===e.SpecularColor.type&&(o.specular=(new r.Color).fromArray(e.SpecularColor.value));const i=this;return a.get(n).children.forEach((function(e){const n=e.relationship;switch(n){case"Bump":o.bumpMap=i.getTexture(t,e.ID);break;case"Maya|TEX_ao_map":o.aoMap=i.getTexture(t,e.ID);break;case"DiffuseColor":case"Maya|TEX_color_map":o.map=i.getTexture(t,e.ID),void 0!==o.map&&(o.map.encoding=r.sRGBEncoding);break;case"DisplacementColor":o.displacementMap=i.getTexture(t,e.ID);break;case"EmissiveColor":o.emissiveMap=i.getTexture(t,e.ID),void 0!==o.emissiveMap&&(o.emissiveMap.encoding=r.sRGBEncoding);break;case"NormalMap":case"Maya|TEX_normal_map":o.normalMap=i.getTexture(t,e.ID);break;case"ReflectionColor":o.envMap=i.getTexture(t,e.ID),void 0!==o.envMap&&(o.envMap.mapping=r.EquirectangularReflectionMapping,o.envMap.encoding=r.sRGBEncoding);break;case"SpecularColor":o.specularMap=i.getTexture(t,e.ID),void 0!==o.specularMap&&(o.specularMap.encoding=r.sRGBEncoding);break;case"TransparentColor":case"TransparencyFactor":o.alphaMap=i.getTexture(t,e.ID),o.transparent=!0;break;case"AmbientColor":case"ShininessExponent":case"SpecularFactor":case"VectorDisplacementColor":default:console.warn("THREE.FBXLoader: %s map is not supported in three.js, skipping texture.",n)}})),o}getTexture(e,t){return"LayeredTexture"in s.Objects&&t in s.Objects.LayeredTexture&&(console.warn("THREE.FBXLoader: layered textures are not supported in three.js. Discarding all but first layer."),t=a.get(t).children[0].ID),e.get(t)}parseDeformers(){const e={},t={};if("Deformer"in s.Objects){const n=s.Objects.Deformer;for(const r in n){const o=n[r],i=a.get(parseInt(r));if("Skin"===o.attrType){const t=this.parseSkeleton(i,n);t.ID=r,i.parents.length>1&&console.warn("THREE.FBXLoader: skeleton attached to more than one geometry is not supported."),t.geometryID=i.parents[0].ID,e[r]=t}else if("BlendShape"===o.attrType){const e={id:r};e.rawTargets=this.parseMorphTargets(i,n),e.id=r,i.parents.length>1&&console.warn("THREE.FBXLoader: morph target attached to more than one geometry is not supported."),t[r]=e}}}return{skeletons:e,morphTargets:t}}parseSkeleton(e,t){const n=[];return e.children.forEach((function(e){const o=t[e.ID];if("Cluster"!==o.attrType)return;const i={ID:e.ID,indices:[],weights:[],transformLink:(new r.Matrix4).fromArray(o.TransformLink.a)};"Indexes"in o&&(i.indices=o.Indexes.a,i.weights=o.Weights.a),n.push(i)})),{rawBones:n,bones:[]}}parseMorphTargets(e,t){const n=[];for(let r=0;r<e.children.length;r++){const o=e.children[r],i=t[o.ID],s={name:i.attrName,initialWeight:i.DeformPercent,id:i.id,fullWeights:i.FullWeights.a};if("BlendShapeChannel"!==i.attrType)return;s.geoID=a.get(parseInt(o.ID)).children.filter((function(e){return void 0===e.relationship}))[0].ID,n.push(s)}return n}parseScene(e,t,n){c=new r.Group;const o=this.parseModels(e.skeletons,t,n),i=s.Objects.Model,l=this;o.forEach((function(e){const t=i[e.ID];l.setLookAtProperties(e,t);a.get(e.ID).parents.forEach((function(t){const n=o.get(t.ID);void 0!==n&&n.add(e)})),null===e.parent&&c.add(e)})),this.bindSkeleton(e.skeletons,t,o),this.createAmbientLight(),c.traverse((function(e){if(e.userData.transformData){e.parent&&(e.userData.transformData.parentMatrix=e.parent.matrix,e.userData.transformData.parentMatrixWorld=e.parent.matrixWorld);const t=A(e.userData.transformData);e.applyMatrix4(t),e.updateWorldMatrix()}}));const h=(new p).parse();1===c.children.length&&c.children[0].isGroup&&(c.children[0].animations=h,c=c.children[0]),c.animations=h}parseModels(e,t,n){const o=new Map,i=s.Objects.Model;for(const s in i){const c=parseInt(s),l=i[s],h=a.get(c);let u=this.buildSkeleton(h,e,c,l.attrName);if(!u){switch(l.attrType){case"Camera":u=this.createCamera(h);break;case"Light":u=this.createLight(h);break;case"Mesh":u=this.createMesh(h,t,n);break;case"NurbsCurve":u=this.createCurve(h,t);break;case"LimbNode":case"Root":u=new r.Bone;break;case"Null":default:u=new r.Group}u.name=l.attrName?r.PropertyBinding.sanitizeNodeName(l.attrName):"",u.ID=c}this.getTransformData(u,l),o.set(c,u)}return o}buildSkeleton(e,t,n,o){let i=null;return e.parents.forEach((function(e){for(const s in t){const a=t[s];a.rawBones.forEach((function(t,s){if(t.ID===e.ID){const e=i;i=new r.Bone,i.matrixWorld.copy(t.transformLink),i.name=o?r.PropertyBinding.sanitizeNodeName(o):"",i.ID=n,a.bones[s]=i,null!==e&&i.add(e)}}))}})),i}createCamera(e){let t,n;if(e.children.forEach((function(e){const t=s.Objects.NodeAttribute[e.ID];void 0!==t&&(n=t)})),void 0===n)t=new r.Object3D;else{let e=0;void 0!==n.CameraProjectionType&&1===n.CameraProjectionType.value&&(e=1);let o=1;void 0!==n.NearPlane&&(o=n.NearPlane.value/1e3);let i=1e3;void 0!==n.FarPlane&&(i=n.FarPlane.value/1e3);let s=window.innerWidth,a=window.innerHeight;void 0!==n.AspectWidth&&void 0!==n.AspectHeight&&(s=n.AspectWidth.value,a=n.AspectHeight.value);const c=s/a;let l=45;void 0!==n.FieldOfView&&(l=n.FieldOfView.value);const h=n.FocalLength?n.FocalLength.value:null;switch(e){case 0:t=new r.PerspectiveCamera(l,c,o,i),null!==h&&t.setFocalLength(h);break;case 1:t=new r.OrthographicCamera(-s/2,s/2,a/2,-a/2,o,i);break;default:console.warn("THREE.FBXLoader: Unknown camera type "+e+"."),t=new r.Object3D}}return t}createLight(e){let t,n;if(e.children.forEach((function(e){const t=s.Objects.NodeAttribute[e.ID];void 0!==t&&(n=t)})),void 0===n)t=new r.Object3D;else{let e;e=void 0===n.LightType?0:n.LightType.value;let o=16777215;void 0!==n.Color&&(o=(new r.Color).fromArray(n.Color.value));let i=void 0===n.Intensity?1:n.Intensity.value/100;void 0!==n.CastLightOnObject&&0===n.CastLightOnObject.value&&(i=0);let s=0;void 0!==n.FarAttenuationEnd&&(s=void 0!==n.EnableFarAttenuation&&0===n.EnableFarAttenuation.value?0:n.FarAttenuationEnd.value);const a=1;switch(e){case 0:t=new r.PointLight(o,i,s,a);break;case 1:t=new r.DirectionalLight(o,i);break;case 2:let e=Math.PI/3;void 0!==n.InnerAngle&&(e=r.MathUtils.degToRad(n.InnerAngle.value));let c=0;void 0!==n.OuterAngle&&(c=r.MathUtils.degToRad(n.OuterAngle.value),c=Math.max(c,1)),t=new r.SpotLight(o,i,s,e,c,a);break;default:console.warn("THREE.FBXLoader: Unknown light type "+n.LightType.value+", defaulting to a PointLight."),t=new r.PointLight(o,i)}void 0!==n.CastShadows&&1===n.CastShadows.value&&(t.castShadow=!0)}return t}createMesh(e,t,n){let o,i=null,s=null;const a=[];return e.children.forEach((function(e){t.has(e.ID)&&(i=t.get(e.ID)),n.has(e.ID)&&a.push(n.get(e.ID))})),a.length>1?s=a:a.length>0?s=a[0]:(s=new r.MeshPhongMaterial({color:13421772}),a.push(s)),"color"in i.attributes&&a.forEach((function(e){e.vertexColors=!0})),i.FBX_Deformer?(o=new r.SkinnedMesh(i,s),o.normalizeSkinWeights()):o=new r.Mesh(i,s),o}createCurve(e,t){const n=e.children.reduce((function(e,n){return t.has(n.ID)&&(e=t.get(n.ID)),e}),null),o=new r.LineBasicMaterial({color:3342591,linewidth:1});return new r.Line(n,o)}getTransformData(e,t){const n={};"InheritType"in t&&(n.inheritType=parseInt(t.InheritType.value)),n.eulerOrder="RotationOrder"in t?k(t.RotationOrder.value):"ZYX","Lcl_Translation"in t&&(n.translation=t.Lcl_Translation.value),"PreRotation"in t&&(n.preRotation=t.PreRotation.value),"Lcl_Rotation"in t&&(n.rotation=t.Lcl_Rotation.value),"PostRotation"in t&&(n.postRotation=t.PostRotation.value),"Lcl_Scaling"in t&&(n.scale=t.Lcl_Scaling.value),"ScalingOffset"in t&&(n.scalingOffset=t.ScalingOffset.value),"ScalingPivot"in t&&(n.scalingPivot=t.ScalingPivot.value),"RotationOffset"in t&&(n.rotationOffset=t.RotationOffset.value),"RotationPivot"in t&&(n.rotationPivot=t.RotationPivot.value),e.userData.transformData=n}setLookAtProperties(e,t){if("LookAtProperty"in t){a.get(e.ID).children.forEach((function(t){if("LookAtProperty"===t.relationship){const n=s.Objects.Model[t.ID];if("Lcl_Translation"in n){const t=n.Lcl_Translation.value;void 0!==e.target?(e.target.position.fromArray(t),c.add(e.target)):e.lookAt((new r.Vector3).fromArray(t))}}}))}}bindSkeleton(e,t,n){const o=this.parsePoseNodes();for(const i in e){const s=e[i];a.get(parseInt(s.ID)).parents.forEach((function(e){if(t.has(e.ID)){const t=e.ID;a.get(t).parents.forEach((function(e){if(n.has(e.ID)){n.get(e.ID).bind(new r.Skeleton(s.bones),o[e.ID])}}))}}))}}parsePoseNodes(){const e={};if("Pose"in s.Objects){const t=s.Objects.Pose;for(const n in t)if("BindPose"===t[n].attrType&&t[n].NbPoseNodes>0){const o=t[n].PoseNode;Array.isArray(o)?o.forEach((function(t){e[t.Node]=(new r.Matrix4).fromArray(t.Matrix.a)})):e[o.Node]=(new r.Matrix4).fromArray(o.Matrix.a)}}return e}createAmbientLight(){if("GlobalSettings"in s&&"AmbientColor"in s.GlobalSettings){const e=s.GlobalSettings.AmbientColor.value,t=e[0],n=e[1],o=e[2];if(0!==t||0!==n||0!==o){const e=new r.Color(t,n,o);c.add(new r.AmbientLight(e,1))}}}}class u{constructor(){this.negativeMaterialIndices=!1}parse(e){const t=new Map;if("Geometry"in s.Objects){const n=s.Objects.Geometry;for(const r in n){const o=a.get(parseInt(r)),i=this.parseGeometry(o,n[r],e);t.set(parseInt(r),i)}}return!0===this.negativeMaterialIndices&&console.warn("THREE.FBXLoader: The FBX file contains invalid (negative) material indices. The asset might not render as expected."),t}parseGeometry(e,t,n){switch(t.attrType){case"Mesh":return this.parseMeshGeometry(e,t,n);case"NurbsCurve":return this.parseNurbsGeometry(t)}}parseMeshGeometry(e,t,n){const r=n.skeletons,o=[],i=e.parents.map((function(e){return s.Objects.Model[e.ID]}));if(0===i.length)return;const a=e.children.reduce((function(e,t){return void 0!==r[t.ID]&&(e=r[t.ID]),e}),null);e.children.forEach((function(e){void 0!==n.morphTargets[e.ID]&&o.push(n.morphTargets[e.ID])}));const c=i[0],l={};"RotationOrder"in c&&(l.eulerOrder=k(c.RotationOrder.value)),"InheritType"in c&&(l.inheritType=parseInt(c.InheritType.value)),"GeometricTranslation"in c&&(l.translation=c.GeometricTranslation.value),"GeometricRotation"in c&&(l.rotation=c.GeometricRotation.value),"GeometricScaling"in c&&(l.scale=c.GeometricScaling.value);const h=A(l);return this.genGeometry(t,a,o,h)}genGeometry(e,t,n,o){const i=new r.BufferGeometry;e.attrName&&(i.name=e.attrName);const s=this.parseGeoNode(e,t),a=this.genBuffers(s),c=new r.Float32BufferAttribute(a.vertex,3);if(c.applyMatrix4(o),i.setAttribute("position",c),a.colors.length>0&&i.setAttribute("color",new r.Float32BufferAttribute(a.colors,3)),t&&(i.setAttribute("skinIndex",new r.Uint16BufferAttribute(a.weightsIndices,4)),i.setAttribute("skinWeight",new r.Float32BufferAttribute(a.vertexWeights,4)),i.FBX_Deformer=t),a.normal.length>0){const e=(new r.Matrix3).getNormalMatrix(o),t=new r.Float32BufferAttribute(a.normal,3);t.applyNormalMatrix(e),i.setAttribute("normal",t)}if(a.uvs.forEach((function(e,t){let n="uv"+(t+1).toString();0===t&&(n="uv"),i.setAttribute(n,new r.Float32BufferAttribute(a.uvs[t],2))})),s.material&&"AllSame"!==s.material.mappingType){let e=a.materialIndex[0],t=0;if(a.materialIndex.forEach((function(n,r){n!==e&&(i.addGroup(t,r-t,e),e=n,t=r)})),i.groups.length>0){const t=i.groups[i.groups.length-1],n=t.start+t.count;n!==a.materialIndex.length&&i.addGroup(n,a.materialIndex.length-n,e)}0===i.groups.length&&i.addGroup(0,a.materialIndex.length,a.materialIndex[0])}return this.addMorphTargets(i,e,n,o),i}parseGeoNode(e,t){const n={};if(n.vertexPositions=void 0!==e.Vertices?e.Vertices.a:[],n.vertexIndices=void 0!==e.PolygonVertexIndex?e.PolygonVertexIndex.a:[],e.LayerElementColor&&(n.color=this.parseVertexColors(e.LayerElementColor[0])),e.LayerElementMaterial&&(n.material=this.parseMaterialIndices(e.LayerElementMaterial[0])),e.LayerElementNormal&&(n.normal=this.parseNormals(e.LayerElementNormal[0])),e.LayerElementUV){n.uv=[];let t=0;for(;e.LayerElementUV[t];)e.LayerElementUV[t].UV&&n.uv.push(this.parseUVs(e.LayerElementUV[t])),t++}return n.weightTable={},null!==t&&(n.skeleton=t,t.rawBones.forEach((function(e,t){e.indices.forEach((function(r,o){void 0===n.weightTable[r]&&(n.weightTable[r]=[]),n.weightTable[r].push({id:t,weight:e.weights[o]})}))}))),n}genBuffers(e){const t={vertex:[],normal:[],colors:[],uvs:[],materialIndex:[],vertexWeights:[],weightsIndices:[]};let n=0,r=0,o=!1,i=[],s=[],a=[],c=[],l=[],h=[];const u=this;return e.vertexIndices.forEach((function(p,d){let f,m=!1;p<0&&(p^=-1,m=!0);let g=[],y=[];if(i.push(3*p,3*p+1,3*p+2),e.color){const t=b(d,n,p,e.color);a.push(t[0],t[1],t[2])}if(e.skeleton){if(void 0!==e.weightTable[p]&&e.weightTable[p].forEach((function(e){y.push(e.weight),g.push(e.id)})),y.length>4){o||(console.warn("THREE.FBXLoader: Vertex has more than 4 skinning weights assigned to vertex. Deleting additional weights."),o=!0);const e=[0,0,0,0],t=[0,0,0,0];y.forEach((function(n,r){let o=n,i=g[r];t.forEach((function(t,n,r){if(o>t){r[n]=o,o=t;const s=e[n];e[n]=i,i=s}}))})),g=e,y=t}for(;y.length<4;)y.push(0),g.push(0);for(let e=0;e<4;++e)l.push(y[e]),h.push(g[e])}if(e.normal){const t=b(d,n,p,e.normal);s.push(t[0],t[1],t[2])}e.material&&"AllSame"!==e.material.mappingType&&(f=b(d,n,p,e.material)[0],f<0&&(u.negativeMaterialIndices=!0,f=0)),e.uv&&e.uv.forEach((function(e,t){const r=b(d,n,p,e);void 0===c[t]&&(c[t]=[]),c[t].push(r[0]),c[t].push(r[1])})),r++,m&&(u.genFace(t,e,i,f,s,a,c,l,h,r),n++,r=0,i=[],s=[],a=[],c=[],l=[],h=[])})),t}genFace(e,t,n,r,o,i,s,a,c,l){for(let h=2;h<l;h++)e.vertex.push(t.vertexPositions[n[0]]),e.vertex.push(t.vertexPositions[n[1]]),e.vertex.push(t.vertexPositions[n[2]]),e.vertex.push(t.vertexPositions[n[3*(h-1)]]),e.vertex.push(t.vertexPositions[n[3*(h-1)+1]]),e.vertex.push(t.vertexPositions[n[3*(h-1)+2]]),e.vertex.push(t.vertexPositions[n[3*h]]),e.vertex.push(t.vertexPositions[n[3*h+1]]),e.vertex.push(t.vertexPositions[n[3*h+2]]),t.skeleton&&(e.vertexWeights.push(a[0]),e.vertexWeights.push(a[1]),e.vertexWeights.push(a[2]),e.vertexWeights.push(a[3]),e.vertexWeights.push(a[4*(h-1)]),e.vertexWeights.push(a[4*(h-1)+1]),e.vertexWeights.push(a[4*(h-1)+2]),e.vertexWeights.push(a[4*(h-1)+3]),e.vertexWeights.push(a[4*h]),e.vertexWeights.push(a[4*h+1]),e.vertexWeights.push(a[4*h+2]),e.vertexWeights.push(a[4*h+3]),e.weightsIndices.push(c[0]),e.weightsIndices.push(c[1]),e.weightsIndices.push(c[2]),e.weightsIndices.push(c[3]),e.weightsIndices.push(c[4*(h-1)]),e.weightsIndices.push(c[4*(h-1)+1]),e.weightsIndices.push(c[4*(h-1)+2]),e.weightsIndices.push(c[4*(h-1)+3]),e.weightsIndices.push(c[4*h]),e.weightsIndices.push(c[4*h+1]),e.weightsIndices.push(c[4*h+2]),e.weightsIndices.push(c[4*h+3])),t.color&&(e.colors.push(i[0]),e.colors.push(i[1]),e.colors.push(i[2]),e.colors.push(i[3*(h-1)]),e.colors.push(i[3*(h-1)+1]),e.colors.push(i[3*(h-1)+2]),e.colors.push(i[3*h]),e.colors.push(i[3*h+1]),e.colors.push(i[3*h+2])),t.material&&"AllSame"!==t.material.mappingType&&(e.materialIndex.push(r),e.materialIndex.push(r),e.materialIndex.push(r)),t.normal&&(e.normal.push(o[0]),e.normal.push(o[1]),e.normal.push(o[2]),e.normal.push(o[3*(h-1)]),e.normal.push(o[3*(h-1)+1]),e.normal.push(o[3*(h-1)+2]),e.normal.push(o[3*h]),e.normal.push(o[3*h+1]),e.normal.push(o[3*h+2])),t.uv&&t.uv.forEach((function(t,n){void 0===e.uvs[n]&&(e.uvs[n]=[]),e.uvs[n].push(s[n][0]),e.uvs[n].push(s[n][1]),e.uvs[n].push(s[n][2*(h-1)]),e.uvs[n].push(s[n][2*(h-1)+1]),e.uvs[n].push(s[n][2*h]),e.uvs[n].push(s[n][2*h+1])}))}addMorphTargets(e,t,n,r){if(0===n.length)return;e.morphTargetsRelative=!0,e.morphAttributes.position=[];const o=this;n.forEach((function(n){n.rawTargets.forEach((function(n){const i=s.Objects.Geometry[n.geoID];void 0!==i&&o.genMorphGeometry(e,t,i,r,n.name)}))}))}genMorphGeometry(e,t,n,o,i){const s=void 0!==t.PolygonVertexIndex?t.PolygonVertexIndex.a:[],a=void 0!==n.Vertices?n.Vertices.a:[],c=void 0!==n.Indexes?n.Indexes.a:[],l=3*e.attributes.position.count,h=new Float32Array(l);for(let e=0;e<c.length;e++){const t=3*c[e];h[t]=a[3*e],h[t+1]=a[3*e+1],h[t+2]=a[3*e+2]}const u={vertexIndices:s,vertexPositions:h},p=this.genBuffers(u),d=new r.Float32BufferAttribute(p.vertex,3);d.name=i||n.attrName,d.applyMatrix4(o),e.morphAttributes.position.push(d)}parseNormals(e){const t=e.MappingInformationType,n=e.ReferenceInformationType,r=e.Normals.a;let o=[];return"IndexToDirect"===n&&("NormalIndex"in e?o=e.NormalIndex.a:"NormalsIndex"in e&&(o=e.NormalsIndex.a)),{dataSize:3,buffer:r,indices:o,mappingType:t,referenceType:n}}parseUVs(e){const t=e.MappingInformationType,n=e.ReferenceInformationType,r=e.UV.a;let o=[];return"IndexToDirect"===n&&(o=e.UVIndex.a),{dataSize:2,buffer:r,indices:o,mappingType:t,referenceType:n}}parseVertexColors(e){const t=e.MappingInformationType,n=e.ReferenceInformationType,r=e.Colors.a;let o=[];return"IndexToDirect"===n&&(o=e.ColorIndex.a),{dataSize:4,buffer:r,indices:o,mappingType:t,referenceType:n}}parseMaterialIndices(e){const t=e.MappingInformationType,n=e.ReferenceInformationType;if("NoMappingInformation"===t)return{dataSize:1,buffer:[0],indices:[0],mappingType:"AllSame",referenceType:n};const r=e.Materials.a,o=[];for(let e=0;e<r.length;++e)o.push(e);return{dataSize:1,buffer:r,indices:o,mappingType:t,referenceType:n}}parseNurbsGeometry(e){if(void 0===i.NURBSCurve)return console.error("THREE.FBXLoader: The loader relies on NURBSCurve for any nurbs present in the model. Nurbs will show up as empty geometry."),new r.BufferGeometry;const t=parseInt(e.Order);if(isNaN(t))return console.error("THREE.FBXLoader: Invalid Order %s given for geometry ID: %s",e.Order,e.id),new r.BufferGeometry;const n=t-1,o=e.KnotVector.a,s=[],a=e.Points.a;for(let e=0,t=a.length;e<t;e+=4)s.push((new r.Vector4).fromArray(a,e));let c,l;if("Closed"===e.Form)s.push(s[0]);else if("Periodic"===e.Form){c=n,l=o.length-1-c;for(let e=0;e<n;++e)s.push(s[e])}const h=new i.NURBSCurve(n,o,s,c,l).getPoints(12*s.length);return(new r.BufferGeometry).setFromPoints(h)}}class p{parse(){const e=[],t=this.parseClips();if(void 0!==t)for(const n in t){const r=t[n],o=this.addClip(r);e.push(o)}return e}parseClips(){if(void 0===s.Objects.AnimationCurve)return;const e=this.parseAnimationCurveNodes();this.parseAnimationCurves(e);const t=this.parseAnimationLayers(e);return this.parseAnimStacks(t)}parseAnimationCurveNodes(){const e=s.Objects.AnimationCurveNode,t=new Map;for(const n in e){const r=e[n];if(null!==r.attrName.match(/S|R|T|DeformPercent/)){const e={id:r.id,attr:r.attrName,curves:{}};t.set(e.id,e)}}return t}parseAnimationCurves(e){const t=s.Objects.AnimationCurve;for(const n in t){const r={id:t[n].id,times:t[n].KeyTime.a.map(v),values:t[n].KeyValueFloat.a},o=a.get(r.id);if(void 0!==o){const t=o.parents[0].ID,n=o.parents[0].relationship;n.match(/X/)?e.get(t).curves.x=r:n.match(/Y/)?e.get(t).curves.y=r:n.match(/Z/)?e.get(t).curves.z=r:n.match(/d|DeformPercent/)&&e.has(t)&&(e.get(t).curves.morph=r)}}}parseAnimationLayers(e){const t=s.Objects.AnimationLayer,n=new Map;for(const o in t){const t=[],i=a.get(parseInt(o));if(void 0!==i){i.children.forEach((function(n,o){if(e.has(n.ID)){const i=e.get(n.ID);if(void 0!==i.curves.x||void 0!==i.curves.y||void 0!==i.curves.z){if(void 0===t[o]){const e=a.get(n.ID).parents.filter((function(e){return void 0!==e.relationship}))[0].ID;if(void 0!==e){const i=s.Objects.Model[e.toString()];if(void 0===i)return void console.warn("THREE.FBXLoader: Encountered a unused curve.",n);const a={modelName:i.attrName?r.PropertyBinding.sanitizeNodeName(i.attrName):"",ID:i.id,initialPosition:[0,0,0],initialRotation:[0,0,0],initialScale:[1,1,1]};c.traverse((function(e){e.ID===i.id&&(a.transform=e.matrix,e.userData.transformData&&(a.eulerOrder=e.userData.transformData.eulerOrder))})),a.transform||(a.transform=new r.Matrix4),"PreRotation"in i&&(a.preRotation=i.PreRotation.value),"PostRotation"in i&&(a.postRotation=i.PostRotation.value),t[o]=a}}t[o]&&(t[o][i.attr]=i)}else if(void 0!==i.curves.morph){if(void 0===t[o]){const e=a.get(n.ID).parents.filter((function(e){return void 0!==e.relationship}))[0].ID,i=a.get(e).parents[0].ID,c=a.get(i).parents[0].ID,l=a.get(c).parents[0].ID,h=s.Objects.Model[l],u={modelName:h.attrName?r.PropertyBinding.sanitizeNodeName(h.attrName):"",morphName:s.Objects.Deformer[e].attrName};t[o]=u}t[o][i.attr]=i}}})),n.set(parseInt(o),t)}}return n}parseAnimStacks(e){const t=s.Objects.AnimationStack,n={};for(const r in t){const o=a.get(parseInt(r)).children;o.length>1&&console.warn("THREE.FBXLoader: Encountered an animation stack with multiple layers, this is currently not supported. Ignoring subsequent layers.");const i=e.get(o[0].ID);n[r]={name:t[r].attrName,layer:i}}return n}addClip(e){let t=[];const n=this;return e.layer.forEach((function(e){t=t.concat(n.generateTracks(e))})),new r.AnimationClip(e.name,-1,t)}generateTracks(e){const t=[];let n=new r.Vector3,o=new r.Quaternion,i=new r.Vector3;if(e.transform&&e.transform.decompose(n,o,i),n=n.toArray(),o=(new r.Euler).setFromQuaternion(o,e.eulerOrder).toArray(),i=i.toArray(),void 0!==e.T&&Object.keys(e.T.curves).length>0){const r=this.generateVectorTrack(e.modelName,e.T.curves,n,"position");void 0!==r&&t.push(r)}if(void 0!==e.R&&Object.keys(e.R.curves).length>0){const n=this.generateRotationTrack(e.modelName,e.R.curves,o,e.preRotation,e.postRotation,e.eulerOrder);void 0!==n&&t.push(n)}if(void 0!==e.S&&Object.keys(e.S.curves).length>0){const n=this.generateVectorTrack(e.modelName,e.S.curves,i,"scale");void 0!==n&&t.push(n)}if(void 0!==e.DeformPercent){const n=this.generateMorphTrack(e);void 0!==n&&t.push(n)}return t}generateVectorTrack(e,t,n,o){const i=this.getTimesForAllAxes(t),s=this.getKeyframeTrackValues(i,t,n);return new r.VectorKeyframeTrack(e+"."+o,i,s)}generateRotationTrack(e,t,n,o,i,s){void 0!==t.x&&(this.interpolateRotations(t.x),t.x.values=t.x.values.map(r.MathUtils.degToRad)),void 0!==t.y&&(this.interpolateRotations(t.y),t.y.values=t.y.values.map(r.MathUtils.degToRad)),void 0!==t.z&&(this.interpolateRotations(t.z),t.z.values=t.z.values.map(r.MathUtils.degToRad));const a=this.getTimesForAllAxes(t),c=this.getKeyframeTrackValues(a,t,n);void 0!==o&&((o=o.map(r.MathUtils.degToRad)).push(s),o=(new r.Euler).fromArray(o),o=(new r.Quaternion).setFromEuler(o)),void 0!==i&&((i=i.map(r.MathUtils.degToRad)).push(s),i=(new r.Euler).fromArray(i),i=(new r.Quaternion).setFromEuler(i).invert());const l=new r.Quaternion,h=new r.Euler,u=[];for(let e=0;e<c.length;e+=3)h.set(c[e],c[e+1],c[e+2],s),l.setFromEuler(h),void 0!==o&&l.premultiply(o),void 0!==i&&l.multiply(i),l.toArray(u,e/3*4);return new r.QuaternionKeyframeTrack(e+".quaternion",a,u)}generateMorphTrack(e){const t=e.DeformPercent.curves.morph,n=t.values.map((function(e){return e/100})),o=c.getObjectByName(e.modelName).morphTargetDictionary[e.morphName];return new r.NumberKeyframeTrack(e.modelName+".morphTargetInfluences["+o+"]",t.times,n)}getTimesForAllAxes(e){let t=[];if(void 0!==e.x&&(t=t.concat(e.x.times)),void 0!==e.y&&(t=t.concat(e.y.times)),void 0!==e.z&&(t=t.concat(e.z.times)),t=t.sort((function(e,t){return e-t})),t.length>1){let e=1,n=t[0];for(let r=1;r<t.length;r++){const o=t[r];o!==n&&(t[e]=o,n=o,e++)}t=t.slice(0,e)}return t}getKeyframeTrackValues(e,t,n){const r=n,o=[];let i=-1,s=-1,a=-1;return e.forEach((function(e){if(t.x&&(i=t.x.times.indexOf(e)),t.y&&(s=t.y.times.indexOf(e)),t.z&&(a=t.z.times.indexOf(e)),-1!==i){const e=t.x.values[i];o.push(e),r[0]=e}else o.push(r[0]);if(-1!==s){const e=t.y.values[s];o.push(e),r[1]=e}else o.push(r[1]);if(-1!==a){const e=t.z.values[a];o.push(e),r[2]=e}else o.push(r[2])})),o}interpolateRotations(e){for(let t=1;t<e.values.length;t++){const n=e.values[t-1],r=e.values[t]-n,o=Math.abs(r);if(o>=180){const i=o/180,s=r/i;let a=n+s;const c=e.times[t-1],l=(e.times[t]-c)/i;let h=c+l;const u=[],p=[];for(;h<e.times[t];)u.push(h),h+=l,p.push(a),a+=s;e.times=N(e.times,t,u),e.values=N(e.values,t,p)}}}}class d{getPrevNode(){return this.nodeStack[this.currentIndent-2]}getCurrentNode(){return this.nodeStack[this.currentIndent-1]}getCurrentProp(){return this.currentProp}pushStack(e){this.nodeStack.push(e),this.currentIndent+=1}popStack(){this.nodeStack.pop(),this.currentIndent-=1}setCurrentProp(e,t){this.currentProp=e,this.currentPropName=t}parse(e){this.currentIndent=0,this.allNodes=new g,this.nodeStack=[],this.currentProp=[],this.currentPropName="";const t=this,n=e.split(/[\r\n]+/);return n.forEach((function(e,r){const o=e.match(/^[\s\t]*;/),i=e.match(/^[\s\t]*$/);if(o||i)return;const s=e.match("^\\t{"+t.currentIndent+"}(\\w+):(.*){",""),a=e.match("^\\t{"+t.currentIndent+"}(\\w+):[\\s\\t\\r\\n](.*)"),c=e.match("^\\t{"+(t.currentIndent-1)+"}}");s?t.parseNodeBegin(e,s):a?t.parseNodeProperty(e,a,n[++r]):c?t.popStack():e.match(/^[^\s\t}]/)&&t.parseNodePropertyContinued(e)})),this.allNodes}parseNodeBegin(e,t){const n=t[1].trim().replace(/^"/,"").replace(/"$/,""),r=t[2].split(",").map((function(e){return e.trim().replace(/^"/,"").replace(/"$/,"")})),o={name:n},i=this.parseNodeAttr(r),s=this.getCurrentNode();0===this.currentIndent?this.allNodes.add(n,o):n in s?("PoseNode"===n?s.PoseNode.push(o):void 0!==s[n].id&&(s[n]={},s[n][s[n].id]=s[n]),""!==i.id&&(s[n][i.id]=o)):"number"==typeof i.id?(s[n]={},s[n][i.id]=o):"Properties70"!==n&&(s[n]="PoseNode"===n?[o]:o),"number"==typeof i.id&&(o.id=i.id),""!==i.name&&(o.attrName=i.name),""!==i.type&&(o.attrType=i.type),this.pushStack(o)}parseNodeAttr(e){let t=e[0];""!==e[0]&&(t=parseInt(e[0]),isNaN(t)&&(t=e[0]));let n="",r="";return e.length>1&&(n=e[1].replace(/^(\w+)::/,""),r=e[2]),{id:t,name:n,type:r}}parseNodeProperty(e,t,n){let r=t[1].replace(/^"/,"").replace(/"$/,"").trim(),o=t[2].replace(/^"/,"").replace(/"$/,"").trim();"Content"===r&&","===o&&(o=n.replace(/"/g,"").replace(/,$/,"").trim());const i=this.getCurrentNode();if("Properties70"!==i.name){if("C"===r){const e=o.split(",").slice(1),t=parseInt(e[0]),n=parseInt(e[1]);let s=o.split(",").slice(3);s=s.map((function(e){return e.trim().replace(/^"/,"")})),r="connections",o=[t,n],function(e,t){for(let n=0,r=e.length,o=t.length;n<o;n++,r++)e[r]=t[n]}(o,s),void 0===i[r]&&(i[r]=[])}"Node"===r&&(i.id=o),r in i&&Array.isArray(i[r])?i[r].push(o):"a"!==r?i[r]=o:i.a=o,this.setCurrentProp(i,r),"a"===r&&","!==o.slice(-1)&&(i.a=T(o))}else this.parseNodeSpecialProperty(e,r,o)}parseNodePropertyContinued(e){const t=this.getCurrentNode();t.a+=e,","!==e.slice(-1)&&(t.a=T(t.a))}parseNodeSpecialProperty(e,t,n){const r=n.split('",').map((function(e){return e.trim().replace(/^\"/,"").replace(/\s/,"_")})),o=r[0],i=r[1],s=r[2],a=r[3];let c=r[4];switch(i){case"int":case"enum":case"bool":case"ULongLong":case"double":case"Number":case"FieldOfView":c=parseFloat(c);break;case"Color":case"ColorRGB":case"Vector3D":case"Lcl_Translation":case"Lcl_Rotation":case"Lcl_Scaling":c=T(c)}this.getPrevNode()[o]={type:i,type2:s,flag:a,value:c},this.setCurrentProp(this.getPrevNode(),o)}}class f{parse(e){const t=new m(e);t.skip(23);const n=t.getUint32();if(n<6400)throw new Error("THREE.FBXLoader: FBX version not supported, FileVersion: "+n);const r=new g;for(;!this.endOfContent(t);){const e=this.parseNode(t,n);null!==e&&r.add(e.name,e)}return r}endOfContent(e){return e.size()%16==0?(e.getOffset()+160+16&-16)>=e.size():e.getOffset()+160+16>=e.size()}parseNode(e,t){const n={},r=t>=7500?e.getUint64():e.getUint32(),o=t>=7500?e.getUint64():e.getUint32();t>=7500?e.getUint64():e.getUint32();const i=e.getUint8(),s=e.getString(i);if(0===r)return null;const a=[];for(let t=0;t<o;t++)a.push(this.parseProperty(e));const c=a.length>0?a[0]:"",l=a.length>1?a[1]:"",h=a.length>2?a[2]:"";for(n.singleProperty=1===o&&e.getOffset()===r;r>e.getOffset();){const r=this.parseNode(e,t);null!==r&&this.parseSubNode(s,n,r)}return n.propertyList=a,"number"==typeof c&&(n.id=c),""!==l&&(n.attrName=l),""!==h&&(n.attrType=h),""!==s&&(n.name=s),n}parseSubNode(e,t,n){if(!0===n.singleProperty){const e=n.propertyList[0];Array.isArray(e)?(t[n.name]=n,n.a=e):t[n.name]=e}else if("Connections"===e&&"C"===n.name){const e=[];n.propertyList.forEach((function(t,n){0!==n&&e.push(t)})),void 0===t.connections&&(t.connections=[]),t.connections.push(e)}else if("Properties70"===n.name){Object.keys(n).forEach((function(e){t[e]=n[e]}))}else if("Properties70"===e&&"P"===n.name){let e=n.propertyList[0],r=n.propertyList[1];const o=n.propertyList[2],i=n.propertyList[3];let s;0===e.indexOf("Lcl ")&&(e=e.replace("Lcl ","Lcl_")),0===r.indexOf("Lcl ")&&(r=r.replace("Lcl ","Lcl_")),s="Color"===r||"ColorRGB"===r||"Vector"===r||"Vector3D"===r||0===r.indexOf("Lcl_")?[n.propertyList[4],n.propertyList[5],n.propertyList[6]]:n.propertyList[4],t[e]={type:r,type2:o,flag:i,value:s}}else void 0===t[n.name]?"number"==typeof n.id?(t[n.name]={},t[n.name][n.id]=n):t[n.name]=n:"PoseNode"===n.name?(Array.isArray(t[n.name])||(t[n.name]=[t[n.name]]),t[n.name].push(n)):void 0===t[n.name][n.id]&&(t[n.name][n.id]=n)}parseProperty(e){const t=e.getString(1);let n;switch(t){case"C":return e.getBoolean();case"D":return e.getFloat64();case"F":return e.getFloat32();case"I":return e.getInt32();case"L":return e.getInt64();case"R":return n=e.getUint32(),e.getArrayBuffer(n);case"S":return n=e.getUint32(),e.getString(n);case"Y":return e.getInt16();case"b":case"c":case"d":case"f":case"i":case"l":const r=e.getUint32(),i=e.getUint32(),s=e.getUint32();if(0===i)switch(t){case"b":case"c":return e.getBooleanArray(r);case"d":return e.getFloat64Array(r);case"f":return e.getFloat32Array(r);case"i":return e.getInt32Array(r);case"l":return e.getInt64Array(r)}void 0===o&&console.error("THREE.FBXLoader: External library fflate.min.js required.");const a=o.unzlibSync(new Uint8Array(e.getArrayBuffer(s))),c=new m(a.buffer);switch(t){case"b":case"c":return c.getBooleanArray(r);case"d":return c.getFloat64Array(r);case"f":return c.getFloat32Array(r);case"i":return c.getInt32Array(r);case"l":return c.getInt64Array(r)}break;default:throw new Error("THREE.FBXLoader: Unknown property type "+t)}}}class m{constructor(e,t){this.dv=new DataView(e),this.offset=0,this.littleEndian=void 0===t||t}getOffset(){return this.offset}size(){return this.dv.buffer.byteLength}skip(e){this.offset+=e}getBoolean(){return 1==(1&this.getUint8())}getBooleanArray(e){const t=[];for(let n=0;n<e;n++)t.push(this.getBoolean());return t}getUint8(){const e=this.dv.getUint8(this.offset);return this.offset+=1,e}getInt16(){const e=this.dv.getInt16(this.offset,this.littleEndian);return this.offset+=2,e}getInt32(){const e=this.dv.getInt32(this.offset,this.littleEndian);return this.offset+=4,e}getInt32Array(e){const t=[];for(let n=0;n<e;n++)t.push(this.getInt32());return t}getUint32(){const e=this.dv.getUint32(this.offset,this.littleEndian);return this.offset+=4,e}getInt64(){let e,t;return this.littleEndian?(e=this.getUint32(),t=this.getUint32()):(t=this.getUint32(),e=this.getUint32()),2147483648&t?(t=4294967295&~t,e=4294967295&~e,4294967295===e&&(t=t+1&4294967295),e=e+1&4294967295,-(4294967296*t+e)):4294967296*t+e}getInt64Array(e){const t=[];for(let n=0;n<e;n++)t.push(this.getInt64());return t}getUint64(){let e,t;return this.littleEndian?(e=this.getUint32(),t=this.getUint32()):(t=this.getUint32(),e=this.getUint32()),4294967296*t+e}getFloat32(){const e=this.dv.getFloat32(this.offset,this.littleEndian);return this.offset+=4,e}getFloat32Array(e){const t=[];for(let n=0;n<e;n++)t.push(this.getFloat32());return t}getFloat64(){const e=this.dv.getFloat64(this.offset,this.littleEndian);return this.offset+=8,e}getFloat64Array(e){const t=[];for(let n=0;n<e;n++)t.push(this.getFloat64());return t}getArrayBuffer(e){const t=this.dv.buffer.slice(this.offset,this.offset+e);return this.offset+=e,t}getString(e){let t=[];for(let n=0;n<e;n++)t[n]=this.getUint8();const n=t.indexOf(0);return n>=0&&(t=t.slice(0,n)),r.LoaderUtils.decodeText(new Uint8Array(t))}}class g{add(e,t){this[e]=t}}function y(e){const t=e.match(/FBXVersion: (\d+)/);if(t){return parseInt(t[1])}throw new Error("THREE.FBXLoader: Cannot find the version number for the file given.")}function v(e){return e/46186158e3}const w=[];function b(e,t,n,r){let o;switch(r.mappingType){case"ByPolygonVertex":o=e;break;case"ByPolygon":o=t;break;case"ByVertice":o=n;break;case"AllSame":o=r.indices[0];break;default:console.warn("THREE.FBXLoader: unknown attribute mapping type "+r.mappingType)}"IndexToDirect"===r.referenceType&&(o=r.indices[o]);const i=o*r.dataSize,s=i+r.dataSize;return function(e,t,n,r){for(let o=n,i=0;o<r;o++,i++)e[i]=t[o];return e}(w,r.buffer,i,s)}const x=new r.Euler,M=new r.Vector3;function A(e){const t=new r.Matrix4,n=new r.Matrix4,o=new r.Matrix4,i=new r.Matrix4,s=new r.Matrix4,a=new r.Matrix4,c=new r.Matrix4,l=new r.Matrix4,h=new r.Matrix4,u=new r.Matrix4,p=new r.Matrix4,d=new r.Matrix4,f=e.inheritType?e.inheritType:0;if(e.translation&&t.setPosition(M.fromArray(e.translation)),e.preRotation){const t=e.preRotation.map(r.MathUtils.degToRad);t.push(e.eulerOrder||r.Euler.DefaultOrder),n.makeRotationFromEuler(x.fromArray(t))}if(e.rotation){const t=e.rotation.map(r.MathUtils.degToRad);t.push(e.eulerOrder||r.Euler.DefaultOrder),o.makeRotationFromEuler(x.fromArray(t))}if(e.postRotation){const t=e.postRotation.map(r.MathUtils.degToRad);t.push(e.eulerOrder||r.Euler.DefaultOrder),i.makeRotationFromEuler(x.fromArray(t)),i.invert()}e.scale&&s.scale(M.fromArray(e.scale)),e.scalingOffset&&c.setPosition(M.fromArray(e.scalingOffset)),e.scalingPivot&&a.setPosition(M.fromArray(e.scalingPivot)),e.rotationOffset&&l.setPosition(M.fromArray(e.rotationOffset)),e.rotationPivot&&h.setPosition(M.fromArray(e.rotationPivot)),e.parentMatrixWorld&&(p.copy(e.parentMatrix),u.copy(e.parentMatrixWorld));const m=n.clone().multiply(o).multiply(i),g=new r.Matrix4;g.extractRotation(u);const y=new r.Matrix4;y.copyPosition(u);const v=y.clone().invert().multiply(u),w=g.clone().invert().multiply(v),b=s,A=new r.Matrix4;if(0===f)A.copy(g).multiply(m).multiply(w).multiply(b);else if(1===f)A.copy(g).multiply(w).multiply(m).multiply(b);else{const e=(new r.Matrix4).scale((new r.Vector3).setFromMatrixScale(p)).clone().invert(),t=w.clone().multiply(e);A.copy(g).multiply(m).multiply(t).multiply(b)}const k=h.clone().invert(),T=a.clone().invert();let I=t.clone().multiply(l).multiply(h).multiply(n).multiply(o).multiply(i).multiply(k).multiply(c).multiply(a).multiply(s).multiply(T);const N=(new r.Matrix4).copyPosition(I),E=u.clone().multiply(N);return d.copyPosition(E),I=d.clone().multiply(A),I.premultiply(u.invert()),I}function k(e){const t=["ZYX","YZX","XZY","ZXY","YXZ","XYZ"];return 6===(e=e||0)?(console.warn("THREE.FBXLoader: unsupported Euler Order: Spherical XYZ. Animations and rotations may be incorrect."),t[0]):t[e]}function T(e){return e.split(",").map((function(e){return parseFloat(e)}))}function I(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=e.byteLength),r.LoaderUtils.decodeText(new Uint8Array(e,t,n))}function N(e,t,n){return e.slice(0,t).concat(n).concat(e.slice(t))}},36023:(e,t,n)=>{n.r(t),n.d(t,{MTLLoader:()=>o});var r=n(81396);class o extends r.Loader{constructor(e){super(e)}load(e,t,n,o){const i=this,s=""===this.path?r.LoaderUtils.extractUrlBase(e):this.path,a=new r.FileLoader(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,(function(n){try{t(i.parse(n,s))}catch(t){o?o(t):console.error(t),i.manager.itemError(e)}}),n,o)}setMaterialOptions(e){return this.materialOptions=e,this}parse(e,t){const n=e.split("\n");let r={};const o=/\s+/,s={};for(let e=0;e<n.length;e++){let t=n[e];if(t=t.trim(),0===t.length||"#"===t.charAt(0))continue;const i=t.indexOf(" ");let a=i>=0?t.substring(0,i):t;a=a.toLowerCase();let c=i>=0?t.substring(i+1):"";if(c=c.trim(),"newmtl"===a)r={name:c},s[c]=r;else if("ka"===a||"kd"===a||"ks"===a||"ke"===a){const e=c.split(o,3);r[a]=[parseFloat(e[0]),parseFloat(e[1]),parseFloat(e[2])]}else r[a]=c}const a=new i(this.resourcePath||t,this.materialOptions);return a.setCrossOrigin(this.crossOrigin),a.setManager(this.manager),a.setMaterials(s),a}}class i{constructor(e="",t={}){this.baseUrl=e,this.options=t,this.materialsInfo={},this.materials={},this.materialsArray=[],this.nameLookup={},this.crossOrigin="anonymous",this.side=void 0!==this.options.side?this.options.side:r.FrontSide,this.wrap=void 0!==this.options.wrap?this.options.wrap:r.RepeatWrapping}setCrossOrigin(e){return this.crossOrigin=e,this}setManager(e){this.manager=e}setMaterials(e){this.materialsInfo=this.convert(e),this.materials={},this.materialsArray=[],this.nameLookup={}}convert(e){if(!this.options)return e;const t={};for(const n in e){const r=e[n],o={};t[n]=o;for(const e in r){let t=!0,n=r[e];const i=e.toLowerCase();switch(i){case"kd":case"ka":case"ks":this.options&&this.options.normalizeRGB&&(n=[n[0]/255,n[1]/255,n[2]/255]),this.options&&this.options.ignoreZeroRGBs&&0===n[0]&&0===n[1]&&0===n[2]&&(t=!1)}t&&(o[i]=n)}}return t}preload(){for(const e in this.materialsInfo)this.create(e)}getIndex(e){return this.nameLookup[e]}getAsArray(){let e=0;for(const t in this.materialsInfo)this.materialsArray[e]=this.create(t),this.nameLookup[t]=e,e++;return this.materialsArray}create(e){return void 0===this.materials[e]&&this.createMaterial_(e),this.materials[e]}createMaterial_(e){const t=this,n=this.materialsInfo[e],o={name:e,side:this.side};function i(e,n){if(o[e])return;const i=t.getTextureParams(n,o),s=t.loadTexture((a=t.baseUrl,"string"!=typeof(c=i.url)||""===c?"":/^https?:\/\//i.test(c)?c:a+c));var a,c;s.repeat.copy(i.scale),s.offset.copy(i.offset),s.wrapS=t.wrap,s.wrapT=t.wrap,"map"!==e&&"emissiveMap"!==e||(s.encoding=r.sRGBEncoding),o[e]=s}for(const e in n){const t=n[e];let s;if(""!==t)switch(e.toLowerCase()){case"kd":o.color=(new r.Color).fromArray(t).convertSRGBToLinear();break;case"ks":o.specular=(new r.Color).fromArray(t).convertSRGBToLinear();break;case"ke":o.emissive=(new r.Color).fromArray(t).convertSRGBToLinear();break;case"map_kd":i("map",t);break;case"map_ks":i("specularMap",t);break;case"map_ke":i("emissiveMap",t);break;case"norm":i("normalMap",t);break;case"map_bump":case"bump":i("bumpMap",t);break;case"map_d":i("alphaMap",t),o.transparent=!0;break;case"ns":o.shininess=parseFloat(t);break;case"d":s=parseFloat(t),s<1&&(o.opacity=s,o.transparent=!0);break;case"tr":s=parseFloat(t),this.options&&this.options.invertTrProperty&&(s=1-s),s>0&&(o.opacity=1-s,o.transparent=!0)}}return this.materials[e]=new r.MeshPhongMaterial(o),this.materials[e]}getTextureParams(e,t){const n={scale:new r.Vector2(1,1),offset:new r.Vector2(0,0)},o=e.split(/\s+/);let i;return i=o.indexOf("-bm"),i>=0&&(t.bumpScale=parseFloat(o[i+1]),o.splice(i,2)),i=o.indexOf("-s"),i>=0&&(n.scale.set(parseFloat(o[i+1]),parseFloat(o[i+2])),o.splice(i,4)),i=o.indexOf("-o"),i>=0&&(n.offset.set(parseFloat(o[i+1]),parseFloat(o[i+2])),o.splice(i,4)),n.url=o.join(" ").trim(),n}loadTexture(e,t,n,o,i){const s=void 0!==this.manager?this.manager:r.DefaultLoadingManager;let a=s.getHandler(e);null===a&&(a=new r.TextureLoader(s)),a.setCrossOrigin&&a.setCrossOrigin(this.crossOrigin);const c=a.load(e,n,o,i);return void 0!==t&&(c.mapping=t),c}}},87011:(e,t,n)=>{n.r(t),n.d(t,{OBJLoader:()=>g});var r=n(81396);const o=/^[og]\s*(.+)?/,i=/^mtllib /,s=/^usemtl /,a=/^usemap /,c=/\s+/,l=new r.Vector3,h=new r.Vector3,u=new r.Vector3,p=new r.Vector3,d=new r.Vector3,f=new r.Color;function m(){const e={objects:[],object:{},vertices:[],normals:[],colors:[],uvs:[],materials:{},materialLibraries:[],startObject:function(e,t){if(this.object&&!1===this.object.fromDeclaration)return this.object.name=e,void(this.object.fromDeclaration=!1!==t);const n=this.object&&"function"==typeof this.object.currentMaterial?this.object.currentMaterial():void 0;if(this.object&&"function"==typeof this.object._finalize&&this.object._finalize(!0),this.object={name:e||"",fromDeclaration:!1!==t,geometry:{vertices:[],normals:[],colors:[],uvs:[],hasUVIndices:!1},materials:[],smooth:!0,startMaterial:function(e,t){const n=this._finalize(!1);n&&(n.inherited||n.groupCount<=0)&&this.materials.splice(n.index,1);const r={index:this.materials.length,name:e||"",mtllib:Array.isArray(t)&&t.length>0?t[t.length-1]:"",smooth:void 0!==n?n.smooth:this.smooth,groupStart:void 0!==n?n.groupEnd:0,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(e){const t={index:"number"==typeof e?e:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return t.clone=this.clone.bind(t),t}};return this.materials.push(r),r},currentMaterial:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]},_finalize:function(e){const t=this.currentMaterial();if(t&&-1===t.groupEnd&&(t.groupEnd=this.geometry.vertices.length/3,t.groupCount=t.groupEnd-t.groupStart,t.inherited=!1),e&&this.materials.length>1)for(let e=this.materials.length-1;e>=0;e--)this.materials[e].groupCount<=0&&this.materials.splice(e,1);return e&&0===this.materials.length&&this.materials.push({name:"",smooth:this.smooth}),t}},n&&n.name&&"function"==typeof n.clone){const e=n.clone(0);e.inherited=!0,this.object.materials.push(e)}this.objects.push(this.object)},finalize:function(){this.object&&"function"==typeof this.object._finalize&&this.object._finalize(!0)},parseVertexIndex:function(e,t){const n=parseInt(e,10);return 3*(n>=0?n-1:n+t/3)},parseNormalIndex:function(e,t){const n=parseInt(e,10);return 3*(n>=0?n-1:n+t/3)},parseUVIndex:function(e,t){const n=parseInt(e,10);return 2*(n>=0?n-1:n+t/2)},addVertex:function(e,t,n){const r=this.vertices,o=this.object.geometry.vertices;o.push(r[e+0],r[e+1],r[e+2]),o.push(r[t+0],r[t+1],r[t+2]),o.push(r[n+0],r[n+1],r[n+2])},addVertexPoint:function(e){const t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addVertexLine:function(e){const t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addNormal:function(e,t,n){const r=this.normals,o=this.object.geometry.normals;o.push(r[e+0],r[e+1],r[e+2]),o.push(r[t+0],r[t+1],r[t+2]),o.push(r[n+0],r[n+1],r[n+2])},addFaceNormal:function(e,t,n){const r=this.vertices,o=this.object.geometry.normals;l.fromArray(r,e),h.fromArray(r,t),u.fromArray(r,n),d.subVectors(u,h),p.subVectors(l,h),d.cross(p),d.normalize(),o.push(d.x,d.y,d.z),o.push(d.x,d.y,d.z),o.push(d.x,d.y,d.z)},addColor:function(e,t,n){const r=this.colors,o=this.object.geometry.colors;void 0!==r[e]&&o.push(r[e+0],r[e+1],r[e+2]),void 0!==r[t]&&o.push(r[t+0],r[t+1],r[t+2]),void 0!==r[n]&&o.push(r[n+0],r[n+1],r[n+2])},addUV:function(e,t,n){const r=this.uvs,o=this.object.geometry.uvs;o.push(r[e+0],r[e+1]),o.push(r[t+0],r[t+1]),o.push(r[n+0],r[n+1])},addDefaultUV:function(){const e=this.object.geometry.uvs;e.push(0,0),e.push(0,0),e.push(0,0)},addUVLine:function(e){const t=this.uvs;this.object.geometry.uvs.push(t[e+0],t[e+1])},addFace:function(e,t,n,r,o,i,s,a,c){const l=this.vertices.length;let h=this.parseVertexIndex(e,l),u=this.parseVertexIndex(t,l),p=this.parseVertexIndex(n,l);if(this.addVertex(h,u,p),this.addColor(h,u,p),void 0!==s&&""!==s){const e=this.normals.length;h=this.parseNormalIndex(s,e),u=this.parseNormalIndex(a,e),p=this.parseNormalIndex(c,e),this.addNormal(h,u,p)}else this.addFaceNormal(h,u,p);if(void 0!==r&&""!==r){const e=this.uvs.length;h=this.parseUVIndex(r,e),u=this.parseUVIndex(o,e),p=this.parseUVIndex(i,e),this.addUV(h,u,p),this.object.geometry.hasUVIndices=!0}else this.addDefaultUV()},addPointGeometry:function(e){this.object.geometry.type="Points";const t=this.vertices.length;for(let n=0,r=e.length;n<r;n++){const r=this.parseVertexIndex(e[n],t);this.addVertexPoint(r),this.addColor(r)}},addLineGeometry:function(e,t){this.object.geometry.type="Line";const n=this.vertices.length,r=this.uvs.length;for(let t=0,r=e.length;t<r;t++)this.addVertexLine(this.parseVertexIndex(e[t],n));for(let e=0,n=t.length;e<n;e++)this.addUVLine(this.parseUVIndex(t[e],r))}};return e.startObject("",!1),e}class g extends r.Loader{constructor(e){super(e),this.materials=null}load(e,t,n,o){const i=this,s=new r.FileLoader(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,(function(n){try{t(i.parse(n))}catch(t){o?o(t):console.error(t),i.manager.itemError(e)}}),n,o)}setMaterials(e){return this.materials=e,this}parse(e){const t=new m;-1!==e.indexOf("\r\n")&&(e=e.replace(/\r\n/g,"\n")),-1!==e.indexOf("\\\n")&&(e=e.replace(/\\\n/g,""));const n=e.split("\n");let l=[];for(let e=0,r=n.length;e<r;e++){const r=n[e].trimStart();if(0===r.length)continue;const h=r.charAt(0);if("#"!==h)if("v"===h){const e=r.split(c);switch(e[0]){case"v":t.vertices.push(parseFloat(e[1]),parseFloat(e[2]),parseFloat(e[3])),e.length>=7?(f.setRGB(parseFloat(e[4]),parseFloat(e[5]),parseFloat(e[6])).convertSRGBToLinear(),t.colors.push(f.r,f.g,f.b)):t.colors.push(void 0,void 0,void 0);break;case"vn":t.normals.push(parseFloat(e[1]),parseFloat(e[2]),parseFloat(e[3]));break;case"vt":t.uvs.push(parseFloat(e[1]),parseFloat(e[2]))}}else if("f"===h){const e=r.slice(1).trim().split(c),n=[];for(let t=0,r=e.length;t<r;t++){const r=e[t];if(r.length>0){const e=r.split("/");n.push(e)}}const o=n[0];for(let e=1,r=n.length-1;e<r;e++){const r=n[e],i=n[e+1];t.addFace(o[0],r[0],i[0],o[1],r[1],i[1],o[2],r[2],i[2])}}else if("l"===h){const e=r.substring(1).trim().split(" ");let n=[];const o=[];if(-1===r.indexOf("/"))n=e;else for(let t=0,r=e.length;t<r;t++){const r=e[t].split("/");""!==r[0]&&n.push(r[0]),""!==r[1]&&o.push(r[1])}t.addLineGeometry(n,o)}else if("p"===h){const e=r.slice(1).trim().split(" ");t.addPointGeometry(e)}else if(null!==(l=o.exec(r))){const e=(" "+l[0].slice(1).trim()).slice(1);t.startObject(e)}else if(s.test(r))t.object.startMaterial(r.substring(7).trim(),t.materialLibraries);else if(i.test(r))t.materialLibraries.push(r.substring(7).trim());else if(a.test(r))console.warn('THREE.OBJLoader: Rendering identifier "usemap" not supported. Textures must be defined in MTL files.');else if("s"===h){if(l=r.split(" "),l.length>1){const e=l[1].trim().toLowerCase();t.object.smooth="0"!==e&&"off"!==e}else t.object.smooth=!0;const e=t.object.currentMaterial();e&&(e.smooth=t.object.smooth)}else{if("\0"===r)continue;console.warn('THREE.OBJLoader: Unexpected line: "'+r+'"')}}t.finalize();const h=new r.Group;h.materialLibraries=[].concat(t.materialLibraries);if(!0===!(1===t.objects.length&&0===t.objects[0].geometry.vertices.length))for(let e=0,n=t.objects.length;e<n;e++){const n=t.objects[e],o=n.geometry,i=n.materials,s="Line"===o.type,a="Points"===o.type;let c=!1;if(0===o.vertices.length)continue;const l=new r.BufferGeometry;l.setAttribute("position",new r.Float32BufferAttribute(o.vertices,3)),o.normals.length>0&&l.setAttribute("normal",new r.Float32BufferAttribute(o.normals,3)),o.colors.length>0&&(c=!0,l.setAttribute("color",new r.Float32BufferAttribute(o.colors,3))),!0===o.hasUVIndices&&l.setAttribute("uv",new r.Float32BufferAttribute(o.uvs,2));const u=[];for(let e=0,n=i.length;e<n;e++){const n=i[e],o=n.name+"_"+n.smooth+"_"+c;let l=t.materials[o];if(null!==this.materials)if(l=this.materials.create(n.name),!s||!l||l instanceof r.LineBasicMaterial){if(a&&l&&!(l instanceof r.PointsMaterial)){const e=new r.PointsMaterial({size:10,sizeAttenuation:!1});r.Material.prototype.copy.call(e,l),e.color.copy(l.color),e.map=l.map,l=e}}else{const e=new r.LineBasicMaterial;r.Material.prototype.copy.call(e,l),e.color.copy(l.color),l=e}void 0===l&&(l=s?new r.LineBasicMaterial:a?new r.PointsMaterial({size:1,sizeAttenuation:!1}):new r.MeshPhongMaterial,l.name=n.name,l.flatShading=!n.smooth,l.vertexColors=c,t.materials[o]=l),u.push(l)}let p;if(u.length>1){for(let e=0,t=i.length;e<t;e++){const t=i[e];l.addGroup(t.groupStart,t.groupCount,e)}p=s?new r.LineSegments(l,u):a?new r.Points(l,u):new r.Mesh(l,u)}else p=s?new r.LineSegments(l,u[0]):a?new r.Points(l,u[0]):new r.Mesh(l,u[0]);p.name=n.name,h.add(p)}else if(t.vertices.length>0){const e=new r.PointsMaterial({size:1,sizeAttenuation:!1}),n=new r.BufferGeometry;n.setAttribute("position",new r.Float32BufferAttribute(t.vertices,3)),t.colors.length>0&&void 0!==t.colors[0]&&(n.setAttribute("color",new r.Float32BufferAttribute(t.colors,3)),e.vertexColors=!0);const o=new r.Points(n,e);h.add(o)}return h}}}}]);
@@ -0,0 +1,27 @@
1
+ /*!
2
+ * Matterport Showcase SDK
3
+ *
4
+ * © 2022 Matterport, Inc. All rights reserved.
5
+ *
6
+ * Matterport Showcase SDK ("Showcase SDK") must be used according to
7
+ * the Matterport Terms of Service located at https://matterport.com/terms-of-use, the Platform Subscription Agreement ("PSA") available at https://matterport.com/legal/platform-subscription-agreement and the SDK License terms included in the PSA ("SDK License"). Any use of the Showcase SDK requires a current active Matterport account and associated developer key.
8
+ *
9
+ * -------------------------------------------------------------------------------
10
+ *
11
+ * Redistribution and use in source and binary forms, without modification, is permitted in accordance with the SDK License provided that the following conditions are met:
12
+ *
13
+ * * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
14
+ * * Neither the name of Matterport nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
15
+ *
16
+ * THE SHOWCASE SDK IS PROVIDED BY MATTERPORT AS THE COPYRIGHT HOLDER AND, IF APPLICABLE, ITS CONTRIBUTORS "AS IS" AND WITHOUT WARRANTIES OF ANY KIND. TO THE FULLEST EXTENT PERMISSIBLE PURSUANT TO APPLICABLE LAW, MATTERPORT DISCLAIMS, ON BEHALF OF ITSELF AND ITS AFFILIATES AND LICENSORS, ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. MATTERPORT DOES NOT WARRANT THAT THE AVAILABILITY OF THE SHOWCASE SDK WILL BE UNINTERRUPTED OR ERROR-FREE, THAT DEFECTS WILL BE CORRECTED, OR THAT THE SHOWCASE SDK WILL BE FREE OF VIRUSES OR OTHER HARMFUL COMPONENTS. MATTERPORT DOES NOT MAKE ANY REPRESENTATIONS OR WARRANTIES REGARDING THE USE OR THE RESULTS OF THE USE OF THE SHOWCASE SDK OR FUNCTIONS ON THE SHOWCASE SDK IN TERMS OF THEIR CORRECTNESS, ACCURACY, RELIABILITY, RESULTS TO BE ACHIEVED, OR OTHERWISE. APPLICABLE LAW MAY NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SOME OR ALL OF THE FOREGOING DISCLAIMERS MAY NOT APPLY TO YOU.
17
+ *
18
+ * TO THE EXTENT PERMITTED UNDER APPLICABLE LAW UNDER NO CIRCUMSTANCES, INCLUDING, BUT NOT LIMITED TO, NEGLIGENCE, SHALL MATTERPORT OR ITS AFFILIATES OR LICENSORS BE LIABLE FOR ANY CONSEQUENTIAL, EXEMPLARY, PUNITIVE, SPECIAL, INCIDENTAL OR OTHER INDIRECT DAMAGES, EVEN IF MATTERPORT OR A MATTERPORT AUTHORIZED REPRESENTATIVE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. APPLICABLE LAW MAY NOT ALLOW SOME OR ALL OF THIS LIMITATION OF LIABILITY, SO IT MAY NOT APPLY TO YOU.
19
+ *
20
+ */
21
+
22
+ /*!
23
+ fflate - fast JavaScript compression/decompression
24
+ <https://101arrowz.github.io/fflate>
25
+ Licensed under MIT. https://github.com/101arrowz/fflate/blob/master/LICENSE
26
+ version 0.6.9
27
+ */
@@ -0,0 +1,2 @@
1
+ /*! For license information please see 512.js.LICENSE.txt */
2
+ (self.webpackChunkmp_webgl=self.webpackChunkmp_webgl||[]).push([[512],{55721:(e,t,i)=>{"use strict";var r;i.d(t,{Z:()=>o}),function(e){e[e.None=0]="None",e[e.Queued=1]="Queued",e[e.ForceQueued=2]="ForceQueued",e[e.Downloading=3]="Downloading",e[e.Downloaded=4]="Downloaded",e[e.DownloadFailed=5]="DownloadFailed"}(r||(r={}));const o=r},21270:(e,t,i)=>{"use strict";var r;i.d(t,{V:()=>r}),function(e){e[e.Min=0]="Min",e[e.Standard=1]="Standard",e[e.High=2]="High",e[e.Detail=3]="Detail"}(r||(r={}))},51524:(e,t,i)=>{"use strict";i.d(t,{t:()=>n});var r=i(59279),o=i(53261),s=i(31362),a=i(21270);const n={urlTemplateToken:"<file>",initialMaxLOD:a.V.Min,nonMeshMaxLOD:a.V.Standard,maxLOD:a.V.High,minLOD:a.V.Min,loadSiblings:!0,displayActiveTiles:!1,autoDisableRendererCulling:!0,optimizeRaycast:!1,stopAtEmptyTiles:!1,errorTarget:Number((0,r.eY)("errorTarget",(0,s.tq)()?6:4)),disableTileUpdates:!1,errorMultiplierRaycastOcclusion:.1,errorMultiplierHiddenFloors:.01,disposeModel:!1,limitMemoryUsage:(0,s.tq)(),allocatedMegsBeforeLimitingLod:350,lruMinExtraTiles:(0,s.tq)()?0:100,lruMaxTiles:800,lruUnloadPercent:.05,tileAssetRequestPriority:o.ru.MEDIUM,downloadQueueConcurrency:8,parseQueueConcurrency:10,snappingMaxLOD:a.V.Standard}},88338:(e,t,i)=>{"use strict";i.d(t,{E:()=>r});const r={longerTransitionMaxDist:10,TRANSITION_TIME_DH:650}},20043:(e,t,i)=>{"use strict";i.d(t,{Tq:()=>a,bG:()=>c});var r=i(98169),o=i(81248),s=i(88338);const a=(e,t,i,r,...o)=>n({sweepData:e,direction:t,directionFactor:i,sourceSweep:r,ignoreSweeps:o}),n=e=>{const{sweepData:t,direction:i,sourceSweep:s,ignoreSweeps:a,directionFactor:n}=e;if(!t.currentSweepObject)return[];const c=s||t.currentSweepObject,h=[r.ff(c),r._k(),r.vO(c),r.pI(c.position,i,n)];for(const e of a)h.push(r.ff(e));const l=[o.o7(c.position,i),o.TE(c.position)],u=t.getSweepNeighbours(c);return t.sortByScore(h,l,u)},c=(e,t,i,a)=>{const n=[r._k(),r._T()],c=[o.Dv(i.point)],h=e.currentSweepObject;t&&h&&n.push(r.ff(h),r.SF(h.position,s.E.longerTransitionMaxDist),r.vO(h)),i.face&&n.push(r.D5(i.point,i.face.normal));const l=a.floorIdFromObject(i.object);l&&c.push(o.Bv(l));const u=e.sortByScore(n,c);if(0===u.length){const t=e.getClosestSweep(i.point,!0);u.push({sweep:t,score:0})}return u}},48176:(e,t,i)=>{"use strict";i.d(t,{I6:()=>D,at:()=>b});var r,o=i(81396),s=i(27646),a=i(55084),n=i(55721),c=i(2569),h=i(76609),l=i(71239),u=i(54730),p=i(98169),d=i(81248),g=i(37082),f=i(20387),w=i(90304),y=i(31362),S=i(95882),m=i(20043);!function(e){e[e.None=0]="None",e[e.DirectionalFOV=1]="DirectionalFOV"}(r||(r={}));class D{constructor(e,t,i,r){this.cameraRot=new o.Quaternion,this.sweep=e,this.cameraPosition=(new o.Vector3).copy(t),this.cameraDir=(new o.Vector3).copy(i),this.upcomingSweeps=r,this.zoomingActive=!1}}const T=(e,t,i=!1)=>{let r=0;if(e&&t)for(const o of t)i&&-1!==e.indexOf(o)||(e.push(o),r++);return r};class b{constructor(e,t,i,r){this.panoQualityManager=e,this.tilingSettings=t,this.sweepData=i,this.raycaster=r,this.directionalFOV=120,this.tempQueue=[],this.filterAndPrioritize=(e,t,i)=>{if(!this.priorityCriteria.sweep)return;const r=void 0!==this.priorityCriteria.upcomingSweeps&&null!==this.priorityCriteria.upcomingSweeps,o=this.tempQueue;o.length=0,this.queueTilesForPano(o,i,this.priorityCriteria.sweep,h.AB.BASE);const s=T(e,o,!0);this.currViewQueue[h.SL.BASE].value=s,this.fullPanoQueue[h.SL.BASE].value=s,r?this.queueForRestrictedSweeps(e,i):this.priorityCriteria.viewMode!==S.Ey.Panorama?this.queueForNonPanoViewmode(e,i):this.queueForPanoViewmode(e,t,i),this.tilingSettings.downloadFullPano&&this.queueFullPano(e,i)},this.queueRaycast=(()=>{const e=new o.Vector3;return(t,i)=>{if(this.priorityCriteria.sweep)if(this.priorityCriteria.hoveredSweep)this.queueTilesForPano(t,i,this.priorityCriteria.hoveredSweep,h.AB.BASE);else if(this.raycaster&&this.raycaster.hit){const r=e.copy(this.raycaster.hit.point).sub(this.priorityCriteria.sweep.position),o=this.getSinglePanoInDirection(r),s=this.sweepData.getSweep(o);s&&this.queueTilesForPano(t,i,s,h.AB.BASE)}}})(),this.queueRaycastIntersection=(e,t)=>{if(!this.raycaster||!this.raycaster.hit||!this.meshQuery)return;const i=(0,m.bG)(this.sweepData,!1,this.raycaster.hit.intersection,this.meshQuery),r=i.length>0?i[0].sweep:this.sweepData.getClosestSweep(this.raycaster.hit.point,!0);r&&this.queueTilesForPano(e,t,r,h.AB.BASE)},this.getSweepIdInLocalDirection=(()=>{const e=new o.Vector3;return t=>{const i=this.priorityCriteria.cameraRot,r=e.copy(t).applyQuaternion(i);return this.getSinglePanoInDirection(r)}})(),this.persistentStorage=new u.a,this.maxResolution=e.getNavPanoSize(),this.currViewQueue=x(),this.fullPanoQueue=x(),this.isMobileDevice=(0,y.tq)(),this.priorityCriteria=new D(null,new o.Vector3(0,0,0),new o.Vector3(0,0,-1))}getQualityQueueSize(e,t){return e===f.v.CurrentView?this.currViewQueue[t].value:this.fullPanoQueue[t].value}makeQueueSubscription(e,t,i){return(e===f.v.CurrentView?this.currViewQueue[t]:this.fullPanoQueue[t]).onChanged(i)}updateCriteria(e,t,i,r){this.priorityCriteria.sweep=e,this.priorityCriteria.cameraPosition.copy(t),this.priorityCriteria.cameraDir.copy(i),this.priorityCriteria.cameraRot.copy(r)}setHoveredSweep(e){this.priorityCriteria.hoveredSweep=e}setUpcomingSweeps(e){this.priorityCriteria.upcomingSweeps=e}clearUpcomingSweeps(){this.priorityCriteria.upcomingSweeps=void 0}setDownloadFOV(e){this.directionalFOV=e}queueForRestrictedSweeps(e,t){if(!this.priorityCriteria.upcomingSweeps)return;let i=0;for(const r of this.priorityCriteria.upcomingSweeps)if(i++,this.queueTilesForPano(e,t,r,h.AB.BASE),i>=3)break;this.queueFOVStandardNarrow(e,t),this.queueFOVHighNarrow(e,t)}queueForPanoViewmode(e,t,i){this.queueRaycast(e,i),this.queueFOVStandardNarrow(e,i),this.queueScoredSweeps(e,t,i),this.queueFOVHighNarrow(e,i),this.isMobileDevice||this.queueWASD(e,t,i)}queueForNonPanoViewmode(e,t){this.queueRaycastIntersection(e,t)}queueFOVTiles(e,t,i,r){if(!this.priorityCriteria.sweep)return 0;const o=h.eE[t];return this.canDownloadSize(this.priorityCriteria.sweep,t)?this.queueTilesInDirectionForPano(e,r,this.priorityCriteria.sweep,o,this.priorityCriteria.cameraDir,i):0}queueScoredSweeps(e,t,i){if(this.priorityCriteria.sweep&&this.maxResolution<=2048){const r=this.persistentStorage.getArray("filterAndPrioritize:scoredSweeps");this.populateScoredSweeps(this.priorityCriteria.sweep,t,r,this.priorityCriteria.cameraDir,6),this.queueTilesForPanos(e,r,i,h.AB.BASE,4)}}queueFOVStandardNarrow(e,t){if(!this.priorityCriteria.sweep)return;const i=this.tempQueue;i.length=0;const r=this.queueFOVTiles(i,h.SL.STANDARD,this.directionalFOV,t);this.sortTiles(i,this.priorityCriteria.sweep,this.priorityCriteria.cameraDir),T(e,i),this.currViewQueue[h.SL.STANDARD].value=r,this.fullPanoQueue[h.SL.STANDARD].value=r}queueFOVHighNarrow(e,t){if(!this.priorityCriteria.sweep)return;const i=this.tempQueue;i.length=0;const r=this.queueFOVTiles(i,h.SL.HIGH,this.directionalFOV,t),o=this.queueFOVTiles(i,h.SL.ULTRAHIGH,this.directionalFOV,t);this.sortTiles(i,this.priorityCriteria.sweep,this.priorityCriteria.cameraDir),T(e,i),this.currViewQueue[h.SL.HIGH].value=r,this.currViewQueue[h.SL.ULTRAHIGH].value=o}queueFullPano(e,t){if(!this.priorityCriteria.sweep)return;const i=this.tempQueue;if(i.length=0,this.maxResolution<=h.AB.HIGH){if(this.canDownloadSize(this.priorityCriteria.sweep,h.SL.HIGH)){const e=this.queueTilesForPano(i,t,this.priorityCriteria.sweep,h.AB.HIGH);this.fullPanoQueue[h.SL.HIGH].value=e}}else if(this.canDownloadSize(this.priorityCriteria.sweep,h.SL.ULTRAHIGH)){const e=this.queueTilesForPano(i,t,this.priorityCriteria.sweep,h.AB.ULTRAHIGH);this.fullPanoQueue[h.SL.ULTRAHIGH].value=e}this.sortTiles(i,this.priorityCriteria.sweep,this.priorityCriteria.cameraDir),T(e,i,!0)}queueWASD(e,t,i){const r=this.persistentStorage.getArray("filterAndPrioritize:neighbors")||[];if(r.length=0,!this.priorityCriteria.sweep)return;const o=[w.f.FORWARD,w.f.RIGHT,w.f.LEFT,w.f.BACK];for(const e of o){const i=this.getSweepIdInLocalDirection(e),o=t.get(i);o&&r.push(o)}this.queueTilesForPanos(e,r,i,h.AB.BASE)}canDownloadSize(e,t){const i=h.eE[t],r=this.panoQualityManager.getNavPanoSize()>=i||this.maxResolution>=i&&this.panoQualityManager.getZoomPanoSize()>=i,o=this.panoQualityManager.getTestResults(e.id,t);return r&&o===s.S.Untested&&this.panoQualityManager.testDownload(e,t,a.I_),o===s.S.Success&&r}populateScoredSweeps(e,t,i,r,s){(i=i||[]).length=0;const a=(new o.Vector3).copy(e.position),n=[p._k(),p.ff(e),p.jN(a,400),p.pI(a,r,.75)],c=[d.Dv(a,l.Xd.navigation.distanceFactor),d.o7(a,r,l.Xd.navigation.directionFactor)],h=this.sweepData.getSweepNeighbours(e),u=this.sweepData.sortByScore(n,c,h);for(let e=0;e<u.length&&e<s;e++){const t=u[e].sweep;i.push(t)}}queueTilesForPanos(e,t,i,r,o){let s=0;for(const a of t){if(s+=this.queueTilesForPano(e,i,a,r)>0?1:0,o&&s>=o)break}return s}queueTilesForPano(e,t,i,o){const s=this.persistentStorage.get("queueTilesForSweep:filterCriteria",(()=>({filter:r.None})));return this.filterAndQueueTileDownloadDescriptors(e,t,i,o,s)}queueTilesInDirectionForPano(e,t,i,s,n,c){const h=this.persistentStorage.get("queueTilesInDirectionForSweep:panoSpaceDir",(()=>new o.Vector3)),l=this.persistentStorage.get("queueTilesInDirectionForSweep:filterCriteria",(()=>({filter:r.DirectionalFOV,direction:new o.Vector3,fov:60})));return h.copy(n),a.ym(i.rotation,h),l.direction.copy(h),l.fov=c,this.filterAndQueueTileDownloadDescriptors(e,t,i,s,l)}filterAndQueueTileDownloadDescriptors(e,t,i,r,o){const s=this.persistentStorage.getArray("filterAndQueueTileDownloadDescriptors:descriptors"),a=t.getTileDownloadDescriptors(i,r);s.length=0,this.filterTileDownloadDescriptors(a,s,o);let n=0;for(const t of s)t&&(e.push(t),n++);return n}filterTileDownloadDescriptors(e,t,i){let o,s;switch(i.filter){case r.DirectionalFOV:for(o=0;o<e.length;o++)s=e[o],s&&a.eO(s.panoSize,s.tileSize,s.face,s.tileX,s.tileY,i.direction,i.fov)&&t.push(s);break;default:for(o=0;o<e.length;o++)s=e[o],t.push(s)}for(o=0;o<t.length;o++)s=t[o],s&&!this.canIncludeDescriptor(s)&&(t[o]=null)}canIncludeDescriptor(e){return e.status!==n.Z.Downloading&&e.status!==n.Z.Downloaded}sortTiles(e,t,i){C.panoSpaceDir.copy(i),a.ym(t.rotation,C.panoSpaceDir),C.fovThresholdNarrow=c.tf(this.directionalFOV),e.sort(v)}insertSortedPanoTile(e,t,i,r){C.panoSpaceDir.copy(r),a.ym(i.rotation,C.panoSpaceDir),C.fovThresholdNarrow=c.tf(this.directionalFOV);let o=-1;for(let i=0;i<e.length;i++){if(v(t,e[i])<=0){o=i;break}}if(-1===o)e[e.length]=t;else{for(let t=e.length;t>o;t--)e[t]=e[t-1];e[o]=t}}getSinglePanoInDirection(e){const t=this.priorityCriteria.sweep;if(!t)return"";const i=[p.ff(t),p._k(),p.pI(t.position,e)],r=[d.o7(t.position,e),d.TE(t.position)],o=t.neighbours.filter((e=>{const t=this.sweepData.getSweep(e);return i.every((e=>e(t)))})).map((e=>{const t=this.sweepData.getSweep(e);return{sweepId:e,score:r.reduce(((e,i)=>e+i(t)),0)}})),s=o.reduce(((e,t)=>e.score>t.score?e:t),o[0]);return s?s.sweepId:""}}const C={panoSpaceDir:new o.Vector3,fovThresholdNarrow:-1},v=(e,t)=>{const i=C.panoSpaceDir,r=C.fovThresholdNarrow,o=Math.max(Math.min(i.dot(e.direction),1),-1),s=Math.max(Math.min(i.dot(t.direction),1),-1);return o>=r&&s<r?-1:o<r&&s>=r||e.panoSize>t.panoSize?1:t.panoSize>e.panoSize?-1:-(o-s)};function x(){return{[h.SL.BASE]:(0,g.Y)(0),[h.SL.STANDARD]:(0,g.Y)(0),[h.SL.HIGH]:(0,g.Y)(0),[h.SL.ULTRAHIGH]:(0,g.Y)(0)}}},78449:(e,t,i)=>{"use strict";i.d(t,{$7:()=>y,uc:()=>m,N3:()=>w});var r=i(81396),o=i(45837),s=i(90304),a=i(59370),n=i(69505),c=i(49827),h=i(67944),l=i(67557),u=i(7531),p=i.n(u),d=i(87804),g=i.n(d);class f extends r.Mesh{}var w;!function(e){e.WORLD="world",e.NDC="ndc"}(w||(w={}));class y extends r.Object3D{constructor(e,t=l.Qi.instance,i=w.WORLD){var a;super(),this.config=e,this.fontManager=t,this.scaleType=i,this.bindings=[],this.update=()=>{const e=this.resolvedConfig;this.textGeometry.update(e),this.textGeometry.computeBoundingBox();const t=this.textGeometry.layout.lineHeight-this.textGeometry.layout.baseline;this.labelTextMesh.position.x=-.5*this.textGeometry.layout.width+t,this.labelTextMesh.position.y=-.5*this.textGeometry.layout.height+t,this.labelTextMesh.position.z=.25,this.unscaledWidth=this.textGeometry.layout.width+this.config.backgroundBorderWidth,this.unscaledHeight=this.textGeometry.layout.height+this.config.backgroundBorderHeight,(this.labelBackgroundMesh||this.config.backgroundAsCollider)&&this.labelBackgroundMesh.scale.set(this.unscaledWidth,this.unscaledHeight,.01),this.aspect=this.unscaledWidth/Math.max(this.unscaledHeight,.001),this.fontHeightToMeters=1/e.font.info.size,this.updateScale(),this._onGeomUpdate&&this._onGeomUpdate()};const c=void 0!==this.config.opacity?this.config.opacity:1;if(this.config.background||this.config.backgroundAsCollider){this.config.backgroundOpacity=void 0!==this.config.backgroundOpacity?this.config.backgroundOpacity:1,this.config.backgroundOpacity=this.config.background?this.config.backgroundOpacity:0;const t=new r.BoxGeometry(1,1,.01),i=new r.MeshBasicMaterial({color:e.backgroundColor,transparent:!0,depthTest:this.config.backgroundOpacity>0&&!e.disableDepth,depthWrite:this.config.backgroundOpacity>0&&!e.disableDepth,opacity:this.config.backgroundOpacity,stencilRef:1,stencilFail:r.KeepStencilOp,stencilZFail:r.KeepStencilOp,stencilZPass:r.ReplaceStencilOp,stencilFunc:r.AlwaysStencilFunc,stencilWrite:!0});this.labelBackgroundMesh=new this.config.backgroundColliderType(t,i),this.labelBackgroundMesh.position.z=-.25,this.labelBackgroundMesh.name="Label Background",this.collider=this.labelBackgroundMesh,this.add(this.labelBackgroundMesh)}const h={fontPath:`${null!==(a=e.assetBasePath)&&void 0!==a?a:""}${l.Ye.fontPath}`,outline:this.config.outline,outlineWidth:this.config.outlineWidth},u={uniforms:{map:{type:"t",value:(d=Object.assign(Object.assign({},h),{color:e.color,opacity:c})).map},color:{type:"c",value:new r.Color(d.color)},opacity:{type:"f",value:d.opacity}},vertexShader:p(),fragmentShader:g()};var d;const y=new r.RawShaderMaterial({uniforms:u.uniforms,fragmentShader:u.fragmentShader,vertexShader:u.vertexShader,side:r.DoubleSide,transparent:!0,depthTest:!1,depthWrite:!1,opacity:c});y.name="Label Text",this.fontId=this.fontManager.getFontId(h);const S=this.fontManager.getFont(this.fontId);y.uniforms.map.value=S.textures[0],this.bindings.push(S.onChanged((()=>{y.uniforms.map.value=S.textures[0],this.update()})));const m=this.resolvedConfig,D=m.font;this.textGeometry=(0,o.Y)(m),this.labelTextMesh=new f(this.textGeometry,y),this.labelTextMesh.name="Label Text",this.labelTextMesh.renderOrder=10;const T=(new r.Quaternion).setFromAxisAngle(s.f.FORWARD,(0,n.Id)(180)),b=(new r.Quaternion).setFromAxisAngle(s.f.UP,(0,n.Id)(180));this.labelTextMesh.quaternion.multiply(T).multiply(b),this.add(this.labelTextMesh),this.name="Label Container",this.fontHeightToMeters=1/D.info.size,this.scaleFactor=e.scale||this.fontHeightToMeters,this.update()}dispose(){this.bindings.forEach((e=>e.cancel())),this.textGeometry.dispose()}get resolvedConfig(){let e;if(void 0!==this.config.wordWrapWidth){const t=this.fontManager.measureText(this.fontId,this.config.text);void 0!==t&&t>this.config.wordWrapWidth&&(e=this.config.wordWrapWidth)}const t=this.fontManager.getFont(this.fontId);return Object.assign(Object.assign({},this.config),{font:t.fontData,texture:t.textures[0],width:e})}onGeomUpdate(e){this._onGeomUpdate=e}updateScale(){const e=this.config.scale*this.fontHeightToMeters;this.scale.set(e,e,e)}get text(){return this.config.text}set text(e){e!==this.name&&(this.config.text=e,this.name=e,this.fontManager.getFont(this.fontId).addCharsIfNeeded(e),this.update())}get mesh(){return this.labelTextMesh}get scaleFactor(){return this.config.scale}set scaleFactor(e){this.scaleFactor!==e&&(this.config.scale=e,this.updateScale())}get opacity(){return void 0!==this.config.opacity?this.config.opacity:1}set opacity(e){if(e!==this.config.opacity){this.config.opacity=e;const t=e>0&&!this.config.disableDepth;if(this.config.background){const i=this.labelBackgroundMesh.material;i.opacity=Math.min(this.config.backgroundOpacity||1,e),i.depthWrite=e>.15,i.depthTest=t}const i=this.labelTextMesh.material;i.uniforms.opacity.value=e,i.depthTest=t,this.visible=e>0}}setColorHex(e){const t=this.labelTextMesh.material.uniforms.color;t.value.getHex()!==e&&t.value.setHex(e)}setRenderLayer(e){this.labelTextMesh.layers.mask=e.mask,this.labelBackgroundMesh&&(this.labelBackgroundMesh.layers.mask=e.mask)}setRenderOrder(e){this.renderOrder=e,this.labelTextMesh.renderOrder=e,this.labelBackgroundMesh&&(this.labelBackgroundMesh.renderOrder=e)}setPosition(e,t=(e=>e)){this.position.copy(t(e))}setOrientation(e,t=0){this.quaternion.copy(e),0!==t&&this.rotateZ(-t*n.Ue)}scaleBillboard(e,t,i,r,o,s,n=S.SCALE_DEFAULT){if(0!==i.elements[15])this.scaleFactor=.2*n*r*(S.ORTHO_IDEAL_HEIGHT/o);else{const l=(0,a.D_)(this.position,e,t,i.asThreeMatrix4()),u=Math.abs(l.x);if(u<1){const t=(0,h.mY)(i,e,this.position,o,n),a=((0,c.uZ)(s,1,2.5)+r)*S.SCALE_ASPECT,l=1+S.SCALE_NDC-u*S.SCALE_NDC-a,p=Math.max(Math.min(1/t*l,3),.001);this.scaleType===w.NDC?this.scaleFactor=p:this.scaleFactor=Math.min(p*S.NDC_MULT,n*S.SCALE_WORLD)}else this.scaleFactor=.001}this.updateScale()}}const S={SCALE_DEFAULT:.1,SCALE_WORLD:4,SCALE_NDC:.5,SCALE_ASPECT:.035,DEPTH_WRITE_THRESHOD:.15,ORTHO_IDEAL_HEIGHT:1500,NDC_MULT:1.15};class m{constructor(e){this.currentTextConfig=m.defaultTextConfig,e?this.updateTextStyle(e):this.updateTextStyle(m.defaultTextConfig)}updateTextStyle(e){this.currentTextConfig=Object.assign(Object.assign({},this.currentTextConfig),e)}createLabel(e={text:""}){return new y(Object.assign(Object.assign({},this.currentTextConfig),e))}static makeConfig(e){return Object.assign(Object.assign({},m.defaultTextConfig),e)}}m.defaultTextConfig={text:"",align:"center",wordWrapWidth:void 0,color:"black",backgroundColor:"white",backgroundBorderWidth:50,backgroundBorderHeight:30,background:!0,backgroundAsCollider:!0,backgroundColliderType:r.Mesh,scale:1,outline:!1,outlineWidth:4}},87804:e=>{e.exports="precision highp float;precision highp int;uniform sampler2D map;uniform vec3 color;uniform float opacity;varying vec2 vUv;void main(){vec4 sample=texture2D(map,vUv).rgba;gl_FragColor=vec4(sample.rgb*color.rgb,clamp(sample.a*opacity,0.,1.));}"},7531:e=>{e.exports="precision highp float;precision highp int;attribute vec2 uv;attribute vec4 position;uniform mat4 projectionMatrix;uniform mat4 modelViewMatrix;varying vec2 vUv;void main(){vUv=uv;gl_Position=projectionMatrix*modelViewMatrix*position;}"}}]);
@@ -0,0 +1,20 @@
1
+ /*!
2
+ * Matterport Showcase SDK
3
+ *
4
+ * © 2022 Matterport, Inc. All rights reserved.
5
+ *
6
+ * Matterport Showcase SDK ("Showcase SDK") must be used according to
7
+ * the Matterport Terms of Service located at https://matterport.com/terms-of-use, the Platform Subscription Agreement ("PSA") available at https://matterport.com/legal/platform-subscription-agreement and the SDK License terms included in the PSA ("SDK License"). Any use of the Showcase SDK requires a current active Matterport account and associated developer key.
8
+ *
9
+ * -------------------------------------------------------------------------------
10
+ *
11
+ * Redistribution and use in source and binary forms, without modification, is permitted in accordance with the SDK License provided that the following conditions are met:
12
+ *
13
+ * * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
14
+ * * Neither the name of Matterport nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
15
+ *
16
+ * THE SHOWCASE SDK IS PROVIDED BY MATTERPORT AS THE COPYRIGHT HOLDER AND, IF APPLICABLE, ITS CONTRIBUTORS "AS IS" AND WITHOUT WARRANTIES OF ANY KIND. TO THE FULLEST EXTENT PERMISSIBLE PURSUANT TO APPLICABLE LAW, MATTERPORT DISCLAIMS, ON BEHALF OF ITSELF AND ITS AFFILIATES AND LICENSORS, ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. MATTERPORT DOES NOT WARRANT THAT THE AVAILABILITY OF THE SHOWCASE SDK WILL BE UNINTERRUPTED OR ERROR-FREE, THAT DEFECTS WILL BE CORRECTED, OR THAT THE SHOWCASE SDK WILL BE FREE OF VIRUSES OR OTHER HARMFUL COMPONENTS. MATTERPORT DOES NOT MAKE ANY REPRESENTATIONS OR WARRANTIES REGARDING THE USE OR THE RESULTS OF THE USE OF THE SHOWCASE SDK OR FUNCTIONS ON THE SHOWCASE SDK IN TERMS OF THEIR CORRECTNESS, ACCURACY, RELIABILITY, RESULTS TO BE ACHIEVED, OR OTHERWISE. APPLICABLE LAW MAY NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SOME OR ALL OF THE FOREGOING DISCLAIMERS MAY NOT APPLY TO YOU.
17
+ *
18
+ * TO THE EXTENT PERMITTED UNDER APPLICABLE LAW UNDER NO CIRCUMSTANCES, INCLUDING, BUT NOT LIMITED TO, NEGLIGENCE, SHALL MATTERPORT OR ITS AFFILIATES OR LICENSORS BE LIABLE FOR ANY CONSEQUENTIAL, EXEMPLARY, PUNITIVE, SPECIAL, INCIDENTAL OR OTHER INDIRECT DAMAGES, EVEN IF MATTERPORT OR A MATTERPORT AUTHORIZED REPRESENTATIVE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. APPLICABLE LAW MAY NOT ALLOW SOME OR ALL OF THIS LIMITATION OF LIABILITY, SO IT MAY NOT APPLY TO YOU.
19
+ *
20
+ */