mxdraw 0.1.105 → 0.1.106
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +3802 -0
- package/dist/{types/MxModule/McEdGetPointWorldDrawObject/McEdGetPointWorldDrawObjectClass.d.ts → lib/MxModule/McEdGetPointWorldDrawObject/index.d.ts} +0 -0
- package/dist/lib/MxModule/McEdGetPointWorldDrawObject/index.js +1 -1
- package/dist/{types/MxModule/McGePoint3d/McGePoint3d.d.ts → lib/MxModule/McGePoint3d/index.d.ts} +0 -0
- package/dist/lib/MxModule/McGePoint3d/index.js +1 -1
- package/dist/{types/MxModule/McGePoint3dArray/McGePoint3dArray.d.ts → lib/MxModule/McGePoint3dArray/index.d.ts} +0 -0
- package/dist/lib/MxModule/McGePoint3dArray/index.js +1 -1
- package/dist/{types/MxModule/McGeTool/McGeTool.d.ts → lib/MxModule/McGeTool/index.d.ts} +3 -2
- package/dist/lib/MxModule/McGeTool/index.js +1 -1
- package/dist/{types/MxModule/McGiWorldDraw/McGiWorldDraw.d.ts → lib/MxModule/McGiWorldDraw/index.d.ts} +0 -0
- package/dist/lib/MxModule/McGiWorldDraw/index.js +1 -1
- package/dist/{types/MxModule/McGiWorldDrawType/McGiWorldDrawType.d.ts → lib/MxModule/McGiWorldDrawType/index.d.ts} +0 -0
- package/dist/lib/MxModule/McGiWorldDrawType/index.js +1 -1
- package/dist/{types/MxModule/MrxDbgUiPrBaseReturn/MrxDbgUiPrBaseReturn.d.ts → lib/MxModule/MrxDbgUiPrBaseReturn/index.d.ts} +0 -0
- package/dist/lib/MxModule/MrxDbgUiPrBaseReturn/index.js +1 -1
- package/dist/{types/MxModule/MrxDbgUiPrPoint/MrxDbgUiPrPointClass.d.ts → lib/MxModule/MrxDbgUiPrPoint/index.d.ts} +2 -1
- package/dist/lib/MxModule/MrxDbgUiPrPoint/index.js +1 -1
- package/dist/{types/MxModule/MrxDbgUtils/MrxDbgUtils.d.ts → lib/MxModule/MrxDbgUtils/index.d.ts} +3 -2
- package/dist/lib/MxModule/MrxDbgUtils/index.js +1 -1
- package/dist/{types/MxModule/Mx3PointArc/Mx3PointArc.d.ts → lib/MxModule/Mx3PointArc/index.d.ts} +5 -6
- package/dist/lib/MxModule/Mx3PointArc/index.js +1 -1
- package/dist/{types/MxModule/MxCADObject/MxCADObject.d.ts → lib/MxModule/MxCADObject/index.d.ts} +0 -0
- package/dist/lib/MxModule/MxCADObject/index.js +1 -1
- package/dist/{types/MxModule/MxDb2LineAngularDimension/MxDb2LineAngularDimension.d.ts → lib/MxModule/MxDb2LineAngularDimension/index.d.ts} +2 -4
- package/dist/lib/MxModule/MxDb2LineAngularDimension/index.js +1 -1
- package/dist/{types/MxModule/MxDbAlignedDimension/MxDbAlignedDimension.d.ts → lib/MxModule/MxDbAlignedDimension/index.d.ts} +0 -1
- package/dist/lib/MxModule/MxDbAlignedDimension/index.js +1 -1
- package/dist/{types/MxModule/MxDbAnyLine/MxDbAnyLine.d.ts → lib/MxModule/MxDbAnyLine/index.d.ts} +4 -5
- package/dist/lib/MxModule/MxDbAnyLine/index.js +1 -1
- package/dist/{types/MxModule/MxDbArea/MxDbArea.d.ts → lib/MxModule/MxDbArea/index.d.ts} +1 -3
- package/dist/lib/MxModule/MxDbArea/index.js +1 -1
- package/dist/{types/MxModule/MxDbCloudLine/MxDbCloudLine.d.ts → lib/MxModule/MxDbCloudLine/index.d.ts} +4 -5
- package/dist/lib/MxModule/MxDbCloudLine/index.js +1 -1
- package/dist/{types/MxModule/MxDbCoord/MxDbCoord.d.ts → lib/MxModule/MxDbCoord/index.d.ts} +0 -1
- package/dist/lib/MxModule/MxDbCoord/index.js +1 -1
- package/dist/{types/MxModule/MxDbDatabase/MxDbDatabase.d.ts → lib/MxModule/MxDbDatabase/index.d.ts} +0 -0
- package/dist/lib/MxModule/MxDbDatabase/index.js +1 -1
- package/dist/{types/MxModule/MxDbEllipse/MxDbEllipse.d.ts → lib/MxModule/MxDbEllipse/index.d.ts} +4 -5
- package/dist/lib/MxModule/MxDbEllipse/index.js +1 -1
- package/dist/{types/MxModule/MxDbEntity/MxDbEntity.d.ts → lib/MxModule/MxDbEntity/index.d.ts} +0 -1
- package/dist/lib/MxModule/MxDbEntity/index.js +1 -1
- package/dist/{types/MxModule/MxDbGroup/MxDbGroup.d.ts → lib/MxModule/MxDbGroup/index.d.ts} +0 -0
- package/dist/lib/MxModule/MxDbGroup/index.js +1 -1
- package/dist/{types/MxModule/MxDbHatch/MxDbHatch.d.ts → lib/MxModule/MxDbHatch/index.d.ts} +0 -1
- package/dist/lib/MxModule/MxDbHatch/index.js +1 -1
- package/dist/{types/MxModule/MxDbImage/MxDbImage.d.ts → lib/MxModule/MxDbImage/index.d.ts} +0 -1
- package/dist/lib/MxModule/MxDbImage/index.js +1 -1
- package/dist/{types/MxModule/MxDbLayerTableRecord/MxDbLayerTableRecord.d.ts → lib/MxModule/MxDbLayerTableRecord/index.d.ts} +0 -0
- package/dist/lib/MxModule/MxDbLayerTableRecord/index.js +1 -1
- package/dist/{types → lib}/MxModule/MxDbLeadComment/MxDbLeadComment.d.ts +0 -0
- package/dist/lib/MxModule/MxDbLeadComment/MxDbLeadComment.js +1 -1
- package/dist/lib/MxModule/MxDbLeadComment/index.d.ts +24 -0
- package/dist/lib/MxModule/MxDbLeadComment/index.js +1 -1
- package/dist/{types/MxModule/MxDbLeadTag/MxDbLeadTag.d.ts → lib/MxModule/MxDbLeadTag/index.d.ts} +1 -2
- package/dist/lib/MxModule/MxDbLeadTag/index.js +1 -1
- package/dist/{types/MxModule/MxDbLine/MxDbLine.d.ts → lib/MxModule/MxDbLine/index.d.ts} +0 -1
- package/dist/lib/MxModule/MxDbLine/index.js +1 -1
- package/dist/{types/MxModule/MxDbPolyline/MxDbPolyline.d.ts → lib/MxModule/MxDbPolyline/index.d.ts} +0 -1
- package/dist/lib/MxModule/MxDbPolyline/index.js +1 -1
- package/dist/{types/MxModule/MxDbRect/MxDbRect.d.ts → lib/MxModule/MxDbRect/index.d.ts} +5 -6
- package/dist/lib/MxModule/MxDbRect/index.js +1 -1
- package/dist/{types → lib}/MxModule/MxDbRectBoxLeadComment/MxDbRectBoxLeadComment.d.ts +0 -2
- package/dist/lib/MxModule/MxDbRectBoxLeadComment/MxDbRectBoxLeadComment.js +1 -1
- package/dist/lib/MxModule/MxDbRectBoxLeadComment/index.d.ts +26 -0
- package/dist/lib/MxModule/MxDbRectBoxLeadComment/index.js +1 -1
- package/dist/{types → lib}/MxModule/MxDbRegularPolygon/MxDbRegularPolygon.d.ts +4 -5
- package/dist/lib/MxModule/MxDbRegularPolygon/MxDbRegularPolygon.js +1 -1
- package/dist/lib/MxModule/MxDbRegularPolygon/index.d.ts +20 -0
- package/dist/lib/MxModule/MxDbRegularPolygon/index.js +1 -1
- package/dist/{types → lib}/MxModule/MxDbSVG/MxDbSVG.d.ts +0 -1
- package/dist/lib/MxModule/MxDbSVG/MxDbSVG.js +1 -1
- package/dist/lib/MxModule/MxDbSVG/index.d.ts +92 -0
- package/dist/lib/MxModule/MxDbSVG/index.js +1 -1
- package/dist/{types → lib}/MxModule/MxDbSVGText/MxDbSVGText.d.ts +0 -1
- package/dist/lib/MxModule/MxDbSVGText/MxDbSVGText.js +1 -1
- package/dist/lib/MxModule/MxDbSVGText/index.d.ts +18 -0
- package/dist/lib/MxModule/MxDbSVGText/index.js +1 -1
- package/dist/{types/MxModule/MxDbText/MxDbText.d.ts → lib/MxModule/MxDbText/index.d.ts} +3 -4
- package/dist/lib/MxModule/MxDbText/index.js +1 -1
- package/dist/{types → lib}/MxModule/MxDrawObject/MxDrawObject.d.ts +0 -0
- package/dist/lib/MxModule/MxDrawObject/MxDrawObject.js +1 -1
- package/dist/lib/MxModule/MxDrawObject/index.d.ts +822 -0
- package/dist/lib/MxModule/MxDrawObject/index.js +1 -1
- package/dist/{types/MxModule/MxFilters/MxFilters.d.ts → lib/MxModule/MxFilters/index.d.ts} +3 -4
- package/dist/lib/MxModule/MxFilters/index.js +1 -1
- package/dist/{types → lib}/MxModule/MxFun/MxFun.d.ts +3 -3
- package/dist/lib/MxModule/MxFun/MxFun.js +1 -1
- package/dist/lib/MxModule/MxFun/index.d.ts +592 -0
- package/dist/lib/MxModule/MxFun/index.js +1 -1
- package/dist/{types → lib}/MxModule/MxThreeJS/MxThreeJS.d.ts +10 -11
- package/dist/lib/MxModule/MxThreeJS/MxThreeJS.js +1 -1
- package/dist/lib/MxModule/MxThreeJS/MxThreeJS.mixin.d.ts +2 -0
- package/dist/lib/MxModule/MxThreeJS/MxThreeJS.mixin.js +1 -1
- package/dist/lib/MxModule/MxThreeJS/index.d.ts +3 -0
- package/dist/lib/MxModule/MxThreeJS/index.js +1 -1
- package/dist/{types → lib}/MxModule/MxType/MxType.d.ts +0 -0
- package/dist/lib/MxModule/MxType/MxType.js +1 -1
- package/dist/lib/MxModule/MxType/index.d.ts +44 -0
- package/dist/lib/MxModule/MxType/index.js +1 -1
- package/dist/{types/MxModule/Mxassembly/Mxassembly.d.ts → lib/MxModule/Mxassembly/index.d.ts} +9 -7
- package/dist/lib/MxModule/Mxassembly/index.js +1 -1
- package/dist/{types/MxModule/loadCoreCode/loadCoreCode.d.ts → lib/MxModule/loadCoreCode/index.d.ts} +0 -0
- package/dist/lib/MxModule/loadCoreCode/index.js +1 -1
- package/dist/{types → lib}/MxModule/loadCoreCode/mxUiData.d.ts +2 -2
- package/dist/lib/MxModule/loadCoreCode/mxUiData.js +1 -1
- package/dist/{types → lib}/MxModule/loadCoreCode/mxcadassembly_es5.d.ts +0 -0
- package/dist/lib/MxModule/loadCoreCode/mxcadassembly_es5.js +1 -1
- package/dist/{types → lib}/MxModule/loadCoreCode/mxfun.es5.d.ts +0 -0
- package/dist/lib/MxModule/loadCoreCode/mxfun.es5.js +1 -1
- package/dist/{types → lib}/MxModule/store/PubsubClass.d.ts +0 -0
- package/dist/lib/MxModule/store/PubsubClass.js +1 -1
- package/dist/{types → lib}/MxModule/store/StoreClass.d.ts +1 -1
- package/dist/lib/MxModule/store/StoreClass.js +1 -1
- package/dist/{types → lib}/MxModule/store/index.d.ts +0 -0
- package/dist/lib/MxModule/store/index.js +1 -1
- package/dist/{types → lib}/MxModule/store/store.d.ts +4 -4
- package/dist/lib/MxModule/store/store.js +1 -1
- package/dist/{types/MxModule/useCanvasResizeListener/useCanvasResizeListener.d.ts → lib/MxModule/useCanvasResizeListener/index.d.ts} +2 -2
- package/dist/lib/MxModule/useCanvasResizeListener/index.js +1 -1
- package/dist/{types → lib}/doc.d.ts +1 -1
- package/dist/lib/doc.js +1 -1
- package/dist/lib/index.d.ts +3 -0
- package/dist/lib/index.js +1 -0
- package/dist/lib/mxdraw.d.ts +43 -0
- package/dist/lib/mxdraw.js +1 -1
- package/dist/{types → lib}/tools/algorithm/math.d.ts +0 -0
- package/dist/lib/tools/algorithm/math.js +1 -1
- package/dist/{types → lib}/tools/algorithm/random.d.ts +0 -0
- package/dist/lib/tools/algorithm/random.js +1 -1
- package/dist/{types → lib}/tools/dom/create.d.ts +0 -0
- package/dist/lib/tools/dom/create.js +1 -1
- package/dist/{types → lib}/tools/dynamicImport/index.d.ts +0 -0
- package/dist/lib/tools/dynamicImport/index.js +1 -1
- package/dist/{types → lib}/tools/formatting/index.d.ts +0 -0
- package/dist/lib/tools/formatting/index.js +1 -1
- package/dist/{types → lib}/tools/proxy/index.d.ts +0 -0
- package/dist/lib/tools/proxy/index.js +1 -1
- package/dist/{types → lib}/tools/three/index.d.ts +14 -15
- package/dist/lib/tools/three/index.js +1 -1
- package/dist/mxdraw.umd.js +1 -1
- package/package.json +16 -10
- package/dist/lib/MxModule/McEdGetPointWorldDrawObject/McEdGetPointWorldDrawObjectClass.js +0 -1
- package/dist/lib/MxModule/McGePoint3d/McGePoint3d.js +0 -1
- package/dist/lib/MxModule/McGePoint3dArray/McGePoint3dArray.js +0 -1
- package/dist/lib/MxModule/McGeTool/McGeTool.js +0 -1
- package/dist/lib/MxModule/McGiWorldDraw/McGiWorldDraw.js +0 -1
- package/dist/lib/MxModule/McGiWorldDrawType/McGiWorldDrawType.js +0 -1
- package/dist/lib/MxModule/MrxDbgUiPrBaseReturn/MrxDbgUiPrBaseReturn.js +0 -1
- package/dist/lib/MxModule/MrxDbgUiPrPoint/MrxDbgUiPrPointClass.js +0 -1
- package/dist/lib/MxModule/MrxDbgUtils/MrxDbgUtils.js +0 -1
- package/dist/lib/MxModule/Mx3PointArc/Mx3PointArc.js +0 -1
- package/dist/lib/MxModule/MxCADObject/MxCADObject.js +0 -1
- package/dist/lib/MxModule/MxDb2LineAngularDimension/MxDb2LineAngularDimension.js +0 -1
- package/dist/lib/MxModule/MxDbAlignedDimension/MxDbAlignedDimension.js +0 -1
- package/dist/lib/MxModule/MxDbAnyLine/MxDbAnyLine.js +0 -1
- package/dist/lib/MxModule/MxDbArea/MxDbArea.js +0 -1
- package/dist/lib/MxModule/MxDbCloudLine/MxDbCloudLine.js +0 -1
- package/dist/lib/MxModule/MxDbCoord/MxDbCoord.js +0 -1
- package/dist/lib/MxModule/MxDbDatabase/MxDbDatabase.js +0 -1
- package/dist/lib/MxModule/MxDbEllipse/MxDbEllipse.js +0 -1
- package/dist/lib/MxModule/MxDbEntity/MxDbEntity.js +0 -1
- package/dist/lib/MxModule/MxDbGroup/MxDbGroup.js +0 -1
- package/dist/lib/MxModule/MxDbHatch/MxDbHatch.js +0 -1
- package/dist/lib/MxModule/MxDbImage/MxDbImage.js +0 -1
- package/dist/lib/MxModule/MxDbLayerTableRecord/MxDbLayerTableRecord.js +0 -1
- package/dist/lib/MxModule/MxDbLeadTag/MxDbLeadTag.js +0 -1
- package/dist/lib/MxModule/MxDbLine/MxDbLine.js +0 -1
- package/dist/lib/MxModule/MxDbPolyline/MxDbPolyline.js +0 -1
- package/dist/lib/MxModule/MxDbRect/MxDbRect.js +0 -1
- package/dist/lib/MxModule/MxDbText/MxDbText.js +0 -1
- package/dist/lib/MxModule/MxFilters/MxFilters.js +0 -1
- package/dist/lib/MxModule/Mxassembly/Mxassembly.js +0 -1
- package/dist/lib/MxModule/loadCoreCode/loadCoreCode.js +0 -1
- package/dist/lib/MxModule/useCanvasResizeListener/useCanvasResizeListener.js +0 -1
- package/dist/mxdraw.es5.js +0 -1
- package/dist/types/MxModule/McEdGetPointWorldDrawObject/index.d.ts +0 -3
- package/dist/types/MxModule/McGePoint3d/index.d.ts +0 -3
- package/dist/types/MxModule/McGePoint3dArray/index.d.ts +0 -3
- package/dist/types/MxModule/McGeTool/index.d.ts +0 -4
- package/dist/types/MxModule/McGiWorldDraw/index.d.ts +0 -2
- package/dist/types/MxModule/McGiWorldDrawType/index.d.ts +0 -2
- package/dist/types/MxModule/MrxDbgUiPrBaseReturn/index.d.ts +0 -3
- package/dist/types/MxModule/MrxDbgUiPrPoint/index.d.ts +0 -3
- package/dist/types/MxModule/MrxDbgUtils/index.d.ts +0 -4
- package/dist/types/MxModule/Mx3PointArc/index.d.ts +0 -3
- package/dist/types/MxModule/MxCADObject/index.d.ts +0 -3
- package/dist/types/MxModule/MxDb2LineAngularDimension/index.d.ts +0 -3
- package/dist/types/MxModule/MxDbAlignedDimension/index.d.ts +0 -3
- package/dist/types/MxModule/MxDbAnyLine/index.d.ts +0 -3
- package/dist/types/MxModule/MxDbArea/index.d.ts +0 -3
- package/dist/types/MxModule/MxDbCloudLine/index.d.ts +0 -3
- package/dist/types/MxModule/MxDbCoord/index.d.ts +0 -3
- package/dist/types/MxModule/MxDbDatabase/index.d.ts +0 -3
- package/dist/types/MxModule/MxDbEllipse/index.d.ts +0 -3
- package/dist/types/MxModule/MxDbEntity/index.d.ts +0 -3
- package/dist/types/MxModule/MxDbGroup/index.d.ts +0 -3
- package/dist/types/MxModule/MxDbHatch/index.d.ts +0 -3
- package/dist/types/MxModule/MxDbImage/index.d.ts +0 -3
- package/dist/types/MxModule/MxDbLayerTableRecord/index.d.ts +0 -3
- package/dist/types/MxModule/MxDbLeadComment/index.d.ts +0 -3
- package/dist/types/MxModule/MxDbLeadTag/index.d.ts +0 -3
- package/dist/types/MxModule/MxDbLine/index.d.ts +0 -3
- package/dist/types/MxModule/MxDbPolyline/index.d.ts +0 -3
- package/dist/types/MxModule/MxDbRect/index.d.ts +0 -2
- package/dist/types/MxModule/MxDbRectBoxLeadComment/index.d.ts +0 -3
- package/dist/types/MxModule/MxDbRegularPolygon/index.d.ts +0 -2
- package/dist/types/MxModule/MxDbSVG/index.d.ts +0 -3
- package/dist/types/MxModule/MxDbSVGText/index.d.ts +0 -3
- package/dist/types/MxModule/MxDbText/index.d.ts +0 -3
- package/dist/types/MxModule/MxDrawObject/index.d.ts +0 -3
- package/dist/types/MxModule/MxFilters/index.d.ts +0 -2
- package/dist/types/MxModule/MxFun/index.d.ts +0 -3
- package/dist/types/MxModule/MxThreeJS/MxThreeJS.mixin.d.ts +0 -2
- package/dist/types/MxModule/MxThreeJS/index.d.ts +0 -3
- package/dist/types/MxModule/MxType/index.d.ts +0 -2
- package/dist/types/MxModule/Mxassembly/index.d.ts +0 -3
- package/dist/types/MxModule/loadCoreCode/index.d.ts +0 -3
- package/dist/types/MxModule/useCanvasResizeListener/index.d.ts +0 -3
- package/dist/types/mxdraw.d.ts +0 -86
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function __awaiter(t,e,n,r){return new(n||(n=Promise))(function(i,a){function o(t){try{l(r.next(t))}catch(t){a(t)}}function s(t){try{l(r.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(o,s)}l((r=r.apply(t,e||[])).next())})}function dynamicImport(t){return __awaiter(this,void 0,void 0,function*(){let e;switch(t){case"jquery":e=yield dynamicImportJquery();break;case"element-resize-event-polyfill":e=yield dynamicImportResize()}return e})}function dynamicImportResize(){return __awaiter(this,void 0,void 0,function*(){try{const t=yield Promise.resolve().then(function(){return elementResizeEventPolyfill_umd_min$2});return t.default?t.default:t}catch(t){console.log("import动态导入:element-resize-event-polyfill失败!",t)}})}function dynamicImportJquery(){return __awaiter(this,void 0,void 0,function*(){try{const t=yield Promise.resolve().then(function(){return jquery$1});return t.default?t.default:t}catch(t){console.log("import动态导入:jquery失败!",t)}})}let _mapDynamicCreate=null;function intiDynamicCreateMxObject(){_mapDynamicCreate||((_mapDynamicCreate={}).MxDbArea=(()=>Promise.resolve().then(function(){return index$8})),_mapDynamicCreate.MxDbLeadTag=(()=>Promise.resolve().then(function(){return index$7})),_mapDynamicCreate.MxDbCoord=(()=>Promise.resolve().then(function(){return index$d})),_mapDynamicCreate.MxDb2LineAngularDimension=(()=>Promise.resolve().then(function(){return index$f})),_mapDynamicCreate.Mx3PointArc=(()=>Promise.resolve().then(function(){return index$e})),_mapDynamicCreate.MxDbAnyLine=(()=>Promise.resolve().then(function(){return index$6})),_mapDynamicCreate.MxDbCloudLine=(()=>Promise.resolve().then(function(){return index$5})),_mapDynamicCreate.MxDbLeadComment=(()=>Promise.resolve().then(function(){return index$3})),_mapDynamicCreate.MxDbRectBoxLeadComment=(()=>Promise.resolve().then(function(){return index$2})),_mapDynamicCreate.MxDbEllipse=(()=>Promise.resolve().then(function(){return index$1})),_mapDynamicCreate.MxDbText=(()=>Promise.resolve().then(function(){return index})),_mapDynamicCreate.MxDbRegularPolygon=(()=>Promise.resolve().then(function(){return index$4})),_mapDynamicCreate.MxDbHatch=(()=>Promise.resolve().then(function(){return index$9})))}function dynamicCreateMxObject(t){return __awaiter(this,void 0,void 0,function*(){let e;switch(intiDynamicCreateMxObject(),t){case"MxDbSVG":try{e=yield Promise.resolve().then(function(){return index$h})}catch(e){console.log("import:"+t+"error!",e)}break;case"MxDbImage":try{e=yield Promise.resolve().then(function(){return index$j})}catch(e){console.log("import:"+t+"error!",e)}break;case"MxDbLine":try{e=yield Promise.resolve().then(function(){return index$c})}catch(e){console.log("import:"+t+"error!",e)}break;case"MxDbRect":try{e=yield Promise.resolve().then(function(){return index$b})}catch(e){console.log("import:"+t+"error!",e)}break;case"MxDbSVGText":try{e=yield Promise.resolve().then(function(){return index$i})}catch(e){console.log("import:"+t+"error!",e)}break;case"MxDbPolyline":try{e=yield Promise.resolve().then(function(){return index$g})}catch(e){console.log("import:"+t+"error!",e)}break;case"MxDbAlignedDimension":try{e=yield Promise.resolve().then(function(){return index$a})}catch(e){console.log("import:"+t+"error!",e)}}if(!e&&_mapDynamicCreate[t])try{e=yield _mapDynamicCreate[t]()}catch(e){console.log("import:"+t+"error!",e)}return e?e.default?e.default:e:(console.log("mx dynmac load:"+t+" failed"),null)})}class PubSub{constructor(){this.events={}}on(t,e){let n=this;return n.events.hasOwnProperty(t)||(n.events[t]=[]),n.events[t].push(e)}emit(t,...e){return this.events.hasOwnProperty(t)?this.events[t].map(t=>t(...e)):[]}}class Store{constructor(t){let e=this;e.actions={},e.mutations={},e.state=t.state,e.status="resting",e.events=new PubSub,t.hasOwnProperty("actions")&&(e.actions=t.actions),t.hasOwnProperty("mutations")&&(e.mutations=t.mutations)}dispatch(t,e){let n=this;return"function"!=typeof n.actions[t]?(console.error(`Action "${t} doesn't exist.`),!1):(console.groupCollapsed(`ACTION: ${t}`),n.status="action",n.actions[t](n,e),console.groupEnd(),!0)}commit(t,e){let n=this;if("function"!=typeof n.mutations[t])return console.log(`Mutation "${t}" doesn't exist`),!1;n.status="mutation";let r=n.mutations[t](n.state,e);return n.state=Object.assign(n.state,r),!0}}const options={state:{MxFun:null,Mxassembly:null,isCreateDrawObj:!1},actions:{},mutations:{}};for(let t in options.state){const e=t.charAt(0).toUpperCase()+t.slice(1);options.mutations["set"+e]=((e,n)=>{e[t]=n})}const store=new Store(options);function mxfun(){!function t(e,n,r){function i(o,s){if(!n[o]){if(!e[o]){var l="function"==typeof require&&require;if(!s&&l)return l(o,!0);if(a)return a(o,!0);var u=new Error("Cannot find module '"+o+"'");throw u.code="MODULE_NOT_FOUND",u}var c=n[o]={exports:{}};e[o][0].call(c.exports,function(t){return i(e[o][1][t]||t)},c,c.exports,t,e,n,r)}return n[o].exports}for(var a="function"==typeof require&&require,o=0;o<r.length;o++)i(r[o]);return i}({1:[function(t,e,n){var r={};(0,t("./lib/utils/common").assign)(r,t("./lib/deflate"),t("./lib/inflate"),t("./lib/zlib/constants")),e.exports=r},{"./lib/deflate":2,"./lib/inflate":3,"./lib/utils/common":4,"./lib/zlib/constants":7}],2:[function(t,e,n){var r=t("./zlib/deflate"),i=t("./utils/common"),a=t("./utils/strings"),o=t("./zlib/messages"),s=t("./zlib/zstream"),l=Object.prototype.toString;function u(t){if(!(this instanceof u))return new u(t);this.options=i.assign({level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,to:""},t||{});var e=this.options;e.raw&&0<e.windowBits?e.windowBits=-e.windowBits:e.gzip&&0<e.windowBits&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new s,this.strm.avail_out=0;var n=r.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(0!==n)throw new Error(o[n]);if(e.header&&r.deflateSetHeader(this.strm,e.header),e.dictionary){var c;if(c="string"==typeof e.dictionary?a.string2buf(e.dictionary):"[object ArrayBuffer]"===l.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,0!==(n=r.deflateSetDictionary(this.strm,c)))throw new Error(o[n]);this._dict_set=!0}}function c(t,e){var n=new u(e);if(n.push(t,!0),n.err)throw n.msg||o[n.err];return n.result}u.prototype.push=function(t,e){var n,o,s=this.strm,u=this.options.chunkSize;if(this.ended)return!1;o=e===~~e?e:!0===e?4:0,"string"==typeof t?s.input=a.string2buf(t):"[object ArrayBuffer]"===l.call(t)?s.input=new Uint8Array(t):s.input=t,s.next_in=0,s.avail_in=s.input.length;do{if(0===s.avail_out&&(s.output=new i.Buf8(u),s.next_out=0,s.avail_out=u),1!==(n=r.deflate(s,o))&&0!==n)return this.onEnd(n),!(this.ended=!0);0!==s.avail_out&&(0!==s.avail_in||4!==o&&2!==o)||("string"===this.options.to?this.onData(a.buf2binstring(i.shrinkBuf(s.output,s.next_out))):this.onData(i.shrinkBuf(s.output,s.next_out)))}while((0<s.avail_in||0===s.avail_out)&&1!==n);return 4===o?(n=r.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,0===n):2!==o||(this.onEnd(0),!(s.avail_out=0))},u.prototype.onData=function(t){this.chunks.push(t)},u.prototype.onEnd=function(t){0===t&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},n.Deflate=u,n.deflate=c,n.deflateRaw=function(t,e){return(e=e||{}).raw=!0,c(t,e)},n.gzip=function(t,e){return(e=e||{}).gzip=!0,c(t,e)}},{"./utils/common":4,"./utils/strings":5,"./zlib/deflate":9,"./zlib/messages":14,"./zlib/zstream":16}],3:[function(t,e,n){var r=t("./zlib/inflate"),i=t("./utils/common"),a=t("./utils/strings"),o=t("./zlib/constants"),s=t("./zlib/messages"),l=t("./zlib/zstream"),u=t("./zlib/gzheader"),c=Object.prototype.toString;function h(t){if(!(this instanceof h))return new h(t);this.options=i.assign({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&0<=e.windowBits&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(0<=e.windowBits&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),15<e.windowBits&&e.windowBits<48&&0==(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new l,this.strm.avail_out=0;var n=r.inflateInit2(this.strm,e.windowBits);if(n!==o.Z_OK)throw new Error(s[n]);if(this.header=new u,r.inflateGetHeader(this.strm,this.header),e.dictionary&&("string"==typeof e.dictionary?e.dictionary=a.string2buf(e.dictionary):"[object ArrayBuffer]"===c.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(n=r.inflateSetDictionary(this.strm,e.dictionary))!==o.Z_OK))throw new Error(s[n])}function d(t,e){var n=new h(e);if(n.push(t,!0),n.err)throw n.msg||s[n.err];return n.result}h.prototype.push=function(t,e){var n,s,l,u,h,d=this.strm,p=this.options.chunkSize,f=this.options.dictionary,m=!1;if(this.ended)return!1;s=e===~~e?e:!0===e?o.Z_FINISH:o.Z_NO_FLUSH,"string"==typeof t?d.input=a.binstring2buf(t):"[object ArrayBuffer]"===c.call(t)?d.input=new Uint8Array(t):d.input=t,d.next_in=0,d.avail_in=d.input.length;do{if(0===d.avail_out&&(d.output=new i.Buf8(p),d.next_out=0,d.avail_out=p),(n=r.inflate(d,o.Z_NO_FLUSH))===o.Z_NEED_DICT&&f&&(n=r.inflateSetDictionary(this.strm,f)),n===o.Z_BUF_ERROR&&!0===m&&(n=o.Z_OK,m=!1),n!==o.Z_STREAM_END&&n!==o.Z_OK)return this.onEnd(n),!(this.ended=!0);d.next_out&&(0!==d.avail_out&&n!==o.Z_STREAM_END&&(0!==d.avail_in||s!==o.Z_FINISH&&s!==o.Z_SYNC_FLUSH)||("string"===this.options.to?(l=a.utf8border(d.output,d.next_out),u=d.next_out-l,h=a.buf2string(d.output,l),d.next_out=u,d.avail_out=p-u,u&&i.arraySet(d.output,d.output,l,u,0),this.onData(h)):this.onData(i.shrinkBuf(d.output,d.next_out)))),0===d.avail_in&&0===d.avail_out&&(m=!0)}while((0<d.avail_in||0===d.avail_out)&&n!==o.Z_STREAM_END);return n===o.Z_STREAM_END&&(s=o.Z_FINISH),s===o.Z_FINISH?(n=r.inflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===o.Z_OK):s!==o.Z_SYNC_FLUSH||(this.onEnd(o.Z_OK),!(d.avail_out=0))},h.prototype.onData=function(t){this.chunks.push(t)},h.prototype.onEnd=function(t){t===o.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},n.Inflate=h,n.inflate=d,n.inflateRaw=function(t,e){return(e=e||{}).raw=!0,d(t,e)},n.ungzip=d},{"./utils/common":4,"./utils/strings":5,"./zlib/constants":7,"./zlib/gzheader":10,"./zlib/inflate":12,"./zlib/messages":14,"./zlib/zstream":16}],4:[function(t,e,n){var r="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;n.assign=function(t){for(var e,n,r=Array.prototype.slice.call(arguments,1);r.length;){var i=r.shift();if(i){if("object"!=typeof i)throw new TypeError(i+"must be non-object");for(var a in i)e=i,n=a,Object.prototype.hasOwnProperty.call(e,n)&&(t[a]=i[a])}}return t},n.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var i={arraySet:function(t,e,n,r,i){if(e.subarray&&t.subarray)t.set(e.subarray(n,n+r),i);else for(var a=0;a<r;a++)t[i+a]=e[n+a]},flattenChunks:function(t){var e,n,r,i,a,o;for(e=r=0,n=t.length;e<n;e++)r+=t[e].length;for(o=new Uint8Array(r),e=i=0,n=t.length;e<n;e++)a=t[e],o.set(a,i),i+=a.length;return o}},a={arraySet:function(t,e,n,r,i){for(var a=0;a<r;a++)t[i+a]=e[n+a]},flattenChunks:function(t){return[].concat.apply([],t)}};n.setTyped=function(t){t?(n.Buf8=Uint8Array,n.Buf16=Uint16Array,n.Buf32=Int32Array,n.assign(n,i)):(n.Buf8=Array,n.Buf16=Array,n.Buf32=Array,n.assign(n,a))},n.setTyped(r)},{}],5:[function(t,e,n){var r=t("./common"),i=!0,a=!0;try{String.fromCharCode.apply(null,[0])}catch(t){i=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){a=!1}for(var o=new r.Buf8(256),s=0;s<256;s++)o[s]=252<=s?6:248<=s?5:240<=s?4:224<=s?3:192<=s?2:1;function l(t,e){if(e<65534&&(t.subarray&&a||!t.subarray&&i))return String.fromCharCode.apply(null,r.shrinkBuf(t,e));for(var n="",o=0;o<e;o++)n+=String.fromCharCode(t[o]);return n}o[254]=o[254]=1,n.string2buf=function(t){var e,n,i,a,o,s=t.length,l=0;for(a=0;a<s;a++)55296==(64512&(n=t.charCodeAt(a)))&&a+1<s&&56320==(64512&(i=t.charCodeAt(a+1)))&&(n=65536+(n-55296<<10)+(i-56320),a++),l+=n<128?1:n<2048?2:n<65536?3:4;for(e=new r.Buf8(l),a=o=0;o<l;a++)55296==(64512&(n=t.charCodeAt(a)))&&a+1<s&&56320==(64512&(i=t.charCodeAt(a+1)))&&(n=65536+(n-55296<<10)+(i-56320),a++),n<128?e[o++]=n:(n<2048?e[o++]=192|n>>>6:(n<65536?e[o++]=224|n>>>12:(e[o++]=240|n>>>18,e[o++]=128|n>>>12&63),e[o++]=128|n>>>6&63),e[o++]=128|63&n);return e},n.buf2binstring=function(t){return l(t,t.length)},n.binstring2buf=function(t){for(var e=new r.Buf8(t.length),n=0,i=e.length;n<i;n++)e[n]=t.charCodeAt(n);return e},n.buf2string=function(t,e){var n,r,i,a,s=e||t.length,u=new Array(2*s);for(n=r=0;n<s;)if((i=t[n++])<128)u[r++]=i;else if(4<(a=o[i]))u[r++]=65533,n+=a-1;else{for(i&=2===a?31:3===a?15:7;1<a&&n<s;)i=i<<6|63&t[n++],a--;1<a?u[r++]=65533:i<65536?u[r++]=i:(i-=65536,u[r++]=55296|i>>10&1023,u[r++]=56320|1023&i)}return l(u,r)},n.utf8border=function(t,e){var n;for((e=e||t.length)>t.length&&(e=t.length),n=e-1;0<=n&&128==(192&t[n]);)n--;return!(n<0)&&0!==n&&n+o[t[n]]>e?n:e}},{"./common":4}],6:[function(t,e,n){e.exports=function(t,e,n,r){for(var i=65535&t|0,a=t>>>16&65535|0,o=0;0!==n;){for(n-=o=2e3<n?2e3:n;a=a+(i=i+e[r++]|0)|0,--o;);i%=65521,a%=65521}return i|a<<16|0}},{}],7:[function(t,e,n){e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],8:[function(t,e,n){var r=function(){for(var t,e=[],n=0;n<256;n++){t=n;for(var r=0;r<8;r++)t=1&t?3988292384^t>>>1:t>>>1;e[n]=t}return e}();e.exports=function(t,e,n,i){var a=r,o=i+n;t^=-1;for(var s=i;s<o;s++)t=t>>>8^a[255&(t^e[s])];return-1^t}},{}],9:[function(t,e,n){var r,i=t("../utils/common"),a=t("./trees"),o=t("./adler32"),s=t("./crc32"),l=t("./messages"),u=-2,c=258,h=262,d=113;function p(t,e){return t.msg=l[e],e}function f(t){return(t<<1)-(4<t?9:0)}function m(t){for(var e=t.length;0<=--e;)t[e]=0}function g(t){var e=t.state,n=e.pending;n>t.avail_out&&(n=t.avail_out),0!==n&&(i.arraySet(t.output,e.pending_buf,e.pending_out,n,t.next_out),t.next_out+=n,e.pending_out+=n,t.total_out+=n,t.avail_out-=n,e.pending-=n,0===e.pending&&(e.pending_out=0))}function v(t,e){a._tr_flush_block(t,0<=t.block_start?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,g(t.strm)}function y(t,e){t.pending_buf[t.pending++]=e}function x(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function b(t,e){var n,r,i=t.max_chain_length,a=t.strstart,o=t.prev_length,s=t.nice_match,l=t.strstart>t.w_size-h?t.strstart-(t.w_size-h):0,u=t.window,d=t.w_mask,p=t.prev,f=t.strstart+c,m=u[a+o-1],g=u[a+o];t.prev_length>=t.good_match&&(i>>=2),s>t.lookahead&&(s=t.lookahead);do{if(u[(n=e)+o]===g&&u[n+o-1]===m&&u[n]===u[a]&&u[++n]===u[a+1]){a+=2,n++;do{}while(u[++a]===u[++n]&&u[++a]===u[++n]&&u[++a]===u[++n]&&u[++a]===u[++n]&&u[++a]===u[++n]&&u[++a]===u[++n]&&u[++a]===u[++n]&&u[++a]===u[++n]&&a<f);if(r=c-(f-a),a=f-c,o<r){if(t.match_start=e,s<=(o=r))break;m=u[a+o-1],g=u[a+o]}}}while((e=p[e&d])>l&&0!=--i);return o<=t.lookahead?o:t.lookahead}function w(t){var e,n,r,a,l,u,c,d,p,f,m=t.w_size;do{if(a=t.window_size-t.lookahead-t.strstart,t.strstart>=m+(m-h)){for(i.arraySet(t.window,t.window,m,m,0),t.match_start-=m,t.strstart-=m,t.block_start-=m,e=n=t.hash_size;r=t.head[--e],t.head[e]=m<=r?r-m:0,--n;);for(e=n=m;r=t.prev[--e],t.prev[e]=m<=r?r-m:0,--n;);a+=m}if(0===t.strm.avail_in)break;if(u=t.strm,c=t.window,d=t.strstart+t.lookahead,f=void 0,(p=a)<(f=u.avail_in)&&(f=p),n=0===f?0:(u.avail_in-=f,i.arraySet(c,u.input,u.next_in,f,d),1===u.state.wrap?u.adler=o(u.adler,c,f,d):2===u.state.wrap&&(u.adler=s(u.adler,c,f,d)),u.next_in+=f,u.total_in+=f,f),t.lookahead+=n,t.lookahead+t.insert>=3)for(l=t.strstart-t.insert,t.ins_h=t.window[l],t.ins_h=(t.ins_h<<t.hash_shift^t.window[l+1])&t.hash_mask;t.insert&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[l+3-1])&t.hash_mask,t.prev[l&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=l,l++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<h&&0!==t.strm.avail_in)}function _(t,e){for(var n,r;;){if(t.lookahead<h){if(w(t),t.lookahead<h&&0===e)return 1;if(0===t.lookahead)break}if(n=0,t.lookahead>=3&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==n&&t.strstart-n<=t.w_size-h&&(t.match_length=b(t,n)),t.match_length>=3)if(r=a._tr_tally(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){for(t.match_length--;t.strstart++,t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart,0!=--t.match_length;);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+1])&t.hash_mask;else r=a._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(r&&(v(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,4===e?(v(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(v(t,!1),0===t.strm.avail_out)?1:2}function M(t,e){for(var n,r,i;;){if(t.lookahead<h){if(w(t),t.lookahead<h&&0===e)return 1;if(0===t.lookahead)break}if(n=0,t.lookahead>=3&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==n&&t.prev_length<t.max_lazy_match&&t.strstart-n<=t.w_size-h&&(t.match_length=b(t,n),t.match_length<=5&&(1===t.strategy||3===t.match_length&&4096<t.strstart-t.match_start)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){for(i=t.strstart+t.lookahead-3,r=a._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;++t.strstart<=i&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!=--t.prev_length;);if(t.match_available=0,t.match_length=2,t.strstart++,r&&(v(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((r=a._tr_tally(t,0,t.window[t.strstart-1]))&&v(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(r=a._tr_tally(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,4===e?(v(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(v(t,!1),0===t.strm.avail_out)?1:2}function S(t,e,n,r,i){this.good_length=t,this.max_lazy=e,this.nice_length=n,this.max_chain=r,this.func=i}function T(t){var e;return t&&t.state?(t.total_in=t.total_out=0,t.data_type=2,(e=t.state).pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:d,t.adler=2===e.wrap?0:1,e.last_flush=0,a._tr_init(e),0):p(t,u)}function C(t){var e,n=T(t);return 0===n&&((e=t.state).window_size=2*e.w_size,m(e.head),e.max_lazy_match=r[e.level].max_lazy,e.good_match=r[e.level].good_length,e.nice_match=r[e.level].nice_length,e.max_chain_length=r[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0),n}function E(t,e,n,r,a,o){if(!t)return u;var s=1;if(-1===e&&(e=6),r<0?(s=0,r=-r):15<r&&(s=2,r-=16),a<1||9<a||8!==n||r<8||15<r||e<0||9<e||o<0||4<o)return p(t,u);8===r&&(r=9);var l=new function(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new i.Buf16(1146),this.dyn_dtree=new i.Buf16(122),this.bl_tree=new i.Buf16(78),m(this.dyn_ltree),m(this.dyn_dtree),m(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new i.Buf16(16),this.heap=new i.Buf16(573),m(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new i.Buf16(573),m(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0};return(t.state=l).strm=t,l.wrap=s,l.gzhead=null,l.w_bits=r,l.w_size=1<<l.w_bits,l.w_mask=l.w_size-1,l.hash_bits=a+7,l.hash_size=1<<l.hash_bits,l.hash_mask=l.hash_size-1,l.hash_shift=~~((l.hash_bits+3-1)/3),l.window=new i.Buf8(2*l.w_size),l.head=new i.Buf16(l.hash_size),l.prev=new i.Buf16(l.w_size),l.lit_bufsize=1<<a+6,l.pending_buf_size=4*l.lit_bufsize,l.pending_buf=new i.Buf8(l.pending_buf_size),l.d_buf=+l.lit_bufsize,l.l_buf=3*l.lit_bufsize,l.level=e,l.strategy=o,l.method=n,C(t)}r=[new S(0,0,0,0,function(t,e){var n=65535;for(n>t.pending_buf_size-5&&(n=t.pending_buf_size-5);;){if(t.lookahead<=1){if(w(t),0===t.lookahead&&0===e)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var r=t.block_start+n;if((0===t.strstart||t.strstart>=r)&&(t.lookahead=t.strstart-r,t.strstart=r,v(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-h&&(v(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(v(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(v(t,!1),t.strm.avail_out),1)}),new S(4,4,8,4,_),new S(4,5,16,8,_),new S(4,6,32,32,_),new S(4,4,16,16,M),new S(8,16,32,32,M),new S(8,16,128,128,M),new S(8,32,128,256,M),new S(32,128,258,1024,M),new S(32,258,258,4096,M)],n.deflateInit=function(t,e){return E(t,e,8,15,8,0)},n.deflateInit2=E,n.deflateReset=C,n.deflateResetKeep=T,n.deflateSetHeader=function(t,e){return t&&t.state&&2===t.state.wrap?(t.state.gzhead=e,0):u},n.deflate=function(t,e){var n,i,o,l;if(!t||!t.state||5<e||e<0)return t?p(t,u):u;if(i=t.state,!t.output||!t.input&&0!==t.avail_in||666===i.status&&4!==e)return p(t,0===t.avail_out?-5:u);if(i.strm=t,n=i.last_flush,i.last_flush=e,42===i.status)if(2===i.wrap)t.adler=0,y(i,31),y(i,139),y(i,8),i.gzhead?(y(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),y(i,255&i.gzhead.time),y(i,i.gzhead.time>>8&255),y(i,i.gzhead.time>>16&255),y(i,i.gzhead.time>>24&255),y(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),y(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(y(i,255&i.gzhead.extra.length),y(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(t.adler=s(t.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(y(i,0),y(i,0),y(i,0),y(i,0),y(i,0),y(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),y(i,3),i.status=d);else{var h=8+(i.w_bits-8<<4)<<8;h|=(2<=i.strategy||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(h|=32),h+=31-h%31,i.status=d,x(i,h),0!==i.strstart&&(x(i,t.adler>>>16),x(i,65535&t.adler)),t.adler=1}if(69===i.status)if(i.gzhead.extra){for(o=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>o&&(t.adler=s(t.adler,i.pending_buf,i.pending-o,o)),g(t),o=i.pending,i.pending!==i.pending_buf_size));)y(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>o&&(t.adler=s(t.adler,i.pending_buf,i.pending-o,o)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(73===i.status)if(i.gzhead.name){o=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>o&&(t.adler=s(t.adler,i.pending_buf,i.pending-o,o)),g(t),o=i.pending,i.pending===i.pending_buf_size)){l=1;break}l=i.gzindex<i.gzhead.name.length?255&i.gzhead.name.charCodeAt(i.gzindex++):0,y(i,l)}while(0!==l);i.gzhead.hcrc&&i.pending>o&&(t.adler=s(t.adler,i.pending_buf,i.pending-o,o)),0===l&&(i.gzindex=0,i.status=91)}else i.status=91;if(91===i.status)if(i.gzhead.comment){o=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>o&&(t.adler=s(t.adler,i.pending_buf,i.pending-o,o)),g(t),o=i.pending,i.pending===i.pending_buf_size)){l=1;break}l=i.gzindex<i.gzhead.comment.length?255&i.gzhead.comment.charCodeAt(i.gzindex++):0,y(i,l)}while(0!==l);i.gzhead.hcrc&&i.pending>o&&(t.adler=s(t.adler,i.pending_buf,i.pending-o,o)),0===l&&(i.status=103)}else i.status=103;if(103===i.status&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&g(t),i.pending+2<=i.pending_buf_size&&(y(i,255&t.adler),y(i,t.adler>>8&255),t.adler=0,i.status=d)):i.status=d),0!==i.pending){if(g(t),0===t.avail_out)return i.last_flush=-1,0}else if(0===t.avail_in&&f(e)<=f(n)&&4!==e)return p(t,-5);if(666===i.status&&0!==t.avail_in)return p(t,-5);if(0!==t.avail_in||0!==i.lookahead||0!==e&&666!==i.status){var b=2===i.strategy?function(t,e){for(var n;;){if(0===t.lookahead&&(w(t),0===t.lookahead)){if(0===e)return 1;break}if(t.match_length=0,n=a._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,n&&(v(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(v(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(v(t,!1),0===t.strm.avail_out)?1:2}(i,e):3===i.strategy?function(t,e){for(var n,r,i,o,s=t.window;;){if(t.lookahead<=c){if(w(t),t.lookahead<=c&&0===e)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&0<t.strstart&&(r=s[i=t.strstart-1])===s[++i]&&r===s[++i]&&r===s[++i]){o=t.strstart+c;do{}while(r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&i<o);t.match_length=c-(o-i),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(n=a._tr_tally(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(n=a._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),n&&(v(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(v(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(v(t,!1),0===t.strm.avail_out)?1:2}(i,e):r[i.level].func(i,e);if(3!==b&&4!==b||(i.status=666),1===b||3===b)return 0===t.avail_out&&(i.last_flush=-1),0;if(2===b&&(1===e?a._tr_align(i):5!==e&&(a._tr_stored_block(i,0,0,!1),3===e&&(m(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),g(t),0===t.avail_out))return i.last_flush=-1,0}return 4!==e?0:i.wrap<=0?1:(2===i.wrap?(y(i,255&t.adler),y(i,t.adler>>8&255),y(i,t.adler>>16&255),y(i,t.adler>>24&255),y(i,255&t.total_in),y(i,t.total_in>>8&255),y(i,t.total_in>>16&255),y(i,t.total_in>>24&255)):(x(i,t.adler>>>16),x(i,65535&t.adler)),g(t),0<i.wrap&&(i.wrap=-i.wrap),0!==i.pending?0:1)},n.deflateEnd=function(t){var e;return t&&t.state?42!==(e=t.state.status)&&69!==e&&73!==e&&91!==e&&103!==e&&e!==d&&666!==e?p(t,u):(t.state=null,e===d?p(t,-3):0):u},n.deflateSetDictionary=function(t,e){var n,r,a,s,l,c,h,d,p=e.length;if(!t||!t.state)return u;if(2===(s=(n=t.state).wrap)||1===s&&42!==n.status||n.lookahead)return u;for(1===s&&(t.adler=o(t.adler,e,p,0)),n.wrap=0,p>=n.w_size&&(0===s&&(m(n.head),n.strstart=0,n.block_start=0,n.insert=0),d=new i.Buf8(n.w_size),i.arraySet(d,e,p-n.w_size,n.w_size,0),e=d,p=n.w_size),l=t.avail_in,c=t.next_in,h=t.input,t.avail_in=p,t.next_in=0,t.input=e,w(n);n.lookahead>=3;){for(r=n.strstart,a=n.lookahead-2;n.ins_h=(n.ins_h<<n.hash_shift^n.window[r+3-1])&n.hash_mask,n.prev[r&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=r,r++,--a;);n.strstart=r,n.lookahead=2,w(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,t.next_in=c,t.input=h,t.avail_in=l,n.wrap=s,0},n.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":4,"./adler32":6,"./crc32":8,"./messages":14,"./trees":15}],10:[function(t,e,n){e.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],11:[function(t,e,n){e.exports=function(t,e){var n,r,i,a,o,s,l,u,c,h,d,p,f,m,g,v,y,x,b,w,_,M,S,T,C;n=t.state,r=t.next_in,T=t.input,i=r+(t.avail_in-5),a=t.next_out,C=t.output,o=a-(e-t.avail_out),s=a+(t.avail_out-257),l=n.dmax,u=n.wsize,c=n.whave,h=n.wnext,d=n.window,p=n.hold,f=n.bits,m=n.lencode,g=n.distcode,v=(1<<n.lenbits)-1,y=(1<<n.distbits)-1;t:do{f<15&&(p+=T[r++]<<f,f+=8,p+=T[r++]<<f,f+=8),x=m[p&v];e:for(;;){if(p>>>=b=x>>>24,f-=b,0==(b=x>>>16&255))C[a++]=65535&x;else{if(!(16&b)){if(0==(64&b)){x=m[(65535&x)+(p&(1<<b)-1)];continue e}if(32&b){n.mode=12;break t}t.msg="invalid literal/length code",n.mode=30;break t}w=65535&x,(b&=15)&&(f<b&&(p+=T[r++]<<f,f+=8),w+=p&(1<<b)-1,p>>>=b,f-=b),f<15&&(p+=T[r++]<<f,f+=8,p+=T[r++]<<f,f+=8),x=g[p&y];n:for(;;){if(p>>>=b=x>>>24,f-=b,!(16&(b=x>>>16&255))){if(0==(64&b)){x=g[(65535&x)+(p&(1<<b)-1)];continue n}t.msg="invalid distance code",n.mode=30;break t}if(_=65535&x,f<(b&=15)&&(p+=T[r++]<<f,(f+=8)<b&&(p+=T[r++]<<f,f+=8)),l<(_+=p&(1<<b)-1)){t.msg="invalid distance too far back",n.mode=30;break t}if(p>>>=b,f-=b,(b=a-o)<_){if(c<(b=_-b)&&n.sane){t.msg="invalid distance too far back",n.mode=30;break t}if(S=d,(M=0)===h){if(M+=u-b,b<w){for(w-=b;C[a++]=d[M++],--b;);M=a-_,S=C}}else if(h<b){if(M+=u+h-b,(b-=h)<w){for(w-=b;C[a++]=d[M++],--b;);if(M=0,h<w){for(w-=b=h;C[a++]=d[M++],--b;);M=a-_,S=C}}}else if(M+=h-b,b<w){for(w-=b;C[a++]=d[M++],--b;);M=a-_,S=C}for(;2<w;)C[a++]=S[M++],C[a++]=S[M++],C[a++]=S[M++],w-=3;w&&(C[a++]=S[M++],1<w&&(C[a++]=S[M++]))}else{for(M=a-_;C[a++]=C[M++],C[a++]=C[M++],C[a++]=C[M++],2<(w-=3););w&&(C[a++]=C[M++],1<w&&(C[a++]=C[M++]))}break}}break}}while(r<i&&a<s);r-=w=f>>3,p&=(1<<(f-=w<<3))-1,t.next_in=r,t.next_out=a,t.avail_in=r<i?i-r+5:5-(r-i),t.avail_out=a<s?s-a+257:257-(a-s),n.hold=p,n.bits=f}},{}],12:[function(t,e,n){var r=t("../utils/common"),i=t("./adler32"),a=t("./crc32"),o=t("./inffast"),s=t("./inftrees"),l=-2;function u(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function c(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new r.Buf16(320),this.work=new r.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function h(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=1,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new r.Buf32(852),e.distcode=e.distdyn=new r.Buf32(592),e.sane=1,e.back=-1,0):l}function d(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,h(t)):l}function p(t,e){var n,r;return t&&t.state?(r=t.state,e<0?(n=0,e=-e):(n=1+(e>>4),e<48&&(e&=15)),e&&(e<8||15<e)?l:(null!==r.window&&r.wbits!==e&&(r.window=null),r.wrap=n,r.wbits=e,d(t))):l}function f(t,e){var n,r;return t?(r=new c,(t.state=r).window=null,0!==(n=p(t,e))&&(t.state=null),n):l}var m,g,v=!0;function y(t){if(v){var e;for(m=new r.Buf32(512),g=new r.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(s(1,t.lens,0,288,m,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;s(2,t.lens,0,32,g,0,t.work,{bits:5}),v=!1}t.lencode=m,t.lenbits=9,t.distcode=g,t.distbits=5}function x(t,e,n,i){var a,o=t.state;return null===o.window&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new r.Buf8(o.wsize)),i>=o.wsize?(r.arraySet(o.window,e,n-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):(i<(a=o.wsize-o.wnext)&&(a=i),r.arraySet(o.window,e,n-i,a,o.wnext),(i-=a)?(r.arraySet(o.window,e,n-i,i,0),o.wnext=i,o.whave=o.wsize):(o.wnext+=a,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=a))),0}n.inflateReset=d,n.inflateReset2=p,n.inflateResetKeep=h,n.inflateInit=function(t){return f(t,15)},n.inflateInit2=f,n.inflate=function(t,e){var n,c,h,d,p,f,m,g,v,b,w,_,M,S,T,C,E,D,A,O,L,P,R,I,k=0,B=new r.Buf8(4),F=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!t||!t.state||!t.output||!t.input&&0!==t.avail_in)return l;12===(n=t.state).mode&&(n.mode=13),p=t.next_out,h=t.output,m=t.avail_out,d=t.next_in,c=t.input,f=t.avail_in,g=n.hold,v=n.bits,b=f,w=m,P=0;t:for(;;)switch(n.mode){case 1:if(0===n.wrap){n.mode=13;break}for(;v<16;){if(0===f)break t;f--,g+=c[d++]<<v,v+=8}if(2&n.wrap&&35615===g){B[n.check=0]=255&g,B[1]=g>>>8&255,n.check=a(n.check,B,2,0),v=g=0,n.mode=2;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&g)<<8)+(g>>8))%31){t.msg="incorrect header check",n.mode=30;break}if(8!=(15&g)){t.msg="unknown compression method",n.mode=30;break}if(v-=4,L=8+(15&(g>>>=4)),0===n.wbits)n.wbits=L;else if(L>n.wbits){t.msg="invalid window size",n.mode=30;break}n.dmax=1<<L,t.adler=n.check=1,n.mode=512&g?10:12,v=g=0;break;case 2:for(;v<16;){if(0===f)break t;f--,g+=c[d++]<<v,v+=8}if(n.flags=g,8!=(255&n.flags)){t.msg="unknown compression method",n.mode=30;break}if(57344&n.flags){t.msg="unknown header flags set",n.mode=30;break}n.head&&(n.head.text=g>>8&1),512&n.flags&&(B[0]=255&g,B[1]=g>>>8&255,n.check=a(n.check,B,2,0)),v=g=0,n.mode=3;case 3:for(;v<32;){if(0===f)break t;f--,g+=c[d++]<<v,v+=8}n.head&&(n.head.time=g),512&n.flags&&(B[0]=255&g,B[1]=g>>>8&255,B[2]=g>>>16&255,B[3]=g>>>24&255,n.check=a(n.check,B,4,0)),v=g=0,n.mode=4;case 4:for(;v<16;){if(0===f)break t;f--,g+=c[d++]<<v,v+=8}n.head&&(n.head.xflags=255&g,n.head.os=g>>8),512&n.flags&&(B[0]=255&g,B[1]=g>>>8&255,n.check=a(n.check,B,2,0)),v=g=0,n.mode=5;case 5:if(1024&n.flags){for(;v<16;){if(0===f)break t;f--,g+=c[d++]<<v,v+=8}n.length=g,n.head&&(n.head.extra_len=g),512&n.flags&&(B[0]=255&g,B[1]=g>>>8&255,n.check=a(n.check,B,2,0)),v=g=0}else n.head&&(n.head.extra=null);n.mode=6;case 6:if(1024&n.flags&&(f<(_=n.length)&&(_=f),_&&(n.head&&(L=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),r.arraySet(n.head.extra,c,d,_,L)),512&n.flags&&(n.check=a(n.check,c,_,d)),f-=_,d+=_,n.length-=_),n.length))break t;n.length=0,n.mode=7;case 7:if(2048&n.flags){if(0===f)break t;for(_=0;L=c[d+_++],n.head&&L&&n.length<65536&&(n.head.name+=String.fromCharCode(L)),L&&_<f;);if(512&n.flags&&(n.check=a(n.check,c,_,d)),f-=_,d+=_,L)break t}else n.head&&(n.head.name=null);n.length=0,n.mode=8;case 8:if(4096&n.flags){if(0===f)break t;for(_=0;L=c[d+_++],n.head&&L&&n.length<65536&&(n.head.comment+=String.fromCharCode(L)),L&&_<f;);if(512&n.flags&&(n.check=a(n.check,c,_,d)),f-=_,d+=_,L)break t}else n.head&&(n.head.comment=null);n.mode=9;case 9:if(512&n.flags){for(;v<16;){if(0===f)break t;f--,g+=c[d++]<<v,v+=8}if(g!==(65535&n.check)){t.msg="header crc mismatch",n.mode=30;break}v=g=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),t.adler=n.check=0,n.mode=12;break;case 10:for(;v<32;){if(0===f)break t;f--,g+=c[d++]<<v,v+=8}t.adler=n.check=u(g),v=g=0,n.mode=11;case 11:if(0===n.havedict)return t.next_out=p,t.avail_out=m,t.next_in=d,t.avail_in=f,n.hold=g,n.bits=v,2;t.adler=n.check=1,n.mode=12;case 12:if(5===e||6===e)break t;case 13:if(n.last){g>>>=7&v,v-=7&v,n.mode=27;break}for(;v<3;){if(0===f)break t;f--,g+=c[d++]<<v,v+=8}switch(n.last=1&g,--v,3&(g>>>=1)){case 0:n.mode=14;break;case 1:if(y(n),n.mode=20,6!==e)break;g>>>=2,v-=2;break t;case 2:n.mode=17;break;case 3:t.msg="invalid block type",n.mode=30}g>>>=2,v-=2;break;case 14:for(g>>>=7&v,v-=7&v;v<32;){if(0===f)break t;f--,g+=c[d++]<<v,v+=8}if((65535&g)!=(g>>>16^65535)){t.msg="invalid stored block lengths",n.mode=30;break}if(n.length=65535&g,v=g=0,n.mode=15,6===e)break t;case 15:n.mode=16;case 16:if(_=n.length){if(f<_&&(_=f),m<_&&(_=m),0===_)break t;r.arraySet(h,c,d,_,p),f-=_,d+=_,m-=_,p+=_,n.length-=_;break}n.mode=12;break;case 17:for(;v<14;){if(0===f)break t;f--,g+=c[d++]<<v,v+=8}if(n.nlen=257+(31&g),g>>>=5,v-=5,n.ndist=1+(31&g),g>>>=5,v-=5,n.ncode=4+(15&g),g>>>=4,v-=4,286<n.nlen||30<n.ndist){t.msg="too many length or distance symbols",n.mode=30;break}n.have=0,n.mode=18;case 18:for(;n.have<n.ncode;){for(;v<3;){if(0===f)break t;f--,g+=c[d++]<<v,v+=8}n.lens[F[n.have++]]=7&g,g>>>=3,v-=3}for(;n.have<19;)n.lens[F[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,R={bits:n.lenbits},P=s(0,n.lens,0,19,n.lencode,0,n.work,R),n.lenbits=R.bits,P){t.msg="invalid code lengths set",n.mode=30;break}n.have=0,n.mode=19;case 19:for(;n.have<n.nlen+n.ndist;){for(;C=(k=n.lencode[g&(1<<n.lenbits)-1])>>>16&255,E=65535&k,!((T=k>>>24)<=v);){if(0===f)break t;f--,g+=c[d++]<<v,v+=8}if(E<16)g>>>=T,v-=T,n.lens[n.have++]=E;else{if(16===E){for(I=T+2;v<I;){if(0===f)break t;f--,g+=c[d++]<<v,v+=8}if(g>>>=T,v-=T,0===n.have){t.msg="invalid bit length repeat",n.mode=30;break}L=n.lens[n.have-1],_=3+(3&g),g>>>=2,v-=2}else if(17===E){for(I=T+3;v<I;){if(0===f)break t;f--,g+=c[d++]<<v,v+=8}v-=T,L=0,_=3+(7&(g>>>=T)),g>>>=3,v-=3}else{for(I=T+7;v<I;){if(0===f)break t;f--,g+=c[d++]<<v,v+=8}v-=T,L=0,_=11+(127&(g>>>=T)),g>>>=7,v-=7}if(n.have+_>n.nlen+n.ndist){t.msg="invalid bit length repeat",n.mode=30;break}for(;_--;)n.lens[n.have++]=L}}if(30===n.mode)break;if(0===n.lens[256]){t.msg="invalid code -- missing end-of-block",n.mode=30;break}if(n.lenbits=9,R={bits:n.lenbits},P=s(1,n.lens,0,n.nlen,n.lencode,0,n.work,R),n.lenbits=R.bits,P){t.msg="invalid literal/lengths set",n.mode=30;break}if(n.distbits=6,n.distcode=n.distdyn,R={bits:n.distbits},P=s(2,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,R),n.distbits=R.bits,P){t.msg="invalid distances set",n.mode=30;break}if(n.mode=20,6===e)break t;case 20:n.mode=21;case 21:if(6<=f&&258<=m){t.next_out=p,t.avail_out=m,t.next_in=d,t.avail_in=f,n.hold=g,n.bits=v,o(t,w),p=t.next_out,h=t.output,m=t.avail_out,d=t.next_in,c=t.input,f=t.avail_in,g=n.hold,v=n.bits,12===n.mode&&(n.back=-1);break}for(n.back=0;C=(k=n.lencode[g&(1<<n.lenbits)-1])>>>16&255,E=65535&k,!((T=k>>>24)<=v);){if(0===f)break t;f--,g+=c[d++]<<v,v+=8}if(C&&0==(240&C)){for(D=T,A=C,O=E;C=(k=n.lencode[O+((g&(1<<D+A)-1)>>D)])>>>16&255,E=65535&k,!(D+(T=k>>>24)<=v);){if(0===f)break t;f--,g+=c[d++]<<v,v+=8}g>>>=D,v-=D,n.back+=D}if(g>>>=T,v-=T,n.back+=T,n.length=E,0===C){n.mode=26;break}if(32&C){n.back=-1,n.mode=12;break}if(64&C){t.msg="invalid literal/length code",n.mode=30;break}n.extra=15&C,n.mode=22;case 22:if(n.extra){for(I=n.extra;v<I;){if(0===f)break t;f--,g+=c[d++]<<v,v+=8}n.length+=g&(1<<n.extra)-1,g>>>=n.extra,v-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=23;case 23:for(;C=(k=n.distcode[g&(1<<n.distbits)-1])>>>16&255,E=65535&k,!((T=k>>>24)<=v);){if(0===f)break t;f--,g+=c[d++]<<v,v+=8}if(0==(240&C)){for(D=T,A=C,O=E;C=(k=n.distcode[O+((g&(1<<D+A)-1)>>D)])>>>16&255,E=65535&k,!(D+(T=k>>>24)<=v);){if(0===f)break t;f--,g+=c[d++]<<v,v+=8}g>>>=D,v-=D,n.back+=D}if(g>>>=T,v-=T,n.back+=T,64&C){t.msg="invalid distance code",n.mode=30;break}n.offset=E,n.extra=15&C,n.mode=24;case 24:if(n.extra){for(I=n.extra;v<I;){if(0===f)break t;f--,g+=c[d++]<<v,v+=8}n.offset+=g&(1<<n.extra)-1,g>>>=n.extra,v-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){t.msg="invalid distance too far back",n.mode=30;break}n.mode=25;case 25:if(0===m)break t;if(_=w-m,n.offset>_){if((_=n.offset-_)>n.whave&&n.sane){t.msg="invalid distance too far back",n.mode=30;break}M=_>n.wnext?(_-=n.wnext,n.wsize-_):n.wnext-_,_>n.length&&(_=n.length),S=n.window}else S=h,M=p-n.offset,_=n.length;for(m<_&&(_=m),m-=_,n.length-=_;h[p++]=S[M++],--_;);0===n.length&&(n.mode=21);break;case 26:if(0===m)break t;h[p++]=n.length,m--,n.mode=21;break;case 27:if(n.wrap){for(;v<32;){if(0===f)break t;f--,g|=c[d++]<<v,v+=8}if(w-=m,t.total_out+=w,n.total+=w,w&&(t.adler=n.check=(n.flags?a:i)(n.check,h,w,p-w)),w=m,(n.flags?g:u(g))!==n.check){t.msg="incorrect data check",n.mode=30;break}v=g=0}n.mode=28;case 28:if(n.wrap&&n.flags){for(;v<32;){if(0===f)break t;f--,g+=c[d++]<<v,v+=8}if(g!==(4294967295&n.total)){t.msg="incorrect length check",n.mode=30;break}v=g=0}n.mode=29;case 29:P=1;break t;case 30:P=-3;break t;case 31:return-4;default:return l}return t.next_out=p,t.avail_out=m,t.next_in=d,t.avail_in=f,n.hold=g,n.bits=v,(n.wsize||w!==t.avail_out&&n.mode<30&&(n.mode<27||4!==e))&&x(t,t.output,t.next_out,w-t.avail_out)?(n.mode=31,-4):(b-=t.avail_in,w-=t.avail_out,t.total_in+=b,t.total_out+=w,n.total+=w,n.wrap&&w&&(t.adler=n.check=(n.flags?a:i)(n.check,h,w,t.next_out-w)),t.data_type=n.bits+(n.last?64:0)+(12===n.mode?128:0)+(20===n.mode||15===n.mode?256:0),(0==b&&0===w||4===e)&&0===P&&(P=-5),P)},n.inflateEnd=function(t){if(!t||!t.state)return l;var e=t.state;return e.window&&(e.window=null),t.state=null,0},n.inflateGetHeader=function(t,e){var n;return t&&t.state&&0!=(2&(n=t.state).wrap)?((n.head=e).done=!1,0):l},n.inflateSetDictionary=function(t,e){var n,r=e.length;return!t||!t.state||0!==(n=t.state).wrap&&11!==n.mode?l:11===n.mode&&i(1,e,r,0)!==n.check?-3:x(t,e,r,r)?(n.mode=31,-4):(n.havedict=1,0)},n.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":4,"./adler32":6,"./crc32":8,"./inffast":11,"./inftrees":13}],13:[function(t,e,n){var r=t("../utils/common"),i=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],a=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],o=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],s=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];e.exports=function(t,e,n,l,u,c,h,d){var p,f,m,g,v,y,x,b,w,_=d.bits,M=0,S=0,T=0,C=0,E=0,D=0,A=0,O=0,L=0,P=0,R=null,I=0,k=new r.Buf16(16),B=new r.Buf16(16),F=null,N=0;for(M=0;M<=15;M++)k[M]=0;for(S=0;S<l;S++)k[e[n+S]]++;for(E=_,C=15;1<=C&&0===k[C];C--);if(C<E&&(E=C),0===C)return u[c++]=20971520,u[c++]=20971520,d.bits=1,0;for(T=1;T<C&&0===k[T];T++);for(E<T&&(E=T),M=O=1;M<=15;M++)if(O<<=1,(O-=k[M])<0)return-1;if(0<O&&(0===t||1!==C))return-1;for(B[1]=0,M=1;M<15;M++)B[M+1]=B[M]+k[M];for(S=0;S<l;S++)0!==e[n+S]&&(h[B[e[n+S]]++]=S);if(y=0===t?(R=F=h,19):1===t?(R=i,I-=257,F=a,N-=257,256):(R=o,F=s,-1),M=T,v=c,A=S=P=0,m=-1,g=(L=1<<(D=E))-1,1===t&&852<L||2===t&&592<L)return 1;for(;;){for(x=M-A,w=h[S]<y?(b=0,h[S]):h[S]>y?(b=F[N+h[S]],R[I+h[S]]):(b=96,0),p=1<<M-A,T=f=1<<D;u[v+(P>>A)+(f-=p)]=x<<24|b<<16|w|0,0!==f;);for(p=1<<M-1;P&p;)p>>=1;if(0!==p?(P&=p-1,P+=p):P=0,S++,0==--k[M]){if(M===C)break;M=e[n+h[S]]}if(E<M&&(P&g)!==m){for(0===A&&(A=E),v+=T,O=1<<(D=M-A);D+A<C&&!((O-=k[D+A])<=0);)D++,O<<=1;if(L+=1<<D,1===t&&852<L||2===t&&592<L)return 1;u[m=P&g]=E<<24|D<<16|v-c|0}}return 0!==P&&(u[v+P]=M-A<<24|64<<16|0),d.bits=E,0}},{"../utils/common":4}],14:[function(t,e,n){e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],15:[function(t,e,n){var r=t("../utils/common");function i(t){for(var e=t.length;0<=--e;)t[e]=0}var a=256,o=286,s=30,l=15,u=[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],c=[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],h=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],d=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],p=new Array(576);i(p);var f=new Array(60);i(f);var m=new Array(512);i(m);var g=new Array(256);i(g);var v=new Array(29);i(v);var y,x,b,w=new Array(s);function _(t,e,n,r,i){this.static_tree=t,this.extra_bits=e,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=t&&t.length}function M(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function S(t){return t<256?m[t]:m[256+(t>>>7)]}function T(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function C(t,e,n){t.bi_valid>16-n?(t.bi_buf|=e<<t.bi_valid&65535,T(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=n-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=n)}function E(t,e,n){C(t,n[2*e],n[2*e+1])}function D(t,e){for(var n=0;n|=1&t,t>>>=1,n<<=1,0<--e;);return n>>>1}function A(t,e,n){var r,i,a=new Array(16),o=0;for(r=1;r<=l;r++)a[r]=o=o+n[r-1]<<1;for(i=0;i<=e;i++){var s=t[2*i+1];0!==s&&(t[2*i]=D(a[s]++,s))}}function O(t){var e;for(e=0;e<o;e++)t.dyn_ltree[2*e]=0;for(e=0;e<s;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}function L(t){8<t.bi_valid?T(t,t.bi_buf):0<t.bi_valid&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function P(t,e,n,r){var i=2*e,a=2*n;return t[i]<t[a]||t[i]===t[a]&&r[e]<=r[n]}function R(t,e,n){for(var r=t.heap[n],i=n<<1;i<=t.heap_len&&(i<t.heap_len&&P(e,t.heap[i+1],t.heap[i],t.depth)&&i++,!P(e,r,t.heap[i],t.depth));)t.heap[n]=t.heap[i],n=i,i<<=1;t.heap[n]=r}function I(t,e,n){var r,i,o,s,l=0;if(0!==t.last_lit)for(;r=t.pending_buf[t.d_buf+2*l]<<8|t.pending_buf[t.d_buf+2*l+1],i=t.pending_buf[t.l_buf+l],l++,0===r?E(t,i,e):(E(t,(o=g[i])+a+1,e),0!==(s=u[o])&&C(t,i-=v[o],s),E(t,o=S(--r),n),0!==(s=c[o])&&C(t,r-=w[o],s)),l<t.last_lit;);E(t,256,e)}function k(t,e){var n,r,i,a=e.dyn_tree,o=e.stat_desc.static_tree,s=e.stat_desc.has_stree,u=e.stat_desc.elems,c=-1;for(t.heap_len=0,t.heap_max=573,n=0;n<u;n++)0!==a[2*n]?(t.heap[++t.heap_len]=c=n,t.depth[n]=0):a[2*n+1]=0;for(;t.heap_len<2;)a[2*(i=t.heap[++t.heap_len]=c<2?++c:0)]=1,t.depth[i]=0,t.opt_len--,s&&(t.static_len-=o[2*i+1]);for(e.max_code=c,n=t.heap_len>>1;1<=n;n--)R(t,a,n);for(i=u;n=t.heap[1],t.heap[1]=t.heap[t.heap_len--],R(t,a,1),r=t.heap[1],t.heap[--t.heap_max]=n,t.heap[--t.heap_max]=r,a[2*i]=a[2*n]+a[2*r],t.depth[i]=(t.depth[n]>=t.depth[r]?t.depth[n]:t.depth[r])+1,a[2*n+1]=a[2*r+1]=i,t.heap[1]=i++,R(t,a,1),2<=t.heap_len;);t.heap[--t.heap_max]=t.heap[1],function(t,e){var n,r,i,a,o,s,u=e.dyn_tree,c=e.max_code,h=e.stat_desc.static_tree,d=e.stat_desc.has_stree,p=e.stat_desc.extra_bits,f=e.stat_desc.extra_base,m=e.stat_desc.max_length,g=0;for(a=0;a<=l;a++)t.bl_count[a]=0;for(u[2*t.heap[t.heap_max]+1]=0,n=t.heap_max+1;n<573;n++)m<(a=u[2*u[2*(r=t.heap[n])+1]+1]+1)&&(a=m,g++),u[2*r+1]=a,c<r||(t.bl_count[a]++,o=0,f<=r&&(o=p[r-f]),s=u[2*r],t.opt_len+=s*(a+o),d&&(t.static_len+=s*(h[2*r+1]+o)));if(0!==g){do{for(a=m-1;0===t.bl_count[a];)a--;t.bl_count[a]--,t.bl_count[a+1]+=2,t.bl_count[m]--,g-=2}while(0<g);for(a=m;0!==a;a--)for(r=t.bl_count[a];0!==r;)c<(i=t.heap[--n])||(u[2*i+1]!==a&&(t.opt_len+=(a-u[2*i+1])*u[2*i],u[2*i+1]=a),r--)}}(t,e),A(a,c,t.bl_count)}function B(t,e,n){var r,i,a=-1,o=e[1],s=0,l=7,u=4;for(0===o&&(l=138,u=3),e[2*(n+1)+1]=65535,r=0;r<=n;r++)i=o,o=e[2*(r+1)+1],++s<l&&i===o||(s<u?t.bl_tree[2*i]+=s:0!==i?(i!==a&&t.bl_tree[2*i]++,t.bl_tree[32]++):s<=10?t.bl_tree[34]++:t.bl_tree[36]++,a=i,u=(s=0)===o?(l=138,3):i===o?(l=6,3):(l=7,4))}function F(t,e,n){var r,i,a=-1,o=e[1],s=0,l=7,u=4;for(0===o&&(l=138,u=3),r=0;r<=n;r++)if(i=o,o=e[2*(r+1)+1],!(++s<l&&i===o)){if(s<u)for(;E(t,i,t.bl_tree),0!=--s;);else 0!==i?(i!==a&&(E(t,i,t.bl_tree),s--),E(t,16,t.bl_tree),C(t,s-3,2)):s<=10?(E(t,17,t.bl_tree),C(t,s-3,3)):(E(t,18,t.bl_tree),C(t,s-11,7));a=i,u=(s=0)===o?(l=138,3):i===o?(l=6,3):(l=7,4)}}i(w);var N=!1;function j(t,e,n,i){var a,o,s;C(t,0+(i?1:0),3),o=e,s=n,L(a=t),T(a,s),T(a,~s),r.arraySet(a.pending_buf,a.window,o,s,a.pending),a.pending+=s}n._tr_init=function(t){N||(function(){var t,e,n,r,i,a=new Array(16);for(r=n=0;r<28;r++)for(v[r]=n,t=0;t<1<<u[r];t++)g[n++]=r;for(g[n-1]=r,r=i=0;r<16;r++)for(w[r]=i,t=0;t<1<<c[r];t++)m[i++]=r;for(i>>=7;r<s;r++)for(w[r]=i<<7,t=0;t<1<<c[r]-7;t++)m[256+i++]=r;for(e=0;e<=l;e++)a[e]=0;for(t=0;t<=143;)p[2*t+1]=8,t++,a[8]++;for(;t<=255;)p[2*t+1]=9,t++,a[9]++;for(;t<=279;)p[2*t+1]=7,t++,a[7]++;for(;t<=287;)p[2*t+1]=8,t++,a[8]++;for(A(p,287,a),t=0;t<s;t++)f[2*t+1]=5,f[2*t]=D(t,5);y=new _(p,u,257,o,l),x=new _(f,c,0,s,l),b=new _(new Array(0),h,0,19,7)}(),N=!0),t.l_desc=new M(t.dyn_ltree,y),t.d_desc=new M(t.dyn_dtree,x),t.bl_desc=new M(t.bl_tree,b),t.bi_buf=0,t.bi_valid=0,O(t)},n._tr_stored_block=j,n._tr_flush_block=function(t,e,n,r){var i,o,s=0;0<t.level?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,n=4093624447;for(e=0;e<=31;e++,n>>>=1)if(1&n&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<a;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),k(t,t.l_desc),k(t,t.d_desc),s=function(t){var e;for(B(t,t.dyn_ltree,t.l_desc.max_code),B(t,t.dyn_dtree,t.d_desc.max_code),k(t,t.bl_desc),e=18;3<=e&&0===t.bl_tree[2*d[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),i=t.opt_len+3+7>>>3,(o=t.static_len+3+7>>>3)<=i&&(i=o)):i=o=n+5,n+4<=i&&-1!==e?j(t,e,n,r):4===t.strategy||o===i?(C(t,2+(r?1:0),3),I(t,p,f)):(C(t,4+(r?1:0),3),function(t,e,n,r){var i;for(C(t,e-257,5),C(t,n-1,5),C(t,r-4,4),i=0;i<r;i++)C(t,t.bl_tree[2*d[i]+1],3);F(t,t.dyn_ltree,e-1),F(t,t.dyn_dtree,n-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,s+1),I(t,t.dyn_ltree,t.dyn_dtree)),O(t),r&&L(t)},n._tr_tally=function(t,e,n){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&n,t.last_lit++,0===e?t.dyn_ltree[2*n]++:(t.matches++,e--,t.dyn_ltree[2*(g[n]+a+1)]++,t.dyn_dtree[2*S(e)]++),t.last_lit===t.lit_bufsize-1},n._tr_align=function(t){var e;C(t,2,3),E(t,256,p),16===(e=t).bi_valid?(T(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):8<=e.bi_valid&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}},{"../utils/common":4}],16:[function(t,e,n){e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],17:[function(t,e,n){var r=t("three");r.OrbitControls=function(t,e){var n,i,a,o,s;void 0===e&&console.warn('THREE.OrbitControls: The second parameter "domElement" is now mandatory.'),e===document&&console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),this.object=t,this.domElement=e,this.enabled=!0,this.target=new r.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!1,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.enableKeys=!0,this.keys={LEFT:37,UP:38,RIGHT:39,BOTTOM:40},this.mouseButtons={LEFT:r.MOUSE.ROTATE,MIDDLE:r.MOUSE.DOLLY,RIGHT:r.MOUSE.PAN},this.touches={ONE:r.TOUCH.ROTATE,TWO:r.TOUCH.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=function(){return m.phi},this.getAzimuthalAngle=function(){return m.theta},this.saveState=function(){l.target0.copy(l.target),l.position0.copy(l.object.position),l.zoom0=l.object.zoom},this.resetStatusValue=function(){p=d.NONE},this.reset=function(){l.target.copy(l.target0),l.object.position.copy(l.position0),l.object.zoom=l.zoom0,l.object.updateProjectionMatrix(),l.dispatchEvent(u),l.update(),p=d.NONE},this.update=(n=new r.Vector3,i=(new r.Quaternion).setFromUnitVectors(t.up,new r.Vector3(0,1,0)),a=i.clone().inverse(),o=new r.Vector3,s=new r.Quaternion,function(){var t=l.object.position;return n.copy(t).sub(l.target),n.applyQuaternion(i),m.setFromVector3(n),l.autoRotate&&p===d.NONE&&O(2*Math.PI/60/60*l.autoRotateSpeed),l.enableDamping?(m.theta+=g.theta*l.dampingFactor,m.phi+=g.phi*l.dampingFactor):(m.theta+=g.theta,m.phi+=g.phi),m.theta=Math.max(l.minAzimuthAngle,Math.min(l.maxAzimuthAngle,m.theta)),m.phi=Math.max(l.minPolarAngle,Math.min(l.maxPolarAngle,m.phi)),m.makeSafe(),m.radius*=v,m.radius=Math.max(l.minDistance,Math.min(l.maxDistance,m.radius)),!0===l.enableDamping?l.target.addScaledVector(y,l.dampingFactor):l.target.add(y),n.setFromSpherical(m),n.applyQuaternion(a),t.copy(l.target).add(n),l.object.lookAt(l.target),!0===l.enableDamping?(g.theta*=1-l.dampingFactor,g.phi*=1-l.dampingFactor,y.multiplyScalar(1-l.dampingFactor)):(g.set(0,0,0),y.set(0,0,0)),v=1,!(!(x||o.distanceToSquared(l.object.position)>f||8*(1-s.dot(l.object.quaternion))>f)||(l.dispatchEvent(u),o.copy(l.object.position),s.copy(l.object.quaternion),x=!1))}),this.dispose=function(){l.domElement.removeEventListener("contextmenu",nt,!1),l.domElement.removeEventListener("mousedown",X,!1),l.domElement.removeEventListener("wheel",$,!1),l.domElement.removeEventListener("touchstart",Q,!1),l.domElement.removeEventListener("touchend",et,!1),l.domElement.removeEventListener("touchmove",tt,!1),document.removeEventListener("mousemove",Y,!1),document.removeEventListener("mouseup",Z,!1),l.domElement.removeEventListener("keydown",K,!1)};var l=this,u={type:"change"},c={type:"start"},h={type:"end"},d={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},p=d.NONE,f=1e-6,m=new r.Spherical,g=new r.Spherical,v=1,y=new r.Vector3,x=!1,b=new r.Vector2,w=new r.Vector2,_=new r.Vector2,M=new r.Vector2,S=new r.Vector2,T=new r.Vector2,C=new r.Vector2,E=new r.Vector2,D=new r.Vector2;function A(){return Math.pow(.95,l.zoomSpeed)}function O(t){g.theta-=t}function L(t){g.phi-=t}var P,R,I,k=(P=new r.Vector3,function(t,e){P.setFromMatrixColumn(e,0),P.multiplyScalar(-t),y.add(P)}),B=(R=new r.Vector3,function(t,e){!0===l.screenSpacePanning?R.setFromMatrixColumn(e,1):(R.setFromMatrixColumn(e,0),R.crossVectors(l.object.up,R)),R.multiplyScalar(t),y.add(R)}),F=(I=new r.Vector3,function(t,e){var n=l.domElement;if(l.object.isPerspectiveCamera){var r=l.object.position;I.copy(r).sub(l.target);var i=I.length();i*=Math.tan(l.object.fov/2*Math.PI/180),k(2*t*i/n.clientHeight,l.object.matrix),B(2*e*i/n.clientHeight,l.object.matrix)}else l.object.isOrthographicCamera?(k(t*(l.object.right-l.object.left)/l.object.zoom/n.clientWidth,l.object.matrix),B(e*(l.object.top-l.object.bottom)/l.object.zoom/n.clientHeight,l.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),l.enablePan=!1)});function N(t){l.object.isPerspectiveCamera?v/=t:l.object.isOrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom*t)),l.object.updateProjectionMatrix(),x=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function j(t){l.object.isPerspectiveCamera?v*=t:l.object.isOrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom/t)),l.object.updateProjectionMatrix(),x=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function z(t){b.set(t.clientX,t.clientY)}function V(t){M.set(t.clientX,t.clientY)}function G(t){if(1==t.touches.length)b.set(t.touches[0].pageX,t.touches[0].pageY);else{var e=.5*(t.touches[0].pageX+t.touches[1].pageX),n=.5*(t.touches[0].pageY+t.touches[1].pageY);b.set(e,n)}}function U(t){if(1==t.touches.length)M.set(t.touches[0].pageX,t.touches[0].pageY);else{var e=.5*(t.touches[0].pageX+t.touches[1].pageX),n=.5*(t.touches[0].pageY+t.touches[1].pageY);M.set(e,n)}}function H(t){var e=t.touches[0].pageX-t.touches[1].pageX,n=t.touches[0].pageY-t.touches[1].pageY,r=Math.sqrt(e*e+n*n);C.set(0,r)}function W(t){if(1==t.touches.length)w.set(t.touches[0].pageX,t.touches[0].pageY);else{var e=.5*(t.touches[0].pageX+t.touches[1].pageX),n=.5*(t.touches[0].pageY+t.touches[1].pageY);w.set(e,n)}_.subVectors(w,b).multiplyScalar(l.rotateSpeed);var r=l.domElement;O(2*Math.PI*_.x/r.clientHeight),L(2*Math.PI*_.y/r.clientHeight),b.copy(w)}function J(t){if(1==t.touches.length)S.set(t.touches[0].pageX,t.touches[0].pageY);else{var e=.5*(t.touches[0].pageX+t.touches[1].pageX),n=.5*(t.touches[0].pageY+t.touches[1].pageY);S.set(e,n)}T.subVectors(S,M).multiplyScalar(l.panSpeed),F(T.x,T.y),M.copy(S)}function q(t){var e=t.touches[0].pageX-t.touches[1].pageX,n=t.touches[0].pageY-t.touches[1].pageY,r=Math.sqrt(e*e+n*n);E.set(0,r),D.set(0,Math.pow(E.y/C.y,l.zoomSpeed)),N(D.y),C.copy(E)}function X(t){if(!1!==l.enabled){switch(t.preventDefault(),l.domElement.focus?l.domElement.focus():window.focus(),t.button){case 0:switch(l.mouseButtons.LEFT){case r.MOUSE.ROTATE:if(t.ctrlKey||t.metaKey||t.shiftKey){if(!1===l.enablePan)return;V(t),p=d.PAN}else{if(!1===l.enableRotate)return;z(t),p=d.ROTATE}break;case r.MOUSE.PAN:if(t.ctrlKey||t.metaKey||t.shiftKey){if(!1===l.enableRotate)return;z(t),p=d.ROTATE}else{if(!1===l.enablePan)return;V(t),p=d.PAN}break;default:p=d.NONE}break;case 1:switch(l.mouseButtons.MIDDLE){case r.MOUSE.DOLLY:if(!1===l.enableZoom)return;e=t,C.set(e.clientX,e.clientY),p=d.DOLLY;break;case r.MOUSE.PAN:if(!1===l.enablePan)return;V(t),p=d.PAN;break;default:p=d.NONE}break;case 2:switch(l.mouseButtons.RIGHT){case r.MOUSE.ROTATE:if(!1===l.enableRotate)return;z(t),p=d.ROTATE;break;case r.MOUSE.PAN:if(!1===l.enablePan)return;V(t),p=d.PAN;break;default:p=d.NONE}}var e;p!==d.NONE&&(document.addEventListener("mousemove",Y,!1),document.addEventListener("mouseup",Z,!1),l.dispatchEvent(c))}}function Y(t){var e,n;if(!1!==l.enabled)switch(t.preventDefault(),p){case d.ROTATE:if(!1===l.enableRotate)return;!function(t){w.set(t.clientX,t.clientY),_.subVectors(w,b).multiplyScalar(l.rotateSpeed);var e=l.domElement;O(2*Math.PI*_.x/e.clientHeight),L(2*Math.PI*_.y/e.clientHeight),b.copy(w),l.update()}(t);break;case d.DOLLY:if(!1===l.enableZoom)return;n=t,E.set(n.clientX,n.clientY),D.subVectors(E,C),0<D.y?N(A()):D.y<0&&j(A()),C.copy(E),l.update();break;case d.PAN:if(!1===l.enablePan)return;e=t,S.set(e.clientX,e.clientY),T.subVectors(S,M).multiplyScalar(l.panSpeed),F(T.x,T.y),M.copy(S),l.update()}}function Z(t){!1!==l.enabled&&(document.removeEventListener("mousemove",Y,!1),document.removeEventListener("mouseup",Z,!1),l.dispatchEvent(h),p=d.NONE)}function $(t){var e;!1===l.enabled||!1===l.enableZoom||p!==d.NONE&&p!==d.ROTATE||(t.preventDefault(),t.stopPropagation(),l.dispatchEvent(c),(e=t).deltaY<0?j(A()):0<e.deltaY&&N(A()),l.update(),l.dispatchEvent(h))}function K(t){!1!==l.enabled&&!1!==l.enableKeys&&!1!==l.enablePan&&function(t){var e=!1;switch(t.keyCode){case l.keys.UP:F(0,l.keyPanSpeed),e=!0;break;case l.keys.BOTTOM:F(0,-l.keyPanSpeed),e=!0;break;case l.keys.LEFT:F(l.keyPanSpeed,0),e=!0;break;case l.keys.RIGHT:F(-l.keyPanSpeed,0),e=!0}e&&(t.preventDefault(),l.update())}(t)}function Q(t){if(!1!==l.enabled){switch(t.preventDefault(),t.touches.length){case 1:switch(l.touches.ONE){case r.TOUCH.ROTATE:if(!1===l.enableRotate)return;G(t),p=d.TOUCH_ROTATE;break;case r.TOUCH.PAN:if(!1===l.enablePan)return;U(t),p=d.TOUCH_PAN;break;default:p=d.NONE}break;case 2:switch(l.touches.TWO){case r.TOUCH.DOLLY_PAN:if(!1===l.enableZoom&&!1===l.enablePan)return;n=t,l.enableZoom&&H(n),l.enablePan&&U(n),p=d.TOUCH_DOLLY_PAN;break;case r.TOUCH.DOLLY_ROTATE:if(!1===l.enableZoom&&!1===l.enableRotate)return;e=t,l.enableZoom&&H(e),l.enableRotate&&G(e),p=d.TOUCH_DOLLY_ROTATE;break;default:p=d.NONE}break;default:p=d.NONE}var e,n;p!==d.NONE&&l.dispatchEvent(c)}}function tt(t){var e,n;if(!1!==l.enabled)switch(t.preventDefault(),t.stopPropagation(),p){case d.TOUCH_ROTATE:if(!1===l.enableRotate)return;W(t),l.update();break;case d.TOUCH_PAN:if(!1===l.enablePan)return;J(t),l.update();break;case d.TOUCH_DOLLY_PAN:if(!1===l.enableZoom&&!1===l.enablePan)return;n=t,l.enableZoom&&q(n),l.enablePan&&J(n),l.update();break;case d.TOUCH_DOLLY_ROTATE:if(!1===l.enableZoom&&!1===l.enableRotate)return;e=t,l.enableZoom&&q(e),l.enableRotate&&W(e),l.update();break;default:p=d.NONE}}function et(t){!1!==l.enabled&&(l.dispatchEvent(h),p=d.NONE)}function nt(t){!1!==l.enabled&&t.preventDefault()}l.domElement.addEventListener("contextmenu",nt,!1),l.domElement.addEventListener("mousedown",X,!1),l.domElement.addEventListener("wheel",$,!1),l.domElement.addEventListener("touchstart",Q,!1),l.domElement.addEventListener("touchend",et,!1),l.domElement.addEventListener("touchmove",tt,!1),l.domElement.addEventListener("keydown",K,!1),-1===l.domElement.tabIndex&&(l.domElement.tabIndex=0),this.update()},r.OrbitControls.prototype=Object.create(r.EventDispatcher.prototype),r.OrbitControls.prototype.constructor=r.OrbitControls,r.MapControls=function(t,e){r.OrbitControls.call(this,t,e),this.mouseButtons.LEFT=r.MOUSE.PAN,this.mouseButtons.RIGHT=r.MOUSE.ROTATE,this.touches.ONE=r.TOUCH.PAN,this.touches.TWO=r.TOUCH.DOLLY_ROTATE},r.MapControls.prototype=Object.create(r.EventDispatcher.prototype),r.MapControls.prototype.constructor=r.MapControls,void 0!==n&&(void 0!==e&&e.exports&&(n=e.exports={OrbitControls:r.OrbitControls,MapControls:r.MapControls}),n.OrbitControls=r.OrbitControls,n.MapControls=r.MapControls)},{three:19}],18:[function(t,e,n){(function(){var r,i,a,o=void 0!==t,s=this.THREE||o&&t("three");if(!s)throw new Error("MeshLine requires three.js");function l(){this.positions=[],this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[],this.counters=[],this.geometry=new s.BufferGeometry,this.widthCallback=null,this.matrixWorld=new s.Matrix4}function u(t,e,n,r,i){var a;if(t=t.subarray||t.slice?t:t.buffer,n=n.subarray||n.slice?n:n.buffer,t=e?t.subarray?t.subarray(e,i&&e+i):t.slice(e,i&&e+i):t,n.set)n.set(t,r);else for(a=0;a<t.length;a++)n[a+r]=t[a];return n}function c(t){s.ShaderMaterial.call(this,{uniforms:Object.assign({},s.UniformsLib.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new s.Color(16777215)},opacity:{value:1},resolution:{value:new s.Vector2(1,1)},sizeAttenuation:{value:1},near:{value:1},far:{value:1},dashArray:{value:0},dashOffset:{value:0},dashRatio:{value:.5},useDash:{value:0},visibility:{value:1},alphaTest:{value:0},repeat:{value:new s.Vector2(1,1)}}),vertexShader:s.ShaderChunk.meshline_vert,fragmentShader:s.ShaderChunk.meshline_frag}),this.type="MeshLineMaterial",Object.defineProperties(this,{lineWidth:{enumerable:!0,get:function(){return this.uniforms.lineWidth.value},set:function(t){this.uniforms.lineWidth.value=t}},map:{enumerable:!0,get:function(){return this.uniforms.map.value},set:function(t){this.uniforms.map.value=t}},useMap:{enumerable:!0,get:function(){return this.uniforms.useMap.value},set:function(t){this.uniforms.useMap.value=t}},alphaMap:{enumerable:!0,get:function(){return this.uniforms.alphaMap.value},set:function(t){this.uniforms.alphaMap.value=t}},useAlphaMap:{enumerable:!0,get:function(){return this.uniforms.useAlphaMap.value},set:function(t){this.uniforms.useAlphaMap.value=t}},color:{enumerable:!0,get:function(){return this.uniforms.color.value},set:function(t){this.uniforms.color.value=t}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(t){this.uniforms.opacity.value=t}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(t){this.uniforms.resolution.value.copy(t)}},sizeAttenuation:{enumerable:!0,get:function(){return this.uniforms.sizeAttenuation.value},set:function(t){this.uniforms.sizeAttenuation.value=t}},near:{enumerable:!0,get:function(){return this.uniforms.near.value},set:function(t){this.uniforms.near.value=t}},far:{enumerable:!0,get:function(){return this.uniforms.far.value},set:function(t){this.uniforms.far.value=t}},dashArray:{enumerable:!0,get:function(){return this.uniforms.dashArray.value},set:function(t){this.uniforms.dashArray.value=t,this.useDash=0!==t?1:0}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(t){this.uniforms.dashOffset.value=t}},dashRatio:{enumerable:!0,get:function(){return this.uniforms.dashRatio.value},set:function(t){this.uniforms.dashRatio.value=t}},useDash:{enumerable:!0,get:function(){return this.uniforms.useDash.value},set:function(t){this.uniforms.useDash.value=t}},visibility:{enumerable:!0,get:function(){return this.uniforms.visibility.value},set:function(t){this.uniforms.visibility.value=t}},alphaTest:{enumerable:!0,get:function(){return this.uniforms.alphaTest.value},set:function(t){this.uniforms.alphaTest.value=t}},repeat:{enumerable:!0,get:function(){return this.uniforms.repeat.value},set:function(t){this.uniforms.repeat.value.copy(t)}}}),this.setValues(t)}l.prototype.setMatrixWorld=function(t){this.matrixWorld=t},l.prototype.setGeometry=function(t,e){if(this.widthCallback=e,this.positions=[],this.counters=[],t instanceof s.Geometry)for(var n=0;n<t.vertices.length;n++){var r=t.vertices[n];e=n/t.vertices.length,this.positions.push(r.x,r.y,r.z),this.positions.push(r.x,r.y,r.z),this.counters.push(e),this.counters.push(e)}if(s.BufferGeometry,t instanceof Float32Array||t instanceof Array)for(n=0;n<t.length;n+=3)e=n/t.length,this.positions.push(t[n],t[n+1],t[n+2]),this.positions.push(t[n],t[n+1],t[n+2]),this.counters.push(e),this.counters.push(e);this.process()},l.prototype.raycast=(r=new s.Matrix4,i=new s.Ray,a=new s.Sphere,function(t,e){var n=t.linePrecision,o=n*n,l=this.geometry;if(null===l.boundingSphere&&l.computeBoundingSphere(),a.copy(l.boundingSphere),a.applyMatrix4(this.matrixWorld),!1!==t.ray.intersectSphere(a)){r.getInverse(this.matrixWorld),i.copy(t.ray).applyMatrix4(r);var u=new s.Vector3,c=new s.Vector3,h=new s.Vector3,d=new s.Vector3,p=this instanceof s.LineSegments?2:1;if(l instanceof s.BufferGeometry){var f=l.index,m=l.attributes;if(null!==f)for(var g=f.array,v=m.position.array,y=0,x=g.length-1;y<x;y+=p){var b=g[y],w=g[y+1];u.fromArray(v,3*b),c.fromArray(v,3*w),o<i.distanceSqToSegment(u,c,d,h)||(d.applyMatrix4(this.matrixWorld),(S=t.ray.origin.distanceTo(d))<t.near||S>t.far||e.push({distance:S,point:h.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this}))}else for(y=0,x=(v=m.position.array).length/3-1;y<x;y+=p)u.fromArray(v,3*y),c.fromArray(v,3*y+3),o<i.distanceSqToSegment(u,c,d,h)||(d.applyMatrix4(this.matrixWorld),(S=t.ray.origin.distanceTo(d))<t.near||S>t.far||e.push({distance:S,point:h.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this}))}else if(l instanceof s.Geometry){var _=l.vertices,M=_.length;for(y=0;y<M-1;y+=p){var S;o<i.distanceSqToSegment(_[y],_[y+1],d,h)||(d.applyMatrix4(this.matrixWorld),(S=t.ray.origin.distanceTo(d))<t.near||S>t.far||e.push({distance:S,point:h.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this}))}}}}),l.prototype.compareV3=function(t,e){var n=6*t,r=6*e;return this.positions[n]===this.positions[r]&&this.positions[1+n]===this.positions[1+r]&&this.positions[2+n]===this.positions[2+r]},l.prototype.copyV3=function(t){var e=6*t;return[this.positions[e],this.positions[1+e],this.positions[2+e]]},l.prototype.process=function(){var t,e,n=this.positions.length/6;this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[];for(var r=0;r<n;r++)this.side.push(1),this.side.push(-1);for(r=0;r<n;r++)t=this.widthCallback?this.widthCallback(r/(n-1)):1,this.width.push(t),this.width.push(t);for(r=0;r<n;r++)this.uvs.push(r/(n-1),0),this.uvs.push(r/(n-1),1);for(e=this.compareV3(0,n-1)?this.copyV3(n-2):this.copyV3(0),this.previous.push(e[0],e[1],e[2]),this.previous.push(e[0],e[1],e[2]),r=0;r<n-1;r++)e=this.copyV3(r),this.previous.push(e[0],e[1],e[2]),this.previous.push(e[0],e[1],e[2]);for(r=1;r<n;r++)e=this.copyV3(r),this.next.push(e[0],e[1],e[2]),this.next.push(e[0],e[1],e[2]);for(e=this.compareV3(n-1,0)?this.copyV3(1):this.copyV3(n-1),this.next.push(e[0],e[1],e[2]),this.next.push(e[0],e[1],e[2]),r=0;r<n-1;r++){var i=2*r;this.indices_array.push(i,1+i,2+i),this.indices_array.push(2+i,1+i,3+i)}this.attributes?(this.attributes.position.copyArray(new Float32Array(this.positions)),this.attributes.position.needsUpdate=!0,this.attributes.previous.copyArray(new Float32Array(this.previous)),this.attributes.previous.needsUpdate=!0,this.attributes.next.copyArray(new Float32Array(this.next)),this.attributes.next.needsUpdate=!0,this.attributes.side.copyArray(new Float32Array(this.side)),this.attributes.side.needsUpdate=!0,this.attributes.width.copyArray(new Float32Array(this.width)),this.attributes.width.needsUpdate=!0,this.attributes.uv.copyArray(new Float32Array(this.uvs)),this.attributes.uv.needsUpdate=!0,this.attributes.index.copyArray(new Uint16Array(this.indices_array)),this.attributes.index.needsUpdate=!0):this.attributes={position:new s.BufferAttribute(new Float32Array(this.positions),3),previous:new s.BufferAttribute(new Float32Array(this.previous),3),next:new s.BufferAttribute(new Float32Array(this.next),3),side:new s.BufferAttribute(new Float32Array(this.side),1),width:new s.BufferAttribute(new Float32Array(this.width),1),uv:new s.BufferAttribute(new Float32Array(this.uvs),2),index:new s.BufferAttribute(new Uint16Array(this.indices_array),1),counters:new s.BufferAttribute(new Float32Array(this.counters),1)},this.geometry.setAttribute("position",this.attributes.position),this.geometry.setAttribute("previous",this.attributes.previous),this.geometry.setAttribute("next",this.attributes.next),this.geometry.setAttribute("side",this.attributes.side),this.geometry.setAttribute("width",this.attributes.width),this.geometry.setAttribute("uv",this.attributes.uv),this.geometry.setAttribute("counters",this.attributes.counters),this.geometry.setIndex(this.attributes.index)},l.prototype.advance=function(t){var e=this.attributes.position.array,n=this.attributes.previous.array,r=this.attributes.next.array,i=e.length;u(e,0,n,0,i),u(e,6,e,0,i-6),e[i-6]=t.x,e[i-5]=t.y,e[i-4]=t.z,e[i-3]=t.x,e[i-2]=t.y,e[i-1]=t.z,u(e,6,r,0,i-6),r[i-6]=t.x,r[i-5]=t.y,r[i-4]=t.z,r[i-3]=t.x,r[i-2]=t.y,r[i-1]=t.z,this.attributes.position.needsUpdate=!0,this.attributes.previous.needsUpdate=!0,this.attributes.next.needsUpdate=!0},s.ShaderChunk.meshline_vert=["",s.ShaderChunk.logdepthbuf_pars_vertex,s.ShaderChunk.fog_pars_vertex,"","attribute vec3 previous;","attribute vec3 next;","attribute float side;","attribute float width;","attribute float counters;","","uniform vec2 resolution;","uniform float lineWidth;","uniform vec3 color;","uniform float opacity;","uniform float sizeAttenuation;","","varying vec2 vUV;","varying vec4 vColor;","varying float vCounters;","","vec2 fix( vec4 i, float aspect ) {",""," vec2 res = i.xy / i.w;"," res.x *= aspect;","\t vCounters = counters;"," return res;","","}","","void main() {",""," float aspect = resolution.x / resolution.y;",""," vColor = vec4( color, opacity );"," vUV = uv;",""," mat4 m = projectionMatrix * modelViewMatrix;"," vec4 finalPosition = m * vec4( position, 1.0 );"," vec4 prevPos = m * vec4( previous, 1.0 );"," vec4 nextPos = m * vec4( next, 1.0 );",""," vec2 currentP = fix( finalPosition, aspect );"," vec2 prevP = fix( prevPos, aspect );"," vec2 nextP = fix( nextPos, aspect );",""," float w = lineWidth * width;",""," vec2 dir;"," if( nextP == currentP ) dir = normalize( currentP - prevP );"," else if( prevP == currentP ) dir = normalize( nextP - currentP );"," else {"," vec2 dir1 = normalize( currentP - prevP );"," vec2 dir2 = normalize( nextP - currentP );"," dir = normalize( dir1 + dir2 );",""," vec2 perp = vec2( -dir1.y, dir1.x );"," vec2 miter = vec2( -dir.y, dir.x );"," //w = clamp( w / dot( miter, perp ), 0., 4. * lineWidth * width );",""," }",""," //vec2 normal = ( cross( vec3( dir, 0. ), vec3( 0., 0., 1. ) ) ).xy;"," vec4 normal = vec4( -dir.y, dir.x, 0., 1. );"," normal.xy *= .5 * w;"," normal *= projectionMatrix;"," if( sizeAttenuation == 0. ) {"," normal.xy *= finalPosition.w;"," normal.xy /= ( vec4( resolution, 0., 1. ) * projectionMatrix ).xy;"," }",""," finalPosition.xy += normal.xy * side;",""," gl_Position = finalPosition;","",s.ShaderChunk.logdepthbuf_vertex,s.ShaderChunk.fog_vertex&&" vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );",s.ShaderChunk.fog_vertex,"}"].join("\n"),s.ShaderChunk.meshline_frag=["",s.ShaderChunk.fog_pars_fragment,s.ShaderChunk.logdepthbuf_pars_fragment,"","uniform sampler2D map;","uniform sampler2D alphaMap;","uniform float useMap;","uniform float useAlphaMap;","uniform float useDash;","uniform float dashArray;","uniform float dashOffset;","uniform float dashRatio;","uniform float visibility;","uniform float alphaTest;","uniform vec2 repeat;","","varying vec2 vUV;","varying vec4 vColor;","varying float vCounters;","","void main() {","",s.ShaderChunk.logdepthbuf_fragment,""," vec4 c = vColor;"," if( useMap == 1. ) c *= texture2D( map, vUV * repeat );"," if( useAlphaMap == 1. ) c.a *= texture2D( alphaMap, vUV * repeat ).a;"," if( c.a < alphaTest ) discard;"," if( useDash == 1. ){"," c.a *= ceil(mod(vCounters + dashOffset, dashArray) - (dashArray * dashRatio));"," }"," gl_FragColor = c;"," gl_FragColor.a *= step(vCounters, visibility);","",s.ShaderChunk.fog_fragment,"}"].join("\n"),((c.prototype=Object.create(s.ShaderMaterial.prototype)).constructor=c).prototype.isMeshLineMaterial=!0,c.prototype.copy=function(t){return s.ShaderMaterial.prototype.copy.call(this,t),this.lineWidth=t.lineWidth,this.map=t.map,this.useMap=t.useMap,this.alphaMap=t.alphaMap,this.useAlphaMap=t.useAlphaMap,this.color.copy(t.color),this.opacity=t.opacity,this.resolution.copy(t.resolution),this.sizeAttenuation=t.sizeAttenuation,this.near=t.near,this.far=t.far,this.dashArray.copy(t.dashArray),this.dashOffset.copy(t.dashOffset),this.dashRatio.copy(t.dashRatio),this.useDash=t.useDash,this.visibility=t.visibility,this.alphaTest=t.alphaTest,this.repeat.copy(t.repeat),this},void 0!==n?(void 0!==e&&e.exports&&(n=e.exports={MeshLine:l,MeshLineMaterial:c}),n.MeshLine=l,n.MeshLineMaterial=c):(this.MeshLine=l,this.MeshLineMaterial=c)}).call(this)},{three:19}],19:[function(t,e,n){var r,i;r=this,i=function(t){void 0===Number.EPSILON&&(Number.EPSILON=Math.pow(2,-52)),void 0===Number.isInteger&&(Number.isInteger=function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t}),void 0===Math.sign&&(Math.sign=function(t){return t<0?-1:0<t?1:+t}),"name"in Function.prototype==0&&Object.defineProperty(Function.prototype,"name",{get:function(){return this.toString().match(/^\s*function\s*([^\(\s]*)/)[1]}}),void 0===Object.assign&&(Object.assign=function(t){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),n=1;n<arguments.length;n++){var r=arguments[n];if(null!=r)for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e});var e=100,n=301,r=302,i=304,a=306,o=307,s=1e3,l=1001,u=1002,c=1003,h=1004,d=1005,p=1006,f=1007,m=1008,g=1009,v=1012,y=1014,x=1015,b=1016,w=1020,_=1022,M=1023,S=1026,T=1027,C=33776,E=33777,D=33778,A=33779,O=35840,L=35841,P=35842,R=35843,I=2300,k=2301,B=2400,F=2401,N=2402,j=3e3,z=3001,V=3007,G=3002,U=3004,H=3005,W=3006,J=7680,q=35044,X=35048;function Y(){}Object.assign(Y.prototype,{addEventListener:function(t,e){void 0===this._listeners&&(this._listeners={});var n=this._listeners;void 0===n[t]&&(n[t]=[]),-1===n[t].indexOf(e)&&n[t].push(e)},hasEventListener:function(t,e){if(void 0===this._listeners)return!1;var n=this._listeners;return void 0!==n[t]&&-1!==n[t].indexOf(e)},removeEventListener:function(t,e){if(void 0!==this._listeners){var n=this._listeners[t];if(void 0!==n){var r=n.indexOf(e);-1!==r&&n.splice(r,1)}}},dispatchEvent:function(t){if(void 0!==this._listeners){var e=this._listeners[t.type];if(void 0!==e){t.target=this;for(var n=e.slice(0),r=0,i=n.length;r<i;r++)n[r].call(this,t)}}}});for(var Z=[],$=0;$<256;$++)Z[$]=($<16?"0":"")+$.toString(16);var K,Q={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){var t=4294967295*Math.random()|0,e=4294967295*Math.random()|0,n=4294967295*Math.random()|0,r=4294967295*Math.random()|0;return(Z[255&t]+Z[t>>8&255]+Z[t>>16&255]+Z[t>>24&255]+"-"+Z[255&e]+Z[e>>8&255]+"-"+Z[e>>16&15|64]+Z[e>>24&255]+"-"+Z[63&n|128]+Z[n>>8&255]+"-"+Z[n>>16&255]+Z[n>>24&255]+Z[255&r]+Z[r>>8&255]+Z[r>>16&255]+Z[r>>24&255]).toUpperCase()},clamp:function(t,e,n){return Math.max(e,Math.min(n,t))},euclideanModulo:function(t,e){return(t%e+e)%e},mapLinear:function(t,e,n,r,i){return r+(t-e)*(i-r)/(n-e)},lerp:function(t,e,n){return(1-n)*t+n*e},smoothstep:function(t,e,n){return t<=e?0:n<=t?1:(t=(t-e)/(n-e))*t*(3-2*t)},smootherstep:function(t,e,n){return t<=e?0:n<=t?1:(t=(t-e)/(n-e))*t*t*(t*(6*t-15)+10)},randInt:function(t,e){return t+Math.floor(Math.random()*(e-t+1))},randFloat:function(t,e){return t+Math.random()*(e-t)},randFloatSpread:function(t){return t*(.5-Math.random())},degToRad:function(t){return t*Q.DEG2RAD},radToDeg:function(t){return t*Q.RAD2DEG},isPowerOfTwo:function(t){return 0==(t&t-1)&&0!==t},ceilPowerOfTwo:function(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},floorPowerOfTwo:function(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))},setQuaternionFromProperEuler:function(t,e,n,r,i){var a=Math.cos,o=Math.sin,s=a(n/2),l=o(n/2),u=a((e+r)/2),c=o((e+r)/2),h=a((e-r)/2),d=o((e-r)/2),p=a((r-e)/2),f=o((r-e)/2);"XYX"===i?t.set(s*c,l*h,l*d,s*u):"YZY"===i?t.set(l*d,s*c,l*h,s*u):"ZXZ"===i?t.set(l*h,l*d,s*c,s*u):"XZX"===i?t.set(s*c,l*f,l*p,s*u):"YXY"===i?t.set(l*p,s*c,l*f,s*u):"ZYZ"===i?t.set(l*f,l*p,s*c,s*u):console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order.")}};function tt(t,e){this.x=t||0,this.y=e||0}function et(){this.elements=[1,0,0,0,1,0,0,0,1],0<arguments.length&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}Object.defineProperties(tt.prototype,{width:{get:function(){return this.x},set:function(t){this.x=t}},height:{get:function(){return this.y},set:function(t){this.y=t}}}),Object.assign(tt.prototype,{isVector2:!0,set:function(t,e){return this.x=t,this.y=e,this},setScalar:function(t){return this.x=t,this.y=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(t){return this.x=t.x,this.y=t.y,this},add:function(t,e){return void 0!==e?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this)},addScalar:function(t){return this.x+=t,this.y+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this)},subScalar:function(t){return this.x-=t,this.y-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this},multiplyScalar:function(t){return this.x*=t,this.y*=t,this},divide:function(t){return this.x/=t.x,this.y/=t.y,this},divideScalar:function(t){return this.multiplyScalar(1/t)},applyMatrix3:function(t){var e=this.x,n=this.y,r=t.elements;return this.x=r[0]*e+r[3]*n+r[6],this.y=r[1]*e+r[4]*n+r[7],this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this},clampScalar:function(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this},clampLength:function(t,e){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this},negate:function(){return this.x=-this.x,this.y=-this.y,this},dot:function(t){return this.x*t.x+this.y*t.y},cross:function(t){return this.x*t.y-this.y*t.x},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)},normalize:function(){return this.divideScalar(this.length()||1)},angle:function(){var t=Math.atan2(this.y,this.x);return t<0&&(t+=2*Math.PI),t},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){var e=this.x-t.x,n=this.y-t.y;return e*e+n*n},manhattanDistanceTo:function(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)},setLength:function(t){return this.normalize().multiplyScalar(t)},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this},lerpVectors:function(t,e,n){return this.subVectors(e,t).multiplyScalar(n).add(t)},equals:function(t){return t.x===this.x&&t.y===this.y},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t},fromBufferAttribute:function(t,e,n){return void 0!==n&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this},rotateAround:function(t,e){var n=Math.cos(e),r=Math.sin(e),i=this.x-t.x,a=this.y-t.y;return this.x=i*n-a*r+t.x,this.y=i*r+a*n+t.y,this}}),Object.assign(et.prototype,{isMatrix3:!0,set:function(t,e,n,r,i,a,o,s,l){var u=this.elements;return u[0]=t,u[1]=r,u[2]=o,u[3]=e,u[4]=i,u[5]=s,u[6]=n,u[7]=a,u[8]=l,this},identity:function(){return this.set(1,0,0,0,1,0,0,0,1),this},clone:function(){return(new this.constructor).fromArray(this.elements)},copy:function(t){var e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],this},setFromMatrix4:function(t){var e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this},multiply:function(t){return this.multiplyMatrices(this,t)},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){var n=t.elements,r=e.elements,i=this.elements,a=n[0],o=n[3],s=n[6],l=n[1],u=n[4],c=n[7],h=n[2],d=n[5],p=n[8],f=r[0],m=r[3],g=r[6],v=r[1],y=r[4],x=r[7],b=r[2],w=r[5],_=r[8];return i[0]=a*f+o*v+s*b,i[3]=a*m+o*y+s*w,i[6]=a*g+o*x+s*_,i[1]=l*f+u*v+c*b,i[4]=l*m+u*y+c*w,i[7]=l*g+u*x+c*_,i[2]=h*f+d*v+p*b,i[5]=h*m+d*y+p*w,i[8]=h*g+d*x+p*_,this},multiplyScalar:function(t){var e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this},determinant:function(){var t=this.elements,e=t[0],n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],l=t[7],u=t[8];return e*a*u-e*o*l-n*i*u+n*o*s+r*i*l-r*a*s},getInverse:function(t,e){t&&t.isMatrix4&&console.error("THREE.Matrix3: .getInverse() no longer takes a Matrix4 argument.");var n=t.elements,r=this.elements,i=n[0],a=n[1],o=n[2],s=n[3],l=n[4],u=n[5],c=n[6],h=n[7],d=n[8],p=d*l-u*h,f=u*c-d*s,m=h*s-l*c,g=i*p+a*f+o*m;if(0==g){var v="THREE.Matrix3: .getInverse() can't invert matrix, determinant is 0";if(!0===e)throw new Error(v);return console.warn(v),this.identity()}var y=1/g;return r[0]=p*y,r[1]=(o*h-d*a)*y,r[2]=(u*a-o*l)*y,r[3]=f*y,r[4]=(d*i-o*c)*y,r[5]=(o*s-u*i)*y,r[6]=m*y,r[7]=(a*c-h*i)*y,r[8]=(l*i-a*s)*y,this},transpose:function(){var t,e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this},getNormalMatrix:function(t){return this.setFromMatrix4(t).getInverse(this).transpose()},transposeIntoArray:function(t){var e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this},setUvTransform:function(t,e,n,r,i,a,o){var s=Math.cos(i),l=Math.sin(i);this.set(n*s,n*l,-n*(s*a+l*o)+a+t,-r*l,r*s,-r*(-l*a+s*o)+o+e,0,0,1)},scale:function(t,e){var n=this.elements;return n[0]*=t,n[3]*=t,n[6]*=t,n[1]*=e,n[4]*=e,n[7]*=e,this},rotate:function(t){var e=Math.cos(t),n=Math.sin(t),r=this.elements,i=r[0],a=r[3],o=r[6],s=r[1],l=r[4],u=r[7];return r[0]=e*i+n*s,r[3]=e*a+n*l,r[6]=e*o+n*u,r[1]=-n*i+e*s,r[4]=-n*a+e*l,r[7]=-n*o+e*u,this},translate:function(t,e){var n=this.elements;return n[0]+=t*n[2],n[3]+=t*n[5],n[6]+=t*n[8],n[1]+=e*n[2],n[4]+=e*n[5],n[7]+=e*n[8],this},equals:function(t){for(var e=this.elements,n=t.elements,r=0;r<9;r++)if(e[r]!==n[r])return!1;return!0},fromArray:function(t,e){void 0===e&&(e=0);for(var n=0;n<9;n++)this.elements[n]=t[n+e];return this},toArray:function(t,e){void 0===t&&(t=[]),void 0===e&&(e=0);var n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t}});var nt={getDataURL:function(t){var e;if("undefined"==typeof HTMLCanvasElement)return t.src;if(t instanceof HTMLCanvasElement)e=t;else{void 0===K&&(K=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),K.width=t.width,K.height=t.height;var n=K.getContext("2d");t instanceof ImageData?n.putImageData(t,0,0):n.drawImage(t,0,0,t.width,t.height),e=K}return 2048<e.width||2048<e.height?e.toDataURL("image/jpeg",.6):e.toDataURL("image/png")}},rt=0;function it(t,e,n,r,i,a,o,s,u,c){Object.defineProperty(this,"id",{value:rt++}),this.uuid=Q.generateUUID(),this.name="",this.image=void 0!==t?t:it.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=void 0!==e?e:it.DEFAULT_MAPPING,this.wrapS=void 0!==n?n:l,this.wrapT=void 0!==r?r:l,this.magFilter=void 0!==i?i:p,this.minFilter=void 0!==a?a:m,this.anisotropy=void 0!==u?u:1,this.format=void 0!==o?o:M,this.internalFormat=null,this.type=void 0!==s?s:g,this.offset=new tt(0,0),this.repeat=new tt(1,1),this.center=new tt(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new et,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=void 0!==c?c:j,this.version=0,this.onUpdate=null}function at(t,e,n,r){this.x=t||0,this.y=e||0,this.z=n||0,this.w=void 0!==r?r:1}function ot(t,e,n){this.width=t,this.height=e,this.scissor=new at(0,0,t,e),this.scissorTest=!1,this.viewport=new at(0,0,t,e),n=n||{},this.texture=new it(void 0,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.encoding),this.texture.image={},this.texture.image.width=t,this.texture.image.height=e,this.texture.generateMipmaps=void 0!==n.generateMipmaps&&n.generateMipmaps,this.texture.minFilter=void 0!==n.minFilter?n.minFilter:p,this.depthBuffer=void 0===n.depthBuffer||n.depthBuffer,this.stencilBuffer=void 0===n.stencilBuffer||n.stencilBuffer,this.depthTexture=void 0!==n.depthTexture?n.depthTexture:null}function st(t,e,n){ot.call(this,t,e,n),this.samples=4}function lt(t,e,n,r){this._x=t||0,this._y=e||0,this._z=n||0,this._w=void 0!==r?r:1}it.DEFAULT_IMAGE=void 0,it.DEFAULT_MAPPING=300,it.prototype=Object.assign(Object.create(Y.prototype),{constructor:it,isTexture:!0,updateMatrix:function(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.name=t.name,this.image=t.image,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.encoding=t.encoding,this},toJSON:function(t){var e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.textures[this.uuid])return t.textures[this.uuid];var n={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(void 0!==this.image){var r=this.image;if(void 0===r.uuid&&(r.uuid=Q.generateUUID()),!e&&void 0===t.images[r.uuid]){var i;if(Array.isArray(r)){i=[];for(var a=0,o=r.length;a<o;a++)i.push(nt.getDataURL(r[a]))}else i=nt.getDataURL(r);t.images[r.uuid]={uuid:r.uuid,url:i}}n.image=r.uuid}return e||(t.textures[this.uuid]=n),n},dispose:function(){this.dispatchEvent({type:"dispose"})},transformUv:function(t){if(300!==this.mapping)return t;if(t.applyMatrix3(this.matrix),t.x<0||1<t.x)switch(this.wrapS){case s:t.x=t.x-Math.floor(t.x);break;case l:t.x=t.x<0?0:1;break;case u:1===Math.abs(Math.floor(t.x)%2)?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x)}if(t.y<0||1<t.y)switch(this.wrapT){case s:t.y=t.y-Math.floor(t.y);break;case l:t.y=t.y<0?0:1;break;case u:1===Math.abs(Math.floor(t.y)%2)?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y)}return this.flipY&&(t.y=1-t.y),t}}),Object.defineProperty(it.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.defineProperties(at.prototype,{width:{get:function(){return this.z},set:function(t){this.z=t}},height:{get:function(){return this.w},set:function(t){this.w=t}}}),Object.assign(at.prototype,{isVector4:!0,set:function(t,e,n,r){return this.x=t,this.y=e,this.z=n,this.w=r,this},setScalar:function(t){return this.x=t,this.y=t,this.z=t,this.w=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setZ:function(t){return this.z=t,this},setW:function(t){return this.w=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y,this.z,this.w)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=void 0!==t.w?t.w:1,this},add:function(t,e){return void 0!==e?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this)},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this)},subScalar:function(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this},multiplyScalar:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},applyMatrix4:function(t){var e=this.x,n=this.y,r=this.z,i=this.w,a=t.elements;return this.x=a[0]*e+a[4]*n+a[8]*r+a[12]*i,this.y=a[1]*e+a[5]*n+a[9]*r+a[13]*i,this.z=a[2]*e+a[6]*n+a[10]*r+a[14]*i,this.w=a[3]*e+a[7]*n+a[11]*r+a[15]*i,this},divideScalar:function(t){return this.multiplyScalar(1/t)},setAxisAngleFromQuaternion:function(t){this.w=2*Math.acos(t.w);var e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this},setAxisAngleFromRotationMatrix:function(t){var e,n,r,i,a=t.elements,o=a[0],s=a[4],l=a[8],u=a[1],c=a[5],h=a[9],d=a[2],p=a[6],f=a[10];if(Math.abs(s-u)<.01&&Math.abs(l-d)<.01&&Math.abs(h-p)<.01){if(Math.abs(s+u)<.1&&Math.abs(l+d)<.1&&Math.abs(h+p)<.1&&Math.abs(o+c+f-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;var m=(o+1)/2,g=(c+1)/2,v=(f+1)/2,y=(s+u)/4,x=(l+d)/4,b=(h+p)/4;return g<m&&v<m?i=m<.01?(n=0,r=.707106781):(r=y/(n=Math.sqrt(m)),x/n):v<g?i=g<.01?(r=0,n=.707106781):(n=y/(r=Math.sqrt(g)),b/r):v<.01?(r=n=.707106781,i=0):(n=x/(i=Math.sqrt(v)),r=b/i),this.set(n,r,i,e),this}var w=Math.sqrt((p-h)*(p-h)+(l-d)*(l-d)+(u-s)*(u-s));return Math.abs(w)<.001&&(w=1),this.x=(p-h)/w,this.y=(l-d)/w,this.z=(u-s)/w,this.w=Math.acos((o+c+f-1)/2),this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this},clampScalar:function(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this.w=Math.max(t,Math.min(e,this.w)),this},clampLength:function(t,e){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(t){return this.normalize().multiplyScalar(t)},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this},lerpVectors:function(t,e,n){return this.subVectors(e,t).multiplyScalar(n).add(t)},equals:function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t},fromBufferAttribute:function(t,e,n){return void 0!==n&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}}),ot.prototype=Object.assign(Object.create(Y.prototype),{constructor:ot,isWebGLRenderTarget:!0,setSize:function(t,e){this.width===t&&this.height===e||(this.width=t,this.height=e,this.texture.image.width=t,this.texture.image.height=e,this.dispose()),this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.width=t.width,this.height=t.height,this.viewport.copy(t.viewport),this.texture=t.texture.clone(),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.depthTexture=t.depthTexture,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),st.prototype=Object.assign(Object.create(ot.prototype),{constructor:st,isWebGLMultisampleRenderTarget:!0,copy:function(t){return ot.prototype.copy.call(this,t),this.samples=t.samples,this}}),Object.assign(lt,{slerp:function(t,e,n,r){return n.copy(t).slerp(e,r)},slerpFlat:function(t,e,n,r,i,a,o){var s=n[r+0],l=n[r+1],u=n[r+2],c=n[r+3],h=i[a+0],d=i[a+1],p=i[a+2],f=i[a+3];if(c!==f||s!==h||l!==d||u!==p){var m=1-o,g=s*h+l*d+u*p+c*f,v=0<=g?1:-1,y=1-g*g;if(y>Number.EPSILON){var x=Math.sqrt(y),b=Math.atan2(x,g*v);m=Math.sin(m*b)/x,o=Math.sin(o*b)/x}var w=o*v;if(s=s*m+h*w,l=l*m+d*w,u=u*m+p*w,c=c*m+f*w,m===1-o){var _=1/Math.sqrt(s*s+l*l+u*u+c*c);s*=_,l*=_,u*=_,c*=_}}t[e]=s,t[e+1]=l,t[e+2]=u,t[e+3]=c}}),Object.defineProperties(lt.prototype,{x:{get:function(){return this._x},set:function(t){this._x=t,this._onChangeCallback()}},y:{get:function(){return this._y},set:function(t){this._y=t,this._onChangeCallback()}},z:{get:function(){return this._z},set:function(t){this._z=t,this._onChangeCallback()}},w:{get:function(){return this._w},set:function(t){this._w=t,this._onChangeCallback()}}}),Object.assign(lt.prototype,{isQuaternion:!0,set:function(t,e,n,r){return this._x=t,this._y=e,this._z=n,this._w=r,this._onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._w)},copy:function(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this},setFromEuler:function(t,e){if(!t||!t.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var n=t._x,r=t._y,i=t._z,a=t.order,o=Math.cos,s=Math.sin,l=o(n/2),u=o(r/2),c=o(i/2),h=s(n/2),d=s(r/2),p=s(i/2);return"XYZ"===a?(this._x=h*u*c+l*d*p,this._y=l*d*c-h*u*p,this._z=l*u*p+h*d*c,this._w=l*u*c-h*d*p):"YXZ"===a?(this._x=h*u*c+l*d*p,this._y=l*d*c-h*u*p,this._z=l*u*p-h*d*c,this._w=l*u*c+h*d*p):"ZXY"===a?(this._x=h*u*c-l*d*p,this._y=l*d*c+h*u*p,this._z=l*u*p+h*d*c,this._w=l*u*c-h*d*p):"ZYX"===a?(this._x=h*u*c-l*d*p,this._y=l*d*c+h*u*p,this._z=l*u*p-h*d*c,this._w=l*u*c+h*d*p):"YZX"===a?(this._x=h*u*c+l*d*p,this._y=l*d*c+h*u*p,this._z=l*u*p-h*d*c,this._w=l*u*c-h*d*p):"XZY"===a&&(this._x=h*u*c-l*d*p,this._y=l*d*c-h*u*p,this._z=l*u*p+h*d*c,this._w=l*u*c+h*d*p),!1!==e&&this._onChangeCallback(),this},setFromAxisAngle:function(t,e){var n=e/2,r=Math.sin(n);return this._x=t.x*r,this._y=t.y*r,this._z=t.z*r,this._w=Math.cos(n),this._onChangeCallback(),this},setFromRotationMatrix:function(t){var e,n=t.elements,r=n[0],i=n[4],a=n[8],o=n[1],s=n[5],l=n[9],u=n[2],c=n[6],h=n[10],d=r+s+h;return 0<d?(e=.5/Math.sqrt(d+1),this._w=.25/e,this._x=(c-l)*e,this._y=(a-u)*e,this._z=(o-i)*e):s<r&&h<r?(e=2*Math.sqrt(1+r-s-h),this._w=(c-l)/e,this._x=.25*e,this._y=(i+o)/e,this._z=(a+u)/e):h<s?(e=2*Math.sqrt(1+s-r-h),this._w=(a-u)/e,this._x=(i+o)/e,this._y=.25*e,this._z=(l+c)/e):(e=2*Math.sqrt(1+h-r-s),this._w=(o-i)/e,this._x=(a+u)/e,this._y=(l+c)/e,this._z=.25*e),this._onChangeCallback(),this},setFromUnitVectors:function(t,e){var n=t.dot(e)+1;return n<1e-6?(n=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0):(this._x=0,this._y=-t.z,this._z=t.y)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x),this._w=n,this.normalize()},angleTo:function(t){return 2*Math.acos(Math.abs(Q.clamp(this.dot(t),-1,1)))},rotateTowards:function(t,e){var n=this.angleTo(t);if(0===n)return this;var r=Math.min(1,e/n);return this.slerp(t,r),this},inverse:function(){return this.conjugate()},conjugate:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this},dot:function(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w},lengthSq:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},length:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},normalize:function(){var t=this.length();return 0===t?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this},multiply:function(t,e){return void 0!==e?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(t,e)):this.multiplyQuaternions(this,t)},premultiply:function(t){return this.multiplyQuaternions(t,this)},multiplyQuaternions:function(t,e){var n=t._x,r=t._y,i=t._z,a=t._w,o=e._x,s=e._y,l=e._z,u=e._w;return this._x=n*u+a*o+r*l-i*s,this._y=r*u+a*s+i*o-n*l,this._z=i*u+a*l+n*s-r*o,this._w=a*u-n*o-r*s-i*l,this._onChangeCallback(),this},slerp:function(t,e){if(0===e)return this;if(1===e)return this.copy(t);var n=this._x,r=this._y,i=this._z,a=this._w,o=a*t._w+n*t._x+r*t._y+i*t._z;if(o<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,o=-o):this.copy(t),1<=o)return this._w=a,this._x=n,this._y=r,this._z=i,this;var s=1-o*o;if(s<=Number.EPSILON){var l=1-e;return this._w=l*a+e*this._w,this._x=l*n+e*this._x,this._y=l*r+e*this._y,this._z=l*i+e*this._z,this.normalize(),this._onChangeCallback(),this}var u=Math.sqrt(s),c=Math.atan2(u,o),h=Math.sin((1-e)*c)/u,d=Math.sin(e*c)/u;return this._w=a*h+this._w*d,this._x=n*h+this._x*d,this._y=r*h+this._y*d,this._z=i*h+this._z*d,this._onChangeCallback(),this},equals:function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w},fromArray:function(t,e){return void 0===e&&(e=0),this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t},_onChange:function(t){return this._onChangeCallback=t,this},_onChangeCallback:function(){}});var ut=new ht,ct=new lt;function ht(t,e,n){this.x=t||0,this.y=e||0,this.z=n||0}Object.assign(ht.prototype,{isVector3:!0,set:function(t,e,n){return this.x=t,this.y=e,this.z=n,this},setScalar:function(t){return this.x=t,this.y=t,this.z=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setZ:function(t){return this.z=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this},add:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this)},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this)},subScalar:function(t){return this.x-=t,this.y-=t,this.z-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this},multiply:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(t,e)):(this.x*=t.x,this.y*=t.y,this.z*=t.z,this)},multiplyScalar:function(t){return this.x*=t,this.y*=t,this.z*=t,this},multiplyVectors:function(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this},applyEuler:function(t){return t&&t.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(ct.setFromEuler(t))},applyAxisAngle:function(t,e){return this.applyQuaternion(ct.setFromAxisAngle(t,e))},applyMatrix3:function(t){var e=this.x,n=this.y,r=this.z,i=t.elements;return this.x=i[0]*e+i[3]*n+i[6]*r,this.y=i[1]*e+i[4]*n+i[7]*r,this.z=i[2]*e+i[5]*n+i[8]*r,this},applyNormalMatrix:function(t){return this.applyMatrix3(t).normalize()},applyMatrix4:function(t){var e=this.x,n=this.y,r=this.z,i=t.elements,a=1/(i[3]*e+i[7]*n+i[11]*r+i[15]);return this.x=(i[0]*e+i[4]*n+i[8]*r+i[12])*a,this.y=(i[1]*e+i[5]*n+i[9]*r+i[13])*a,this.z=(i[2]*e+i[6]*n+i[10]*r+i[14])*a,this},applyQuaternion:function(t){var e=this.x,n=this.y,r=this.z,i=t.x,a=t.y,o=t.z,s=t.w,l=s*e+a*r-o*n,u=s*n+o*e-i*r,c=s*r+i*n-a*e,h=-i*e-a*n-o*r;return this.x=l*s+h*-i+u*-o-c*-a,this.y=u*s+h*-a+c*-i-l*-o,this.z=c*s+h*-o+l*-a-u*-i,this},project:function(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)},unproject:function(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)},transformDirection:function(t){var e=this.x,n=this.y,r=this.z,i=t.elements;return this.x=i[0]*e+i[4]*n+i[8]*r,this.y=i[1]*e+i[5]*n+i[9]*r,this.z=i[2]*e+i[6]*n+i[10]*r,this.normalize()},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this},divideScalar:function(t){return this.multiplyScalar(1/t)},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this},clampScalar:function(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this},clampLength:function(t,e){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(t){return this.normalize().multiplyScalar(t)},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this},lerpVectors:function(t,e,n){return this.subVectors(e,t).multiplyScalar(n).add(t)},cross:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(t,e)):this.crossVectors(this,t)},crossVectors:function(t,e){var n=t.x,r=t.y,i=t.z,a=e.x,o=e.y,s=e.z;return this.x=r*s-i*o,this.y=i*a-n*s,this.z=n*o-r*a,this},projectOnVector:function(t){var e=t.lengthSq();if(0===e)return this.set(0,0,0);var n=t.dot(this)/e;return this.copy(t).multiplyScalar(n)},projectOnPlane:function(t){return ut.copy(this).projectOnVector(t),this.sub(ut)},reflect:function(t){return this.sub(ut.copy(t).multiplyScalar(2*this.dot(t)))},angleTo:function(t){var e=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===e)return Math.PI/2;var n=this.dot(t)/e;return Math.acos(Q.clamp(n,-1,1))},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){var e=this.x-t.x,n=this.y-t.y,r=this.z-t.z;return e*e+n*n+r*r},manhattanDistanceTo:function(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)},setFromSpherical:function(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)},setFromSphericalCoords:function(t,e,n){var r=Math.sin(e)*t;return this.x=r*Math.sin(n),this.y=Math.cos(e)*t,this.z=r*Math.cos(n),this},setFromCylindrical:function(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)},setFromCylindricalCoords:function(t,e,n){return this.x=t*Math.sin(e),this.y=n,this.z=t*Math.cos(e),this},setFromMatrixPosition:function(t){var e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this},setFromMatrixScale:function(t){var e=this.setFromMatrixColumn(t,0).length(),n=this.setFromMatrixColumn(t,1).length(),r=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=n,this.z=r,this},setFromMatrixColumn:function(t,e){return this.fromArray(t.elements,4*e)},setFromMatrix3Column:function(t,e){return this.fromArray(t.elements,3*e)},equals:function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t},fromBufferAttribute:function(t,e,n){return void 0!==n&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}});var dt=new ht,pt=new xt,ft=new ht(0,0,0),mt=new ht(1,1,1),gt=new ht,vt=new ht,yt=new ht;function xt(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],0<arguments.length&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}Object.assign(xt.prototype,{isMatrix4:!0,set:function(t,e,n,r,i,a,o,s,l,u,c,h,d,p,f,m){var g=this.elements;return g[0]=t,g[4]=e,g[8]=n,g[12]=r,g[1]=i,g[5]=a,g[9]=o,g[13]=s,g[2]=l,g[6]=u,g[10]=c,g[14]=h,g[3]=d,g[7]=p,g[11]=f,g[15]=m,this},identity:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this},clone:function(){return(new xt).fromArray(this.elements)},copy:function(t){var e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e[9]=n[9],e[10]=n[10],e[11]=n[11],e[12]=n[12],e[13]=n[13],e[14]=n[14],e[15]=n[15],this},copyPosition:function(t){var e=this.elements,n=t.elements;return e[12]=n[12],e[13]=n[13],e[14]=n[14],this},extractBasis:function(t,e,n){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this},makeBasis:function(t,e,n){return this.set(t.x,e.x,n.x,0,t.y,e.y,n.y,0,t.z,e.z,n.z,0,0,0,0,1),this},extractRotation:function(t){var e=this.elements,n=t.elements,r=1/dt.setFromMatrixColumn(t,0).length(),i=1/dt.setFromMatrixColumn(t,1).length(),a=1/dt.setFromMatrixColumn(t,2).length();return e[0]=n[0]*r,e[1]=n[1]*r,e[2]=n[2]*r,e[3]=0,e[4]=n[4]*i,e[5]=n[5]*i,e[6]=n[6]*i,e[7]=0,e[8]=n[8]*a,e[9]=n[9]*a,e[10]=n[10]*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},makeRotationFromEuler:function(t){t&&t.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var e=this.elements,n=t.x,r=t.y,i=t.z,a=Math.cos(n),o=Math.sin(n),s=Math.cos(r),l=Math.sin(r),u=Math.cos(i),c=Math.sin(i);if("XYZ"===t.order){var h=a*u,d=a*c,p=o*u,f=o*c;e[0]=s*u,e[4]=-s*c,e[8]=l,e[1]=d+p*l,e[5]=h-f*l,e[9]=-o*s,e[2]=f-h*l,e[6]=p+d*l,e[10]=a*s}else if("YXZ"===t.order){var m=s*u,g=s*c,v=l*u,y=l*c;e[0]=m+y*o,e[4]=v*o-g,e[8]=a*l,e[1]=a*c,e[5]=a*u,e[9]=-o,e[2]=g*o-v,e[6]=y+m*o,e[10]=a*s}else if("ZXY"===t.order)m=s*u,g=s*c,v=l*u,y=l*c,e[0]=m-y*o,e[4]=-a*c,e[8]=v+g*o,e[1]=g+v*o,e[5]=a*u,e[9]=y-m*o,e[2]=-a*l,e[6]=o,e[10]=a*s;else if("ZYX"===t.order)h=a*u,d=a*c,p=o*u,f=o*c,e[0]=s*u,e[4]=p*l-d,e[8]=h*l+f,e[1]=s*c,e[5]=f*l+h,e[9]=d*l-p,e[2]=-l,e[6]=o*s,e[10]=a*s;else if("YZX"===t.order){var x=a*s,b=a*l,w=o*s,_=o*l;e[0]=s*u,e[4]=_-x*c,e[8]=w*c+b,e[1]=c,e[5]=a*u,e[9]=-o*u,e[2]=-l*u,e[6]=b*c+w,e[10]=x-_*c}else"XZY"===t.order&&(x=a*s,b=a*l,w=o*s,_=o*l,e[0]=s*u,e[4]=-c,e[8]=l*u,e[1]=x*c+_,e[5]=a*u,e[9]=b*c-w,e[2]=w*c-b,e[6]=o*u,e[10]=_*c+x);return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},makeRotationFromQuaternion:function(t){return this.compose(ft,t,mt)},lookAt:function(t,e,n){var r=this.elements;return yt.subVectors(t,e),0===yt.lengthSq()&&(yt.z=1),yt.normalize(),gt.crossVectors(n,yt),0===gt.lengthSq()&&(1===Math.abs(n.z)?yt.x+=1e-4:yt.z+=1e-4,yt.normalize(),gt.crossVectors(n,yt)),gt.normalize(),vt.crossVectors(yt,gt),r[0]=gt.x,r[4]=vt.x,r[8]=yt.x,r[1]=gt.y,r[5]=vt.y,r[9]=yt.y,r[2]=gt.z,r[6]=vt.z,r[10]=yt.z,this},multiply:function(t,e){return void 0!==e?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(t,e)):this.multiplyMatrices(this,t)},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){var n=t.elements,r=e.elements,i=this.elements,a=n[0],o=n[4],s=n[8],l=n[12],u=n[1],c=n[5],h=n[9],d=n[13],p=n[2],f=n[6],m=n[10],g=n[14],v=n[3],y=n[7],x=n[11],b=n[15],w=r[0],_=r[4],M=r[8],S=r[12],T=r[1],C=r[5],E=r[9],D=r[13],A=r[2],O=r[6],L=r[10],P=r[14],R=r[3],I=r[7],k=r[11],B=r[15];return i[0]=a*w+o*T+s*A+l*R,i[4]=a*_+o*C+s*O+l*I,i[8]=a*M+o*E+s*L+l*k,i[12]=a*S+o*D+s*P+l*B,i[1]=u*w+c*T+h*A+d*R,i[5]=u*_+c*C+h*O+d*I,i[9]=u*M+c*E+h*L+d*k,i[13]=u*S+c*D+h*P+d*B,i[2]=p*w+f*T+m*A+g*R,i[6]=p*_+f*C+m*O+g*I,i[10]=p*M+f*E+m*L+g*k,i[14]=p*S+f*D+m*P+g*B,i[3]=v*w+y*T+x*A+b*R,i[7]=v*_+y*C+x*O+b*I,i[11]=v*M+y*E+x*L+b*k,i[15]=v*S+y*D+x*P+b*B,this},multiplyScalar:function(t){var e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this},determinant:function(){var t=this.elements,e=t[0],n=t[4],r=t[8],i=t[12],a=t[1],o=t[5],s=t[9],l=t[13],u=t[2],c=t[6],h=t[10],d=t[14];return t[3]*(i*s*c-r*l*c-i*o*h+n*l*h+r*o*d-n*s*d)+t[7]*(e*s*d-e*l*h+i*a*h-r*a*d+r*l*u-i*s*u)+t[11]*(e*l*c-e*o*d-i*a*c+n*a*d+i*o*u-n*l*u)+t[15]*(-r*o*u-e*s*c+e*o*h+r*a*c-n*a*h+n*s*u)},transpose:function(){var t,e=this.elements;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this},setPosition:function(t,e,n){var r=this.elements;return t.isVector3?(r[12]=t.x,r[13]=t.y,r[14]=t.z):(r[12]=t,r[13]=e,r[14]=n),this},getInverse:function(t,e){var n=this.elements,r=t.elements,i=r[0],a=r[1],o=r[2],s=r[3],l=r[4],u=r[5],c=r[6],h=r[7],d=r[8],p=r[9],f=r[10],m=r[11],g=r[12],v=r[13],y=r[14],x=r[15],b=p*y*h-v*f*h+v*c*m-u*y*m-p*c*x+u*f*x,w=g*f*h-d*y*h-g*c*m+l*y*m+d*c*x-l*f*x,_=d*v*h-g*p*h+g*u*m-l*v*m-d*u*x+l*p*x,M=g*p*c-d*v*c-g*u*f+l*v*f+d*u*y-l*p*y,S=i*b+a*w+o*_+s*M;if(0==S){var T="THREE.Matrix4: .getInverse() can't invert matrix, determinant is 0";if(!0===e)throw new Error(T);return console.warn(T),this.identity()}var C=1/S;return n[0]=b*C,n[1]=(v*f*s-p*y*s-v*o*m+a*y*m+p*o*x-a*f*x)*C,n[2]=(u*y*s-v*c*s+v*o*h-a*y*h-u*o*x+a*c*x)*C,n[3]=(p*c*s-u*f*s-p*o*h+a*f*h+u*o*m-a*c*m)*C,n[4]=w*C,n[5]=(d*y*s-g*f*s+g*o*m-i*y*m-d*o*x+i*f*x)*C,n[6]=(g*c*s-l*y*s-g*o*h+i*y*h+l*o*x-i*c*x)*C,n[7]=(l*f*s-d*c*s+d*o*h-i*f*h-l*o*m+i*c*m)*C,n[8]=_*C,n[9]=(g*p*s-d*v*s-g*a*m+i*v*m+d*a*x-i*p*x)*C,n[10]=(l*v*s-g*u*s+g*a*h-i*v*h-l*a*x+i*u*x)*C,n[11]=(d*u*s-l*p*s-d*a*h+i*p*h+l*a*m-i*u*m)*C,n[12]=M*C,n[13]=(d*v*o-g*p*o+g*a*f-i*v*f-d*a*y+i*p*y)*C,n[14]=(g*u*o-l*v*o-g*a*c+i*v*c+l*a*y-i*u*y)*C,n[15]=(l*p*o-d*u*o+d*a*c-i*p*c-l*a*f+i*u*f)*C,this},scale:function(t){var e=this.elements,n=t.x,r=t.y,i=t.z;return e[0]*=n,e[4]*=r,e[8]*=i,e[1]*=n,e[5]*=r,e[9]*=i,e[2]*=n,e[6]*=r,e[10]*=i,e[3]*=n,e[7]*=r,e[11]*=i,this},getMaxScaleOnAxis:function(){var t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],n=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],r=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,n,r))},makeTranslation:function(t,e,n){return this.set(1,0,0,t,0,1,0,e,0,0,1,n,0,0,0,1),this},makeRotationX:function(t){var e=Math.cos(t),n=Math.sin(t);return this.set(1,0,0,0,0,e,-n,0,0,n,e,0,0,0,0,1),this},makeRotationY:function(t){var e=Math.cos(t),n=Math.sin(t);return this.set(e,0,n,0,0,1,0,0,-n,0,e,0,0,0,0,1),this},makeRotationZ:function(t){var e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,0,n,e,0,0,0,0,1,0,0,0,0,1),this},makeRotationAxis:function(t,e){var n=Math.cos(e),r=Math.sin(e),i=1-n,a=t.x,o=t.y,s=t.z,l=i*a,u=i*o;return this.set(l*a+n,l*o-r*s,l*s+r*o,0,l*o+r*s,u*o+n,u*s-r*a,0,l*s-r*o,u*s+r*a,i*s*s+n,0,0,0,0,1),this},makeScale:function(t,e,n){return this.set(t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1),this},makeShear:function(t,e,n){return this.set(1,e,n,0,t,1,n,0,t,e,1,0,0,0,0,1),this},compose:function(t,e,n){var r=this.elements,i=e._x,a=e._y,o=e._z,s=e._w,l=i+i,u=a+a,c=o+o,h=i*l,d=i*u,p=i*c,f=a*u,m=a*c,g=o*c,v=s*l,y=s*u,x=s*c,b=n.x,w=n.y,_=n.z;return r[0]=(1-(f+g))*b,r[1]=(d+x)*b,r[2]=(p-y)*b,r[3]=0,r[4]=(d-x)*w,r[5]=(1-(h+g))*w,r[6]=(m+v)*w,r[7]=0,r[8]=(p+y)*_,r[9]=(m-v)*_,r[10]=(1-(h+f))*_,r[11]=0,r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=1,this},decompose:function(t,e,n){var r=this.elements,i=dt.set(r[0],r[1],r[2]).length(),a=dt.set(r[4],r[5],r[6]).length(),o=dt.set(r[8],r[9],r[10]).length();this.determinant()<0&&(i=-i),t.x=r[12],t.y=r[13],t.z=r[14],pt.copy(this);var s=1/i,l=1/a,u=1/o;return pt.elements[0]*=s,pt.elements[1]*=s,pt.elements[2]*=s,pt.elements[4]*=l,pt.elements[5]*=l,pt.elements[6]*=l,pt.elements[8]*=u,pt.elements[9]*=u,pt.elements[10]*=u,e.setFromRotationMatrix(pt),n.x=i,n.y=a,n.z=o,this},makePerspective:function(t,e,n,r,i,a){void 0===a&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");var o=this.elements,s=2*i/(e-t),l=2*i/(n-r),u=(e+t)/(e-t),c=(n+r)/(n-r),h=-(a+i)/(a-i),d=-2*a*i/(a-i);return o[0]=s,o[4]=0,o[8]=u,o[12]=0,o[1]=0,o[5]=l,o[9]=c,o[13]=0,o[2]=0,o[6]=0,o[10]=h,o[14]=d,o[3]=0,o[7]=0,o[11]=-1,o[15]=0,this},makeOrthographic:function(t,e,n,r,i,a){var o=this.elements,s=1/(e-t),l=1/(n-r),u=1/(a-i),c=(e+t)*s,h=(n+r)*l,d=(a+i)*u;return o[0]=2*s,o[4]=0,o[8]=0,o[12]=-c,o[1]=0,o[5]=2*l,o[9]=0,o[13]=-h,o[2]=0,o[6]=0,o[10]=-2*u,o[14]=-d,o[3]=0,o[7]=0,o[11]=0,o[15]=1,this},equals:function(t){for(var e=this.elements,n=t.elements,r=0;r<16;r++)if(e[r]!==n[r])return!1;return!0},fromArray:function(t,e){void 0===e&&(e=0);for(var n=0;n<16;n++)this.elements[n]=t[n+e];return this},toArray:function(t,e){void 0===t&&(t=[]),void 0===e&&(e=0);var n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t[e+9]=n[9],t[e+10]=n[10],t[e+11]=n[11],t[e+12]=n[12],t[e+13]=n[13],t[e+14]=n[14],t[e+15]=n[15],t}});var bt=new xt,wt=new lt;function _t(t,e,n,r){this._x=t||0,this._y=e||0,this._z=n||0,this._order=r||_t.DefaultOrder}function Mt(){this.mask=1}_t.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"],_t.DefaultOrder="XYZ",Object.defineProperties(_t.prototype,{x:{get:function(){return this._x},set:function(t){this._x=t,this._onChangeCallback()}},y:{get:function(){return this._y},set:function(t){this._y=t,this._onChangeCallback()}},z:{get:function(){return this._z},set:function(t){this._z=t,this._onChangeCallback()}},order:{get:function(){return this._order},set:function(t){this._order=t,this._onChangeCallback()}}}),Object.assign(_t.prototype,{isEuler:!0,set:function(t,e,n,r){return this._x=t,this._y=e,this._z=n,this._order=r||this._order,this._onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._order)},copy:function(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this},setFromRotationMatrix:function(t,e,n){var r=Q.clamp,i=t.elements,a=i[0],o=i[4],s=i[8],l=i[1],u=i[5],c=i[9],h=i[2],d=i[6],p=i[10];return"XYZ"===(e=e||this._order)?(this._y=Math.asin(r(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-c,p),this._z=Math.atan2(-o,a)):(this._x=Math.atan2(d,u),this._z=0)):"YXZ"===e?(this._x=Math.asin(-r(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(s,p),this._z=Math.atan2(l,u)):(this._y=Math.atan2(-h,a),this._z=0)):"ZXY"===e?(this._x=Math.asin(r(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-h,p),this._z=Math.atan2(-o,u)):(this._y=0,this._z=Math.atan2(l,a))):"ZYX"===e?(this._y=Math.asin(-r(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(d,p),this._z=Math.atan2(l,a)):(this._x=0,this._z=Math.atan2(-o,u))):"YZX"===e?(this._z=Math.asin(r(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-c,u),this._y=Math.atan2(-h,a)):(this._x=0,this._y=Math.atan2(s,p))):"XZY"===e?(this._z=Math.asin(-r(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(d,u),this._y=Math.atan2(s,a)):(this._x=Math.atan2(-c,p),this._y=0)):console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+e),this._order=e,!1!==n&&this._onChangeCallback(),this},setFromQuaternion:function(t,e,n){return bt.makeRotationFromQuaternion(t),this.setFromRotationMatrix(bt,e,n)},setFromVector3:function(t,e){return this.set(t.x,t.y,t.z,e||this._order)},reorder:function(t){return wt.setFromEuler(this),this.setFromQuaternion(wt,t)},equals:function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order},fromArray:function(t){return this._x=t[0],this._y=t[1],this._z=t[2],void 0!==t[3]&&(this._order=t[3]),this._onChangeCallback(),this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t},toVector3:function(t){return t?t.set(this._x,this._y,this._z):new ht(this._x,this._y,this._z)},_onChange:function(t){return this._onChangeCallback=t,this},_onChangeCallback:function(){}}),Object.assign(Mt.prototype,{set:function(t){this.mask=1<<t|0},enable:function(t){this.mask|=1<<t|0},enableAll:function(){this.mask=-1},toggle:function(t){this.mask^=1<<t|0},disable:function(t){this.mask&=~(1<<t|0)},disableAll:function(){this.mask=0},test:function(t){return 0!=(this.mask&t.mask)}});var St=0,Tt=new ht,Ct=new lt,Et=new xt,Dt=new ht,At=new ht,Ot=new ht,Lt=new lt,Pt=new ht(1,0,0),Rt=new ht(0,1,0),It=new ht(0,0,1),kt={type:"added"},Bt={type:"removed"};function Ft(){Object.defineProperty(this,"id",{value:St++}),this.uuid=Q.generateUUID(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Ft.DefaultUp.clone();var t=new ht,e=new _t,n=new lt,r=new ht(1,1,1);e._onChange(function(){n.setFromEuler(e,!1)}),n._onChange(function(){e.setFromQuaternion(n,void 0,!1)}),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:e},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new xt},normalMatrix:{value:new et}}),this.matrix=new xt,this.matrixWorld=new xt,this.matrixAutoUpdate=Ft.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new Mt,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.userData={}}function Nt(){Ft.call(this),this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}Ft.DefaultUp=new ht(0,1,0),Ft.DefaultMatrixAutoUpdate=!0,Ft.prototype=Object.assign(Object.create(Y.prototype),{constructor:Ft,isObject3D:!0,onBeforeRender:function(){},onAfterRender:function(){},applyMatrix4:function(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.quaternion,this.scale)},applyQuaternion:function(t){return this.quaternion.premultiply(t),this},setRotationFromAxisAngle:function(t,e){this.quaternion.setFromAxisAngle(t,e)},setRotationFromEuler:function(t){this.quaternion.setFromEuler(t,!0)},setRotationFromMatrix:function(t){this.quaternion.setFromRotationMatrix(t)},setRotationFromQuaternion:function(t){this.quaternion.copy(t)},rotateOnAxis:function(t,e){return Ct.setFromAxisAngle(t,e),this.quaternion.multiply(Ct),this},rotateOnWorldAxis:function(t,e){return Ct.setFromAxisAngle(t,e),this.quaternion.premultiply(Ct),this},rotateX:function(t){return this.rotateOnAxis(Pt,t)},rotateY:function(t){return this.rotateOnAxis(Rt,t)},rotateZ:function(t){return this.rotateOnAxis(It,t)},translateOnAxis:function(t,e){return Tt.copy(t).applyQuaternion(this.quaternion),this.position.add(Tt.multiplyScalar(e)),this},translateX:function(t){return this.translateOnAxis(Pt,t)},translateY:function(t){return this.translateOnAxis(Rt,t)},translateZ:function(t){return this.translateOnAxis(It,t)},localToWorld:function(t){return t.applyMatrix4(this.matrixWorld)},worldToLocal:function(t){return t.applyMatrix4(Et.getInverse(this.matrixWorld))},lookAt:function(t,e,n){t.isVector3?Dt.copy(t):Dt.set(t,e,n);var r=this.parent;this.updateWorldMatrix(!0,!1),At.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Et.lookAt(At,Dt,this.up):Et.lookAt(Dt,At,this.up),this.quaternion.setFromRotationMatrix(Et),r&&(Et.extractRotation(r.matrixWorld),Ct.setFromRotationMatrix(Et),this.quaternion.premultiply(Ct.inverse()))},add:function(t){if(1<arguments.length){for(var e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return t===this?console.error("THREE.Object3D.add: object can't be added as a child of itself.",t):t&&t.isObject3D?(null!==t.parent&&t.parent.remove(t),(t.parent=this).children.push(t),t.dispatchEvent(kt)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this},remove:function(t){if(1<arguments.length){for(var e=0;e<arguments.length;e++)this.remove(arguments[e]);return this}var n=this.children.indexOf(t);return-1!==n&&(t.parent=null,this.children.splice(n,1),t.dispatchEvent(Bt)),this},attach:function(t){return this.updateWorldMatrix(!0,!1),Et.getInverse(this.matrixWorld),null!==t.parent&&(t.parent.updateWorldMatrix(!0,!1),Et.multiply(t.parent.matrixWorld)),t.applyMatrix4(Et),t.updateWorldMatrix(!1,!1),this.add(t),this},getObjectById:function(t){return this.getObjectByProperty("id",t)},getObjectByName:function(t){return this.getObjectByProperty("name",t)},getObjectByProperty:function(t,e){if(this[t]===e)return this;for(var n=0,r=this.children.length;n<r;n++){var i=this.children[n].getObjectByProperty(t,e);if(void 0!==i)return i}},getWorldPosition:function(t){return void 0===t&&(console.warn("THREE.Object3D: .getWorldPosition() target is now required"),t=new ht),this.updateMatrixWorld(!0),t.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:function(t){return void 0===t&&(console.warn("THREE.Object3D: .getWorldQuaternion() target is now required"),t=new lt),this.updateMatrixWorld(!0),this.matrixWorld.decompose(At,t,Ot),t},getWorldScale:function(t){return void 0===t&&(console.warn("THREE.Object3D: .getWorldScale() target is now required"),t=new ht),this.updateMatrixWorld(!0),this.matrixWorld.decompose(At,Lt,t),t},getWorldDirection:function(t){void 0===t&&(console.warn("THREE.Object3D: .getWorldDirection() target is now required"),t=new ht),this.updateMatrixWorld(!0);var e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()},raycast:function(){},traverse:function(t){t(this);for(var e=this.children,n=0,r=e.length;n<r;n++)e[n].traverse(t)},traverseVisible:function(t){if(!1!==this.visible){t(this);for(var e=this.children,n=0,r=e.length;n<r;n++)e[n].traverseVisible(t)}},traverseAncestors:function(t){var e=this.parent;null!==e&&(t(e),e.traverseAncestors(t))},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),t=!(this.matrixWorldNeedsUpdate=!1));for(var e=this.children,n=0,r=e.length;n<r;n++)e[n].updateMatrixWorld(t)},updateWorldMatrix:function(t,e){var n=this.parent;if(!0===t&&null!==n&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),!0===e)for(var r=this.children,i=0,a=r.length;i<a;i++)r[i].updateWorldMatrix(!1,!0)},toJSON:function(t){var e=void 0===t||"string"==typeof t,n={};e&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{}},n.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});var r={};function i(e,n){return void 0===e[n.uuid]&&(e[n.uuid]=n.toJSON(t)),n.uuid}if(r.uuid=this.uuid,r.type=this.type,""!==this.name&&(r.name=this.name),!0===this.castShadow&&(r.castShadow=!0),!0===this.receiveShadow&&(r.receiveShadow=!0),!1===this.visible&&(r.visible=!1),!1===this.frustumCulled&&(r.frustumCulled=!1),0!==this.renderOrder&&(r.renderOrder=this.renderOrder),"{}"!==JSON.stringify(this.userData)&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),!1===this.matrixAutoUpdate&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON()),this.isMesh||this.isLine||this.isPoints){r.geometry=i(t.geometries,this.geometry);var a=this.geometry.parameters;if(void 0!==a&&void 0!==a.shapes){var o=a.shapes;if(Array.isArray(o))for(var s=0,l=o.length;s<l;s++){var u=o[s];i(t.shapes,u)}else i(t.shapes,o)}}if(void 0!==this.material)if(Array.isArray(this.material)){var c=[];for(s=0,l=this.material.length;s<l;s++)c.push(i(t.materials,this.material[s]));r.material=c}else r.material=i(t.materials,this.material);if(0<this.children.length)for(r.children=[],s=0;s<this.children.length;s++)r.children.push(this.children[s].toJSON(t).object);if(e){var h=m(t.geometries),d=m(t.materials),p=m(t.textures),f=m(t.images);o=m(t.shapes),0<h.length&&(n.geometries=h),0<d.length&&(n.materials=d),0<p.length&&(n.textures=p),0<f.length&&(n.images=f),0<o.length&&(n.shapes=o)}return n.object=r,n;function m(t){var e=[];for(var n in t){var r=t[n];delete r.metadata,e.push(r)}return e}},clone:function(t){return(new this.constructor).copy(this,t)},copy:function(t,e){if(void 0===e&&(e=!0),this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.userData=JSON.parse(JSON.stringify(t.userData)),!0===e)for(var n=0;n<t.children.length;n++){var r=t.children[n];this.add(r.clone())}return this}}),Nt.prototype=Object.assign(Object.create(Ft.prototype),{constructor:Nt,isScene:!0,copy:function(t,e){return Ft.prototype.copy.call(this,t,e),null!==t.background&&(this.background=t.background.clone()),null!==t.environment&&(this.environment=t.environment.clone()),null!==t.fog&&(this.fog=t.fog.clone()),null!==t.overrideMaterial&&(this.overrideMaterial=t.overrideMaterial.clone()),this.autoUpdate=t.autoUpdate,this.matrixAutoUpdate=t.matrixAutoUpdate,this},toJSON:function(t){var e=Ft.prototype.toJSON.call(this,t);return null!==this.background&&(e.object.background=this.background.toJSON(t)),null!==this.environment&&(e.object.environment=this.environment.toJSON(t)),null!==this.fog&&(e.object.fog=this.fog.toJSON()),e},dispose:function(){this.dispatchEvent({type:"dispose"})}});var jt=[new ht,new ht,new ht,new ht,new ht,new ht,new ht,new ht],zt=new ht,Vt=new Kt,Gt=new ht,Ut=new ht,Ht=new ht,Wt=new ht,Jt=new ht,qt=new ht,Xt=new ht,Yt=new ht,Zt=new ht,$t=new ht;function Kt(t,e){this.min=void 0!==t?t:new ht(1/0,1/0,1/0),this.max=void 0!==e?e:new ht(-1/0,-1/0,-1/0)}function Qt(t,e,n,r,i){var a,o;for(a=0,o=t.length-3;a<=o;a+=3){$t.fromArray(t,a);var s=i.x*Math.abs($t.x)+i.y*Math.abs($t.y)+i.z*Math.abs($t.z),l=e.dot($t),u=n.dot($t),c=r.dot($t);if(Math.max(-Math.max(l,u,c),Math.min(l,u,c))>s)return!1}return!0}Object.assign(Kt.prototype,{isBox3:!0,set:function(t,e){return this.min.copy(t),this.max.copy(e),this},setFromArray:function(t){for(var e=1/0,n=1/0,r=1/0,i=-1/0,a=-1/0,o=-1/0,s=0,l=t.length;s<l;s+=3){var u=t[s],c=t[s+1],h=t[s+2];u<e&&(e=u),c<n&&(n=c),h<r&&(r=h),i<u&&(i=u),a<c&&(a=c),o<h&&(o=h)}return this.min.set(e,n,r),this.max.set(i,a,o),this},setFromBufferAttribute:function(t){for(var e=1/0,n=1/0,r=1/0,i=-1/0,a=-1/0,o=-1/0,s=0,l=t.count;s<l;s++){var u=t.getX(s),c=t.getY(s),h=t.getZ(s);u<e&&(e=u),c<n&&(n=c),h<r&&(r=h),i<u&&(i=u),a<c&&(a=c),o<h&&(o=h)}return this.min.set(e,n,r),this.max.set(i,a,o),this},setFromPoints:function(t){this.makeEmpty();for(var e=0,n=t.length;e<n;e++)this.expandByPoint(t[e]);return this},setFromCenterAndSize:function(t,e){var n=zt.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(n),this.max.copy(t).add(n),this},setFromObject:function(t){return this.makeEmpty(),this.expandByObject(t)},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.min.copy(t.min),this.max.copy(t.max),this},makeEmpty:function(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z},getCenter:function(t){return void 0===t&&(console.warn("THREE.Box3: .getCenter() target is now required"),t=new ht),this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(t){return void 0===t&&(console.warn("THREE.Box3: .getSize() target is now required"),t=new ht),this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)},expandByPoint:function(t){return this.min.min(t),this.max.max(t),this},expandByVector:function(t){return this.min.sub(t),this.max.add(t),this},expandByScalar:function(t){return this.min.addScalar(-t),this.max.addScalar(t),this},expandByObject:function(t){t.updateWorldMatrix(!1,!1);var e=t.geometry;void 0!==e&&(null===e.boundingBox&&e.computeBoundingBox(),Vt.copy(e.boundingBox),Vt.applyMatrix4(t.matrixWorld),this.expandByPoint(Vt.min),this.expandByPoint(Vt.max));for(var n=t.children,r=0,i=n.length;r<i;r++)this.expandByObject(n[r]);return this},containsPoint:function(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y||t.z<this.min.z||t.z>this.max.z)},containsBox:function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z},getParameter:function(t,e){return void 0===e&&(console.warn("THREE.Box3: .getParameter() target is now required"),e=new ht),e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))},intersectsBox:function(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y||t.max.z<this.min.z||t.min.z>this.max.z)},intersectsSphere:function(t){return this.clampPoint(t.center,zt),zt.distanceToSquared(t.center)<=t.radius*t.radius},intersectsPlane:function(t){var e,n;return n=0<t.normal.x?(e=t.normal.x*this.min.x,t.normal.x*this.max.x):(e=t.normal.x*this.max.x,t.normal.x*this.min.x),0<t.normal.y?(e+=t.normal.y*this.min.y,n+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,n+=t.normal.y*this.min.y),0<t.normal.z?(e+=t.normal.z*this.min.z,n+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,n+=t.normal.z*this.min.z),e<=-t.constant&&n>=-t.constant},intersectsTriangle:function(t){if(this.isEmpty())return!1;this.getCenter(Xt),Yt.subVectors(this.max,Xt),Gt.subVectors(t.a,Xt),Ut.subVectors(t.b,Xt),Ht.subVectors(t.c,Xt),Wt.subVectors(Ut,Gt),Jt.subVectors(Ht,Ut),qt.subVectors(Gt,Ht);var e=[0,-Wt.z,Wt.y,0,-Jt.z,Jt.y,0,-qt.z,qt.y,Wt.z,0,-Wt.x,Jt.z,0,-Jt.x,qt.z,0,-qt.x,-Wt.y,Wt.x,0,-Jt.y,Jt.x,0,-qt.y,qt.x,0];return!!Qt(e,Gt,Ut,Ht,Yt)&&!!Qt(e=[1,0,0,0,1,0,0,0,1],Gt,Ut,Ht,Yt)&&(Zt.crossVectors(Wt,Jt),Qt(e=[Zt.x,Zt.y,Zt.z],Gt,Ut,Ht,Yt))},clampPoint:function(t,e){return void 0===e&&(console.warn("THREE.Box3: .clampPoint() target is now required"),e=new ht),e.copy(t).clamp(this.min,this.max)},distanceToPoint:function(t){return zt.copy(t).clamp(this.min,this.max).sub(t).length()},getBoundingSphere:function(t){return void 0===t&&console.error("THREE.Box3: .getBoundingSphere() target is now required"),this.getCenter(t.center),t.radius=.5*this.getSize(zt).length(),t},intersect:function(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this},union:function(t){return this.min.min(t.min),this.max.max(t.max),this},applyMatrix4:function(t){return this.isEmpty()||(jt[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),jt[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),jt[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),jt[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),jt[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),jt[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),jt[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),jt[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(jt)),this},translate:function(t){return this.min.add(t),this.max.add(t),this},equals:function(t){return t.min.equals(this.min)&&t.max.equals(this.max)}});var te=new Kt;function ee(t,e){this.center=void 0!==t?t:new ht,this.radius=void 0!==e?e:0}Object.assign(ee.prototype,{set:function(t,e){return this.center.copy(t),this.radius=e,this},setFromPoints:function(t,e){var n=this.center;void 0!==e?n.copy(e):te.setFromPoints(t).getCenter(n);for(var r=0,i=0,a=t.length;i<a;i++)r=Math.max(r,n.distanceToSquared(t[i]));return this.radius=Math.sqrt(r),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.center.copy(t.center),this.radius=t.radius,this},empty:function(){return this.radius<=0},containsPoint:function(t){return t.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(t){return t.distanceTo(this.center)-this.radius},intersectsSphere:function(t){var e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e},intersectsBox:function(t){return t.intersectsSphere(this)},intersectsPlane:function(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius},clampPoint:function(t,e){var n=this.center.distanceToSquared(t);return void 0===e&&(console.warn("THREE.Sphere: .clampPoint() target is now required"),e=new ht),e.copy(t),n>this.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e},getBoundingBox:function(t){return void 0===t&&(console.warn("THREE.Sphere: .getBoundingBox() target is now required"),t=new Kt),t.set(this.center,this.center),t.expandByScalar(this.radius),t},applyMatrix4:function(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this},translate:function(t){return this.center.add(t),this},equals:function(t){return t.center.equals(this.center)&&t.radius===this.radius}});var ne=new ht,re=new ht,ie=new ht,ae=new ht,oe=new ht,se=new ht,le=new ht;function ue(t,e){this.origin=void 0!==t?t:new ht,this.direction=void 0!==e?e:new ht(0,0,-1)}Object.assign(ue.prototype,{set:function(t,e){return this.origin.copy(t),this.direction.copy(e),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this},at:function(t,e){return void 0===e&&(console.warn("THREE.Ray: .at() target is now required"),e=new ht),e.copy(this.direction).multiplyScalar(t).add(this.origin)},lookAt:function(t){return this.direction.copy(t).sub(this.origin).normalize(),this},recast:function(t){return this.origin.copy(this.at(t,ne)),this},closestPointToPoint:function(t,e){void 0===e&&(console.warn("THREE.Ray: .closestPointToPoint() target is now required"),e=new ht),e.subVectors(t,this.origin);var n=e.dot(this.direction);return n<0?e.copy(this.origin):e.copy(this.direction).multiplyScalar(n).add(this.origin)},distanceToPoint:function(t){return Math.sqrt(this.distanceSqToPoint(t))},distanceSqToPoint:function(t){var e=ne.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(ne.copy(this.direction).multiplyScalar(e).add(this.origin),ne.distanceToSquared(t))},distanceSqToSegment:function(t,e,n,r){re.copy(t).add(e).multiplyScalar(.5),ie.copy(e).sub(t).normalize(),ae.copy(this.origin).sub(re);var i,a,o,s,l=.5*t.distanceTo(e),u=-this.direction.dot(ie),c=ae.dot(this.direction),h=-ae.dot(ie),d=ae.lengthSq(),p=Math.abs(1-u*u);if(0<p)if(a=u*c-h,s=l*p,0<=(i=u*h-c))if(-s<=a)if(a<=s){var f=1/p;o=(i*=f)*(i+u*(a*=f)+2*c)+a*(u*i+a+2*h)+d}else a=l,o=-(i=Math.max(0,-(u*a+c)))*i+a*(a+2*h)+d;else a=-l,o=-(i=Math.max(0,-(u*a+c)))*i+a*(a+2*h)+d;else o=a<=-s?-(i=Math.max(0,-(-u*l+c)))*i+(a=0<i?-l:Math.min(Math.max(-l,-h),l))*(a+2*h)+d:a<=s?(i=0,(a=Math.min(Math.max(-l,-h),l))*(a+2*h)+d):-(i=Math.max(0,-(u*l+c)))*i+(a=0<i?l:Math.min(Math.max(-l,-h),l))*(a+2*h)+d;else a=0<u?-l:l,o=-(i=Math.max(0,-(u*a+c)))*i+a*(a+2*h)+d;return n&&n.copy(this.direction).multiplyScalar(i).add(this.origin),r&&r.copy(ie).multiplyScalar(a).add(re),o},intersectSphere:function(t,e){ne.subVectors(t.center,this.origin);var n=ne.dot(this.direction),r=ne.dot(ne)-n*n,i=t.radius*t.radius;if(i<r)return null;var a=Math.sqrt(i-r),o=n-a,s=n+a;return o<0&&s<0?null:o<0?this.at(s,e):this.at(o,e)},intersectsSphere:function(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius},distanceToPlane:function(t){var e=t.normal.dot(this.direction);if(0===e)return 0===t.distanceToPoint(this.origin)?0:null;var n=-(this.origin.dot(t.normal)+t.constant)/e;return 0<=n?n:null},intersectPlane:function(t,e){var n=this.distanceToPlane(t);return null===n?null:this.at(n,e)},intersectsPlane:function(t){var e=t.distanceToPoint(this.origin);return 0===e||t.normal.dot(this.direction)*e<0},intersectBox:function(t,e){var n,r,i,a,o,s,l=1/this.direction.x,u=1/this.direction.y,c=1/this.direction.z,h=this.origin;return r=0<=l?(n=(t.min.x-h.x)*l,(t.max.x-h.x)*l):(n=(t.max.x-h.x)*l,(t.min.x-h.x)*l),(a=0<=u?(i=(t.min.y-h.y)*u,(t.max.y-h.y)*u):(i=(t.max.y-h.y)*u,(t.min.y-h.y)*u))<n||r<i?null:((n<i||n!=n)&&(n=i),(a<r||r!=r)&&(r=a),(s=0<=c?(o=(t.min.z-h.z)*c,(t.max.z-h.z)*c):(o=(t.max.z-h.z)*c,(t.min.z-h.z)*c))<n||r<o?null:((n<o||n!=n)&&(n=o),(s<r||r!=r)&&(r=s),r<0?null:this.at(0<=n?n:r,e)))},intersectsBox:function(t){return null!==this.intersectBox(t,ne)},intersectTriangle:function(t,e,n,r,i){oe.subVectors(e,t),se.subVectors(n,t),le.crossVectors(oe,se);var a,o=this.direction.dot(le);if(0<o){if(r)return null;a=1}else{if(!(o<0))return null;a=-1,o=-o}ae.subVectors(this.origin,t);var s=a*this.direction.dot(se.crossVectors(ae,se));if(s<0)return null;var l=a*this.direction.dot(oe.cross(ae));if(l<0)return null;if(o<s+l)return null;var u=-a*ae.dot(le);return u<0?null:this.at(u/o,i)},applyMatrix4:function(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this},equals:function(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}});var ce=new ht,he=new ht,de=new et;function pe(t,e){this.normal=void 0!==t?t:new ht(1,0,0),this.constant=void 0!==e?e:0}Object.assign(pe.prototype,{isPlane:!0,set:function(t,e){return this.normal.copy(t),this.constant=e,this},setComponents:function(t,e,n,r){return this.normal.set(t,e,n),this.constant=r,this},setFromNormalAndCoplanarPoint:function(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this},setFromCoplanarPoints:function(t,e,n){var r=ce.subVectors(n,e).cross(he.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(r,t),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.normal.copy(t.normal),this.constant=t.constant,this},normalize:function(){var t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this},negate:function(){return this.constant*=-1,this.normal.negate(),this},distanceToPoint:function(t){return this.normal.dot(t)+this.constant},distanceToSphere:function(t){return this.distanceToPoint(t.center)-t.radius},projectPoint:function(t,e){return void 0===e&&(console.warn("THREE.Plane: .projectPoint() target is now required"),e=new ht),e.copy(this.normal).multiplyScalar(-this.distanceToPoint(t)).add(t)},intersectLine:function(t,e){void 0===e&&(console.warn("THREE.Plane: .intersectLine() target is now required"),e=new ht);var n=t.delta(ce),r=this.normal.dot(n);if(0===r)return 0===this.distanceToPoint(t.start)?e.copy(t.start):void 0;var i=-(t.start.dot(this.normal)+this.constant)/r;return i<0||1<i?void 0:e.copy(n).multiplyScalar(i).add(t.start)},intersectsLine:function(t){var e=this.distanceToPoint(t.start),n=this.distanceToPoint(t.end);return e<0&&0<n||n<0&&0<e},intersectsBox:function(t){return t.intersectsPlane(this)},intersectsSphere:function(t){return t.intersectsPlane(this)},coplanarPoint:function(t){return void 0===t&&(console.warn("THREE.Plane: .coplanarPoint() target is now required"),t=new ht),t.copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(t,e){var n=e||de.getNormalMatrix(t),r=this.coplanarPoint(ce).applyMatrix4(t),i=this.normal.applyMatrix3(n).normalize();return this.constant=-r.dot(i),this},translate:function(t){return this.constant-=t.dot(this.normal),this},equals:function(t){return t.normal.equals(this.normal)&&t.constant===this.constant}});var fe=new ht,me=new ht,ge=new ht,ve=new ht,ye=new ht,xe=new ht,be=new ht,we=new ht,_e=new ht,Me=new ht;function Se(t,e,n){this.a=void 0!==t?t:new ht,this.b=void 0!==e?e:new ht,this.c=void 0!==n?n:new ht}Object.assign(Se,{getNormal:function(t,e,n,r){void 0===r&&(console.warn("THREE.Triangle: .getNormal() target is now required"),r=new ht),r.subVectors(n,e),fe.subVectors(t,e),r.cross(fe);var i=r.lengthSq();return 0<i?r.multiplyScalar(1/Math.sqrt(i)):r.set(0,0,0)},getBarycoord:function(t,e,n,r,i){fe.subVectors(r,e),me.subVectors(n,e),ge.subVectors(t,e);var a=fe.dot(fe),o=fe.dot(me),s=fe.dot(ge),l=me.dot(me),u=me.dot(ge),c=a*l-o*o;if(void 0===i&&(console.warn("THREE.Triangle: .getBarycoord() target is now required"),i=new ht),0==c)return i.set(-2,-1,-1);var h=1/c,d=(l*s-o*u)*h,p=(a*u-o*s)*h;return i.set(1-d-p,p,d)},containsPoint:function(t,e,n,r){return Se.getBarycoord(t,e,n,r,ve),0<=ve.x&&0<=ve.y&&ve.x+ve.y<=1},getUV:function(t,e,n,r,i,a,o,s){return this.getBarycoord(t,e,n,r,ve),s.set(0,0),s.addScaledVector(i,ve.x),s.addScaledVector(a,ve.y),s.addScaledVector(o,ve.z),s},isFrontFacing:function(t,e,n,r){return fe.subVectors(n,e),me.subVectors(t,e),fe.cross(me).dot(r)<0}}),Object.assign(Se.prototype,{set:function(t,e,n){return this.a.copy(t),this.b.copy(e),this.c.copy(n),this},setFromPointsAndIndices:function(t,e,n,r){return this.a.copy(t[e]),this.b.copy(t[n]),this.c.copy(t[r]),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this},getArea:function(){return fe.subVectors(this.c,this.b),me.subVectors(this.a,this.b),.5*fe.cross(me).length()},getMidpoint:function(t){return void 0===t&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"),t=new ht),t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},getNormal:function(t){return Se.getNormal(this.a,this.b,this.c,t)},getPlane:function(t){return void 0===t&&(console.warn("THREE.Triangle: .getPlane() target is now required"),t=new pe),t.setFromCoplanarPoints(this.a,this.b,this.c)},getBarycoord:function(t,e){return Se.getBarycoord(t,this.a,this.b,this.c,e)},getUV:function(t,e,n,r,i){return Se.getUV(t,this.a,this.b,this.c,e,n,r,i)},containsPoint:function(t){return Se.containsPoint(t,this.a,this.b,this.c)},isFrontFacing:function(t){return Se.isFrontFacing(this.a,this.b,this.c,t)},intersectsBox:function(t){return t.intersectsTriangle(this)},closestPointToPoint:function(t,e){void 0===e&&(console.warn("THREE.Triangle: .closestPointToPoint() target is now required"),e=new ht);var n,r,i=this.a,a=this.b,o=this.c;ye.subVectors(a,i),xe.subVectors(o,i),we.subVectors(t,i);var s=ye.dot(we),l=xe.dot(we);if(s<=0&&l<=0)return e.copy(i);_e.subVectors(t,a);var u=ye.dot(_e),c=xe.dot(_e);if(0<=u&&c<=u)return e.copy(a);var h=s*c-u*l;if(h<=0&&0<=s&&u<=0)return n=s/(s-u),e.copy(i).addScaledVector(ye,n);Me.subVectors(t,o);var d=ye.dot(Me),p=xe.dot(Me);if(0<=p&&d<=p)return e.copy(o);var f=d*l-s*p;if(f<=0&&0<=l&&p<=0)return r=l/(l-p),e.copy(i).addScaledVector(xe,r);var m=u*p-d*c;if(m<=0&&0<=c-u&&0<=d-p)return be.subVectors(o,a),r=(c-u)/(c-u+(d-p)),e.copy(a).addScaledVector(be,r);var g=1/(m+f+h);return n=f*g,r=h*g,e.copy(i).addScaledVector(ye,n).addScaledVector(xe,r)},equals:function(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}});var Te={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Ce={h:0,s:0,l:0},Ee={h:0,s:0,l:0};function De(t,e,n){return void 0===e&&void 0===n?this.set(t):this.setRGB(t,e,n)}function Ae(t,e,n){return n<0&&(n+=1),1<n&&--n,n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+6*(e-t)*(2/3-n):t}function Oe(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function Le(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}function Pe(t,e,n,r,i,a){this.a=t,this.b=e,this.c=n,this.normal=r&&r.isVector3?r:new ht,this.vertexNormals=Array.isArray(r)?r:[],this.color=i&&i.isColor?i:new De,this.vertexColors=Array.isArray(i)?i:[],this.materialIndex=void 0!==a?a:0}Object.assign(De.prototype,{isColor:!0,r:1,g:1,b:1,set:function(t){return t&&t.isColor?this.copy(t):"number"==typeof t?this.setHex(t):"string"==typeof t&&this.setStyle(t),this},setScalar:function(t){return this.r=t,this.g=t,this.b=t,this},setHex:function(t){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,this},setRGB:function(t,e,n){return this.r=t,this.g=e,this.b=n,this},setHSL:function(t,e,n){if(t=Q.euclideanModulo(t,1),e=Q.clamp(e,0,1),n=Q.clamp(n,0,1),0===e)this.r=this.g=this.b=n;else{var r=n<=.5?n*(1+e):n+e-n*e,i=2*n-r;this.r=Ae(i,r,t+1/3),this.g=Ae(i,r,t),this.b=Ae(i,r,t-1/3)}return this},setStyle:function(t){function e(e){void 0!==e&&parseFloat(e)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}var n;if(n=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(t)){var r,i=n[1],a=n[2];switch(i){case"rgb":case"rgba":if(r=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))return this.r=Math.min(255,parseInt(r[1],10))/255,this.g=Math.min(255,parseInt(r[2],10))/255,this.b=Math.min(255,parseInt(r[3],10))/255,e(r[5]),this;if(r=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))return this.r=Math.min(100,parseInt(r[1],10))/100,this.g=Math.min(100,parseInt(r[2],10))/100,this.b=Math.min(100,parseInt(r[3],10))/100,e(r[5]),this;break;case"hsl":case"hsla":if(r=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a)){var o=parseFloat(r[1])/360,s=parseInt(r[2],10)/100,l=parseInt(r[3],10)/100;return e(r[5]),this.setHSL(o,s,l)}}}else if(n=/^\#([A-Fa-f0-9]+)$/.exec(t)){var u=n[1],c=u.length;if(3===c)return this.r=parseInt(u.charAt(0)+u.charAt(0),16)/255,this.g=parseInt(u.charAt(1)+u.charAt(1),16)/255,this.b=parseInt(u.charAt(2)+u.charAt(2),16)/255,this;if(6===c)return this.r=parseInt(u.charAt(0)+u.charAt(1),16)/255,this.g=parseInt(u.charAt(2)+u.charAt(3),16)/255,this.b=parseInt(u.charAt(4)+u.charAt(5),16)/255,this}return t&&0<t.length?this.setColorName(t):this},setColorName:function(t){var e=Te[t];return void 0!==e?this.setHex(e):console.warn("THREE.Color: Unknown color "+t),this},clone:function(){return new this.constructor(this.r,this.g,this.b)},copy:function(t){return this.r=t.r,this.g=t.g,this.b=t.b,this},copyGammaToLinear:function(t,e){return void 0===e&&(e=2),this.r=Math.pow(t.r,e),this.g=Math.pow(t.g,e),this.b=Math.pow(t.b,e),this},copyLinearToGamma:function(t,e){void 0===e&&(e=2);var n=0<e?1/e:1;return this.r=Math.pow(t.r,n),this.g=Math.pow(t.g,n),this.b=Math.pow(t.b,n),this},convertGammaToLinear:function(t){return this.copyGammaToLinear(this,t),this},convertLinearToGamma:function(t){return this.copyLinearToGamma(this,t),this},copySRGBToLinear:function(t){return this.r=Oe(t.r),this.g=Oe(t.g),this.b=Oe(t.b),this},copyLinearToSRGB:function(t){return this.r=Le(t.r),this.g=Le(t.g),this.b=Le(t.b),this},convertSRGBToLinear:function(){return this.copySRGBToLinear(this),this},convertLinearToSRGB:function(){return this.copyLinearToSRGB(this),this},getHex:function(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0},getHexString:function(){return("000000"+this.getHex().toString(16)).slice(-6)},getHSL:function(t){void 0===t&&(console.warn("THREE.Color: .getHSL() target is now required"),t={h:0,s:0,l:0});var e,n,r=this.r,i=this.g,a=this.b,o=Math.max(r,i,a),s=Math.min(r,i,a),l=(s+o)/2;if(s===o)n=e=0;else{var u=o-s;switch(n=l<=.5?u/(o+s):u/(2-o-s),o){case r:e=(i-a)/u+(i<a?6:0);break;case i:e=(a-r)/u+2;break;case a:e=(r-i)/u+4}e/=6}return t.h=e,t.s=n,t.l=l,t},getStyle:function(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"},offsetHSL:function(t,e,n){return this.getHSL(Ce),Ce.h+=t,Ce.s+=e,Ce.l+=n,this.setHSL(Ce.h,Ce.s,Ce.l),this},add:function(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this},addColors:function(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this},addScalar:function(t){return this.r+=t,this.g+=t,this.b+=t,this},sub:function(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this},multiply:function(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this},multiplyScalar:function(t){return this.r*=t,this.g*=t,this.b*=t,this},lerp:function(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this},lerpHSL:function(t,e){this.getHSL(Ce),t.getHSL(Ee);var n=Q.lerp(Ce.h,Ee.h,e),r=Q.lerp(Ce.s,Ee.s,e),i=Q.lerp(Ce.l,Ee.l,e);return this.setHSL(n,r,i),this},equals:function(t){return t.r===this.r&&t.g===this.g&&t.b===this.b},fromArray:function(t,e){return void 0===e&&(e=0),this.r=t[e],this.g=t[e+1],this.b=t[e+2],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t},toJSON:function(){return this.getHex()}}),De.NAMES=Te,Object.assign(Pe.prototype,{clone:function(){return(new this.constructor).copy(this)},copy:function(t){this.a=t.a,this.b=t.b,this.c=t.c,this.normal.copy(t.normal),this.color.copy(t.color),this.materialIndex=t.materialIndex;for(var e=0,n=t.vertexNormals.length;e<n;e++)this.vertexNormals[e]=t.vertexNormals[e].clone();for(e=0,n=t.vertexColors.length;e<n;e++)this.vertexColors[e]=t.vertexColors[e].clone();return this}});var Re=0;function Ie(){Object.defineProperty(this,"id",{value:Re++}),this.uuid=Q.generateUUID(),this.name="",this.type="Material",this.fog=!0,this.blending=1,this.side=0,this.flatShading=!1,this.vertexTangents=!1,this.vertexColors=0,this.opacity=1,this.transparent=!1,this.blendSrc=204,this.blendDst=205,this.blendEquation=e,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=3,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=J,this.stencilZFail=J,this.stencilZPass=J,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaTest=0,this.premultipliedAlpha=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0}function ke(t){Ie.call(this),this.type="MeshBasicMaterial",this.color=new De(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.setValues(t)}Ie.prototype=Object.assign(Object.create(Y.prototype),{constructor:Ie,isMaterial:!0,onBeforeCompile:function(){},setValues:function(t){if(void 0!==t)for(var e in t){var n=t[e];if(void 0!==n)if("shading"!==e){var r=this[e];void 0!==r?r&&r.isColor?r.set(n):r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[e]=n:console.warn("THREE."+this.type+": '"+e+"' is not a property of this material.")}else console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===n;else console.warn("THREE.Material: '"+e+"' parameter is undefined.")}},toJSON:function(t){var e=void 0===t||"string"==typeof t;e&&(t={textures:{},images:{}});var n={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};function r(t){var e=[];for(var n in t){var r=t[n];delete r.metadata,e.push(r)}return e}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),void 0!==this.roughness&&(n.roughness=this.roughness),void 0!==this.metalness&&(n.metalness=this.metalness),this.sheen&&this.sheen.isColor&&(n.sheen=this.sheen.getHex()),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity&&1!==this.emissiveIntensity&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),void 0!==this.shininess&&(n.shininess=this.shininess),void 0!==this.clearcoat&&(n.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(t).uuid),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(t).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(t).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(t).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(t).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(t).uuid,n.reflectivity=this.reflectivity,n.refractionRatio=this.refractionRatio,void 0!==this.combine&&(n.combine=this.combine),void 0!==this.envMapIntensity&&(n.envMapIntensity=this.envMapIntensity)),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(t).uuid),void 0!==this.size&&(n.size=this.size),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),1!==this.blending&&(n.blending=this.blending),!0===this.flatShading&&(n.flatShading=this.flatShading),0!==this.side&&(n.side=this.side),0!==this.vertexColors&&(n.vertexColors=this.vertexColors),this.opacity<1&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=this.transparent),n.depthFunc=this.depthFunc,n.depthTest=this.depthTest,n.depthWrite=this.depthWrite,n.stencilWrite=this.stencilWrite,n.stencilWriteMask=this.stencilWriteMask,n.stencilFunc=this.stencilFunc,n.stencilRef=this.stencilRef,n.stencilFuncMask=this.stencilFuncMask,n.stencilFail=this.stencilFail,n.stencilZFail=this.stencilZFail,n.stencilZPass=this.stencilZPass,this.rotation&&0!==this.rotation&&(n.rotation=this.rotation),!0===this.polygonOffset&&(n.polygonOffset=!0),0!==this.polygonOffsetFactor&&(n.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth&&1!==this.linewidth&&(n.linewidth=this.linewidth),void 0!==this.dashSize&&(n.dashSize=this.dashSize),void 0!==this.gapSize&&(n.gapSize=this.gapSize),void 0!==this.scale&&(n.scale=this.scale),!0===this.dithering&&(n.dithering=!0),0<this.alphaTest&&(n.alphaTest=this.alphaTest),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(n.wireframe=this.wireframe),1<this.wireframeLinewidth&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.morphTargets&&(n.morphTargets=!0),!0===this.morphNormals&&(n.morphNormals=!0),!0===this.skinning&&(n.skinning=!0),!1===this.visible&&(n.visible=!1),!1===this.toneMapped&&(n.toneMapped=!1),"{}"!==JSON.stringify(this.userData)&&(n.userData=this.userData),e){var i=r(t.textures),a=r(t.images);0<i.length&&(n.textures=i),0<a.length&&(n.images=a)}return n},clone:function(){return(new this.constructor).copy(this)},copy:function(t){this.name=t.name,this.fog=t.fog,this.blending=t.blending,this.side=t.side,this.flatShading=t.flatShading,this.vertexTangents=t.vertexTangents,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;var e=t.clippingPlanes,n=null;if(null!==e){var r=e.length;n=new Array(r);for(var i=0;i!==r;++i)n[i]=e[i].clone()}return this.clippingPlanes=n,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.premultipliedAlpha=t.premultipliedAlpha,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.defineProperty(Ie.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),((ke.prototype=Object.create(Ie.prototype)).constructor=ke).prototype.isMeshBasicMaterial=!0,ke.prototype.copy=function(t){return Ie.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this};var Be=new ht;function Fe(t,e,n){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=t,this.itemSize=e,this.count=void 0!==t?t.length/e:0,this.normalized=!0===n,this.usage=q,this.updateRange={offset:0,count:-1},this.version=0}function Ne(t,e,n){Fe.call(this,new Int8Array(t),e,n)}function je(t,e,n){Fe.call(this,new Uint8Array(t),e,n)}function ze(t,e,n){Fe.call(this,new Uint8ClampedArray(t),e,n)}function Ve(t,e,n){Fe.call(this,new Int16Array(t),e,n)}function Ge(t,e,n){Fe.call(this,new Uint16Array(t),e,n)}function Ue(t,e,n){Fe.call(this,new Int32Array(t),e,n)}function He(t,e,n){Fe.call(this,new Uint32Array(t),e,n)}function We(t,e,n){Fe.call(this,new Float32Array(t),e,n)}function Je(t,e,n){Fe.call(this,new Float64Array(t),e,n)}function qe(){this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1}function Xe(t){if(0===t.length)return-1/0;for(var e=t[0],n=1,r=t.length;n<r;++n)t[n]>e&&(e=t[n]);return e}Object.defineProperty(Fe.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(Fe.prototype,{isBufferAttribute:!0,onUploadCallback:function(){},setUsage:function(t){return this.usage=t,this},copy:function(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this},copyAt:function(t,e,n){t*=this.itemSize,n*=e.itemSize;for(var r=0,i=this.itemSize;r<i;r++)this.array[t+r]=e.array[n+r];return this},copyArray:function(t){return this.array.set(t),this},copyColorsArray:function(t){for(var e=this.array,n=0,r=0,i=t.length;r<i;r++){var a=t[r];void 0===a&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",r),a=new De),e[n++]=a.r,e[n++]=a.g,e[n++]=a.b}return this},copyVector2sArray:function(t){for(var e=this.array,n=0,r=0,i=t.length;r<i;r++){var a=t[r];void 0===a&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",r),a=new tt),e[n++]=a.x,e[n++]=a.y}return this},copyVector3sArray:function(t){for(var e=this.array,n=0,r=0,i=t.length;r<i;r++){var a=t[r];void 0===a&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",r),a=new ht),e[n++]=a.x,e[n++]=a.y,e[n++]=a.z}return this},copyVector4sArray:function(t){for(var e=this.array,n=0,r=0,i=t.length;r<i;r++){var a=t[r];void 0===a&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",r),a=new at),e[n++]=a.x,e[n++]=a.y,e[n++]=a.z,e[n++]=a.w}return this},applyMatrix3:function(t){for(var e=0,n=this.count;e<n;e++)Be.x=this.getX(e),Be.y=this.getY(e),Be.z=this.getZ(e),Be.applyMatrix3(t),this.setXYZ(e,Be.x,Be.y,Be.z);return this},applyMatrix4:function(t){for(var e=0,n=this.count;e<n;e++)Be.x=this.getX(e),Be.y=this.getY(e),Be.z=this.getZ(e),Be.applyMatrix4(t),this.setXYZ(e,Be.x,Be.y,Be.z);return this},applyNormalMatrix:function(t){for(var e=0,n=this.count;e<n;e++)Be.x=this.getX(e),Be.y=this.getY(e),Be.z=this.getZ(e),Be.applyNormalMatrix(t),this.setXYZ(e,Be.x,Be.y,Be.z);return this},transformDirection:function(t){for(var e=0,n=this.count;e<n;e++)Be.x=this.getX(e),Be.y=this.getY(e),Be.z=this.getZ(e),Be.transformDirection(t),this.setXYZ(e,Be.x,Be.y,Be.z);return this},set:function(t,e){return void 0===e&&(e=0),this.array.set(t,e),this},getX:function(t){return this.array[t*this.itemSize]},setX:function(t,e){return this.array[t*this.itemSize]=e,this},getY:function(t){return this.array[t*this.itemSize+1]},setY:function(t,e){return this.array[t*this.itemSize+1]=e,this},getZ:function(t){return this.itemSize<3?0:this.array[t*this.itemSize+2]},setZ:function(t,e){return this.array[t*this.itemSize+2]=e,this},getW:function(t){return this.array[t*this.itemSize+3]},setW:function(t,e){return this.array[t*this.itemSize+3]=e,this},setXY:function(t,e,n){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=n,this},setXYZ:function(t,e,n,r){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=r,this},setXYZW:function(t,e,n,r,i){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=r,this.array[t+3]=i,this},onUpload:function(t){return this.onUploadCallback=t,this},clone:function(){return new this.constructor(this.array,this.itemSize).copy(this)},toJSON:function(){return{itemSize:this.itemSize,type:this.array.constructor.name,array:Array.prototype.slice.call(this.array),normalized:this.normalized}}}),(Ne.prototype=Object.create(Fe.prototype)).constructor=Ne,(je.prototype=Object.create(Fe.prototype)).constructor=je,(ze.prototype=Object.create(Fe.prototype)).constructor=ze,(Ve.prototype=Object.create(Fe.prototype)).constructor=Ve,(Ge.prototype=Object.create(Fe.prototype)).constructor=Ge,(Ue.prototype=Object.create(Fe.prototype)).constructor=Ue,(He.prototype=Object.create(Fe.prototype)).constructor=He,(We.prototype=Object.create(Fe.prototype)).constructor=We,(Je.prototype=Object.create(Fe.prototype)).constructor=Je,Object.assign(qe.prototype,{computeGroups:function(t){for(var e,n=[],r=void 0,i=t.faces,a=0;a<i.length;a++){var o=i[a];o.materialIndex!==r&&(r=o.materialIndex,void 0!==e&&(e.count=3*a-e.start,n.push(e)),e={start:3*a,materialIndex:r})}void 0!==e&&(e.count=3*a-e.start,n.push(e)),this.groups=n},fromGeometry:function(t){var e,n=t.faces,r=t.vertices,i=t.faceVertexUvs,a=i[0]&&0<i[0].length,o=i[1]&&0<i[1].length,s=t.morphTargets,l=s.length;if(0<l){e=[];for(var u=0;u<l;u++)e[u]={name:s[u].name,data:[]};this.morphTargets.position=e}var c,h=t.morphNormals,d=h.length;if(0<d){for(c=[],u=0;u<d;u++)c[u]={name:h[u].name,data:[]};this.morphTargets.normal=c}var p=t.skinIndices,f=t.skinWeights,m=p.length===r.length,g=f.length===r.length;for(0<r.length&&0===n.length&&console.error("THREE.DirectGeometry: Faceless geometries are not supported."),u=0;u<n.length;u++){var v=n[u];this.vertices.push(r[v.a],r[v.b],r[v.c]);var y=v.vertexNormals;if(3===y.length)this.normals.push(y[0],y[1],y[2]);else{var x=v.normal;this.normals.push(x,x,x)}var b,w=v.vertexColors;if(3===w.length)this.colors.push(w[0],w[1],w[2]);else{var _=v.color;this.colors.push(_,_,_)}!0===a&&(void 0!==(b=i[0][u])?this.uvs.push(b[0],b[1],b[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",u),this.uvs.push(new tt,new tt,new tt))),!0===o&&(void 0!==(b=i[1][u])?this.uvs2.push(b[0],b[1],b[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",u),this.uvs2.push(new tt,new tt,new tt)));for(var M=0;M<l;M++){var S=s[M].vertices;e[M].data.push(S[v.a],S[v.b],S[v.c])}for(M=0;M<d;M++){var T=h[M].vertexNormals[u];c[M].data.push(T.a,T.b,T.c)}m&&this.skinIndices.push(p[v.a],p[v.b],p[v.c]),g&&this.skinWeights.push(f[v.a],f[v.b],f[v.c])}return this.computeGroups(t),this.verticesNeedUpdate=t.verticesNeedUpdate,this.normalsNeedUpdate=t.normalsNeedUpdate,this.colorsNeedUpdate=t.colorsNeedUpdate,this.uvsNeedUpdate=t.uvsNeedUpdate,this.groupsNeedUpdate=t.groupsNeedUpdate,null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),this}});var Ye=2147483647,Ze=new xt,$e=new Ft,Ke=new ht,Qe=new Kt,tn=new Kt,en=new ht;function nn(){Object.defineProperty(this,"id",{value:Ye+=2}),this.uuid=Q.generateUUID(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}nn.prototype=Object.assign(Object.create(Y.prototype),{constructor:nn,isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(t){Array.isArray(t)?this.index=new(65535<Xe(t)?He:Ge)(t,1):this.index=t},getAttribute:function(t){return this.attributes[t]},setAttribute:function(t,e){return this.attributes[t]=e,this},deleteAttribute:function(t){return delete this.attributes[t],this},addGroup:function(t,e,n){this.groups.push({start:t,count:e,materialIndex:void 0!==n?n:0})},clearGroups:function(){this.groups=[]},setDrawRange:function(t,e){this.drawRange.start=t,this.drawRange.count=e},applyMatrix4:function(t){var e=this.attributes.position;void 0!==e&&(e.applyMatrix4(t),e.needsUpdate=!0);var n=this.attributes.normal;if(void 0!==n){var r=(new et).getNormalMatrix(t);n.applyNormalMatrix(r),n.needsUpdate=!0}var i=this.attributes.tangent;return void 0!==i&&(i.transformDirection(t),i.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:function(t){return Ze.makeRotationX(t),this.applyMatrix4(Ze),this},rotateY:function(t){return Ze.makeRotationY(t),this.applyMatrix4(Ze),this},rotateZ:function(t){return Ze.makeRotationZ(t),this.applyMatrix4(Ze),this},translate:function(t,e,n){return Ze.makeTranslation(t,e,n),this.applyMatrix4(Ze),this},scale:function(t,e,n){return Ze.makeScale(t,e,n),this.applyMatrix4(Ze),this},lookAt:function(t){return $e.lookAt(t),$e.updateMatrix(),this.applyMatrix4($e.matrix),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(Ke).negate(),this.translate(Ke.x,Ke.y,Ke.z),this},setFromObject:function(t){var e=t.geometry;if(t.isPoints||t.isLine){var n=new We(3*e.vertices.length,3),r=new We(3*e.colors.length,3);if(this.setAttribute("position",n.copyVector3sArray(e.vertices)),this.setAttribute("color",r.copyColorsArray(e.colors)),e.lineDistances&&e.lineDistances.length===e.vertices.length){var i=new We(e.lineDistances.length,1);this.setAttribute("lineDistance",i.copyArray(e.lineDistances))}null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone())}else t.isMesh&&e&&e.isGeometry&&this.fromGeometry(e);return this},setFromPoints:function(t){for(var e=[],n=0,r=t.length;n<r;n++){var i=t[n];e.push(i.x,i.y,i.z||0)}return this.setAttribute("position",new We(e,3)),this},updateFromObject:function(t){var e,n=t.geometry;if(t.isMesh){var r=n.__directGeometry;if(!0===n.elementsNeedUpdate&&(r=void 0,n.elementsNeedUpdate=!1),void 0===r)return this.fromGeometry(n);r.verticesNeedUpdate=n.verticesNeedUpdate,r.normalsNeedUpdate=n.normalsNeedUpdate,r.colorsNeedUpdate=n.colorsNeedUpdate,r.uvsNeedUpdate=n.uvsNeedUpdate,r.groupsNeedUpdate=n.groupsNeedUpdate,n.verticesNeedUpdate=!1,n.normalsNeedUpdate=!1,n.colorsNeedUpdate=!1,n.uvsNeedUpdate=!1,n.groupsNeedUpdate=!1,n=r}return!0===n.verticesNeedUpdate&&(void 0!==(e=this.attributes.position)&&(e.copyVector3sArray(n.vertices),e.needsUpdate=!0),n.verticesNeedUpdate=!1),!0===n.normalsNeedUpdate&&(void 0!==(e=this.attributes.normal)&&(e.copyVector3sArray(n.normals),e.needsUpdate=!0),n.normalsNeedUpdate=!1),!0===n.colorsNeedUpdate&&(void 0!==(e=this.attributes.color)&&(e.copyColorsArray(n.colors),e.needsUpdate=!0),n.colorsNeedUpdate=!1),n.uvsNeedUpdate&&(void 0!==(e=this.attributes.uv)&&(e.copyVector2sArray(n.uvs),e.needsUpdate=!0),n.uvsNeedUpdate=!1),n.lineDistancesNeedUpdate&&(void 0!==(e=this.attributes.lineDistance)&&(e.copyArray(n.lineDistances),e.needsUpdate=!0),n.lineDistancesNeedUpdate=!1),n.groupsNeedUpdate&&(n.computeGroups(t.geometry),this.groups=n.groups,n.groupsNeedUpdate=!1),this},fromGeometry:function(t){return t.__directGeometry=(new qe).fromGeometry(t),this.fromDirectGeometry(t.__directGeometry)},fromDirectGeometry:function(t){var e=new Float32Array(3*t.vertices.length);if(this.setAttribute("position",new Fe(e,3).copyVector3sArray(t.vertices)),0<t.normals.length){var n=new Float32Array(3*t.normals.length);this.setAttribute("normal",new Fe(n,3).copyVector3sArray(t.normals))}if(0<t.colors.length){var r=new Float32Array(3*t.colors.length);this.setAttribute("color",new Fe(r,3).copyColorsArray(t.colors))}if(0<t.uvs.length){var i=new Float32Array(2*t.uvs.length);this.setAttribute("uv",new Fe(i,2).copyVector2sArray(t.uvs))}if(0<t.uvs2.length){var a=new Float32Array(2*t.uvs2.length);this.setAttribute("uv2",new Fe(a,2).copyVector2sArray(t.uvs2))}for(var o in this.groups=t.groups,t.morphTargets){for(var s=[],l=t.morphTargets[o],u=0,c=l.length;u<c;u++){var h=l[u],d=new We(3*h.data.length,3);d.name=h.name,s.push(d.copyVector3sArray(h.data))}this.morphAttributes[o]=s}if(0<t.skinIndices.length){var p=new We(4*t.skinIndices.length,4);this.setAttribute("skinIndex",p.copyVector4sArray(t.skinIndices))}if(0<t.skinWeights.length){var f=new We(4*t.skinWeights.length,4);this.setAttribute("skinWeight",f.copyVector4sArray(t.skinWeights))}return null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),this},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new Kt);var t=this.attributes.position,e=this.morphAttributes.position;if(void 0!==t){if(this.boundingBox.setFromBufferAttribute(t),e)for(var n=0,r=e.length;n<r;n++){var i=e[n];Qe.setFromBufferAttribute(i),this.morphTargetsRelative?(en.addVectors(this.boundingBox.min,Qe.min),this.boundingBox.expandByPoint(en),en.addVectors(this.boundingBox.max,Qe.max),this.boundingBox.expandByPoint(en)):(this.boundingBox.expandByPoint(Qe.min),this.boundingBox.expandByPoint(Qe.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new ee);var t=this.attributes.position,e=this.morphAttributes.position;if(t){var n=this.boundingSphere.center;if(Qe.setFromBufferAttribute(t),e)for(var r=0,i=e.length;r<i;r++){var a=e[r];tn.setFromBufferAttribute(a),this.morphTargetsRelative?(en.addVectors(Qe.min,tn.min),Qe.expandByPoint(en),en.addVectors(Qe.max,tn.max),Qe.expandByPoint(en)):(Qe.expandByPoint(tn.min),Qe.expandByPoint(tn.max))}Qe.getCenter(n);var o=0;for(r=0,i=t.count;r<i;r++)en.fromBufferAttribute(t,r),o=Math.max(o,n.distanceToSquared(en));if(e)for(r=0,i=e.length;r<i;r++){a=e[r];for(var s=this.morphTargetsRelative,l=0,u=a.count;l<u;l++)en.fromBufferAttribute(a,l),s&&(Ke.fromBufferAttribute(t,l),en.add(Ke)),o=Math.max(o,n.distanceToSquared(en))}this.boundingSphere.radius=Math.sqrt(o),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}},computeFaceNormals:function(){},computeVertexNormals:function(){var t=this.index,e=this.attributes;if(e.position){var n=e.position.array;if(void 0===e.normal)this.setAttribute("normal",new Fe(new Float32Array(n.length),3));else for(var r=e.normal.array,i=0,a=r.length;i<a;i++)r[i]=0;var o,s,l,u=e.normal.array,c=new ht,h=new ht,d=new ht,p=new ht,f=new ht;if(t){var m=t.array;for(i=0,a=t.count;i<a;i+=3)o=3*m[i+0],s=3*m[i+1],l=3*m[i+2],c.fromArray(n,o),h.fromArray(n,s),d.fromArray(n,l),p.subVectors(d,h),f.subVectors(c,h),p.cross(f),u[o]+=p.x,u[1+o]+=p.y,u[2+o]+=p.z,u[s]+=p.x,u[1+s]+=p.y,u[2+s]+=p.z,u[l]+=p.x,u[1+l]+=p.y,u[2+l]+=p.z}else for(i=0,a=n.length;i<a;i+=9)c.fromArray(n,i),h.fromArray(n,i+3),d.fromArray(n,i+6),p.subVectors(d,h),f.subVectors(c,h),p.cross(f),u[i]=p.x,u[i+1]=p.y,u[i+2]=p.z,u[i+3]=p.x,u[i+4]=p.y,u[i+5]=p.z,u[i+6]=p.x,u[i+7]=p.y,u[i+8]=p.z;this.normalizeNormals(),e.normal.needsUpdate=!0}},merge:function(t,e){if(t&&t.isBufferGeometry){void 0===e&&(e=0,console.warn("THREE.BufferGeometry.merge(): Overwriting original geometry, starting at offset=0. Use BufferGeometryUtils.mergeBufferGeometries() for lossless merge."));var n=this.attributes;for(var r in n)if(void 0!==t.attributes[r])for(var i=n[r].array,a=t.attributes[r],o=a.array,s=a.itemSize*e,l=Math.min(o.length,i.length-s),u=0,c=s;u<l;u++,c++)i[c]=o[u];return this}console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",t)},normalizeNormals:function(){for(var t=this.attributes.normal,e=0,n=t.count;e<n;e++)en.x=t.getX(e),en.y=t.getY(e),en.z=t.getZ(e),en.normalize(),t.setXYZ(e,en.x,en.y,en.z)},toNonIndexed:function(){function t(t,e){for(var n=t.array,r=t.itemSize,i=new n.constructor(e.length*r),a=0,o=0,s=0,l=e.length;s<l;s++){a=e[s]*r;for(var u=0;u<r;u++)i[o++]=n[a++]}return new Fe(i,r)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),this;var e=new nn,n=this.index.array,r=this.attributes;for(var i in r){var a=t(r[i],n);e.setAttribute(i,a)}var o=this.morphAttributes;for(i in o){for(var s=[],l=o[i],u=0,c=l.length;u<c;u++)a=t(l[u],n),s.push(a);e.morphAttributes[i]=s}e.morphTargetsRelative=this.morphTargetsRelative;for(var h=this.groups,d=(u=0,h.length);u<d;u++){var p=h[u];e.addGroup(p.start,p.count,p.materialIndex)}return e},toJSON:function(){var t={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,""!==this.name&&(t.name=this.name),0<Object.keys(this.userData).length&&(t.userData=this.userData),void 0!==this.parameters){var e=this.parameters;for(var n in e)void 0!==e[n]&&(t[n]=e[n]);return t}t.data={attributes:{}};var r=this.index;null!==r&&(t.data.index={type:r.array.constructor.name,array:Array.prototype.slice.call(r.array)});var i=this.attributes;for(var n in i){var a=(d=i[n]).toJSON();""!==d.name&&(a.name=d.name),t.data.attributes[n]=a}var o={},s=!1;for(var n in this.morphAttributes){for(var l=this.morphAttributes[n],u=[],c=0,h=l.length;c<h;c++){var d;a=(d=l[c]).toJSON(),""!==d.name&&(a.name=d.name),u.push(a)}0<u.length&&(o[n]=u,s=!0)}s&&(t.data.morphAttributes=o,t.data.morphTargetsRelative=this.morphTargetsRelative);var p=this.groups;0<p.length&&(t.data.groups=JSON.parse(JSON.stringify(p)));var f=this.boundingSphere;return null!==f&&(t.data.boundingSphere={center:f.center.toArray(),radius:f.radius}),t},clone:function(){return(new nn).copy(this)},copy:function(t){var e,n,r;this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.name=t.name;var i=t.index;null!==i&&this.setIndex(i.clone());var a=t.attributes;for(e in a){var o=a[e];this.setAttribute(e,o.clone())}var s=t.morphAttributes;for(e in s){var l=[],u=s[e];for(n=0,r=u.length;n<r;n++)l.push(u[n].clone());this.morphAttributes[e]=l}this.morphTargetsRelative=t.morphTargetsRelative;var c=t.groups;for(n=0,r=c.length;n<r;n++){var h=c[n];this.addGroup(h.start,h.count,h.materialIndex)}var d=t.boundingBox;null!==d&&(this.boundingBox=d.clone());var p=t.boundingSphere;return null!==p&&(this.boundingSphere=p.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this.userData=t.userData,this},dispose:function(){this.dispatchEvent({type:"dispose"})}});var rn=new xt,an=new ue,on=new ee,sn=new ht,ln=new ht,un=new ht,cn=new ht,hn=new ht,dn=new ht,pn=new ht,fn=new ht,mn=new ht,gn=new tt,vn=new tt,yn=new tt,xn=new ht,bn=new ht;function wn(t,e){Ft.call(this),this.type="Mesh",this.geometry=void 0!==t?t:new nn,this.material=void 0!==e?e:new ke,this.updateMorphTargets()}function _n(t,e,n,r,i,a,o,s){if(null===(1===e.side?r.intersectTriangle(o,a,i,!0,s):r.intersectTriangle(i,a,o,2!==e.side,s)))return null;bn.copy(s),bn.applyMatrix4(t.matrixWorld);var l=n.ray.origin.distanceTo(bn);return l<n.near||l>n.far?null:{distance:l,point:bn.clone(),object:t}}function Mn(t,e,n,r,i,a,o,s,l,u,c,h){sn.fromBufferAttribute(i,u),ln.fromBufferAttribute(i,c),un.fromBufferAttribute(i,h);var d=t.morphTargetInfluences;if(e.morphTargets&&a&&d){pn.set(0,0,0),fn.set(0,0,0),mn.set(0,0,0);for(var p=0,f=a.length;p<f;p++){var m=d[p],g=a[p];0!==m&&(cn.fromBufferAttribute(g,u),hn.fromBufferAttribute(g,c),dn.fromBufferAttribute(g,h),o?(pn.addScaledVector(cn,m),fn.addScaledVector(hn,m),mn.addScaledVector(dn,m)):(pn.addScaledVector(cn.sub(sn),m),fn.addScaledVector(hn.sub(ln),m),mn.addScaledVector(dn.sub(un),m)))}sn.add(pn),ln.add(fn),un.add(mn)}var v=_n(t,e,n,r,sn,ln,un,xn);if(v){s&&(gn.fromBufferAttribute(s,u),vn.fromBufferAttribute(s,c),yn.fromBufferAttribute(s,h),v.uv=Se.getUV(xn,sn,ln,un,gn,vn,yn,new tt)),l&&(gn.fromBufferAttribute(l,u),vn.fromBufferAttribute(l,c),yn.fromBufferAttribute(l,h),v.uv2=Se.getUV(xn,sn,ln,un,gn,vn,yn,new tt));var y=new Pe(u,c,h);Se.getNormal(sn,ln,un,y.normal),v.face=y}return v}wn.prototype=Object.assign(Object.create(Ft.prototype),{constructor:wn,isMesh:!0,copy:function(t){return Ft.prototype.copy.call(this,t),void 0!==t.morphTargetInfluences&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),void 0!==t.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this},updateMorphTargets:function(){var t,e,n,r=this.geometry;if(r.isBufferGeometry){var i=r.morphAttributes,a=Object.keys(i);if(0<a.length){var o=i[a[0]];if(void 0!==o)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},t=0,e=o.length;t<e;t++)n=o[t].name||String(t),this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=t}}else{var s=r.morphTargets;void 0!==s&&0<s.length&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}},raycast:function(t,e){var n,r=this.geometry,i=this.material,a=this.matrixWorld;if(void 0!==i&&(null===r.boundingSphere&&r.computeBoundingSphere(),on.copy(r.boundingSphere),on.applyMatrix4(a),!1!==t.ray.intersectsSphere(on)&&(rn.getInverse(a),an.copy(t.ray).applyMatrix4(rn),null===r.boundingBox||!1!==an.intersectsBox(r.boundingBox))))if(r.isBufferGeometry){var o,s,l,u,c,h,d,p,f,m=r.index,g=r.attributes.position,v=r.morphAttributes.position,y=r.morphTargetsRelative,x=r.attributes.uv,b=r.attributes.uv2,w=r.groups,_=r.drawRange;if(null!==m)if(Array.isArray(i))for(u=0,h=w.length;u<h;u++)for(f=i[(p=w[u]).materialIndex],c=Math.max(p.start,_.start),d=Math.min(p.start+p.count,_.start+_.count);c<d;c+=3)o=m.getX(c),s=m.getX(c+1),l=m.getX(c+2),(n=Mn(this,f,t,an,g,v,y,x,b,o,s,l))&&(n.faceIndex=Math.floor(c/3),n.face.materialIndex=p.materialIndex,e.push(n));else for(u=Math.max(0,_.start),h=Math.min(m.count,_.start+_.count);u<h;u+=3)o=m.getX(u),s=m.getX(u+1),l=m.getX(u+2),(n=Mn(this,i,t,an,g,v,y,x,b,o,s,l))&&(n.faceIndex=Math.floor(u/3),e.push(n));else if(void 0!==g)if(Array.isArray(i))for(u=0,h=w.length;u<h;u++)for(f=i[(p=w[u]).materialIndex],c=Math.max(p.start,_.start),d=Math.min(p.start+p.count,_.start+_.count);c<d;c+=3)(n=Mn(this,f,t,an,g,v,y,x,b,o=c,s=c+1,l=c+2))&&(n.faceIndex=Math.floor(c/3),n.face.materialIndex=p.materialIndex,e.push(n));else for(u=Math.max(0,_.start),h=Math.min(g.count,_.start+_.count);u<h;u+=3)(n=Mn(this,i,t,an,g,v,y,x,b,o=u,s=u+1,l=u+2))&&(n.faceIndex=Math.floor(u/3),e.push(n))}else if(r.isGeometry){var M,S,T,C,E=Array.isArray(i),D=r.vertices,A=r.faces,O=r.faceVertexUvs[0];0<O.length&&(C=O);for(var L=0,P=A.length;L<P;L++){var R=A[L],I=E?i[R.materialIndex]:i;if(void 0!==I&&(M=D[R.a],S=D[R.b],T=D[R.c],n=_n(this,I,t,an,M,S,T,xn))){if(C&&C[L]){var k=C[L];gn.copy(k[0]),vn.copy(k[1]),yn.copy(k[2]),n.uv=Se.getUV(xn,M,S,T,gn,vn,yn,new tt)}n.face=R,n.faceIndex=L,e.push(n)}}}},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});var Sn=0,Tn=new xt,Cn=new Ft,En=new ht;function Dn(){Object.defineProperty(this,"id",{value:Sn+=2}),this.uuid=Q.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.elementsNeedUpdate=!1,this.verticesNeedUpdate=!1,this.uvsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.lineDistancesNeedUpdate=!1,this.groupsNeedUpdate=!1}Dn.prototype=Object.assign(Object.create(Y.prototype),{constructor:Dn,isGeometry:!0,applyMatrix4:function(t){for(var e=(new et).getNormalMatrix(t),n=0,r=this.vertices.length;n<r;n++)this.vertices[n].applyMatrix4(t);for(n=0,r=this.faces.length;n<r;n++){var i=this.faces[n];i.normal.applyMatrix3(e).normalize();for(var a=0,o=i.vertexNormals.length;a<o;a++)i.vertexNormals[a].applyMatrix3(e).normalize()}return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this.verticesNeedUpdate=!0,this.normalsNeedUpdate=!0,this},rotateX:function(t){return Tn.makeRotationX(t),this.applyMatrix4(Tn),this},rotateY:function(t){return Tn.makeRotationY(t),this.applyMatrix4(Tn),this},rotateZ:function(t){return Tn.makeRotationZ(t),this.applyMatrix4(Tn),this},translate:function(t,e,n){return Tn.makeTranslation(t,e,n),this.applyMatrix4(Tn),this},scale:function(t,e,n){return Tn.makeScale(t,e,n),this.applyMatrix4(Tn),this},lookAt:function(t){return Cn.lookAt(t),Cn.updateMatrix(),this.applyMatrix4(Cn.matrix),this},fromBufferGeometry:function(t){var e=this,n=null!==t.index?t.index.array:void 0,r=t.attributes;if(void 0===r.position)return console.error("THREE.Geometry.fromBufferGeometry(): Position attribute required for conversion."),this;var i=r.position.array,a=void 0!==r.normal?r.normal.array:void 0,o=void 0!==r.color?r.color.array:void 0,s=void 0!==r.uv?r.uv.array:void 0,l=void 0!==r.uv2?r.uv2.array:void 0;void 0!==l&&(this.faceVertexUvs[1]=[]);for(var u=0;u<i.length;u+=3)e.vertices.push((new ht).fromArray(i,u)),void 0!==o&&e.colors.push((new De).fromArray(o,u));function c(t,n,r,i){var u=void 0===o?[]:[e.colors[t].clone(),e.colors[n].clone(),e.colors[r].clone()],c=new Pe(t,n,r,void 0===a?[]:[(new ht).fromArray(a,3*t),(new ht).fromArray(a,3*n),(new ht).fromArray(a,3*r)],u,i);e.faces.push(c),void 0!==s&&e.faceVertexUvs[0].push([(new tt).fromArray(s,2*t),(new tt).fromArray(s,2*n),(new tt).fromArray(s,2*r)]),void 0!==l&&e.faceVertexUvs[1].push([(new tt).fromArray(l,2*t),(new tt).fromArray(l,2*n),(new tt).fromArray(l,2*r)])}var h=t.groups;if(0<h.length)for(u=0;u<h.length;u++)for(var d=h[u],p=d.start,f=p,m=p+d.count;f<m;f+=3)void 0!==n?c(n[f],n[f+1],n[f+2],d.materialIndex):c(f,f+1,f+2,d.materialIndex);else if(void 0!==n)for(u=0;u<n.length;u+=3)c(n[u],n[u+1],n[u+2]);else for(u=0;u<i.length/3;u+=3)c(u,u+1,u+2);return this.computeFaceNormals(),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(En).negate(),this.translate(En.x,En.y,En.z),this},normalize:function(){this.computeBoundingSphere();var t=this.boundingSphere.center,e=this.boundingSphere.radius,n=0===e?1:1/e,r=new xt;return r.set(n,0,0,-n*t.x,0,n,0,-n*t.y,0,0,n,-n*t.z,0,0,0,1),this.applyMatrix4(r),this},computeFaceNormals:function(){for(var t=new ht,e=new ht,n=0,r=this.faces.length;n<r;n++){var i=this.faces[n],a=this.vertices[i.a],o=this.vertices[i.b],s=this.vertices[i.c];t.subVectors(s,o),e.subVectors(a,o),t.cross(e),t.normalize(),i.normal.copy(t)}},computeVertexNormals:function(t){var e,n,r,i,a,o;for(void 0===t&&(t=!0),o=new Array(this.vertices.length),e=0,n=this.vertices.length;e<n;e++)o[e]=new ht;if(t){var s,l,u,c=new ht,h=new ht;for(r=0,i=this.faces.length;r<i;r++)a=this.faces[r],s=this.vertices[a.a],l=this.vertices[a.b],u=this.vertices[a.c],c.subVectors(u,l),h.subVectors(s,l),c.cross(h),o[a.a].add(c),o[a.b].add(c),o[a.c].add(c)}else for(this.computeFaceNormals(),r=0,i=this.faces.length;r<i;r++)o[(a=this.faces[r]).a].add(a.normal),o[a.b].add(a.normal),o[a.c].add(a.normal);for(e=0,n=this.vertices.length;e<n;e++)o[e].normalize();for(r=0,i=this.faces.length;r<i;r++){var d=(a=this.faces[r]).vertexNormals;3===d.length?(d[0].copy(o[a.a]),d[1].copy(o[a.b]),d[2].copy(o[a.c])):(d[0]=o[a.a].clone(),d[1]=o[a.b].clone(),d[2]=o[a.c].clone())}0<this.faces.length&&(this.normalsNeedUpdate=!0)},computeFlatVertexNormals:function(){var t,e,n;for(this.computeFaceNormals(),t=0,e=this.faces.length;t<e;t++){var r=(n=this.faces[t]).vertexNormals;3===r.length?(r[0].copy(n.normal),r[1].copy(n.normal),r[2].copy(n.normal)):(r[0]=n.normal.clone(),r[1]=n.normal.clone(),r[2]=n.normal.clone())}0<this.faces.length&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){var t,e,n,r,i;for(n=0,r=this.faces.length;n<r;n++)for((i=this.faces[n]).__originalFaceNormal?i.__originalFaceNormal.copy(i.normal):i.__originalFaceNormal=i.normal.clone(),i.__originalVertexNormals||(i.__originalVertexNormals=[]),t=0,e=i.vertexNormals.length;t<e;t++)i.__originalVertexNormals[t]?i.__originalVertexNormals[t].copy(i.vertexNormals[t]):i.__originalVertexNormals[t]=i.vertexNormals[t].clone();var a=new Dn;for(a.faces=this.faces,t=0,e=this.morphTargets.length;t<e;t++){if(!this.morphNormals[t]){this.morphNormals[t]={},this.morphNormals[t].faceNormals=[],this.morphNormals[t].vertexNormals=[];var o=this.morphNormals[t].faceNormals,s=this.morphNormals[t].vertexNormals;for(n=0,r=this.faces.length;n<r;n++)l=new ht,u={a:new ht,b:new ht,c:new ht},o.push(l),s.push(u)}var l,u,c=this.morphNormals[t];for(a.vertices=this.morphTargets[t].vertices,a.computeFaceNormals(),a.computeVertexNormals(),n=0,r=this.faces.length;n<r;n++)i=this.faces[n],l=c.faceNormals[n],u=c.vertexNormals[n],l.copy(i.normal),u.a.copy(i.vertexNormals[0]),u.b.copy(i.vertexNormals[1]),u.c.copy(i.vertexNormals[2])}for(n=0,r=this.faces.length;n<r;n++)(i=this.faces[n]).normal=i.__originalFaceNormal,i.vertexNormals=i.__originalVertexNormals},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new Kt),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new ee),this.boundingSphere.setFromPoints(this.vertices)},merge:function(t,e,n){if(t&&t.isGeometry){var r,i=this.vertices.length,a=this.vertices,o=t.vertices,s=this.faces,l=t.faces,u=this.colors,c=t.colors;void 0===n&&(n=0),void 0!==e&&(r=(new et).getNormalMatrix(e));for(var h=0,d=o.length;h<d;h++){var p=o[h].clone();void 0!==e&&p.applyMatrix4(e),a.push(p)}for(h=0,d=c.length;h<d;h++)u.push(c[h].clone());for(h=0,d=l.length;h<d;h++){var f,m,g,v=l[h],y=v.vertexNormals,x=v.vertexColors;(f=new Pe(v.a+i,v.b+i,v.c+i)).normal.copy(v.normal),void 0!==r&&f.normal.applyMatrix3(r).normalize();for(var b=0,w=y.length;b<w;b++)m=y[b].clone(),void 0!==r&&m.applyMatrix3(r).normalize(),f.vertexNormals.push(m);for(f.color.copy(v.color),b=0,w=x.length;b<w;b++)g=x[b],f.vertexColors.push(g.clone());f.materialIndex=v.materialIndex+n,s.push(f)}for(h=0,d=t.faceVertexUvs.length;h<d;h++){var _=t.faceVertexUvs[h];for(void 0===this.faceVertexUvs[h]&&(this.faceVertexUvs[h]=[]),b=0,w=_.length;b<w;b++){for(var M=_[b],S=[],T=0,C=M.length;T<C;T++)S.push(M[T].clone());this.faceVertexUvs[h].push(S)}}}else console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",t)},mergeMesh:function(t){t&&t.isMesh?(t.matrixAutoUpdate&&t.updateMatrix(),this.merge(t.geometry,t.matrix)):console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",t)},mergeVertices:function(){var t,e,n,r,i,a,o,s,l={},u=[],c=[],h=Math.pow(10,4);for(n=0,r=this.vertices.length;n<r;n++)t=this.vertices[n],void 0===l[e=Math.round(t.x*h)+"_"+Math.round(t.y*h)+"_"+Math.round(t.z*h)]?(l[e]=n,u.push(this.vertices[n]),c[n]=u.length-1):c[n]=c[l[e]];var d=[];for(n=0,r=this.faces.length;n<r;n++){(i=this.faces[n]).a=c[i.a],i.b=c[i.b],i.c=c[i.c],a=[i.a,i.b,i.c];for(var p=0;p<3;p++)if(a[p]===a[(p+1)%3]){d.push(n);break}}for(n=d.length-1;0<=n;n--){var f=d[n];for(this.faces.splice(f,1),o=0,s=this.faceVertexUvs.length;o<s;o++)this.faceVertexUvs[o].splice(f,1)}var m=this.vertices.length-u.length;return this.vertices=u,m},setFromPoints:function(t){this.vertices=[];for(var e=0,n=t.length;e<n;e++){var r=t[e];this.vertices.push(new ht(r.x,r.y,r.z||0))}return this},sortFacesByMaterialIndex:function(){for(var t=this.faces,e=t.length,n=0;n<e;n++)t[n]._id=n;t.sort(function(t,e){return t.materialIndex-e.materialIndex});var r,i,a=this.faceVertexUvs[0],o=this.faceVertexUvs[1];for(a&&a.length===e&&(r=[]),o&&o.length===e&&(i=[]),n=0;n<e;n++){var s=t[n]._id;r&&r.push(a[s]),i&&i.push(o[s])}r&&(this.faceVertexUvs[0]=r),i&&(this.faceVertexUvs[1]=i)},toJSON:function(){var t={metadata:{version:4.5,type:"Geometry",generator:"Geometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,""!==this.name&&(t.name=this.name),void 0!==this.parameters){var e=this.parameters;for(var n in e)void 0!==e[n]&&(t[n]=e[n]);return t}for(var r=[],i=0;i<this.vertices.length;i++){var a=this.vertices[i];r.push(a.x,a.y,a.z)}var o=[],s=[],l={},u=[],c={},h=[],d={};for(i=0;i<this.faces.length;i++){var p=this.faces[i],f=void 0!==this.faceVertexUvs[0][i],m=0<p.normal.length(),g=0<p.vertexNormals.length,v=1!==p.color.r||1!==p.color.g||1!==p.color.b,y=0<p.vertexColors.length,x=0;if(x=M(x=M(x=M(x=M(x=M(x=M(x=M(x=M(x,0,0),1,!0),2,!1),3,f),4,m),5,g),6,v),7,y),o.push(x),o.push(p.a,p.b,p.c),o.push(p.materialIndex),f){var b=this.faceVertexUvs[0][i];o.push(C(b[0]),C(b[1]),C(b[2]))}if(m&&o.push(S(p.normal)),g){var w=p.vertexNormals;o.push(S(w[0]),S(w[1]),S(w[2]))}if(v&&o.push(T(p.color)),y){var _=p.vertexColors;o.push(T(_[0]),T(_[1]),T(_[2]))}}function M(t,e,n){return n?t|1<<e:t&~(1<<e)}function S(t){var e=t.x.toString()+t.y.toString()+t.z.toString();return void 0!==l[e]||(l[e]=s.length/3,s.push(t.x,t.y,t.z)),l[e]}function T(t){var e=t.r.toString()+t.g.toString()+t.b.toString();return void 0!==c[e]||(c[e]=u.length,u.push(t.getHex())),c[e]}function C(t){var e=t.x.toString()+t.y.toString();return void 0!==d[e]||(d[e]=h.length/2,h.push(t.x,t.y)),d[e]}return t.data={},t.data.vertices=r,t.data.normals=s,0<u.length&&(t.data.colors=u),0<h.length&&(t.data.uvs=[h]),t.data.faces=o,t},clone:function(){return(new Dn).copy(this)},copy:function(t){var e,n,r,i,a,o;this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.name=t.name;var s=t.vertices;for(e=0,n=s.length;e<n;e++)this.vertices.push(s[e].clone());var l=t.colors;for(e=0,n=l.length;e<n;e++)this.colors.push(l[e].clone());var u=t.faces;for(e=0,n=u.length;e<n;e++)this.faces.push(u[e].clone());for(e=0,n=t.faceVertexUvs.length;e<n;e++){var c=t.faceVertexUvs[e];for(void 0===this.faceVertexUvs[e]&&(this.faceVertexUvs[e]=[]),r=0,i=c.length;r<i;r++){var h=c[r],d=[];for(a=0,o=h.length;a<o;a++){var p=h[a];d.push(p.clone())}this.faceVertexUvs[e].push(d)}}var f=t.morphTargets;for(e=0,n=f.length;e<n;e++){var m={};if(m.name=f[e].name,void 0!==f[e].vertices)for(m.vertices=[],r=0,i=f[e].vertices.length;r<i;r++)m.vertices.push(f[e].vertices[r].clone());if(void 0!==f[e].normals)for(m.normals=[],r=0,i=f[e].normals.length;r<i;r++)m.normals.push(f[e].normals[r].clone());this.morphTargets.push(m)}var g=t.morphNormals;for(e=0,n=g.length;e<n;e++){var v={};if(void 0!==g[e].vertexNormals)for(v.vertexNormals=[],r=0,i=g[e].vertexNormals.length;r<i;r++){var y=g[e].vertexNormals[r],x={};x.a=y.a.clone(),x.b=y.b.clone(),x.c=y.c.clone(),v.vertexNormals.push(x)}if(void 0!==g[e].faceNormals)for(v.faceNormals=[],r=0,i=g[e].faceNormals.length;r<i;r++)v.faceNormals.push(g[e].faceNormals[r].clone());this.morphNormals.push(v)}var b=t.skinWeights;for(e=0,n=b.length;e<n;e++)this.skinWeights.push(b[e].clone());var w=t.skinIndices;for(e=0,n=w.length;e<n;e++)this.skinIndices.push(w[e].clone());var _=t.lineDistances;for(e=0,n=_.length;e<n;e++)this.lineDistances.push(_[e]);var M=t.boundingBox;null!==M&&(this.boundingBox=M.clone());var S=t.boundingSphere;return null!==S&&(this.boundingSphere=S.clone()),this.elementsNeedUpdate=t.elementsNeedUpdate,this.verticesNeedUpdate=t.verticesNeedUpdate,this.uvsNeedUpdate=t.uvsNeedUpdate,this.normalsNeedUpdate=t.normalsNeedUpdate,this.colorsNeedUpdate=t.colorsNeedUpdate,this.lineDistancesNeedUpdate=t.lineDistancesNeedUpdate,this.groupsNeedUpdate=t.groupsNeedUpdate,this},dispose:function(){this.dispatchEvent({type:"dispose"})}});var An=function(t){function e(e,n,r,i,a,o){t.call(this),this.type="BoxGeometry",this.parameters={width:e,height:n,depth:r,widthSegments:i,heightSegments:a,depthSegments:o},this.fromBufferGeometry(new On(e,n,r,i,a,o)),this.mergeVertices()}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e}(Dn),On=function(t){function e(e,n,r,i,a,o){t.call(this),this.type="BoxBufferGeometry",this.parameters={width:e,height:n,depth:r,widthSegments:i,heightSegments:a,depthSegments:o};var s=this;e=e||1,n=n||1,r=r||1,i=Math.floor(i)||1,a=Math.floor(a)||1;var l=[],u=[],c=[],h=[],d=0,p=0;function f(t,e,n,r,i,a,o,f,m,g,v){var y,x,b=a/m,w=o/g,_=a/2,M=o/2,S=f/2,T=m+1,C=g+1,E=0,D=0,A=new ht;for(x=0;x<C;x++){var O=x*w-M;for(y=0;y<T;y++){var L=y*b-_;A[t]=L*r,A[e]=O*i,A[n]=S,u.push(A.x,A.y,A.z),A[t]=0,A[e]=0,A[n]=0<f?1:-1,c.push(A.x,A.y,A.z),h.push(y/m),h.push(1-x/g),E+=1}}for(x=0;x<g;x++)for(y=0;y<m;y++){var P=d+y+T*x,R=d+y+T*(x+1),I=d+(y+1)+T*(x+1),k=d+(y+1)+T*x;l.push(P,R,k),l.push(R,I,k),D+=6}s.addGroup(p,D,v),p+=D,d+=E}f("z","y","x",-1,-1,r,n,e,o=Math.floor(o)||1,a,0),f("z","y","x",1,-1,r,n,-e,o,a,1),f("x","z","y",1,1,e,r,n,i,o,2),f("x","z","y",1,-1,e,r,-n,i,o,3),f("x","y","z",1,-1,e,n,r,i,a,4),f("x","y","z",-1,-1,e,n,-r,i,a,5),this.setIndex(l),this.setAttribute("position",new We(u,3)),this.setAttribute("normal",new We(c,3)),this.setAttribute("uv",new We(h,2))}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e}(nn);function Ln(t){var e={};for(var n in t)for(var r in e[n]={},t[n]){var i=t[n][r];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture)?e[n][r]=i.clone():Array.isArray(i)?e[n][r]=i.slice():e[n][r]=i}return e}function Pn(t){for(var e={},n=0;n<t.length;n++){var r=Ln(t[n]);for(var i in r)e[i]=r[i]}return e}var Rn={clone:Ln,merge:Pn};function In(t){Ie.call(this),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,void 0!==t&&(void 0!==t.attributes&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(t))}function kn(){Ft.call(this),this.type="Camera",this.matrixWorldInverse=new xt,this.projectionMatrix=new xt,this.projectionMatrixInverse=new xt}function Bn(t,e,n,r){kn.call(this),this.type="PerspectiveCamera",this.fov=void 0!==t?t:50,this.zoom=1,this.near=void 0!==n?n:.1,this.far=void 0!==r?r:2e3,this.focus=10,this.aspect=void 0!==e?e:1,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}function Fn(t,e,n,r){Ft.call(this),this.type="CubeCamera";var i=new Bn(90,1,t,e);i.up.set(0,-1,0),i.lookAt(new ht(1,0,0)),this.add(i);var a=new Bn(90,1,t,e);a.up.set(0,-1,0),a.lookAt(new ht(-1,0,0)),this.add(a);var o=new Bn(90,1,t,e);o.up.set(0,0,1),o.lookAt(new ht(0,1,0)),this.add(o);var s=new Bn(90,1,t,e);s.up.set(0,0,-1),s.lookAt(new ht(0,-1,0)),this.add(s);var l=new Bn(90,1,t,e);l.up.set(0,-1,0),l.lookAt(new ht(0,0,1)),this.add(l);var u=new Bn(90,1,t,e);u.up.set(0,-1,0),u.lookAt(new ht(0,0,-1)),this.add(u),r=r||{format:_,magFilter:p,minFilter:p},this.renderTarget=new Nn(n,r),this.renderTarget.texture.name="CubeCamera",this.update=function(t,e){null===this.parent&&this.updateMatrixWorld();var n=t.getRenderTarget(),r=this.renderTarget,c=r.texture.generateMipmaps;r.texture.generateMipmaps=!1,t.setRenderTarget(r,0),t.render(e,i),t.setRenderTarget(r,1),t.render(e,a),t.setRenderTarget(r,2),t.render(e,o),t.setRenderTarget(r,3),t.render(e,s),t.setRenderTarget(r,4),t.render(e,l),r.texture.generateMipmaps=c,t.setRenderTarget(r,5),t.render(e,u),t.setRenderTarget(n)},this.clear=function(t,e,n,r){for(var i=t.getRenderTarget(),a=this.renderTarget,o=0;o<6;o++)t.setRenderTarget(a,o),t.clear(e,n,r);t.setRenderTarget(i)}}function Nn(t,e,n){Number.isInteger(e)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),e=n),ot.call(this,t,t,e)}function jn(t,e,n,r,i,a,o,s,l,u,h,d){it.call(this,null,a,o,s,l,u,r,i,h,d),this.image={data:t||null,width:e||1,height:n||1},this.magFilter=void 0!==l?l:c,this.minFilter=void 0!==u?u:c,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}((In.prototype=Object.create(Ie.prototype)).constructor=In).prototype.isShaderMaterial=!0,In.prototype.copy=function(t){return Ie.prototype.copy.call(this,t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=Ln(t.uniforms),this.defines=Object.assign({},t.defines),this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.lights=t.lights,this.clipping=t.clipping,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this.extensions=t.extensions,this},In.prototype.toJSON=function(t){var e=Ie.prototype.toJSON.call(this,t);for(var n in e.uniforms={},this.uniforms){var r=this.uniforms[n].value;r&&r.isTexture?e.uniforms[n]={type:"t",value:r.toJSON(t).uuid}:r&&r.isColor?e.uniforms[n]={type:"c",value:r.getHex()}:r&&r.isVector2?e.uniforms[n]={type:"v2",value:r.toArray()}:r&&r.isVector3?e.uniforms[n]={type:"v3",value:r.toArray()}:r&&r.isVector4?e.uniforms[n]={type:"v4",value:r.toArray()}:r&&r.isMatrix3?e.uniforms[n]={type:"m3",value:r.toArray()}:r&&r.isMatrix4?e.uniforms[n]={type:"m4",value:r.toArray()}:e.uniforms[n]={value:r}}0<Object.keys(this.defines).length&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader;var i={};for(var a in this.extensions)!0===this.extensions[a]&&(i[a]=!0);return 0<Object.keys(i).length&&(e.extensions=i),e},kn.prototype=Object.assign(Object.create(Ft.prototype),{constructor:kn,isCamera:!0,copy:function(t,e){return Ft.prototype.copy.call(this,t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this},getWorldDirection:function(t){void 0===t&&(console.warn("THREE.Camera: .getWorldDirection() target is now required"),t=new ht),this.updateMatrixWorld(!0);var e=this.matrixWorld.elements;return t.set(-e[8],-e[9],-e[10]).normalize()},updateMatrixWorld:function(t){Ft.prototype.updateMatrixWorld.call(this,t),this.matrixWorldInverse.getInverse(this.matrixWorld)},updateWorldMatrix:function(t,e){Ft.prototype.updateWorldMatrix.call(this,t,e),this.matrixWorldInverse.getInverse(this.matrixWorld)},clone:function(){return(new this.constructor).copy(this)}}),Bn.prototype=Object.assign(Object.create(kn.prototype),{constructor:Bn,isPerspectiveCamera:!0,copy:function(t,e){return kn.prototype.copy.call(this,t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=null===t.view?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this},setFocalLength:function(t){var e=.5*this.getFilmHeight()/t;this.fov=2*Q.RAD2DEG*Math.atan(e),this.updateProjectionMatrix()},getFocalLength:function(){var t=Math.tan(.5*Q.DEG2RAD*this.fov);return.5*this.getFilmHeight()/t},getEffectiveFOV:function(){return 2*Q.RAD2DEG*Math.atan(Math.tan(.5*Q.DEG2RAD*this.fov)/this.zoom)},getFilmWidth:function(){return this.filmGauge*Math.min(this.aspect,1)},getFilmHeight:function(){return this.filmGauge/Math.max(this.aspect,1)},setViewOffset:function(t,e,n,r,i,a){this.aspect=t/e,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=a,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var t=this.near,e=t*Math.tan(.5*Q.DEG2RAD*this.fov)/this.zoom,n=2*e,r=this.aspect*n,i=-.5*r,a=this.view;if(null!==this.view&&this.view.enabled){var o=a.fullWidth,s=a.fullHeight;i+=a.offsetX*r/o,e-=a.offsetY*n/s,r*=a.width/o,n*=a.height/s}var l=this.filmOffset;0!==l&&(i+=t*l/this.getFilmWidth()),this.projectionMatrix.makePerspective(i,i+r,e,e-n,t,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(t){var e=Ft.prototype.toJSON.call(this,t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,null!==this.view&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}}),(Fn.prototype=Object.create(Ft.prototype)).constructor=Fn,((Nn.prototype=Object.create(ot.prototype)).constructor=Nn).prototype.isWebGLCubeRenderTarget=!0,Nn.prototype.fromEquirectangularTexture=function(t,e){this.texture.type=e.type,this.texture.format=e.format,this.texture.encoding=e.encoding;var n=new Nt,r={uniforms:{tEquirect:{value:null}},vertexShader:["varying vec3 vWorldDirection;","vec3 transformDirection( in vec3 dir, in mat4 matrix ) {","\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );","}","void main() {","\tvWorldDirection = transformDirection( position, modelMatrix );","\t#include <begin_vertex>","\t#include <project_vertex>","}"].join("\n"),fragmentShader:["uniform sampler2D tEquirect;","varying vec3 vWorldDirection;","#define RECIPROCAL_PI 0.31830988618","#define RECIPROCAL_PI2 0.15915494","void main() {","\tvec3 direction = normalize( vWorldDirection );","\tvec2 sampleUV;","\tsampleUV.y = asin( clamp( direction.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;","\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;","\tgl_FragColor = texture2D( tEquirect, sampleUV );","}"].join("\n")},i=new In({type:"CubemapFromEquirect",uniforms:Ln(r.uniforms),vertexShader:r.vertexShader,fragmentShader:r.fragmentShader,side:1,blending:0});i.uniforms.tEquirect.value=e;var a=new wn(new On(5,5,5),i);n.add(a);var o=new Fn(1,10,1);return o.renderTarget=this,o.renderTarget.texture.name="CubeCameraTexture",o.update(t,n),a.geometry.dispose(),a.material.dispose(),this},((jn.prototype=Object.create(it.prototype)).constructor=jn).prototype.isDataTexture=!0;var zn=new ee,Vn=new ht;function Gn(t,e,n,r,i,a){this.planes=[void 0!==t?t:new pe,void 0!==e?e:new pe,void 0!==n?n:new pe,void 0!==r?r:new pe,void 0!==i?i:new pe,void 0!==a?a:new pe]}Object.assign(Gn.prototype,{set:function(t,e,n,r,i,a){var o=this.planes;return o[0].copy(t),o[1].copy(e),o[2].copy(n),o[3].copy(r),o[4].copy(i),o[5].copy(a),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){for(var e=this.planes,n=0;n<6;n++)e[n].copy(t.planes[n]);return this},setFromProjectionMatrix:function(t){var e=this.planes,n=t.elements,r=n[0],i=n[1],a=n[2],o=n[3],s=n[4],l=n[5],u=n[6],c=n[7],h=n[8],d=n[9],p=n[10],f=n[11],m=n[12],g=n[13],v=n[14],y=n[15];return e[0].setComponents(o-r,c-s,f-h,y-m).normalize(),e[1].setComponents(o+r,c+s,f+h,y+m).normalize(),e[2].setComponents(o+i,c+l,f+d,y+g).normalize(),e[3].setComponents(o-i,c-l,f-d,y-g).normalize(),e[4].setComponents(o-a,c-u,f-p,y-v).normalize(),e[5].setComponents(o+a,c+u,f+p,y+v).normalize(),this},intersectsObject:function(t){var e=t.geometry;return null===e.boundingSphere&&e.computeBoundingSphere(),zn.copy(e.boundingSphere).applyMatrix4(t.matrixWorld),this.intersectsSphere(zn)},intersectsSprite:function(t){return zn.center.set(0,0,0),zn.radius=.7071067811865476,zn.applyMatrix4(t.matrixWorld),this.intersectsSphere(zn)},intersectsSphere:function(t){for(var e=this.planes,n=t.center,r=-t.radius,i=0;i<6;i++)if(e[i].distanceToPoint(n)<r)return!1;return!0},intersectsBox:function(t){for(var e=this.planes,n=0;n<6;n++){var r=e[n];if(Vn.x=0<r.normal.x?t.max.x:t.min.x,Vn.y=0<r.normal.y?t.max.y:t.min.y,Vn.z=0<r.normal.z?t.max.z:t.min.z,r.distanceToPoint(Vn)<0)return!1}return!0},containsPoint:function(t){for(var e=this.planes,n=0;n<6;n++)if(e[n].distanceToPoint(t)<0)return!1;return!0}});var Un={common:{diffuse:{value:new De(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new et},uv2Transform:{value:new et},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new tt(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new De(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}}},points:{diffuse:{value:new De(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new et}},sprite:{diffuse:{value:new De(15658734)},opacity:{value:1},center:{value:new tt(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new et}}};function Hn(){var t=null,e=!1,n=null;function r(i,a){!1!==e&&(n(i,a),t.requestAnimationFrame(r))}return{start:function(){!0!==e&&null!==n&&(t.requestAnimationFrame(r),e=!0)},stop:function(){e=!1},setAnimationLoop:function(t){n=t},setContext:function(e){t=e}}}function Wn(t,e,n,r){Dn.call(this),this.type="PlaneGeometry",this.parameters={width:t,height:e,widthSegments:n,heightSegments:r},this.fromBufferGeometry(new Jn(t,e,n,r)),this.mergeVertices()}function Jn(t,e,n,r){nn.call(this),this.type="PlaneBufferGeometry",this.parameters={width:t,height:e,widthSegments:n,heightSegments:r};var i,a,o=(t=t||1)/2,s=(e=e||1)/2,l=Math.floor(n)||1,u=Math.floor(r)||1,c=l+1,h=u+1,d=t/l,p=e/u,f=[],m=[],g=[],v=[];for(a=0;a<h;a++){var y=a*p-s;for(i=0;i<c;i++){var x=i*d-o;m.push(x,-y,0),g.push(0,0,1),v.push(i/l),v.push(1-a/u)}}for(a=0;a<u;a++)for(i=0;i<l;i++){var b=i+c*a,w=i+c*(a+1),_=i+1+c*(a+1),M=i+1+c*a;f.push(b,w,M),f.push(w,_,M)}this.setIndex(f),this.setAttribute("position",new We(m,3)),this.setAttribute("normal",new We(g,3)),this.setAttribute("uv",new We(v,2))}(Wn.prototype=Object.create(Dn.prototype)).constructor=Wn,(Jn.prototype=Object.create(nn.prototype)).constructor=Jn;var qn={alphamap_fragment:"#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",alphatest_fragment:"#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif",aomap_fragment:"#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\n\t#endif\n#endif",aomap_pars_fragment:"#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",begin_vertex:"vec3 transformed = vec3( position );",beginnormal_vertex:"vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif",bsdfs:"vec2 integrateSpecularBRDF( const in float dotNV, const in float roughness ) {\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\treturn vec2( -1.04, 1.04 ) * a004 + r.zw;\n}\nfloat punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\tif( cutoffDistance > 0.0 ) {\n\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t}\n\treturn distanceFalloff;\n#else\n\tif( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t}\n\treturn 1.0;\n#endif\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nvec3 F_Schlick_RoughnessDependent( const in vec3 F0, const in float dotNV, const in float roughness ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotNV - 6.98316 ) * dotNV );\n\tvec3 Fr = max( vec3( 1.0 - roughness ), F0 ) - F0;\n\treturn Fr * fresnel + F0;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + viewDir );\n\tfloat dotNL = saturate( dot( normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\nvec3 BRDF_Specular_GGX_Environment( const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\treturn specularColor * brdf.x + brdf.y;\n}\nvoid BRDF_Specular_Multiscattering_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tvec3 F = F_Schlick_RoughnessDependent( specularColor, dotNV, roughness );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\tvec3 FssEss = F * brdf.x + brdf.y;\n\tfloat Ess = brdf.x + brdf.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie(float roughness, float NoH) {\n\tfloat invAlpha = 1.0 / roughness;\n\tfloat cos2h = NoH * NoH;\n\tfloat sin2h = max(1.0 - cos2h, 0.0078125);\treturn (2.0 + invAlpha) * pow(sin2h, invAlpha * 0.5) / (2.0 * PI);\n}\nfloat V_Neubelt(float NoV, float NoL) {\n\treturn saturate(1.0 / (4.0 * (NoL + NoV - NoL * NoV)));\n}\nvec3 BRDF_Specular_Sheen( const in float roughness, const in vec3 L, const in GeometricContext geometry, vec3 specularColor ) {\n\tvec3 N = geometry.normal;\n\tvec3 V = geometry.viewDir;\n\tvec3 H = normalize( V + L );\n\tfloat dotNH = saturate( dot( N, H ) );\n\treturn specularColor * D_Charlie( roughness, dotNH ) * V_Neubelt( dot(N, V), dot(N, L) );\n}\n#endif",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\t\tvec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\t\tfDet *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vViewPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vViewPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\t#if ! defined( STANDARD ) && ! defined( PHONG ) && ! defined( MATCAP )\n\t\tvarying vec3 vViewPosition;\n\t#endif\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0 && ! defined( STANDARD ) && ! defined( PHONG ) && ! defined( MATCAP )\n\tvarying vec3 vViewPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0 && ! defined( STANDARD ) && ! defined( PHONG ) && ! defined( MATCAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif",color_fragment:"#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",color_vertex:"#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",common:"#define PI 3.14159265359\n#define PI2 6.28318530718\n#define PI_HALF 1.5707963267949\n#define RECIPROCAL_PI 0.31830988618\n#define RECIPROCAL_PI2 0.15915494\n#define LOG2 1.442695\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract(sin(sn) * c);\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat max3( vec3 v ) { return max( max( v.x, v.y ), v.z ); }\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat linearToRelativeLuminance( const in vec3 color ) {\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n\treturn dot( weights, color.rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n return m[ 2 ][ 3 ] == - 1.0;\n}",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n#define cubeUV_maxMipLevel 8.0\n#define cubeUV_minMipLevel 4.0\n#define cubeUV_maxTileSize 256.0\n#define cubeUV_minTileSize 16.0\nfloat getFace(vec3 direction) {\n vec3 absDirection = abs(direction);\n float face = -1.0;\n if (absDirection.x > absDirection.z) {\n if (absDirection.x > absDirection.y)\n face = direction.x > 0.0 ? 0.0 : 3.0;\n else\n face = direction.y > 0.0 ? 1.0 : 4.0;\n } else {\n if (absDirection.z > absDirection.y)\n face = direction.z > 0.0 ? 2.0 : 5.0;\n else\n face = direction.y > 0.0 ? 1.0 : 4.0;\n }\n return face;\n}\nvec2 getUV(vec3 direction, float face) {\n vec2 uv;\n if (face == 0.0) {\n uv = vec2(-direction.z, direction.y) / abs(direction.x);\n } else if (face == 1.0) {\n uv = vec2(direction.x, -direction.z) / abs(direction.y);\n } else if (face == 2.0) {\n uv = direction.xy / abs(direction.z);\n } else if (face == 3.0) {\n uv = vec2(direction.z, direction.y) / abs(direction.x);\n } else if (face == 4.0) {\n uv = direction.xz / abs(direction.y);\n } else {\n uv = vec2(-direction.x, direction.y) / abs(direction.z);\n }\n return 0.5 * (uv + 1.0);\n}\nvec3 bilinearCubeUV(sampler2D envMap, vec3 direction, float mipInt) {\n float face = getFace(direction);\n float filterInt = max(cubeUV_minMipLevel - mipInt, 0.0);\n mipInt = max(mipInt, cubeUV_minMipLevel);\n float faceSize = exp2(mipInt);\n float texelSize = 1.0 / (3.0 * cubeUV_maxTileSize);\n vec2 uv = getUV(direction, face) * (faceSize - 1.0);\n vec2 f = fract(uv);\n uv += 0.5 - f;\n if (face > 2.0) {\n uv.y += faceSize;\n face -= 3.0;\n }\n uv.x += face * faceSize;\n if(mipInt < cubeUV_maxMipLevel){\n uv.y += 2.0 * cubeUV_maxTileSize;\n }\n uv.y += filterInt * 2.0 * cubeUV_minTileSize;\n uv.x += 3.0 * max(0.0, cubeUV_maxTileSize - 2.0 * faceSize);\n uv *= texelSize;\n vec3 tl = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n uv.x += texelSize;\n vec3 tr = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n uv.y += texelSize;\n vec3 br = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n uv.x -= texelSize;\n vec3 bl = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n vec3 tm = mix(tl, tr, f.x);\n vec3 bm = mix(bl, br, f.x);\n return mix(tm, bm, f.y);\n}\n#define r0 1.0\n#define v0 0.339\n#define m0 -2.0\n#define r1 0.8\n#define v1 0.276\n#define m1 -1.0\n#define r4 0.4\n#define v4 0.046\n#define m4 2.0\n#define r5 0.305\n#define v5 0.016\n#define m5 3.0\n#define r6 0.21\n#define v6 0.0038\n#define m6 4.0\nfloat roughnessToMip(float roughness) {\n float mip = 0.0;\n if (roughness >= r1) {\n mip = (r0 - roughness) * (m1 - m0) / (r0 - r1) + m0;\n } else if (roughness >= r4) {\n mip = (r1 - roughness) * (m4 - m1) / (r1 - r4) + m1;\n } else if (roughness >= r5) {\n mip = (r4 - roughness) * (m5 - m4) / (r4 - r5) + m4;\n } else if (roughness >= r6) {\n mip = (r5 - roughness) * (m6 - m5) / (r5 - r6) + m5;\n } else {\n mip = -2.0 * log2(1.16 * roughness); }\n return mip;\n}\nvec4 textureCubeUV(sampler2D envMap, vec3 sampleDir, float roughness) {\n float mip = clamp(roughnessToMip(roughness), m0, cubeUV_maxMipLevel);\n float mipF = fract(mip);\n float mipInt = floor(mip);\n vec3 color0 = bilinearCubeUV(envMap, sampleDir, mipInt);\n if (mipF == 0.0) {\n return vec4(color0, 1.0);\n } else {\n vec3 color1 = bilinearCubeUV(envMap, sampleDir, mipInt + 1.0);\n return vec4(mix(color0, color1, mipF), 1.0);\n }\n}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n\ttransformedNormal = mat3( instanceMatrix ) * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",encodings_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",encodings_pars_fragment:"\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n\tfloat maxComponent = max( max( value.r, value.g ), value.b );\n\tfloat fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * value.a * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n\tM = ceil( M * 255.0 ) / 255.0;\n\treturn vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat D = max( maxRange / maxRGB, 1.0 );\n\tD = clamp( floor( D ) / 255.0, 0.0, 1.0 );\n\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n\tvec3 Xp_Y_XYZp = cLogLuvM * value.rgb;\n\tXp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) );\n\tvec4 vResult;\n\tvResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n\tfloat Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n\tvResult.w = fract( Le );\n\tvResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0;\n\treturn vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n\tfloat Le = value.z * 255.0 + value.w;\n\tvec3 Xp_Y_XYZp;\n\tXp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 );\n\tXp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n\tXp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n\tvec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb;\n\treturn vec4( max( vRGB, 0.0 ), 1.0 );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\t\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\tvec2 sampleUV;\n\t\treflectVec = normalize( reflectVec );\n\t\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\n\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\treflectVec = normalize( reflectVec );\n\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0, 0.0, 1.0 ) );\n\t\tvec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifndef ENVMAP_TYPE_CUBE_UV\n\t\tenvColor = envMapTexelToLinear( envColor );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform int maxMipLevel;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#if defined( USE_ENVMAP )\n\t#ifdef ENVMAP_MODE_REFRACTION\n\t\tuniform float refractionRatio;\n\t#endif\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float roughness, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat sigma = PI * roughness * roughness / ( 1.0 + roughness );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar + log2( sigma );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t vec3 reflectVec = reflect( -viewDir, normal );\n\t\t reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t#else\n\t\t vec3 reflectVec = refract( -viewDir, normal, refractionRatio );\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( roughness, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\t\tvec2 sampleUV;\n\t\t\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\t\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, sampleUV, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, sampleUV, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0,0.0,1.0 ) );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#endif\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) { \n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tfogDepth = -mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float fogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * fogDepth * fogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, fogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float fogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn texture2D( gradientMap, coord ).rgb;\n\t#else\n\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t#endif\n}",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\treflectedLight.indirectDiffuse += PI * lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_vertex:"vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\nvIndirectFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n\tvIndirectBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\n#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n#endif",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in GeometricContext geometry ) {\n\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treturn irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t\tfloat shadowCameraNear;\n\t\tfloat shadowCameraFar;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tdirectLight.color = pointLight.color;\n\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\tdirectLight.visible = ( directLight.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\t\tif ( angleCos > spotLight.coneCos ) {\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *= PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct ToonMaterial {\n\tvec3\tdiffuseColor;\n\tvec3\tspecularColor;\n\tfloat\tspecularShininess;\n\tfloat\tspecularStrength;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon\n#define Material_LightProbeLOD( material )\t(0)",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3\tdiffuseColor;\n\tvec3\tspecularColor;\n\tfloat\tspecularShininess;\n\tfloat\tspecularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.specularRoughness = max( roughnessFactor, 0.0525 );material.specularRoughness += geometryRoughness;\nmaterial.specularRoughness = min( material.specularRoughness, 1.0 );\n#ifdef REFLECTIVITY\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n#endif\n#ifdef CLEARCOAT\n\tmaterial.clearcoat = saturate( clearcoat );\tmaterial.clearcoatRoughness = max( clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheen;\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3\tdiffuseColor;\n\tfloat\tspecularRoughness;\n\tvec3\tspecularColor;\n#ifdef CLEARCOAT\n\tfloat clearcoat;\n\tfloat clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tvec3 sheenColor;\n#endif\n};\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\nfloat clearcoatDHRApprox( const in float roughness, const in float dotNL ) {\n\treturn DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.specularRoughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\t#ifdef CLEARCOAT\n\t\tfloat ccDotNL = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = ccDotNL * directLight.color;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tccIrradiance *= PI;\n\t\t#endif\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t\treflectedLight.directSpecular += ccIrradiance * material.clearcoat * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_Sheen(\n\t\t\tmaterial.specularRoughness,\n\t\t\tdirectLight.direction,\n\t\t\tgeometry,\n\t\t\tmaterial.sheenColor\n\t\t);\n\t#else\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.normal, material.specularColor, material.specularRoughness);\n\t#endif\n\treflectedLight.directDiffuse += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef CLEARCOAT\n\t\tfloat ccDotNV = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular += clearcoatRadiance * material.clearcoat * BRDF_Specular_GGX_Environment( geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t\tfloat ccDotNL = ccDotNV;\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\tfloat clearcoatInv = 1.0 - clearcoatDHR;\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\tBRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering );\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\n\treflectedLight.indirectSpecular += clearcoatInv * radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tdirectLight.color *= all( bvec3( pointLight.shadow, directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tdirectLight.color *= all( bvec3( spotLight.shadow, directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectLight.color *= all( bvec3( directionalLight.shadow, directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\tvec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.normal, material.specularRoughness, maxMipLevel );\n\t#ifdef CLEARCOAT\n\t\tclearcoatRadiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness, maxMipLevel );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n#endif\n#ifdef USE_MAP\n\tvec4 mapTexel = texture2D( map, uv );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tuniform mat3 uvTransform;\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifndef USE_MORPHNORMALS\n\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t#endif\n#endif",normal_fragment_begin:"#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n\t#ifdef USE_TANGENT\n\t\tvec3 tangent = normalize( vTangent );\n\t\tvec3 bitangent = normalize( vBitangent );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\ttangent = tangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t\tbitangent = bitangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#endif\n\t\t#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\t\t#endif\n\t#endif\n#endif\nvec3 geometryNormal = normal;",normal_fragment_maps:"#ifdef OBJECTSPACE_NORMALMAP\n\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( TANGENTSPACE_NORMALMAP )\n\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\t#ifdef USE_TANGENT\n\t\tnormal = normalize( vTBN * mapN );\n\t#else\n\t\tnormal = perturbNormal2Arb( -vViewPosition, normal, mapN );\n\t#endif\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN ) {\n\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tfloat scale = sign( st1.t * st0.s - st0.t * st1.s );\n\t\tvec3 S = normalize( ( q0 * st1.t - q1 * st0.t ) * scale );\n\t\tvec3 T = normalize( ( - q0 * st1.s + q1 * st0.s ) * scale );\n\t\tvec3 N = normalize( surf_norm );\n\t\tmat3 tsn = mat3( S, T, N );\n\t\tmapN.xy *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\treturn normalize( tsn * mapN );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\t#ifdef USE_TANGENT\n\t\tclearcoatNormal = normalize( vTBN * clearcoatMapN );\n\t#else\n\t\tclearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN );\n\t#endif\n#endif",clearcoat_normalmap_pars_fragment:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ));\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w);\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn (( near + viewZ ) * far ) / (( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif",shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLight directionalLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tshadow *= all( bvec2( directionalLight.shadow, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLight spotLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tshadow *= all( bvec2( spotLight.shadow, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLight pointLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tshadow *= all( bvec2( pointLight.shadow, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform highp sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nuniform float toneMappingWhitePoint;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\n#define Uncharted2Helper( x ) max( ( ( x * ( 0.15 * x + 0.10 * 0.50 ) + 0.20 * 0.02 ) / ( x * ( 0.15 * x + 0.50 ) + 0.20 * 0.30 ) ) - 0.02 / 0.30, vec3( 0.0 ) )\nvec3 Uncharted2ToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( ( color * ( 2.51 * color + 0.03 ) ) / ( color * ( 2.43 * color + 0.59 ) + 0.14 ) );\n}",uv_pars_fragment:"#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\n\tvarying vec2 vUv;\n#endif",uv_pars_vertex:"#ifdef USE_UV\n\t#ifdef UVS_VERTEX_ONLY\n\t\tvec2 vUv;\n\t#else\n\t\tvarying vec2 vUv;\n\t#endif\n\tuniform mat3 uvTransform;\n#endif",uv_vertex:"#ifdef USE_UV\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif",uv2_pars_fragment:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",uv2_pars_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n\tuniform mat3 uv2Transform;\n#endif",uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",background_frag:"uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",cube_frag:"#include <envmap_common_pars_fragment>\nuniform float opacity;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\tvec3 vReflect = vWorldDirection;\n\t#include <envmap_fragment>\n\tgl_FragColor = envColor;\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",cube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <logdepthbuf_fragment>\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - gl_FragCoord.z ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( gl_FragCoord.z );\n\t#endif\n}",depth_vert:"#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition.xyz;\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV;\n\tsampleUV.y = asin( clamp( direction.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\n\tvec4 texColor = texture2D( tEquirect, sampleUV );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",equirect_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\tvLineDistance = scale * lineDistance;\n\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\treflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",meshbasic_vert:"#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_ENVMAP\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}",meshlambert_frag:"uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <emissivemap_fragment>\n\treflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\n\t#else\n\t\treflectedLight.indirectDiffuse += vIndirectFront;\n\t#endif\n\t#include <lightmap_fragment>\n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <lights_lambert_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t\tmatcapColor = matcapTexelToLinear( matcapColor );\n\t#else\n\t\tvec4 matcapColor = vec4( 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#ifndef FLAT_SHADED\n\t\tvNormal = normalize( transformedNormal );\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\tvViewPosition = - mvPosition.xyz;\n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <lights_toon_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_toon_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define REFLECTIVITY\n\t#define CLEARCOAT\n\t#define TRANSPARENCY\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef TRANSPARENCY\n\tuniform float transparency;\n#endif\n#ifdef REFLECTIVITY\n\tuniform float reflectivity;\n#endif\n#ifdef CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheen;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <bsdfs>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <lights_physical_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_normalmap_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <clearcoat_normal_fragment_begin>\n\t#include <clearcoat_normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#ifdef TRANSPARENCY\n\t\tdiffuseColor.a *= saturate( 1. - transparency + linearToRelativeLuminance( reflectedLight.directSpecular + reflectedLight.indirectSpecular ) );\n\t#endif\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",normal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n}",normal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",points_vert:"uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",shadow_vert:"#include <fog_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}"},Xn={basic:{uniforms:Pn([Un.common,Un.specularmap,Un.envmap,Un.aomap,Un.lightmap,Un.fog]),vertexShader:qn.meshbasic_vert,fragmentShader:qn.meshbasic_frag},lambert:{uniforms:Pn([Un.common,Un.specularmap,Un.envmap,Un.aomap,Un.lightmap,Un.emissivemap,Un.fog,Un.lights,{emissive:{value:new De(0)}}]),vertexShader:qn.meshlambert_vert,fragmentShader:qn.meshlambert_frag},phong:{uniforms:Pn([Un.common,Un.specularmap,Un.envmap,Un.aomap,Un.lightmap,Un.emissivemap,Un.bumpmap,Un.normalmap,Un.displacementmap,Un.fog,Un.lights,{emissive:{value:new De(0)},specular:{value:new De(1118481)},shininess:{value:30}}]),vertexShader:qn.meshphong_vert,fragmentShader:qn.meshphong_frag},standard:{uniforms:Pn([Un.common,Un.envmap,Un.aomap,Un.lightmap,Un.emissivemap,Un.bumpmap,Un.normalmap,Un.displacementmap,Un.roughnessmap,Un.metalnessmap,Un.fog,Un.lights,{emissive:{value:new De(0)},roughness:{value:.5},metalness:{value:.5},envMapIntensity:{value:1}}]),vertexShader:qn.meshphysical_vert,fragmentShader:qn.meshphysical_frag},toon:{uniforms:Pn([Un.common,Un.specularmap,Un.aomap,Un.lightmap,Un.emissivemap,Un.bumpmap,Un.normalmap,Un.displacementmap,Un.gradientmap,Un.fog,Un.lights,{emissive:{value:new De(0)},specular:{value:new De(1118481)},shininess:{value:30}}]),vertexShader:qn.meshtoon_vert,fragmentShader:qn.meshtoon_frag},matcap:{uniforms:Pn([Un.common,Un.bumpmap,Un.normalmap,Un.displacementmap,Un.fog,{matcap:{value:null}}]),vertexShader:qn.meshmatcap_vert,fragmentShader:qn.meshmatcap_frag},points:{uniforms:Pn([Un.points,Un.fog]),vertexShader:qn.points_vert,fragmentShader:qn.points_frag},dashed:{uniforms:Pn([Un.common,Un.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:qn.linedashed_vert,fragmentShader:qn.linedashed_frag},depth:{uniforms:Pn([Un.common,Un.displacementmap]),vertexShader:qn.depth_vert,fragmentShader:qn.depth_frag},normal:{uniforms:Pn([Un.common,Un.bumpmap,Un.normalmap,Un.displacementmap,{opacity:{value:1}}]),vertexShader:qn.normal_vert,fragmentShader:qn.normal_frag},sprite:{uniforms:Pn([Un.sprite,Un.fog]),vertexShader:qn.sprite_vert,fragmentShader:qn.sprite_frag},background:{uniforms:{uvTransform:{value:new et},t2D:{value:null}},vertexShader:qn.background_vert,fragmentShader:qn.background_frag},cube:{uniforms:Pn([Un.envmap,{opacity:{value:1}}]),vertexShader:qn.cube_vert,fragmentShader:qn.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:qn.equirect_vert,fragmentShader:qn.equirect_frag},distanceRGBA:{uniforms:Pn([Un.common,Un.displacementmap,{referencePosition:{value:new ht},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:qn.distanceRGBA_vert,fragmentShader:qn.distanceRGBA_frag},shadow:{uniforms:Pn([Un.lights,Un.fog,{color:{value:new De(0)},opacity:{value:1}}]),vertexShader:qn.shadow_vert,fragmentShader:qn.shadow_frag}};function Yn(t,e,n,r){var i,o,s=new De(0),l=0,u=null,c=0,h=null;function d(t,n){e.buffers.color.setClear(t.r,t.g,t.b,n,r)}return{getClearColor:function(){return s},setClearColor:function(t,e){s.set(t),d(s,l=void 0!==e?e:1)},getClearAlpha:function(){return l},setClearAlpha:function(t){d(s,l=t)},render:function(e,r,p,f){var m=r.background,g=t.xr,v=g.getSession&&g.getSession();if(v&&"additive"===v.environmentBlendMode&&(m=null),null===m?d(s,l):m&&m.isColor&&(d(m,1),f=!0),(t.autoClear||f)&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),m&&(m.isCubeTexture||m.isWebGLCubeRenderTarget||m.mapping===a)){void 0===o&&((o=new wn(new On(1,1,1),new In({type:"BackgroundCubeMaterial",uniforms:Ln(Xn.cube.uniforms),vertexShader:Xn.cube.vertexShader,fragmentShader:Xn.cube.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.deleteAttribute("normal"),o.geometry.deleteAttribute("uv"),o.onBeforeRender=function(t,e,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(o.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),n.update(o));var y=m.isWebGLCubeRenderTarget?m.texture:m;o.material.uniforms.envMap.value=y,o.material.uniforms.flipEnvMap.value=y.isCubeTexture?-1:1,u===m&&c===y.version&&h===t.toneMapping||(o.material.needsUpdate=!0,u=m,c=y.version,h=t.toneMapping),e.unshift(o,o.geometry,o.material,0,0,null)}else m&&m.isTexture&&(void 0===i&&((i=new wn(new Jn(2,2),new In({type:"BackgroundMaterial",uniforms:Ln(Xn.background.uniforms),vertexShader:Xn.background.vertexShader,fragmentShader:Xn.background.fragmentShader,side:0,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.deleteAttribute("normal"),Object.defineProperty(i.material,"map",{get:function(){return this.uniforms.t2D.value}}),n.update(i)),!0===(i.material.uniforms.t2D.value=m).matrixAutoUpdate&&m.updateMatrix(),i.material.uniforms.uvTransform.value.copy(m.matrix),u===m&&c===m.version&&h===t.toneMapping||(i.material.needsUpdate=!0,c=(u=m).version,h=t.toneMapping),e.unshift(i,i.geometry,i.material,0,0,null))}}}function Zn(){var t=this,e=null,n=0,r=!1,i=!1,a=new pe,o=new et,s={value:null,needsUpdate:!1};function l(){s.value!==e&&(s.value=e,s.needsUpdate=0<n),t.numPlanes=n,t.numIntersection=0}function u(e,n,r,i){var l=null!==e?e.length:0,u=null;if(0!==l){if(u=s.value,!0!==i||null===u){var c=r+4*l,h=n.matrixWorldInverse;o.getNormalMatrix(h),(null===u||u.length<c)&&(u=new Float32Array(c));for(var d=0,p=r;d!==l;++d,p+=4)a.copy(e[d]).applyMatrix4(h,o),a.normal.toArray(u,p),u[p+3]=a.constant}s.value=u,s.needsUpdate=!0}return t.numPlanes=l,u}this.uniform=s,this.numPlanes=0,this.numIntersection=0,this.init=function(t,i,a){var o=0!==t.length||i||0!==n||r;return r=i,e=u(t,a,0),n=t.length,o},this.beginShadows=function(){i=!0,u(null)},this.endShadows=function(){i=!1,l()},this.setState=function(t,a,o,c,h,d){if(!r||null===t||0===t.length||i&&!o)i?u(null):l();else{var p=i?0:n,f=4*p,m=h.clippingState||null;s.value=m,m=u(t,c,f,d);for(var g=0;g!==f;++g)m[g]=e[g];h.clippingState=m,this.numIntersection=a?this.numPlanes:0,this.numPlanes+=p}}}function $n(t,e){return Math.abs(e[1])-Math.abs(t[1])}function Kn(t,e,r,i,a,o,s,l,u,c){it.call(this,t=void 0!==t?t:[],e=void 0!==e?e:n,r,i,a,o,s=void 0!==s?s:_,l,u,c),this.flipY=!1}function Qn(t,e,n,r){it.call(this,null),this.image={data:t||null,width:e||1,height:n||1,depth:r||1},this.magFilter=c,this.minFilter=c,this.wrapR=l,this.generateMipmaps=!1,this.flipY=!1,this.needsUpdate=!0}function tr(t,e,n,r){it.call(this,null),this.image={data:t||null,width:e||1,height:n||1,depth:r||1},this.magFilter=c,this.minFilter=c,this.wrapR=l,this.generateMipmaps=!1,this.flipY=!1,this.needsUpdate=!0}Xn.physical={uniforms:Pn([Xn.standard.uniforms,{transparency:{value:0},clearcoat:{value:0},clearcoatRoughness:{value:0},sheen:{value:new De(0)},clearcoatNormalScale:{value:new tt(1,1)},clearcoatNormalMap:{value:null}}]),vertexShader:qn.meshphysical_vert,fragmentShader:qn.meshphysical_frag},((Kn.prototype=Object.create(it.prototype)).constructor=Kn).prototype.isCubeTexture=!0,Object.defineProperty(Kn.prototype,"images",{get:function(){return this.image},set:function(t){this.image=t}}),((Qn.prototype=Object.create(it.prototype)).constructor=Qn).prototype.isDataTexture2DArray=!0,((tr.prototype=Object.create(it.prototype)).constructor=tr).prototype.isDataTexture3D=!0;var er=new it,nr=new Qn,rr=new tr,ir=new Kn,ar=[],or=[],sr=new Float32Array(16),lr=new Float32Array(9),ur=new Float32Array(4);function cr(t,e,n){var r=t[0];if(r<=0||0<r)return t;var i=e*n,a=ar[i];if(void 0===a&&(a=new Float32Array(i),ar[i]=a),0!==e){r.toArray(a,0);for(var o=1,s=0;o!==e;++o)s+=n,t[o].toArray(a,s)}return a}function hr(t,e){if(t.length===e.length){for(var n=0,r=t.length;n<r;n++)if(t[n]!==e[n])return;return 1}}function dr(t,e){for(var n=0,r=e.length;n<r;n++)t[n]=e[n]}function pr(t,e){var n=or[e];void 0===n&&(n=new Int32Array(e),or[e]=n);for(var r=0;r!==e;++r)n[r]=t.allocateTextureUnit();return n}function fr(t,e){var n=this.cache;n[0]!==e&&(t.uniform1f(this.addr,e),n[0]=e)}function mr(t,e){var n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y||(t.uniform2f(this.addr,e.x,e.y),n[0]=e.x,n[1]=e.y);else{if(hr(n,e))return;t.uniform2fv(this.addr,e),dr(n,e)}}function gr(t,e){var n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z||(t.uniform3f(this.addr,e.x,e.y,e.z),n[0]=e.x,n[1]=e.y,n[2]=e.z);else if(void 0!==e.r)n[0]===e.r&&n[1]===e.g&&n[2]===e.b||(t.uniform3f(this.addr,e.r,e.g,e.b),n[0]=e.r,n[1]=e.g,n[2]=e.b);else{if(hr(n,e))return;t.uniform3fv(this.addr,e),dr(n,e)}}function vr(t,e){var n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z&&n[3]===e.w||(t.uniform4f(this.addr,e.x,e.y,e.z,e.w),n[0]=e.x,n[1]=e.y,n[2]=e.z,n[3]=e.w);else{if(hr(n,e))return;t.uniform4fv(this.addr,e),dr(n,e)}}function yr(t,e){var n=this.cache,r=e.elements;if(void 0===r){if(hr(n,e))return;t.uniformMatrix2fv(this.addr,!1,e),dr(n,e)}else{if(hr(n,r))return;ur.set(r),t.uniformMatrix2fv(this.addr,!1,ur),dr(n,r)}}function xr(t,e){var n=this.cache,r=e.elements;if(void 0===r){if(hr(n,e))return;t.uniformMatrix3fv(this.addr,!1,e),dr(n,e)}else{if(hr(n,r))return;lr.set(r),t.uniformMatrix3fv(this.addr,!1,lr),dr(n,r)}}function br(t,e){var n=this.cache,r=e.elements;if(void 0===r){if(hr(n,e))return;t.uniformMatrix4fv(this.addr,!1,e),dr(n,e)}else{if(hr(n,r))return;sr.set(r),t.uniformMatrix4fv(this.addr,!1,sr),dr(n,r)}}function wr(t,e,n){var r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(t.uniform1i(this.addr,i),r[0]=i),n.safeSetTexture2D(e||er,i)}function _r(t,e,n){var r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(t.uniform1i(this.addr,i),r[0]=i),n.setTexture2DArray(e||nr,i)}function Mr(t,e,n){var r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(t.uniform1i(this.addr,i),r[0]=i),n.setTexture3D(e||rr,i)}function Sr(t,e,n){var r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(t.uniform1i(this.addr,i),r[0]=i),n.safeSetTextureCube(e||ir,i)}function Tr(t,e){var n=this.cache;n[0]!==e&&(t.uniform1i(this.addr,e),n[0]=e)}function Cr(t,e){var n=this.cache;hr(n,e)||(t.uniform2iv(this.addr,e),dr(n,e))}function Er(t,e){var n=this.cache;hr(n,e)||(t.uniform3iv(this.addr,e),dr(n,e))}function Dr(t,e){var n=this.cache;hr(n,e)||(t.uniform4iv(this.addr,e),dr(n,e))}function Ar(t,e){var n=this.cache;n[0]!==e&&(t.uniform1ui(this.addr,e),n[0]=e)}function Or(t,e){t.uniform1fv(this.addr,e)}function Lr(t,e){t.uniform1iv(this.addr,e)}function Pr(t,e){t.uniform2iv(this.addr,e)}function Rr(t,e){t.uniform3iv(this.addr,e)}function Ir(t,e){t.uniform4iv(this.addr,e)}function kr(t,e){var n=cr(e,this.size,2);t.uniform2fv(this.addr,n)}function Br(t,e){var n=cr(e,this.size,3);t.uniform3fv(this.addr,n)}function Fr(t,e){var n=cr(e,this.size,4);t.uniform4fv(this.addr,n)}function Nr(t,e){var n=cr(e,this.size,4);t.uniformMatrix2fv(this.addr,!1,n)}function jr(t,e){var n=cr(e,this.size,9);t.uniformMatrix3fv(this.addr,!1,n)}function zr(t,e){var n=cr(e,this.size,16);t.uniformMatrix4fv(this.addr,!1,n)}function Vr(t,e,n){var r=e.length,i=pr(n,r);t.uniform1iv(this.addr,i);for(var a=0;a!==r;++a)n.safeSetTexture2D(e[a]||er,i[a])}function Gr(t,e,n){var r=e.length,i=pr(n,r);t.uniform1iv(this.addr,i);for(var a=0;a!==r;++a)n.safeSetTextureCube(e[a]||ir,i[a])}function Ur(t,e,n){this.id=t,this.addr=n,this.cache=[],this.setValue=function(t){switch(e.type){case 5126:return fr;case 35664:return mr;case 35665:return gr;case 35666:return vr;case 35674:return yr;case 35675:return xr;case 35676:return br;case 5124:case 35670:return Tr;case 35667:case 35671:return Cr;case 35668:case 35672:return Er;case 35669:case 35673:return Dr;case 5125:return Ar;case 35678:case 36198:case 36298:case 36306:case 35682:return wr;case 35679:case 36299:case 36307:return Mr;case 35680:case 36300:case 36308:case 36293:return Sr;case 36289:case 36303:case 36311:case 36292:return _r}}()}function Hr(t,e,n){this.id=t,this.addr=n,this.cache=[],this.size=e.size,this.setValue=function(t){switch(e.type){case 5126:return Or;case 35664:return kr;case 35665:return Br;case 35666:return Fr;case 35674:return Nr;case 35675:return jr;case 35676:return zr;case 5124:case 35670:return Lr;case 35667:case 35671:return Pr;case 35668:case 35672:return Rr;case 35669:case 35673:return Ir;case 35678:case 36198:case 36298:case 36306:case 35682:return Vr;case 35680:case 36300:case 36308:case 36293:return Gr}}()}function Wr(t){this.id=t,this.seq=[],this.map={}}Hr.prototype.updateCache=function(t){var e=this.cache;t instanceof Float32Array&&e.length!==t.length&&(this.cache=new Float32Array(t.length)),dr(e,t)},Wr.prototype.setValue=function(t,e,n){for(var r=this.seq,i=0,a=r.length;i!==a;++i){var o=r[i];o.setValue(t,e[o.id],n)}};var Jr=/([\w\d_]+)(\])?(\[|\.)?/g;function qr(t,e){t.seq.push(e),t.map[e.id]=e}function Xr(t,e,n){var r=t.name,i=r.length;for(Jr.lastIndex=0;;){var a=Jr.exec(r),o=Jr.lastIndex,s=a[1],l="]"===a[2],u=a[3];if(l&&(s|=0),void 0===u||"["===u&&o+2===i){qr(n,new(void 0===u?Ur:Hr)(s,t,e));break}var c=n.map[s];void 0===c&&qr(n,c=new Wr(s)),n=c}}function Yr(t,e){this.seq=[],this.map={};for(var n=t.getProgramParameter(e,35718),r=0;r<n;++r){var i=t.getActiveUniform(e,r);Xr(i,t.getUniformLocation(e,i.name),this)}}function Zr(t,e,n){var r=t.createShader(e);return t.shaderSource(r,n),t.compileShader(r),r}Yr.prototype.setValue=function(t,e,n,r){var i=this.map[e];void 0!==i&&i.setValue(t,n,r)},Yr.prototype.setOptional=function(t,e,n){var r=e[n];void 0!==r&&this.setValue(t,n,r)},Yr.upload=function(t,e,n,r){for(var i=0,a=e.length;i!==a;++i){var o=e[i],s=n[o.id];!1!==s.needsUpdate&&o.setValue(t,s.value,r)}},Yr.seqWithValue=function(t,e){for(var n=[],r=0,i=t.length;r!==i;++r){var a=t[r];a.id in e&&n.push(a)}return n};var $r=0;function Kr(t){switch(t){case j:return["Linear","( value )"];case z:return["sRGB","( value )"];case G:return["RGBE","( value )"];case U:return["RGBM","( value, 7.0 )"];case H:return["RGBM","( value, 16.0 )"];case W:return["RGBD","( value, 256.0 )"];case V:return["Gamma","( value, float( GAMMA_FACTOR ) )"];case 3003:return["LogLuv","( value )"];default:throw new Error("unsupported encoding: "+t)}}function Qr(t,e,n){var r=t.getShaderParameter(e,35713),i=t.getShaderInfoLog(e).trim();return r&&""===i?"":"THREE.WebGLShader: gl.getShaderInfoLog() "+n+"\n"+i+function(t){for(var e=t.split("\n"),n=0;n<e.length;n++)e[n]=n+1+": "+e[n];return e.join("\n")}(t.getShaderSource(e))}function ti(t,e){var n=Kr(e);return"vec4 "+t+"( vec4 value ) { return "+n[0]+"ToLinear"+n[1]+"; }"}function ei(t){return""!==t}function ni(t,e){return t.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,e.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS/g,e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,e.numPointLightShadows)}function ri(t,e){return t.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}var ii=/^[ \t]*#include +<([\w\d./]+)>/gm;function ai(t){return t.replace(ii,oi)}function oi(t,e){var n=qn[e];if(void 0===n)throw new Error("Can not resolve #include <"+e+">");return ai(n)}var si=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g;function li(t){return t.replace(si,ui)}function ui(t,e,n,r){for(var i="",a=parseInt(e);a<parseInt(n);a++)i+=r.replace(/\[ i \]/g,"[ "+a+" ]").replace(/UNROLLED_LOOP_INDEX/g,a);return i}function ci(t){var e="precision "+t.precision+" float;\nprecision "+t.precision+" int;";return"highp"===t.precision?e+="\n#define HIGH_PRECISION":"mediump"===t.precision?e+="\n#define MEDIUM_PRECISION":"lowp"===t.precision&&(e+="\n#define LOW_PRECISION"),e}function hi(t,e,s){var l,u,c,h,d,p,f,m=t.getContext(),g=s.defines,v=s.vertexShader,y=s.fragmentShader,x=(u="SHADOWMAP_TYPE_BASIC",1===(l=s).shadowMapType?u="SHADOWMAP_TYPE_PCF":2===l.shadowMapType?u="SHADOWMAP_TYPE_PCF_SOFT":3===l.shadowMapType&&(u="SHADOWMAP_TYPE_VSM"),u),b=function(t){var e="ENVMAP_TYPE_CUBE";if(t.envMap)switch(t.envMapMode){case n:case r:e="ENVMAP_TYPE_CUBE";break;case a:case o:e="ENVMAP_TYPE_CUBE_UV";break;case 303:case i:e="ENVMAP_TYPE_EQUIREC";break;case 305:e="ENVMAP_TYPE_SPHERE"}return e}(s),w=function(t){var e="ENVMAP_MODE_REFLECTION";if(t.envMap)switch(t.envMapMode){case r:case i:e="ENVMAP_MODE_REFRACTION"}return e}(s),_=function(t){var e="ENVMAP_BLENDING_NONE";if(t.envMap)switch(t.combine){case 0:e="ENVMAP_BLENDING_MULTIPLY";break;case 1:e="ENVMAP_BLENDING_MIX";break;case 2:e="ENVMAP_BLENDING_ADD"}return e}(s),M=0<t.gammaFactor?t.gammaFactor:1,S=s.isWebGL2?"":[(c=s).extensionDerivatives||c.envMapCubeUV||c.bumpMap||c.tangentSpaceNormalMap||c.clearcoatNormalMap||c.flatShading||"physical"===c.shaderID?"#extension GL_OES_standard_derivatives : enable":"",(c.extensionFragDepth||c.logarithmicDepthBuffer)&&c.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",c.extensionDrawBuffers&&c.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(c.extensionShaderTextureLOD||c.envMap)&&c.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(ei).join("\n"),T=function(t){var e=[];for(var n in t){var r=t[n];!1!==r&&e.push("#define "+n+" "+r)}return e.join("\n")}(g),C=m.createProgram(),E=s.numMultiviewViews;if(s.isRawShaderMaterial?(0<(h=[T].filter(ei).join("\n")).length&&(h+="\n"),0<(d=[S,T].filter(ei).join("\n")).length&&(d+="\n")):(h=[ci(s),"#define SHADER_NAME "+s.shaderName,T,s.instancing?"#define USE_INSTANCING":"",s.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+M,"#define MAX_BONES "+s.maxBones,s.useFog&&s.fog?"#define USE_FOG":"",s.useFog&&s.fogExp2?"#define FOG_EXP2":"",s.map?"#define USE_MAP":"",s.envMap?"#define USE_ENVMAP":"",s.envMap?"#define "+w:"",s.lightMap?"#define USE_LIGHTMAP":"",s.aoMap?"#define USE_AOMAP":"",s.emissiveMap?"#define USE_EMISSIVEMAP":"",s.bumpMap?"#define USE_BUMPMAP":"",s.normalMap?"#define USE_NORMALMAP":"",s.normalMap&&s.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",s.normalMap&&s.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",s.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",s.displacementMap&&s.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",s.specularMap?"#define USE_SPECULARMAP":"",s.roughnessMap?"#define USE_ROUGHNESSMAP":"",s.metalnessMap?"#define USE_METALNESSMAP":"",s.alphaMap?"#define USE_ALPHAMAP":"",s.vertexTangents?"#define USE_TANGENT":"",s.vertexColors?"#define USE_COLOR":"",s.vertexUvs?"#define USE_UV":"",s.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",s.flatShading?"#define FLAT_SHADED":"",s.skinning?"#define USE_SKINNING":"",s.useVertexTexture?"#define BONE_TEXTURE":"",s.morphTargets?"#define USE_MORPHTARGETS":"",s.morphNormals&&!1===s.flatShading?"#define USE_MORPHNORMALS":"",s.doubleSided?"#define DOUBLE_SIDED":"",s.flipSided?"#define FLIP_SIDED":"",s.shadowMapEnabled?"#define USE_SHADOWMAP":"",s.shadowMapEnabled?"#define "+x:"",s.sizeAttenuation?"#define USE_SIZEATTENUATION":"",s.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",s.logarithmicDepthBuffer&&s.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#ifdef USE_COLOR","\tattribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(ei).join("\n"),d=[S,ci(s),"#define SHADER_NAME "+s.shaderName,T,s.alphaTest?"#define ALPHATEST "+s.alphaTest+(s.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+M,s.useFog&&s.fog?"#define USE_FOG":"",s.useFog&&s.fogExp2?"#define FOG_EXP2":"",s.map?"#define USE_MAP":"",s.matcap?"#define USE_MATCAP":"",s.envMap?"#define USE_ENVMAP":"",s.envMap?"#define "+b:"",s.envMap?"#define "+w:"",s.envMap?"#define "+_:"",s.lightMap?"#define USE_LIGHTMAP":"",s.aoMap?"#define USE_AOMAP":"",s.emissiveMap?"#define USE_EMISSIVEMAP":"",s.bumpMap?"#define USE_BUMPMAP":"",s.normalMap?"#define USE_NORMALMAP":"",s.normalMap&&s.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",s.normalMap&&s.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",s.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",s.specularMap?"#define USE_SPECULARMAP":"",s.roughnessMap?"#define USE_ROUGHNESSMAP":"",s.metalnessMap?"#define USE_METALNESSMAP":"",s.alphaMap?"#define USE_ALPHAMAP":"",s.sheen?"#define USE_SHEEN":"",s.vertexTangents?"#define USE_TANGENT":"",s.vertexColors?"#define USE_COLOR":"",s.vertexUvs?"#define USE_UV":"",s.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",s.gradientMap?"#define USE_GRADIENTMAP":"",s.flatShading?"#define FLAT_SHADED":"",s.doubleSided?"#define DOUBLE_SIDED":"",s.flipSided?"#define FLIP_SIDED":"",s.shadowMapEnabled?"#define USE_SHADOWMAP":"",s.shadowMapEnabled?"#define "+x:"",s.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",s.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",s.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",s.logarithmicDepthBuffer&&s.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(s.extensionShaderTextureLOD||s.envMap)&&s.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",0!==s.toneMapping?"#define TONE_MAPPING":"",0!==s.toneMapping?qn.tonemapping_pars_fragment:"",0!==s.toneMapping?function(t,e){var n;switch(e){case 1:n="Linear";break;case 2:n="Reinhard";break;case 3:n="Uncharted2";break;case 4:n="OptimizedCineon";break;case 5:n="ACESFilmic";break;default:throw new Error("unsupported toneMapping: "+e)}return"vec3 toneMapping( vec3 color ) { return "+n+"ToneMapping( color ); }"}(0,s.toneMapping):"",s.dithering?"#define DITHERING":"",s.outputEncoding||s.mapEncoding||s.matcapEncoding||s.envMapEncoding||s.emissiveMapEncoding||s.lightMapEncoding?qn.encodings_pars_fragment:"",s.mapEncoding?ti("mapTexelToLinear",s.mapEncoding):"",s.matcapEncoding?ti("matcapTexelToLinear",s.matcapEncoding):"",s.envMapEncoding?ti("envMapTexelToLinear",s.envMapEncoding):"",s.emissiveMapEncoding?ti("emissiveMapTexelToLinear",s.emissiveMapEncoding):"",s.lightMapEncoding?ti("lightMapTexelToLinear",s.lightMapEncoding):"",s.outputEncoding?(p=s.outputEncoding,f=Kr(p),"vec4 linearToOutputTexel( vec4 value ) { return LinearTo"+f[0]+f[1]+"; }"):"",s.depthPacking?"#define DEPTH_PACKING "+s.depthPacking:"","\n"].filter(ei).join("\n")),v=ri(v=ni(v=ai(v),s),s),y=ri(y=ni(y=ai(y),s),s),v=li(v),y=li(y),s.isWebGL2&&!s.isRawShaderMaterial){var D=!1,A=/^\s*#version\s+300\s+es\s*\n/;s.isShaderMaterial&&null!==v.match(A)&&null!==y.match(A)&&(D=!0,v=v.replace(A,""),y=y.replace(A,"")),h=["#version 300 es\n","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+h,d=["#version 300 es\n","#define varying in",D?"":"out highp vec4 pc_fragColor;",D?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+d,0<E&&(h=(h=h.replace("#version 300 es\n",["#version 300 es\n","#extension GL_OVR_multiview2 : require","layout(num_views = "+E+") in;","#define VIEW_ID gl_ViewID_OVR"].join("\n"))).replace(["uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;"].join("\n"),["uniform mat4 modelViewMatrices["+E+"];","uniform mat4 projectionMatrices["+E+"];","uniform mat4 viewMatrices["+E+"];","uniform mat3 normalMatrices["+E+"];","#define modelViewMatrix modelViewMatrices[VIEW_ID]","#define projectionMatrix projectionMatrices[VIEW_ID]","#define viewMatrix viewMatrices[VIEW_ID]","#define normalMatrix normalMatrices[VIEW_ID]"].join("\n")),d=(d=d.replace("#version 300 es\n",["#version 300 es\n","#extension GL_OVR_multiview2 : require","#define VIEW_ID gl_ViewID_OVR"].join("\n"))).replace("uniform mat4 viewMatrix;",["uniform mat4 viewMatrices["+E+"];","#define viewMatrix viewMatrices[VIEW_ID]"].join("\n")))}var O,L,P=d+y,R=Zr(m,35633,h+v),I=Zr(m,35632,P);if(m.attachShader(C,R),m.attachShader(C,I),void 0!==s.index0AttributeName?m.bindAttribLocation(C,0,s.index0AttributeName):!0===s.morphTargets&&m.bindAttribLocation(C,0,"position"),m.linkProgram(C),t.debug.checkShaderErrors){var k=m.getProgramInfoLog(C).trim(),B=m.getShaderInfoLog(R).trim(),F=m.getShaderInfoLog(I).trim(),N=!0,j=!0;if(!1===m.getProgramParameter(C,35714)){N=!1;var z=Qr(m,R,"vertex"),V=Qr(m,I,"fragment");console.error("THREE.WebGLProgram: shader error: ",m.getError(),"35715",m.getProgramParameter(C,35715),"gl.getProgramInfoLog",k,z,V)}else""!==k?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",k):""!==B&&""!==F||(j=!1);j&&(this.diagnostics={runnable:N,programLog:k,vertexShader:{log:B,prefix:h},fragmentShader:{log:F,prefix:d}})}return m.deleteShader(R),m.deleteShader(I),this.getUniforms=function(){return void 0===O&&(O=new Yr(m,C)),O},this.getAttributes=function(){return void 0===L&&(L=function(t,e){for(var n={},r=t.getProgramParameter(e,35721),i=0;i<r;i++){var a=t.getActiveAttrib(e,i).name;n[a]=t.getAttribLocation(e,a)}return n}(m,C)),L},this.destroy=function(){m.deleteProgram(C),this.program=void 0},this.name=s.shaderName,this.id=$r++,this.cacheKey=e,this.usedTimes=1,this.program=C,this.vertexShader=R,this.fragmentShader=I,this.numMultiviewViews=E,this}function di(t,e,n){var r=[],i=n.isWebGL2,s=n.logarithmicDepthBuffer,l=n.floatVertexTextures,u=n.precision,c=n.maxVertexUniforms,h=n.vertexTextures,d={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"},p=["precision","isWebGL2","supportsVertexTextures","outputEncoding","instancing","numMultiviewViews","map","mapEncoding","matcap","matcapEncoding","envMap","envMapMode","envMapEncoding","envMapCubeUV","lightMap","lightMapEncoding","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","objectSpaceNormalMap","tangentSpaceNormalMap","clearcoatNormalMap","displacementMap","specularMap","roughnessMap","metalnessMap","gradientMap","alphaMap","combine","vertexColors","vertexTangents","vertexUvs","uvsVertexOnly","fog","useFog","fogExp2","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","maxMorphTargets","maxMorphNormals","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","numRectAreaLights","numDirLightShadows","numPointLightShadows","numSpotLightShadows","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","alphaTest","doubleSided","flipSided","numClippingPlanes","numClipIntersection","depthPacking","dithering","sheen"];function f(t){var e;return t?t.isTexture?e=t.encoding:t.isWebGLRenderTarget&&(console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."),e=t.texture.encoding):e=j,e}this.getParameters=function(r,p,m,g,v,y,x){var b=g.fog,w=r.isMeshStandardMaterial?g.environment:null,_=r.envMap||w,M=d[r.type],S=x.isSkinnedMesh?function(t){var e=x.skeleton.bones;if(l)return 1024;var n=c,r=Math.floor((n-20)/4),i=Math.min(r,e.length);return i<e.length?(console.warn("THREE.WebGLRenderer: Skeleton has "+e.length+" bones. This GPU supports "+i+"."),0):i}():0;null!==r.precision&&(u=n.getMaxPrecision(r.precision))!==r.precision&&console.warn("THREE.WebGLProgram.getParameters:",r.precision,"not supported, using",u,"instead.");var T=function(t,e){var n;if(M){var r=Xn[M];n={name:t.type,uniforms:Rn.clone(r.uniforms),vertexShader:r.vertexShader,fragmentShader:r.fragmentShader}}else n={name:t.type,uniforms:t.uniforms,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader};return n}(r);r.onBeforeCompile(T,t);var C=t.getRenderTarget(),E=C&&C.isWebGLMultiviewRenderTarget?C.numViews:0;return{isWebGL2:i,shaderID:M,shaderName:T.name,uniforms:T.uniforms,vertexShader:T.vertexShader,fragmentShader:T.fragmentShader,defines:r.defines,isRawShaderMaterial:r.isRawShaderMaterial,isShaderMaterial:r.isShaderMaterial,precision:u,instancing:!0===x.isInstancedMesh,supportsVertexTextures:h,numMultiviewViews:E,outputEncoding:null!==C?f(C.texture):t.outputEncoding,map:!!r.map,mapEncoding:f(r.map),matcap:!!r.matcap,matcapEncoding:f(r.matcap),envMap:!!_,envMapMode:_&&_.mapping,envMapEncoding:f(_),envMapCubeUV:!!_&&(_.mapping===a||_.mapping===o),lightMap:!!r.lightMap,lightMapEncoding:f(r.lightMap),aoMap:!!r.aoMap,emissiveMap:!!r.emissiveMap,emissiveMapEncoding:f(r.emissiveMap),bumpMap:!!r.bumpMap,normalMap:!!r.normalMap,objectSpaceNormalMap:1===r.normalMapType,tangentSpaceNormalMap:0===r.normalMapType,clearcoatNormalMap:!!r.clearcoatNormalMap,displacementMap:!!r.displacementMap,roughnessMap:!!r.roughnessMap,metalnessMap:!!r.metalnessMap,specularMap:!!r.specularMap,alphaMap:!!r.alphaMap,gradientMap:!!r.gradientMap,sheen:!!r.sheen,combine:r.combine,vertexTangents:r.normalMap&&r.vertexTangents,vertexColors:r.vertexColors,vertexUvs:!!(r.map||r.bumpMap||r.normalMap||r.specularMap||r.alphaMap||r.emissiveMap||r.roughnessMap||r.metalnessMap||r.clearcoatNormalMap||r.displacementMap),uvsVertexOnly:!(r.map||r.bumpMap||r.normalMap||r.specularMap||r.alphaMap||r.emissiveMap||r.roughnessMap||r.metalnessMap||r.clearcoatNormalMap||!r.displacementMap),fog:!!b,useFog:r.fog,fogExp2:b&&b.isFogExp2,flatShading:r.flatShading,sizeAttenuation:r.sizeAttenuation,logarithmicDepthBuffer:s,skinning:r.skinning&&0<S,maxBones:S,useVertexTexture:l,morphTargets:r.morphTargets,morphNormals:r.morphNormals,maxMorphTargets:t.maxMorphTargets,maxMorphNormals:t.maxMorphNormals,numDirLights:p.directional.length,numPointLights:p.point.length,numSpotLights:p.spot.length,numRectAreaLights:p.rectArea.length,numHemiLights:p.hemi.length,numDirLightShadows:p.directionalShadowMap.length,numPointLightShadows:p.pointShadowMap.length,numSpotLightShadows:p.spotShadowMap.length,numClippingPlanes:v,numClipIntersection:y,dithering:r.dithering,shadowMapEnabled:t.shadowMap.enabled&&0<m.length,shadowMapType:t.shadowMap.type,toneMapping:r.toneMapped?t.toneMapping:0,physicallyCorrectLights:t.physicallyCorrectLights,premultipliedAlpha:r.premultipliedAlpha,alphaTest:r.alphaTest,doubleSided:2===r.side,flipSided:1===r.side,depthPacking:void 0!==r.depthPacking&&r.depthPacking,index0AttributeName:r.index0AttributeName,extensionDerivatives:r.extensions&&r.extensions.derivatives,extensionFragDepth:r.extensions&&r.extensions.frawbuffers,extensionDrawbuffers:r.extensions&&r.extensions.drawbuffers,extensionShaderTextureLOD:r.extensions&&r.extensions.shaderTextureLOD,rendererExtensionFragDepth:i||null!==e.get("EXT_frag_depth"),rendererExtensionDrawBuffers:i||null!==e.get("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:i||null!==e.get("EXT_shader_texture_lod"),onBeforeCompile:r.onBeforeCompile}},this.getProgramCacheKey=function(e){var n=[];if(e.shaderID?n.push(e.shaderID):(n.push(e.fragmentShader),n.push(e.vertexShader)),void 0!==e.defines)for(var r in e.defines)n.push(r),n.push(e.defines[r]);if(void 0===e.isRawShaderMaterial){for(var i=0;i<p.length;i++)n.push(e[p[i]]);n.push(t.outputEncoding),n.push(t.gammaFactor)}return n.push(e.onBeforeCompile.toString()),n.join()},this.acquireProgram=function(e,n){for(var i,a=0,o=r.length;a<o;a++){var s=r[a];if(s.cacheKey===n){++(i=s).usedTimes;break}}return void 0===i&&(i=new hi(t,n,e),r.push(i)),i},this.releaseProgram=function(t){if(0==--t.usedTimes){var e=r.indexOf(t);r[e]=r[r.length-1],r.pop(),t.destroy()}},this.programs=r}function pi(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.program!==e.program?t.program.id-e.program.id:t.material.id!==e.material.id?t.material.id-e.material.id:t.z!==e.z?t.z-e.z:t.id-e.id}function fi(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.z!==e.z?e.z-t.z:t.id-e.id}function mi(){var t=[],e=0,n=[],r=[],i={id:-1};function a(n,r,a,o,s,l){var u=t[e];return void 0===u?(u={id:n.id,object:n,geometry:r,material:a,program:a.program||i,groupOrder:o,renderOrder:n.renderOrder,z:s,group:l},t[e]=u):(u.id=n.id,u.object=n,u.geometry=r,u.material=a,u.program=a.program||i,u.groupOrder=o,u.renderOrder=n.renderOrder,u.z=s,u.group=l),e++,u}return{opaque:n,transparent:r,init:function(){e=0,n.length=0,r.length=0},push:function(t,e,i,o,s,l){var u=a(t,e,i,o,s,l);(!0===i.transparent?r:n).push(u)},unshift:function(t,e,i,o,s,l){var u=a(t,e,i,o,s,l);(!0===i.transparent?r:n).unshift(u)},sort:function(t,e){1<n.length&&n.sort(t||pi),1<r.length&&r.sort(e||fi)}}}var gi=0;function vi(t,e){return(e.castShadow?1:0)-(t.castShadow?1:0)}function yi(){for(var t=new function(){var t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];var n;switch(e.type){case"DirectionalLight":n={direction:new ht,color:new De,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new tt};break;case"SpotLight":n={position:new ht,direction:new ht,color:new De,distance:0,coneCos:0,penumbraCos:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new tt};break;case"PointLight":n={position:new ht,color:new De,distance:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new tt,shadowCameraNear:1,shadowCameraFar:1e3};break;case"HemisphereLight":n={direction:new ht,skyColor:new De,groundColor:new De};break;case"RectAreaLight":n={color:new De,position:new ht,halfWidth:new ht,halfHeight:new ht}}return t[e.id]=n}}},e={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],point:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},n=0;n<9;n++)e.probe.push(new ht);var r=new ht,i=new xt,a=new xt;return{setup:function(n,o,s){for(var l=0,u=0,c=0,h=0;h<9;h++)e.probe[h].set(0,0,0);var d=0,p=0,f=0,m=0,g=0,v=0,y=0,x=0,b=s.matrixWorldInverse;n.sort(vi),h=0;for(var w=n.length;h<w;h++){var _=n[h],M=_.color,S=_.intensity,T=_.distance,C=_.shadow&&_.shadow.map?_.shadow.map.texture:null;if(_.isAmbientLight)l+=M.r*S,u+=M.g*S,c+=M.b*S;else if(_.isLightProbe)for(var E=0;E<9;E++)e.probe[E].addScaledVector(_.sh.coefficients[E],S);else if(_.isDirectionalLight){if((A=t.get(_)).color.copy(_.color).multiplyScalar(_.intensity),A.direction.setFromMatrixPosition(_.matrixWorld),r.setFromMatrixPosition(_.target.matrixWorld),A.direction.sub(r),A.direction.transformDirection(b),A.shadow=_.castShadow,_.castShadow){var D=_.shadow;A.shadowBias=D.bias,A.shadowRadius=D.radius,A.shadowMapSize=D.mapSize,e.directionalShadowMap[d]=C,e.directionalShadowMatrix[d]=_.shadow.matrix,v++}e.directional[d]=A,d++}else if(_.isSpotLight)(A=t.get(_)).position.setFromMatrixPosition(_.matrixWorld),A.position.applyMatrix4(b),A.color.copy(M).multiplyScalar(S),A.distance=T,A.direction.setFromMatrixPosition(_.matrixWorld),r.setFromMatrixPosition(_.target.matrixWorld),A.direction.sub(r),A.direction.transformDirection(b),A.coneCos=Math.cos(_.angle),A.penumbraCos=Math.cos(_.angle*(1-_.penumbra)),A.decay=_.decay,A.shadow=_.castShadow,_.castShadow&&(D=_.shadow,A.shadowBias=D.bias,A.shadowRadius=D.radius,A.shadowMapSize=D.mapSize,e.spotShadowMap[f]=C,e.spotShadowMatrix[f]=_.shadow.matrix,x++),e.spot[f]=A,f++;else if(_.isRectAreaLight)(A=t.get(_)).color.copy(M).multiplyScalar(S),A.position.setFromMatrixPosition(_.matrixWorld),A.position.applyMatrix4(b),a.identity(),i.copy(_.matrixWorld),i.premultiply(b),a.extractRotation(i),A.halfWidth.set(.5*_.width,0,0),A.halfHeight.set(0,.5*_.height,0),A.halfWidth.applyMatrix4(a),A.halfHeight.applyMatrix4(a),e.rectArea[m]=A,m++;else if(_.isPointLight)(A=t.get(_)).position.setFromMatrixPosition(_.matrixWorld),A.position.applyMatrix4(b),A.color.copy(_.color).multiplyScalar(_.intensity),A.distance=_.distance,A.decay=_.decay,A.shadow=_.castShadow,_.castShadow&&(D=_.shadow,A.shadowBias=D.bias,A.shadowRadius=D.radius,A.shadowMapSize=D.mapSize,A.shadowCameraNear=D.camera.near,A.shadowCameraFar=D.camera.far,e.pointShadowMap[p]=C,e.pointShadowMatrix[p]=_.shadow.matrix,y++),e.point[p]=A,p++;else if(_.isHemisphereLight){var A;(A=t.get(_)).direction.setFromMatrixPosition(_.matrixWorld),A.direction.transformDirection(b),A.direction.normalize(),A.skyColor.copy(_.color).multiplyScalar(S),A.groundColor.copy(_.groundColor).multiplyScalar(S),e.hemi[g]=A,g++}}e.ambient[0]=l,e.ambient[1]=u,e.ambient[2]=c;var O=e.hash;O.directionalLength===d&&O.pointLength===p&&O.spotLength===f&&O.rectAreaLength===m&&O.hemiLength===g&&O.numDirectionalShadows===v&&O.numPointShadows===y&&O.numSpotShadows===x||(e.directional.length=d,e.spot.length=f,e.rectArea.length=m,e.point.length=p,e.hemi.length=g,e.directionalShadowMap.length=v,e.pointShadowMap.length=y,e.spotShadowMap.length=x,e.directionalShadowMatrix.length=v,e.pointShadowMatrix.length=y,e.spotShadowMatrix.length=x,O.directionalLength=d,O.pointLength=p,O.spotLength=f,O.rectAreaLength=m,O.hemiLength=g,O.numDirectionalShadows=v,O.numPointShadows=y,O.numSpotShadows=x,e.version=gi++)},state:e}}function xi(){var t=new yi,e=[],n=[];return{init:function(){e.length=0,n.length=0},state:{lightsArray:e,shadowsArray:n,lights:t},setupLights:function(r){t.setup(e,n,r)},pushLight:function(t){e.push(t)},pushShadow:function(t){n.push(t)}}}function bi(t){Ie.call(this),this.type="MeshDepthMaterial",this.depthPacking=3200,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.setValues(t)}function wi(t){Ie.call(this),this.type="MeshDistanceMaterial",this.referencePosition=new ht,this.nearDistance=1,this.farDistance=1e3,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.setValues(t)}function _i(t,e,n){var r=new Gn,i=new tt,a=new tt,o=new at,s=[],l=[],u={},h={0:1,1:0,2:2},d=new In({defines:{SAMPLE_RATE:.25,HALF_SAMPLE_RATE:1/8},uniforms:{shadow_pass:{value:null},resolution:{value:new tt},radius:{value:4}},vertexShader:"void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include <packing>\nvoid main() {\n float mean = 0.0;\n float squared_mean = 0.0;\n\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy ) / resolution ) );\n for ( float i = -1.0; i < 1.0 ; i += SAMPLE_RATE) {\n #ifdef HORIZONAL_PASS\n vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( i, 0.0 ) * radius ) / resolution ) );\n mean += distribution.x;\n squared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n #else\n float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, i ) * radius ) / resolution ) );\n mean += depth;\n squared_mean += depth * depth;\n #endif\n }\n mean = mean * HALF_SAMPLE_RATE;\n squared_mean = squared_mean * HALF_SAMPLE_RATE;\n float std_dev = sqrt( squared_mean - mean * mean );\n gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"}),f=d.clone();f.defines.HORIZONAL_PASS=1;var m=new nn;m.setAttribute("position",new Fe(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));var g=new wn(m,d),v=this;function y(n,r){var i=e.update(g);d.uniforms.shadow_pass.value=n.map.texture,d.uniforms.resolution.value=n.mapSize,d.uniforms.radius.value=n.radius,t.setRenderTarget(n.mapPass),t.clear(),t.renderBufferDirect(r,null,i,d,g,null),f.uniforms.shadow_pass.value=n.mapPass.texture,f.uniforms.resolution.value=n.mapSize,f.uniforms.radius.value=n.radius,t.setRenderTarget(n.map),t.clear(),t.renderBufferDirect(r,null,i,f,g,null)}function x(t,e,n){var r=t<<0|e<<1|n<<2,i=s[r];return void 0===i&&(i=new bi({depthPacking:3201,morphTargets:t,skinning:e}),s[r]=i),i}function b(t,e,n){var r=t<<0|e<<1|n<<2,i=l[r];return void 0===i&&(i=new wi({morphTargets:t,skinning:e}),l[r]=i),i}function w(e,n,r,i,a,o){var s=e.geometry,l=null,c=x,d=e.customDepthMaterial;if(!0===r.isPointLight&&(c=b,d=e.customDistanceMaterial),void 0===d){var p=!1;!0===n.morphTargets&&(!0===s.isBufferGeometry?p=s.morphAttributes&&s.morphAttributes.position&&0<s.morphAttributes.position.length:!0===s.isGeometry&&(p=s.morphTargets&&0<s.morphTargets.length));var f=!1;!0===e.isSkinnedMesh&&(!0===n.skinning?f=!0:console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",e)),l=c(p,f,!0===e.isInstancedMesh)}else l=d;if(t.localClippingEnabled&&!0===n.clipShadows&&0!==n.clippingPlanes.length){var m=l.uuid,g=n.uuid,v=u[m];void 0===v&&(v={},u[m]=v);var y=v[g];void 0===y&&(y=l.clone(),v[g]=y),l=y}return l.visible=n.visible,l.wireframe=n.wireframe,l.side=3===o?null!==n.shadowSide?n.shadowSide:n.side:null!==n.shadowSide?n.shadowSide:h[n.side],l.clipShadows=n.clipShadows,l.clippingPlanes=n.clippingPlanes,l.clipIntersection=n.clipIntersection,l.wireframeLinewidth=n.wireframeLinewidth,l.linewidth=n.linewidth,!0===r.isPointLight&&!0===l.isMeshDistanceMaterial&&(l.referencePosition.setFromMatrixPosition(r.matrixWorld),l.nearDistance=i,l.farDistance=a),l}function _(n,i,a,o,s){if(!1!==n.visible){if(n.layers.test(i.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&3===s)&&(!n.frustumCulled||r.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(a.matrixWorldInverse,n.matrixWorld);var l=e.update(n),u=n.material;if(Array.isArray(u))for(var c=l.groups,h=0,d=c.length;h<d;h++){var p=c[h],f=u[p.materialIndex];if(f&&f.visible){var m=w(n,f,o,a.near,a.far,s);t.renderBufferDirect(a,null,l,m,n,p)}}else u.visible&&(m=w(n,u,o,a.near,a.far,s),t.renderBufferDirect(a,null,l,m,n,null))}for(var g=n.children,v=0,y=g.length;v<y;v++)_(g[v],i,a,o,s)}}this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=1,this.render=function(e,s,l){if(!1!==v.enabled&&(!1!==v.autoUpdate||!1!==v.needsUpdate)&&0!==e.length){var u=t.getRenderTarget(),h=t.getActiveCubeFace(),d=t.getActiveMipmapLevel(),f=t.state;f.setBlending(0),f.buffers.color.setClear(1,1,1,1),f.buffers.depth.setTest(!0),f.setScissorTest(!1);for(var m=0,g=e.length;m<g;m++){var x=e[m],b=x.shadow;if(void 0!==b){i.copy(b.mapSize);var w=b.getFrameExtents();if(i.multiply(w),a.copy(b.mapSize),(i.x>n||i.y>n)&&(console.warn("THREE.WebGLShadowMap:",x,"has shadow exceeding max texture size, reducing"),i.x>n&&(a.x=Math.floor(n/w.x),i.x=a.x*w.x,b.mapSize.x=a.x),i.y>n&&(a.y=Math.floor(n/w.y),i.y=a.y*w.y,b.mapSize.y=a.y)),null===b.map&&!b.isPointLightShadow&&3===this.type){var S={minFilter:p,magFilter:p,format:M};b.map=new ot(i.x,i.y,S),b.map.texture.name=x.name+".shadowMap",b.mapPass=new ot(i.x,i.y,S),b.camera.updateProjectionMatrix()}null===b.map&&(S={minFilter:c,magFilter:c,format:M},b.map=new ot(i.x,i.y,S),b.map.texture.name=x.name+".shadowMap",b.camera.updateProjectionMatrix()),t.setRenderTarget(b.map),t.clear();for(var T=b.getViewportCount(),C=0;C<T;C++){var E=b.getViewport(C);o.set(a.x*E.x,a.y*E.y,a.x*E.z,a.y*E.w),f.viewport(o),b.updateMatrices(x,C),r=b.getFrustum(),_(s,l,b.camera,x,this.type)}b.isPointLightShadow||3!==this.type||y(b,l)}else console.warn("THREE.WebGLShadowMap:",x,"has no shadow.")}v.needsUpdate=!1,t.setRenderTarget(u,h,d)}}}function Mi(t,n,r){var i=r.isWebGL2,a=new function(){var e=!1,n=new at,r=null,i=new at(0,0,0,0);return{setMask:function(n){r===n||e||(t.colorMask(n,n,n,n),r=n)},setLocked:function(t){e=t},setClear:function(e,r,a,o,s){!0===s&&(e*=o,r*=o,a*=o),n.set(e,r,a,o),!1===i.equals(n)&&(t.clearColor(e,r,a,o),i.copy(n))},reset:function(){e=!1,r=null,i.set(-1,0,0,0)}}},o=new function(){var e=!1,n=null,r=null,i=null;return{setTest:function(t){(t?j:z)(2929)},setMask:function(r){n===r||e||(t.depthMask(r),n=r)},setFunc:function(e){if(r!==e){if(e)switch(e){case 0:t.depthFunc(512);break;case 1:t.depthFunc(519);break;case 2:t.depthFunc(513);break;case 3:default:t.depthFunc(515);break;case 4:t.depthFunc(514);break;case 5:t.depthFunc(518);break;case 6:t.depthFunc(516);break;case 7:t.depthFunc(517)}else t.depthFunc(515);r=e}},setLocked:function(t){e=t},setClear:function(e){i!==e&&(t.clearDepth(e),i=e)},reset:function(){e=!1,i=r=n=null}}},s=new function(){var e=!1,n=null,r=null,i=null,a=null,o=null,s=null,l=null,u=null;return{setTest:function(t){e||(t?j:z)(2960)},setMask:function(r){n===r||e||(t.stencilMask(r),n=r)},setFunc:function(e,n,o){r===e&&i===n&&a===o||(t.stencilFunc(e,n,o),r=e,i=n,a=o)},setOp:function(e,n,r){o===e&&s===n&&l===r||(t.stencilOp(e,n,r),o=e,s=n,l=r)},setLocked:function(t){e=t},setClear:function(e){u!==e&&(t.clearStencil(e),u=e)},reset:function(){e=!1,u=l=s=o=a=i=r=n=null}}},l=t.getParameter(34921),u=new Uint8Array(l),c=new Uint8Array(l),h=new Uint8Array(l),d={},p=null,f=null,m=null,g=null,v=null,y=null,x=null,b=null,w=null,_=!1,M=null,S=null,T=null,C=null,E=null,D=t.getParameter(35661),A=!1,O=0,L=t.getParameter(7938);-1!==L.indexOf("WebGL")?(O=parseFloat(/^WebGL\ ([0-9])/.exec(L)[1]),A=1<=O):-1!==L.indexOf("OpenGL ES")&&(O=parseFloat(/^OpenGL\ ES\ ([0-9])/.exec(L)[1]),A=2<=O);var P=null,R={},I=new at,k=new at;function B(e,n,r){var i=new Uint8Array(4),a=t.createTexture();t.bindTexture(e,a),t.texParameteri(e,10241,9728),t.texParameteri(e,10240,9728);for(var o=0;o<r;o++)t.texImage2D(n+o,0,6408,1,1,0,6408,5121,i);return a}var F={};function N(e,r){u[e]=1,0===c[e]&&(t.enableVertexAttribArray(e),c[e]=1),h[e]!==r&&((i?t:n.get("ANGLE_instanced_arrays"))[i?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](e,r),h[e]=r)}function j(e){!0!==d[e]&&(t.enable(e),d[e]=!0)}function z(e){!1!==d[e]&&(t.disable(e),d[e]=!1)}F[3553]=B(3553,3553,1),F[34067]=B(34067,34069,6),a.setClear(0,0,0,1),o.setClear(1),s.setClear(0),j(2929),o.setFunc(3),W(!1),J(1),j(2884),H(0);var V={100:32774,101:32778,102:32779};if(i)V[103]=32775,V[104]=32776;else{var G=n.get("EXT_blend_minmax");null!==G&&(V[103]=G.MIN_EXT,V[104]=G.MAX_EXT)}var U={};function H(n,r,i,a,o,s,l,u){if(0!==n){if(f||(j(3042),f=!0),5===n)o=o||r,s=s||i,l=l||a,r===g&&o===x||(t.blendEquationSeparate(V[r],V[o]),g=r,x=o),i===v&&a===y&&s===b&&l===w||(t.blendFuncSeparate(U[i],U[a],U[s],U[l]),v=i,y=a,b=s,w=l),m=n,_=null;else if(n!==m||u!==_){if(g===e&&x===e||(t.blendEquation(32774),x=g=e),u)switch(n){case 1:t.blendFuncSeparate(1,771,1,771);break;case 2:t.blendFunc(1,1);break;case 3:t.blendFuncSeparate(0,0,769,771);break;case 4:t.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",n)}else switch(n){case 1:t.blendFuncSeparate(770,771,1,771);break;case 2:t.blendFunc(770,1);break;case 3:t.blendFunc(0,769);break;case 4:t.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",n)}w=b=y=v=null,m=n,_=u}}else f&&(z(3042),f=!1)}function W(e){M!==e&&(e?t.frontFace(2304):t.frontFace(2305),M=e)}function J(e){0!==e?(j(2884),e!==S&&(1===e?t.cullFace(1029):2===e?t.cullFace(1028):t.cullFace(1032))):z(2884),S=e}function q(e,n,r){e?(j(32823),C===n&&E===r||(t.polygonOffset(n,r),C=n,E=r)):z(32823)}function X(e){void 0===e&&(e=33984+D-1),P!==e&&(t.activeTexture(e),P=e)}return U[200]=0,U[201]=1,U[202]=768,U[204]=770,U[210]=776,U[208]=774,U[206]=772,U[203]=769,U[205]=771,U[209]=775,U[207]=773,{buffers:{color:a,depth:o,stencil:s},initAttributes:function(){for(var t=0,e=u.length;t<e;t++)u[t]=0},enableAttribute:function(t){N(t,0)},enableAttributeAndDivisor:N,disableUnusedAttributes:function(){for(var e=0,n=c.length;e!==n;++e)c[e]!==u[e]&&(t.disableVertexAttribArray(e),c[e]=0)},enable:j,disable:z,useProgram:function(e){return p!==e&&(t.useProgram(e),p=e,!0)},setBlending:H,setMaterial:function(t,e){(2===t.side?z:j)(2884);var n=1===t.side;e&&(n=!n),W(n),1===t.blending&&!1===t.transparent?H(0):H(t.blending,t.blendEquation,t.blendSrc,t.blendDst,t.blendEquationAlpha,t.blendSrcAlpha,t.blendDstAlpha,t.premultipliedAlpha),o.setFunc(t.depthFunc),o.setTest(t.depthTest),o.setMask(t.depthWrite),a.setMask(t.colorWrite);var r=t.stencilWrite;s.setTest(r),r&&(s.setMask(t.stencilWriteMask),s.setFunc(t.stencilFunc,t.stencilRef,t.stencilFuncMask),s.setOp(t.stencilFail,t.stencilZFail,t.stencilZPass)),q(t.polygonOffset,t.polygonOffsetFactor,t.polygonOffsetUnits)},setFlipSided:W,setCullFace:J,setLineWidth:function(e){e!==T&&(A&&t.lineWidth(e),T=e)},setPolygonOffset:q,setScissorTest:function(t){(t?j:z)(3089)},activeTexture:X,bindTexture:function(e,n){null===P&&X();var r=R[P];void 0===r&&(r={type:void 0,texture:void 0},R[P]=r),r.type===e&&r.texture===n||(t.bindTexture(e,n||F[e]),r.type=e,r.texture=n)},unbindTexture:function(){var e=R[P];void 0!==e&&void 0!==e.type&&(t.bindTexture(e.type,null),e.type=void 0,e.texture=void 0)},compressedTexImage2D:function(){try{t.compressedTexImage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texImage2D:function(){try{t.texImage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texImage3D:function(){try{t.texImage3D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},scissor:function(e){!1===I.equals(e)&&(t.scissor(e.x,e.y,e.z,e.w),I.copy(e))},viewport:function(e){!1===k.equals(e)&&(t.viewport(e.x,e.y,e.z,e.w),k.copy(e))},reset:function(){for(var e=0;e<c.length;e++)1===c[e]&&(t.disableVertexAttribArray(e),c[e]=0);d={},R={},S=M=m=p=P=null,a.reset(),o.reset(),s.reset()}}}function Si(t,e,n,r,i,a,o){var s,u=i.isWebGL2,g=i.maxTextures,C=i.maxCubemapSize,E=i.maxTextureSize,D=i.maxSamples,A=new WeakMap,O=!1;try{O="undefined"!=typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(t){}function L(t,e){return O?new OffscreenCanvas(t,e):document.createElementNS("http://www.w3.org/1999/xhtml","canvas")}function P(t,e,n,r){var i=1;if((t.width>r||t.height>r)&&(i=r/Math.max(t.width,t.height)),i<1||!0===e){if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap){var a=e?Q.floorPowerOfTwo:Math.floor,o=a(i*t.width),l=a(i*t.height);void 0===s&&(s=L(o,l));var u=n?L(o,l):s;return u.width=o,u.height=l,u.getContext("2d").drawImage(t,0,0,o,l),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+t.width+"x"+t.height+") to ("+o+"x"+l+")."),u}return"data"in t&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+t.width+"x"+t.height+")."),t}return t}function R(t){return Q.isPowerOfTwo(t.width)&&Q.isPowerOfTwo(t.height)}function I(t,e){return t.generateMipmaps&&e&&t.minFilter!==c&&t.minFilter!==p}function k(e,n,i,a){t.generateMipmap(e),r.get(n).__maxMipLevel=Math.log(Math.max(i,a))*Math.LOG2E}function B(n,r,i){if(!1===u)return r;if(null!==n){if(void 0!==t[n])return t[n];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+n+"'")}var a=r;return 6403===r&&(5126===i&&(a=33326),5131===i&&(a=33325),5121===i&&(a=33321)),6407===r&&(5126===i&&(a=34837),5131===i&&(a=34843),5121===i&&(a=32849)),6408===r&&(5126===i&&(a=34836),5131===i&&(a=34842),5121===i&&(a=32856)),33325===a||33326===a||34842===a||34836===a?e.get("EXT_color_buffer_float"):34843!==a&&34837!==a||console.warn("THREE.WebGLRenderer: Floating point textures with RGB format not supported. Please use RGBA instead."),a}function F(t){return t===c||t===h||t===d?9728:9729}function N(e){var n=e.target;n.removeEventListener("dispose",N),function(e){var n=r.get(e);void 0!==n.__webglInit&&(t.deleteTexture(n.__webglTexture),r.remove(e))}(n),n.isVideoTexture&&A.delete(n),o.memory.textures--}function j(e){var n=e.target;n.removeEventListener("dispose",j),function(e){var n=r.get(e),i=r.get(e.texture);if(e){if(void 0!==i.__webglTexture&&t.deleteTexture(i.__webglTexture),e.depthTexture&&e.depthTexture.dispose(),e.isWebGLCubeRenderTarget)for(var a=0;a<6;a++)t.deleteFramebuffer(n.__webglFramebuffer[a]),n.__webglDepthbuffer&&t.deleteRenderbuffer(n.__webglDepthbuffer[a]);else t.deleteFramebuffer(n.__webglFramebuffer),n.__webglDepthbuffer&&t.deleteRenderbuffer(n.__webglDepthbuffer);if(e.isWebGLMultiviewRenderTarget){t.deleteTexture(n.__webglColorTexture),t.deleteTexture(n.__webglDepthStencilTexture),o.memory.textures-=2,a=0;for(var s=n.__webglViewFramebuffers.length;a<s;a++)t.deleteFramebuffer(n.__webglViewFramebuffers[a])}r.remove(e.texture),r.remove(e)}}(n),o.memory.textures--}var z=0;function V(t,e){var i,a,s=r.get(t);if(t.isVideoTexture&&(i=t,a=o.render.frame,A.get(i)!==a&&(A.set(i,a),i.update())),0<t.version&&s.__version!==t.version){var l=t.image;if(void 0===l)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(!1!==l.complete)return void X(s,t,e);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}n.activeTexture(33984+e),n.bindTexture(3553,s.__webglTexture)}function G(e,i){if(6===e.image.length){var o=r.get(e);if(0<e.version&&o.__version!==e.version){q(o,e),n.activeTexture(33984+i),n.bindTexture(34067,o.__webglTexture),t.pixelStorei(37440,e.flipY);for(var s=e&&(e.isCompressedTexture||e.image[0].isCompressedTexture),l=e.image[0]&&e.image[0].isDataTexture,c=[],h=0;h<6;h++)c[h]=s||l?l?e.image[h].image:e.image[h]:P(e.image[h],!1,!0,C);var d,p=c[0],f=R(p)||u,m=a.convert(e.format),g=a.convert(e.type),v=B(e.internalFormat,m,g);if(J(34067,e,f),s){for(h=0;h<6;h++){d=c[h].mipmaps;for(var y=0;y<d.length;y++){var x=d[y];e.format!==M&&e.format!==_?null!==m?n.compressedTexImage2D(34069+h,y,v,x.width,x.height,0,x.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):n.texImage2D(34069+h,y,v,x.width,x.height,0,m,g,x.data)}}o.__maxMipLevel=d.length-1}else{for(d=e.mipmaps,h=0;h<6;h++)if(l)for(n.texImage2D(34069+h,0,v,c[h].width,c[h].height,0,m,g,c[h].data),y=0;y<d.length;y++){var b=(x=d[y]).image[h].image;n.texImage2D(34069+h,y+1,v,b.width,b.height,0,m,g,b.data)}else for(n.texImage2D(34069+h,0,v,m,g,c[h]),y=0;y<d.length;y++)x=d[y],n.texImage2D(34069+h,y+1,v,m,g,x.image[h]);o.__maxMipLevel=d.length}I(e,f)&&k(34067,e,p.width,p.height),o.__version=e.version,e.onUpdate&&e.onUpdate(e)}else n.activeTexture(33984+i),n.bindTexture(34067,o.__webglTexture)}}function U(t,e){n.activeTexture(33984+e),n.bindTexture(34067,r.get(t).__webglTexture)}var H={1000:10497,1001:33071,1002:33648},W={};function J(n,a,o){o?(t.texParameteri(n,10242,H[a.wrapS]),t.texParameteri(n,10243,H[a.wrapT]),32879!==n&&35866!==n||t.texParameteri(n,32882,H[a.wrapR]),t.texParameteri(n,10240,W[a.magFilter]),t.texParameteri(n,10241,W[a.minFilter])):(t.texParameteri(n,10242,33071),t.texParameteri(n,10243,33071),32879!==n&&35866!==n||t.texParameteri(n,32882,33071),a.wrapS===l&&a.wrapT===l||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),t.texParameteri(n,10240,F(a.magFilter)),t.texParameteri(n,10241,F(a.minFilter)),a.minFilter!==c&&a.minFilter!==p&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter."));var s=e.get("EXT_texture_filter_anisotropic");if(s){if(a.type===x&&null===e.get("OES_texture_float_linear"))return;if(a.type===b&&null===(u||e.get("OES_texture_half_float_linear")))return;(1<a.anisotropy||r.get(a).__currentAnisotropy)&&(t.texParameterf(n,s.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(a.anisotropy,i.getMaxAnisotropy())),r.get(a).__currentAnisotropy=a.anisotropy)}}function q(e,n){void 0===e.__webglInit&&(e.__webglInit=!0,n.addEventListener("dispose",N),e.__webglTexture=t.createTexture(),o.memory.textures++)}function X(e,r,i){var o=3553;r.isDataTexture2DArray&&(o=35866),r.isDataTexture3D&&(o=32879),q(e,r),n.activeTexture(33984+i),n.bindTexture(o,e.__webglTexture),t.pixelStorei(37440,r.flipY),t.pixelStorei(37441,r.premultiplyAlpha),t.pixelStorei(3317,r.unpackAlignment);var s,h=(s=r,!u&&(s.wrapS!==l||s.wrapT!==l||s.minFilter!==c&&s.minFilter!==p)&&!1===R(r.image)),d=P(r.image,h,!1,E),f=R(d)||u,m=a.convert(r.format),g=a.convert(r.type),b=B(r.internalFormat,m,g);J(o,r,f);var C,D=r.mipmaps;if(r.isDepthTexture){if(b=6402,r.type===x){if(!1===u)throw new Error("Float Depth Texture only supported in WebGL2.0");b=36012}else u&&(b=33189);r.format===S&&6402===b&&r.type!==v&&r.type!==y&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),r.type=v,g=a.convert(r.type)),r.format===T&&(b=34041,r.type!==w&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),r.type=w,g=a.convert(r.type))),n.texImage2D(3553,0,b,d.width,d.height,0,m,g,null)}else if(r.isDataTexture)if(0<D.length&&f){for(var A=0,O=D.length;A<O;A++)C=D[A],n.texImage2D(3553,A,b,C.width,C.height,0,m,g,C.data);r.generateMipmaps=!1,e.__maxMipLevel=D.length-1}else n.texImage2D(3553,0,b,d.width,d.height,0,m,g,d.data),e.__maxMipLevel=0;else if(r.isCompressedTexture){for(A=0,O=D.length;A<O;A++)C=D[A],r.format!==M&&r.format!==_?null!==m?n.compressedTexImage2D(3553,A,b,C.width,C.height,0,C.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):n.texImage2D(3553,A,b,C.width,C.height,0,m,g,C.data);e.__maxMipLevel=D.length-1}else if(r.isDataTexture2DArray)n.texImage3D(35866,0,b,d.width,d.height,d.depth,0,m,g,d.data),e.__maxMipLevel=0;else if(r.isDataTexture3D)n.texImage3D(32879,0,b,d.width,d.height,d.depth,0,m,g,d.data),e.__maxMipLevel=0;else if(0<D.length&&f){for(A=0,O=D.length;A<O;A++)C=D[A],n.texImage2D(3553,A,b,m,g,C);r.generateMipmaps=!1,e.__maxMipLevel=D.length-1}else n.texImage2D(3553,0,b,m,g,d),e.__maxMipLevel=0;I(r,f)&&k(o,r,d.width,d.height),e.__version=r.version,r.onUpdate&&r.onUpdate(r)}function Y(e,i,o,s){var l=a.convert(i.texture.format),u=a.convert(i.texture.type),c=B(i.texture.internalFormat,l,u);n.texImage2D(s,0,c,i.width,i.height,0,l,u,null),t.bindFramebuffer(36160,e),t.framebufferTexture2D(36160,o,s,r.get(i.texture).__webglTexture,0),t.bindFramebuffer(36160,null)}function Z(e,n,r){if(t.bindRenderbuffer(36161,e),n.depthBuffer&&!n.stencilBuffer){if(r){var i=K(n);t.renderbufferStorageMultisample(36161,i,33189,n.width,n.height)}else t.renderbufferStorage(36161,33189,n.width,n.height);t.framebufferRenderbuffer(36160,36096,36161,e)}else if(n.depthBuffer&&n.stencilBuffer)r?(i=K(n),t.renderbufferStorageMultisample(36161,i,35056,n.width,n.height)):t.renderbufferStorage(36161,34041,n.width,n.height),t.framebufferRenderbuffer(36160,33306,36161,e);else{var o=a.convert(n.texture.format),s=a.convert(n.texture.type),l=B(n.texture.internalFormat,o,s);r?(i=K(n),t.renderbufferStorageMultisample(36161,i,l,n.width,n.height)):t.renderbufferStorage(36161,l,n.width,n.height)}t.bindRenderbuffer(36161,null)}function $(e){var n=r.get(e),i=!0===e.isWebGLCubeRenderTarget;if(e.depthTexture){if(i)throw new Error("target.depthTexture not supported in Cube render targets");!function(e,n){if(n&&n.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(36160,e),!n.depthTexture||!n.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");r.get(n.depthTexture).__webglTexture&&n.depthTexture.image.width===n.width&&n.depthTexture.image.height===n.height||(n.depthTexture.image.width=n.width,n.depthTexture.image.height=n.height,n.depthTexture.needsUpdate=!0),V(n.depthTexture,0);var i=r.get(n.depthTexture).__webglTexture;if(n.depthTexture.format===S)t.framebufferTexture2D(36160,36096,3553,i,0);else{if(n.depthTexture.format!==T)throw new Error("Unknown depthTexture format");t.framebufferTexture2D(36160,33306,3553,i,0)}}(n.__webglFramebuffer,e)}else if(i){n.__webglDepthbuffer=[];for(var a=0;a<6;a++)t.bindFramebuffer(36160,n.__webglFramebuffer[a]),n.__webglDepthbuffer[a]=t.createRenderbuffer(),Z(n.__webglDepthbuffer[a],e)}else t.bindFramebuffer(36160,n.__webglFramebuffer),n.__webglDepthbuffer=t.createRenderbuffer(),Z(n.__webglDepthbuffer,e);t.bindFramebuffer(36160,null)}function K(t){return u&&t.isWebGLMultisampleRenderTarget?Math.min(D,t.samples):0}W[c]=9728,W[h]=9984,W[d]=9986,W[p]=9729,W[f]=9985;var tt=!(W[m]=9987),et=!1;this.allocateTextureUnit=function(){var t=z;return g<=t&&console.warn("THREE.WebGLTextures: Trying to use "+t+" texture units while this GPU supports only "+g),z+=1,t},this.resetTextureUnits=function(){z=0},this.setTexture2D=V,this.setTexture2DArray=function(t,e){var i=r.get(t);0<t.version&&i.__version!==t.version?X(i,t,e):(n.activeTexture(33984+e),n.bindTexture(35866,i.__webglTexture))},this.setTexture3D=function(t,e){var i=r.get(t);0<t.version&&i.__version!==t.version?X(i,t,e):(n.activeTexture(33984+e),n.bindTexture(32879,i.__webglTexture))},this.setTextureCube=G,this.setTextureCubeDynamic=U,this.setupRenderTarget=function(i){var s=r.get(i),l=r.get(i.texture);i.addEventListener("dispose",j),l.__webglTexture=t.createTexture(),o.memory.textures++;var c=!0===i.isWebGLCubeRenderTarget,h=!0===i.isWebGLMultisampleRenderTarget,d=!0===i.isWebGLMultiviewRenderTarget,p=R(i)||u;if(c){s.__webglFramebuffer=[];for(var f=0;f<6;f++)s.__webglFramebuffer[f]=t.createFramebuffer()}else if(s.__webglFramebuffer=t.createFramebuffer(),h)if(u){s.__webglMultisampledFramebuffer=t.createFramebuffer(),s.__webglColorRenderbuffer=t.createRenderbuffer(),t.bindRenderbuffer(36161,s.__webglColorRenderbuffer);var m=a.convert(i.texture.format),g=a.convert(i.texture.type),v=B(i.texture.internalFormat,m,g),y=K(i);t.renderbufferStorageMultisample(36161,y,v,i.width,i.height),t.bindFramebuffer(36160,s.__webglMultisampledFramebuffer),t.framebufferRenderbuffer(36160,36064,36161,s.__webglColorRenderbuffer),t.bindRenderbuffer(36161,null),i.depthBuffer&&(s.__webglDepthRenderbuffer=t.createRenderbuffer(),Z(s.__webglDepthRenderbuffer,i,!0)),t.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");else if(d){var x=i.width,b=i.height,w=i.numViews;t.bindFramebuffer(36160,s.__webglFramebuffer);var _=e.get("OVR_multiview2");o.memory.textures+=2;var M=t.createTexture();t.bindTexture(35866,M),t.texParameteri(35866,10240,9728),t.texParameteri(35866,10241,9728),t.texImage3D(35866,0,32856,x,b,w,0,6408,5121,null),_.framebufferTextureMultiviewOVR(36160,36064,M,0,0,w);var S=t.createTexture();t.bindTexture(35866,S),t.texParameteri(35866,10240,9728),t.texParameteri(35866,10241,9728),t.texImage3D(35866,0,35056,x,b,w,0,34041,34042,null),_.framebufferTextureMultiviewOVR(36160,33306,S,0,0,w);var T=new Array(w);for(f=0;f<w;++f)T[f]=t.createFramebuffer(),t.bindFramebuffer(36160,T[f]),t.framebufferTextureLayer(36160,36064,M,0,f);s.__webglColorTexture=M,s.__webglDepthStencilTexture=S,s.__webglViewFramebuffers=T,t.bindFramebuffer(36160,null),t.bindTexture(35866,null)}if(c){for(n.bindTexture(34067,l.__webglTexture),J(34067,i.texture,p),f=0;f<6;f++)Y(s.__webglFramebuffer[f],i,36064,34069+f);I(i.texture,p)&&k(34067,i.texture,i.width,i.height),n.bindTexture(34067,null)}else d||(n.bindTexture(3553,l.__webglTexture),J(3553,i.texture,p),Y(s.__webglFramebuffer,i,36064,3553),I(i.texture,p)&&k(3553,i.texture,i.width,i.height),n.bindTexture(3553,null));i.depthBuffer&&$(i)},this.updateRenderTargetMipmap=function(t){var e=t.texture;if(I(e,R(t)||u)){var i=t.isWebGLCubeRenderTarget?34067:3553,a=r.get(e).__webglTexture;n.bindTexture(i,a),k(i,e,t.width,t.height),n.bindTexture(i,null)}},this.updateMultisampleRenderTarget=function(e){if(e.isWebGLMultisampleRenderTarget)if(u){var n=r.get(e);t.bindFramebuffer(36008,n.__webglMultisampledFramebuffer),t.bindFramebuffer(36009,n.__webglFramebuffer);var i=e.width,a=e.height,o=16384;e.depthBuffer&&(o|=256),e.stencilBuffer&&(o|=1024),t.blitFramebuffer(0,0,i,a,0,0,i,a,o,9728)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")},this.safeSetTexture2D=function(t,e){t&&t.isWebGLRenderTarget&&(!1===tt&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),tt=!0),t=t.texture),V(t,e)},this.safeSetTextureCube=function(t,e){t&&t.isWebGLCubeRenderTarget&&(!1===et&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),et=!0),t=t.texture),(t&&t.isCubeTexture||Array.isArray(t.image)&&6===t.image.length?G:U)(t,e)}}function Ti(t,e,n){var r=n.isWebGL2;return{convert:function(t){var n;if(t===g)return 5121;if(1017===t)return 32819;if(1018===t)return 32820;if(1019===t)return 33635;if(1010===t)return 5120;if(1011===t)return 5122;if(t===v)return 5123;if(1013===t)return 5124;if(t===y)return 5125;if(t===x)return 5126;if(t===b)return r?5131:null!==(n=e.get("OES_texture_half_float"))?n.HALF_FLOAT_OES:null;if(1021===t)return 6406;if(t===_)return 6407;if(t===M)return 6408;if(1024===t)return 6409;if(1025===t)return 6410;if(t===S)return 6402;if(t===T)return 34041;if(1028===t)return 6403;if(1029===t)return 36244;if(1030===t)return 33319;if(1031===t)return 33320;if(1032===t)return 36248;if(1033===t)return 36249;if(t===C||t===E||t===D||t===A){if(null===(n=e.get("WEBGL_compressed_texture_s3tc")))return null;if(t===C)return n.COMPRESSED_RGB_S3TC_DXT1_EXT;if(t===E)return n.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(t===D)return n.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(t===A)return n.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(t===O||t===L||t===P||t===R){if(null===(n=e.get("WEBGL_compressed_texture_pvrtc")))return null;if(t===O)return n.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(t===L)return n.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(t===P)return n.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(t===R)return n.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}return 36196===t?null!==(n=e.get("WEBGL_compressed_texture_etc1"))?n.COMPRESSED_RGB_ETC1_WEBGL:null:37808===t||37809===t||37810===t||37811===t||37812===t||37813===t||37814===t||37815===t||37816===t||37817===t||37818===t||37819===t||37820===t||37821===t?null!==(n=e.get("WEBGL_compressed_texture_astc"))?t:null:t===w?r?34042:null!==(n=e.get("WEBGL_depth_texture"))?n.UNSIGNED_INT_24_8_WEBGL:null:void 0}}}function Ci(t,e,n,r){ot.call(this,t,e,r),this.depthBuffer=!1,this.stencilBuffer=!1,this.numViews=n}function Ei(t,e){var n,r,i,a,o,s,l,u=t.extensions,c=t.properties,h=0;function d(t){return t.isArrayCamera?t.cameras:(o[0]=t,o)}this.isAvailable=function(){if(void 0===l){var t=u.get("OVR_multiview2");if(l=null!==t&&!1===e.getContextAttributes().antialias){h=e.getParameter(t.MAX_VIEWS_OVR),n=new Ci(0,0,2),s=new tt,a=[],i=[],o=[];for(var r=0;r<h;r++)a[r]=new xt,i[r]=new et}}return l},this.attachCamera=function(e){!1!==function(t){if(void 0===t.isArrayCamera)return!0;var e=t.cameras;if(e.length>h)return!1;for(var n=1,r=e.length;n<r;n++)if(e[0].viewport.z!==e[n].viewport.z||e[0].viewport.w!==e[n].viewport.w)return!1;return!0}(e)&&(r=t.getRenderTarget(),function(e){if(r?s.set(r.width,r.height):t.getDrawingBufferSize(s),e.isArrayCamera){var i=e.cameras[0].viewport;n.setSize(i.z,i.w),n.setNumViews(e.cameras.length)}else n.setSize(s.x,s.y),n.setNumViews(2)}(e),t.setRenderTarget(n))},this.detachCamera=function(i){n===t.getRenderTarget()&&(t.setRenderTarget(r),function(t){var r=n,i=r.numViews,a=c.get(r).__webglViewFramebuffers,o=r.width,l=r.height;if(t.isArrayCamera)for(var u=0;u<i;u++){var h=t.cameras[u].viewport,d=h.x,p=h.y,f=d+h.z,m=p+h.w;e.bindFramebuffer(36008,a[u]),e.blitFramebuffer(0,0,o,l,d,p,f,m,16384,9728)}else e.bindFramebuffer(36008,a[0]),e.blitFramebuffer(0,0,o,l,0,0,s.x,s.y,16384,9728)}(i))},this.updateCameraProjectionMatricesUniform=function(t,n){for(var r=d(t),i=0;i<r.length;i++)a[i].copy(r[i].projectionMatrix);n.setValue(e,"projectionMatrices",a)},this.updateCameraViewMatricesUniform=function(t,n){for(var r=d(t),i=0;i<r.length;i++)a[i].copy(r[i].matrixWorldInverse);n.setValue(e,"viewMatrices",a)},this.updateObjectMatricesUniforms=function(t,n,r){for(var o=d(n),s=0;s<o.length;s++)a[s].multiplyMatrices(o[s].matrixWorldInverse,t.matrixWorld),i[s].getNormalMatrix(a[s]);r.setValue(e,"modelViewMatrices",a),r.setValue(e,"normalMatrices",i)}}function Di(t){Bn.call(this),this.cameras=t||[]}function Ai(){Ft.call(this),this.type="Group"}function Oi(t,e){var n=this,r=null,i=null,a="local-floor",o=null,s=[],l=new Map,u=new Bn;u.layers.enable(1),u.viewport=new at;var c=new Bn;c.layers.enable(2),c.viewport=new at;var h=new Di([u,c]);h.layers.enable(1),h.layers.enable(2);var d=null,p=null;function f(t){var e=l.get(t.inputSource);e&&(e.targetRay&&e.targetRay.dispatchEvent({type:t.type}),e.grip&&e.grip.dispatchEvent({type:t.type}))}function m(){l.forEach(function(t,e){t.targetRay&&(t.targetRay.dispatchEvent({type:"disconnected",data:e}),t.targetRay.visible=!1),t.grip&&(t.grip.dispatchEvent({type:"disconnected",data:e}),t.grip.visible=!1)}),l.clear(),t.setFramebuffer(null),t.setRenderTarget(t.getRenderTarget()),_.stop(),n.isPresenting=!1,n.dispatchEvent({type:"sessionend"})}function g(t){i=t,_.setContext(r),_.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}function v(t){for(var e=r.inputSources,n=0;n<s.length;n++)l.set(e[n],s[n]);for(n=0;n<t.removed.length;n++){var i=t.removed[n];(a=l.get(i))&&(a.targetRay&&a.targetRay.dispatchEvent({type:"disconnected",data:i}),a.grip&&a.grip.dispatchEvent({type:"disconnected",data:i}),l.delete(i))}for(n=0;n<t.added.length;n++){var a;i=t.added[n],(a=l.get(i))&&(a.targetRay&&a.targetRay.dispatchEvent({type:"connected",data:i}),a.grip&&a.grip.dispatchEvent({type:"connected",data:i}))}}this.enabled=!1,this.isPresenting=!1,this.getController=function(t){var e=s[t];return void 0===e&&(e={},s[t]=e),void 0===e.targetRay&&(e.targetRay=new Ai,e.targetRay.matrixAutoUpdate=!1,e.targetRay.visible=!1),e.targetRay},this.getControllerGrip=function(t){var e=s[t];return void 0===e&&(e={},s[t]=e),void 0===e.grip&&(e.grip=new Ai,e.grip.matrixAutoUpdate=!1,e.grip.visible=!1),e.grip},this.setFramebufferScaleFactor=function(){},this.setReferenceSpaceType=function(t){a=t},this.getReferenceSpace=function(){return i},this.getSession=function(){return r},this.setSession=function(t){if(null!==(r=t)){r.addEventListener("select",f),r.addEventListener("selectstart",f),r.addEventListener("selectend",f),r.addEventListener("squeeze",f),r.addEventListener("squeezestart",f),r.addEventListener("squeezeend",f),r.addEventListener("end",m);var n=e.getContextAttributes(),i={antialias:n.antialias,alpha:n.alpha,depth:n.depth,stencil:n.stencil},o=new XRWebGLLayer(r,e,i);r.updateRenderState({baseLayer:o}),r.requestReferenceSpace(a).then(g),r.addEventListener("inputsourceschange",v)}};var y=new ht,x=new ht;function b(t,e){null===e?t.matrixWorld.copy(t.matrix):t.matrixWorld.multiplyMatrices(e.matrixWorld,t.matrix),t.matrixWorldInverse.getInverse(t.matrixWorld)}this.getCamera=function(t){h.near=c.near=u.near=t.near,h.far=c.far=u.far=t.far,d===h.near&&p===h.far||(r.updateRenderState({depthNear:h.near,depthFar:h.far}),d=h.near,p=h.far);var e=t.parent,n=h.cameras;b(h,e);for(var i=0;i<n.length;i++)b(n[i],e);t.matrixWorld.copy(h.matrixWorld);for(var a=t.children,o=(i=0,a.length);i<o;i++)a[i].updateMatrixWorld(!0);return function(t,e,n){y.setFromMatrixPosition(e.matrixWorld),x.setFromMatrixPosition(n.matrixWorld);var r=y.distanceTo(x),i=e.projectionMatrix.elements,a=n.projectionMatrix.elements,o=i[14]/(i[10]-1),s=i[14]/(i[10]+1),l=(i[9]+1)/i[5],u=(i[9]-1)/i[5],c=(i[8]-1)/i[0],h=(a[8]+1)/a[0],d=o*c,p=o*h,f=r/(h-c),m=f*-c;e.matrixWorld.decompose(t.position,t.quaternion,t.scale),t.translateX(m),t.translateZ(f),t.matrixWorld.compose(t.position,t.quaternion,t.scale),t.matrixWorldInverse.getInverse(t.matrixWorld);var g=o+f,v=s+f,b=d-m,w=r-m+p,_=l*s/v*g,M=u*s/v*g;t.projectionMatrix.makePerspective(b,w,_,M,g,v)}(h,u,c),h};var w=null,_=new Hn;_.setAnimationLoop(function(e,n){if(null!==(o=n.getViewerPose(i))){var a=o.views,l=r.renderState.baseLayer;t.setFramebuffer(l.framebuffer);for(var u=0;u<a.length;u++){var c=a[u],d=l.getViewport(c),p=h.cameras[u];p.matrix.fromArray(c.transform.matrix),p.projectionMatrix.fromArray(c.projectionMatrix),p.viewport.set(d.x,d.y,d.width,d.height),0===u&&h.matrix.copy(p.matrix)}}var f=r.inputSources;for(u=0;u<s.length;u++){var m=s[u],g=f[u],v=null,y=null;g&&(m.targetRay&&null!==(v=n.getPose(g.targetRaySpace,i))&&(m.targetRay.matrix.fromArray(v.transform.matrix),m.targetRay.matrix.decompose(m.targetRay.position,m.targetRay.rotation,m.targetRay.scale)),m.grip&&g.gripSpace&&null!==(y=n.getPose(g.gripSpace,i))&&(m.grip.matrix.fromArray(y.transform.matrix),m.grip.matrix.decompose(m.grip.position,m.grip.rotation,m.grip.scale))),m.targetRay&&(m.targetRay.visible=null!==v),m.grip&&(m.grip.visible=null!==y)}w&&w(e,n)}),this.setAnimationLoop=function(t){w=t},this.dispose=function(){}}function Li(t){var e=void 0!==(t=t||{}).canvas?t.canvas:document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),n=void 0!==t.context?t.context:null,r=void 0!==t.alpha&&t.alpha,i=void 0===t.depth||t.depth,a=void 0===t.stencil||t.stencil,o=void 0!==t.antialias&&t.antialias,s=void 0===t.premultipliedAlpha||t.premultipliedAlpha,l=void 0!==t.preserveDrawingBuffer&&t.preserveDrawingBuffer,u=void 0!==t.powerPreference?t.powerPreference:"default",c=void 0!==t.failIfMajorPerformanceCaveat&&t.failIfMajorPerformanceCaveat,h=null,d=null;this.domElement=e,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.outputEncoding=j,this.physicallyCorrectLights=!1,this.toneMapping=1,this.toneMappingExposure=1,this.toneMappingWhitePoint=1,this.maxMorphTargets=8,this.maxMorphNormals=4;var p,f,m,v,y,w,_,S,T,C,E,D,A,O,L,P,R,I,k=this,B=!1,F=null,N=0,z=0,V=null,G=null,U=-1,H={geometry:null,program:null,wireframe:!1},W=null,J=null,q=new at,X=new at,Y=null,Z=e.width,$=e.height,K=1,et=null,nt=null,rt=new at(0,0,Z,$),it=new at(0,0,Z,$),ot=!1,st=new Gn,lt=new Zn,ut=!1,ct=!1,dt=new xt,pt=new ht;function ft(){return null===V?K:1}try{var mt={alpha:r,depth:i,stencil:a,antialias:o,premultipliedAlpha:s,preserveDrawingBuffer:l,powerPreference:u,failIfMajorPerformanceCaveat:c,xrCompatible:!0};if(e.addEventListener("webglcontextlost",wt,!1),e.addEventListener("webglcontextrestored",_t,!1),null===(p=n||e.getContext("webgl",mt)||e.getContext("experimental-webgl",mt)))throw null!==e.getContext("webgl")?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.");void 0===p.getShaderPrecisionFormat&&(p.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(t){throw console.error("THREE.WebGLRenderer: "+t.message),t}function gt(){f=new function(t){var e={};return{get:function(n){if(void 0!==e[n])return e[n];var r;switch(n){case"WEBGL_depth_texture":r=t.getExtension("WEBGL_depth_texture")||t.getExtension("MOZ_WEBGL_depth_texture")||t.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":r=t.getExtension("WEBGL_compressed_texture_s3tc")||t.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":r=t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:r=t.getExtension(n)}return null===r&&console.warn("THREE.WebGLRenderer: "+n+" extension not supported."),e[n]=r}}}(p),!1===(m=new function(t,e,n){var r;function i(e){if("highp"===e){if(0<t.getShaderPrecisionFormat(35633,36338).precision&&0<t.getShaderPrecisionFormat(35632,36338).precision)return"highp";e="mediump"}return"mediump"===e&&0<t.getShaderPrecisionFormat(35633,36337).precision&&0<t.getShaderPrecisionFormat(35632,36337).precision?"mediump":"lowp"}var a="undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext||"undefined"!=typeof WebGL2ComputeRenderingContext&&t instanceof WebGL2ComputeRenderingContext,o=void 0!==n.precision?n.precision:"highp",s=i(o);s!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",s,"instead."),o=s);var l=!0===n.logarithmicDepthBuffer,u=t.getParameter(34930),c=t.getParameter(35660),h=t.getParameter(3379),d=t.getParameter(34076),p=t.getParameter(34921),f=t.getParameter(36347),m=t.getParameter(36348),g=t.getParameter(36349),v=0<c,y=a||!!e.get("OES_texture_float");return{isWebGL2:a,getMaxAnisotropy:function(){if(void 0!==r)return r;var n=e.get("EXT_texture_filter_anisotropic");return r=null!==n?t.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0},getMaxPrecision:i,precision:o,logarithmicDepthBuffer:l,maxTextures:u,maxVertexTextures:c,maxTextureSize:h,maxCubemapSize:d,maxAttributes:p,maxVertexUniforms:f,maxVaryings:m,maxFragmentUniforms:g,vertexTextures:v,floatFragmentTextures:y,floatVertexTextures:v&&y,maxSamples:a?t.getParameter(36183):0}}(p,f,t)).isWebGL2&&(f.get("WEBGL_depth_texture"),f.get("OES_texture_float"),f.get("OES_texture_half_float"),f.get("OES_texture_half_float_linear"),f.get("OES_standard_derivatives"),f.get("OES_element_index_uint"),f.get("ANGLE_instanced_arrays")),f.get("OES_texture_float_linear"),I=new Ti(0,f,m),(v=new Mi(p,f,m)).scissor(X.copy(it).multiplyScalar(K).floor()),v.viewport(q.copy(rt).multiplyScalar(K).floor()),y=new function(t){var e={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:e,programs:null,autoReset:!0,reset:function(){e.frame++,e.calls=0,e.triangles=0,e.points=0,e.lines=0},update:function(t,n,r){switch(r=r||1,e.calls++,n){case 4:e.triangles+=r*(t/3);break;case 1:e.lines+=r*(t/2);break;case 3:e.lines+=r*(t-1);break;case 2:e.lines+=r*t;break;case 0:e.points+=r*t;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",n)}}}},w=new function(){var t=new WeakMap;return{get:function(e){var n=t.get(e);return void 0===n&&(n={},t.set(e,n)),n},remove:function(e){t.delete(e)},update:function(e,n,r){t.get(e)[n]=r},dispose:function(){t=new WeakMap}}},_=new Si(p,f,v,w,m,I,y),S=new function(t,e){var n=e.isWebGL2,r=new WeakMap;return{get:function(t){return t.isInterleavedBufferAttribute&&(t=t.data),r.get(t)},remove:function(e){e.isInterleavedBufferAttribute&&(e=e.data);var n=r.get(e);n&&(t.deleteBuffer(n.buffer),r.delete(e))},update:function(e,i){e.isInterleavedBufferAttribute&&(e=e.data);var a,o,s,l,u,c=r.get(e);void 0===c?r.set(e,function(e,n){var r=e.array,i=e.usage,a=t.createBuffer();t.bindBuffer(n,a),t.bufferData(n,r,i),e.onUploadCallback();var o=5126;return r instanceof Float32Array?o=5126:r instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):r instanceof Uint16Array?o=5123:r instanceof Int16Array?o=5122:r instanceof Uint32Array?o=5125:r instanceof Int32Array?o=5124:r instanceof Int8Array?o=5120:r instanceof Uint8Array&&(o=5121),{buffer:a,type:o,bytesPerElement:r.BYTES_PER_ELEMENT,version:e.version}}(e,i)):c.version<e.version&&(a=c.buffer,s=i,l=(o=e).array,u=o.updateRange,t.bindBuffer(s,a),-1===u.count?t.bufferSubData(s,0,l):(n?t.bufferSubData(s,u.offset*l.BYTES_PER_ELEMENT,l,u.offset,u.count):t.bufferSubData(s,u.offset*l.BYTES_PER_ELEMENT,l.subarray(u.offset,u.offset+u.count)),u.count=-1),c.version=e.version)}}}(p,m),T=new function(t,e,n){var r=new WeakMap,i=new WeakMap;function a(t){var o=t.target,s=r.get(o);for(var l in null!==s.index&&e.remove(s.index),s.attributes)e.remove(s.attributes[l]);o.removeEventListener("dispose",a),r.delete(o);var u=i.get(s);u&&(e.remove(u),i.delete(s)),n.memory.geometries--}function o(t){var n=[],r=t.index,a=t.attributes.position,o=0;if(null!==r){var s=r.array;o=r.version;for(var l=0,u=s.length;l<u;l+=3){var c=s[l+0],h=s[l+1],d=s[l+2];n.push(c,h,h,d,d,c)}}else for(s=a.array,o=a.version,l=0,u=s.length/3-1;l<u;l+=3)c=l+0,h=l+1,d=l+2,n.push(c,h,h,d,d,c);var p=new(65535<Xe(n)?He:Ge)(n,1);p.version=o,e.update(p,34963);var f=i.get(t);f&&e.remove(f),i.set(t,p)}return{get:function(t,e){var i=r.get(e);return i||(e.addEventListener("dispose",a),e.isBufferGeometry?i=e:e.isGeometry&&(void 0===e._bufferGeometry&&(e._bufferGeometry=(new nn).setFromObject(t)),i=e._bufferGeometry),r.set(e,i),n.memory.geometries++,i)},update:function(t){var n=t.index,r=t.attributes;for(var i in null!==n&&e.update(n,34963),r)e.update(r[i],34962);var a=t.morphAttributes;for(var i in a)for(var o=a[i],s=0,l=o.length;s<l;s++)e.update(o[s],34962)},getWireframeAttribute:function(t){var e=i.get(t);if(e){var n=t.index;null!==n&&e.version<n.version&&o(t)}else o(t);return i.get(t)}}}(0,S,y),C=new function(t,e,n,r){var i={};return{update:function(t){var a=r.render.frame,o=t.geometry,s=e.get(t,o);return i[s.id]!==a&&(o.isGeometry&&s.updateFromObject(t),e.update(s),i[s.id]=a),t.isInstancedMesh&&n.update(t.instanceMatrix,34962),s},dispose:function(){i={}}}}(0,T,S,y),L=new function(t){var e={},n=new Float32Array(8);return{update:function(r,i,a,o){var s=r.morphTargetInfluences,l=void 0===s?0:s.length,u=e[i.id];if(void 0===u){u=[];for(var c=0;c<l;c++)u[c]=[c,0];e[i.id]=u}var h=a.morphTargets&&i.morphAttributes.position,d=a.morphNormals&&i.morphAttributes.normal;for(c=0;c<l;c++)0!==(f=u[c])[1]&&(h&&i.deleteAttribute("morphTarget"+c),d&&i.deleteAttribute("morphNormal"+c));for(c=0;c<l;c++)(f=u[c])[0]=c,f[1]=s[c];u.sort($n);var p=0;for(c=0;c<8;c++){var f;if(f=u[c]){var m=f[0],g=f[1];if(g){h&&i.setAttribute("morphTarget"+c,h[m]),d&&i.setAttribute("morphNormal"+c,d[m]),p+=n[c]=g;continue}}n[c]=0}var v=i.morphTargetsRelative?1:1-p;o.getUniforms().setValue(t,"morphTargetBaseInfluence",v),o.getUniforms().setValue(t,"morphTargetInfluences",n)}}}(p),E=new di(k,f,m),D=new function(){var t=new WeakMap;function e(n){var r=n.target;r.removeEventListener("dispose",e),t.delete(r)}return{get:function(n,r){var i,a=t.get(n);return void 0===a?(i=new mi,t.set(n,new WeakMap),t.get(n).set(r,i),n.addEventListener("dispose",e)):void 0===(i=a.get(r))&&(i=new mi,a.set(r,i)),i},dispose:function(){t=new WeakMap}}},A=new function(){var t=new WeakMap;function e(n){var r=n.target;r.removeEventListener("dispose",e),t.delete(r)}return{get:function(n,r){var i;return!1===t.has(n)?(i=new xi,t.set(n,new WeakMap),t.get(n).set(r,i),n.addEventListener("dispose",e)):!1===t.get(n).has(r)?(i=new xi,t.get(n).set(r,i)):i=t.get(n).get(r),i},dispose:function(){t=new WeakMap}}},O=new Yn(k,v,C,s),P=new function(t,e,n,r){var i,a=r.isWebGL2;this.setMode=function(t){i=t},this.render=function(e,r){t.drawArrays(i,e,r),n.update(r,i)},this.renderInstances=function(r,o,s,l){if(0!==l){var u,c;if(a)u=t,c="drawArraysInstanced";else if(c="drawArraysInstancedANGLE",null===(u=e.get("ANGLE_instanced_arrays")))return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");u[c](i,o,s,l),n.update(s,i,l)}}}(p,f,y,m),R=new function(t,e,n,r){var i,a,o,s=r.isWebGL2;this.setMode=function(t){i=t},this.setIndex=function(t){a=t.type,o=t.bytesPerElement},this.render=function(e,r){t.drawElements(i,r,a,e*o),n.update(r,i)},this.renderInstances=function(r,l,u,c){if(0!==c){var h,d;if(s)h=t,d="drawElementsInstanced";else if(d="drawElementsInstancedANGLE",null===(h=e.get("ANGLE_instanced_arrays")))return void console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");h[d](i,u,a,l*o,c),n.update(u,i,c)}}}(p,f,y,m),y.programs=E.programs,k.capabilities=m,k.extensions=f,k.properties=w,k.renderLists=D,k.state=v,k.info=y}gt();var vt=new Oi(k,p);this.xr=vt;var yt=new Ei(k,p),bt=new _i(k,C,m.maxTextureSize);function wt(t){t.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),B=!0}function _t(){console.log("THREE.WebGLRenderer: Context Restored."),B=!1,gt()}function Mt(t){var e,n=t.target;n.removeEventListener("dispose",Mt),St(e=n),w.remove(e)}function St(t){var e=w.get(t).program;(t.program=void 0)!==e&&E.releaseProgram(e)}this.shadowMap=bt,this.getContext=function(){return p},this.getContextAttributes=function(){return p.getContextAttributes()},this.forceContextLoss=function(){var t=f.get("WEBGL_lose_context");t&&t.loseContext()},this.forceContextRestore=function(){var t=f.get("WEBGL_lose_context");t&&t.restoreContext()},this.getPixelRatio=function(){return K},this.setPixelRatio=function(t){void 0!==t&&(K=t,this.setSize(Z,$,!1))},this.getSize=function(t){return void 0===t&&(console.warn("WebGLRenderer: .getsize() now requires a Vector2 as an argument"),t=new tt),t.set(Z,$)},this.setSize=function(t,n,r){vt.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(Z=t,$=n,e.width=Math.floor(t*K),e.height=Math.floor(n*K),!1!==r&&(e.style.width=t+"px",e.style.height=n+"px"),this.setViewport(0,0,t,n))},this.getDrawingBufferSize=function(t){return void 0===t&&(console.warn("WebGLRenderer: .getdrawingBufferSize() now requires a Vector2 as an argument"),t=new tt),t.set(Z*K,$*K).floor()},this.setDrawingBufferSize=function(t,n,r){Z=t,$=n,K=r,e.width=Math.floor(t*r),e.height=Math.floor(n*r),this.setViewport(0,0,t,n)},this.getCurrentViewport=function(t){return void 0===t&&(console.warn("WebGLRenderer: .getCurrentViewport() now requires a Vector4 as an argument"),t=new at),t.copy(q)},this.getViewport=function(t){return t.copy(rt)},this.setViewport=function(t,e,n,r){t.isVector4?rt.set(t.x,t.y,t.z,t.w):rt.set(t,e,n,r),v.viewport(q.copy(rt).multiplyScalar(K).floor())},this.getScissor=function(t){return t.copy(it)},this.setScissor=function(t,e,n,r){t.isVector4?it.set(t.x,t.y,t.z,t.w):it.set(t,e,n,r),v.scissor(X.copy(it).multiplyScalar(K).floor())},this.getScissorTest=function(){return ot},this.setScissorTest=function(t){v.setScissorTest(ot=t)},this.setOpaqueSort=function(t){et=t},this.setTransparentSort=function(t){nt=t},this.getClearColor=function(){return O.getClearColor()},this.setClearColor=function(){O.setClearColor.apply(O,arguments)},this.getClearAlpha=function(){return O.getClearAlpha()},this.setClearAlpha=function(){O.setClearAlpha.apply(O,arguments)},this.clear=function(t,e,n){var r=0;void 0!==t&&!t||(r|=16384),void 0!==e&&!e||(r|=256),void 0!==n&&!n||(r|=1024),p.clear(r)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){e.removeEventListener("webglcontextlost",wt,!1),e.removeEventListener("webglcontextrestored",_t,!1),D.dispose(),A.dispose(),w.dispose(),C.dispose(),vt.dispose(),Et.stop()},this.renderBufferImmediate=function(t,e){v.initAttributes();var n=w.get(t);t.hasPositions&&!n.position&&(n.position=p.createBuffer()),t.hasNormals&&!n.normal&&(n.normal=p.createBuffer()),t.hasUvs&&!n.uv&&(n.uv=p.createBuffer()),t.hasColors&&!n.color&&(n.color=p.createBuffer());var r=e.getAttributes();t.hasPositions&&(p.bindBuffer(34962,n.position),p.bufferData(34962,t.positionArray,35048),v.enableAttribute(r.position),p.vertexAttribPointer(r.position,3,5126,!1,0,0)),t.hasNormals&&(p.bindBuffer(34962,n.normal),p.bufferData(34962,t.normalArray,35048),v.enableAttribute(r.normal),p.vertexAttribPointer(r.normal,3,5126,!1,0,0)),t.hasUvs&&(p.bindBuffer(34962,n.uv),p.bufferData(34962,t.uvArray,35048),v.enableAttribute(r.uv),p.vertexAttribPointer(r.uv,2,5126,!1,0,0)),t.hasColors&&(p.bindBuffer(34962,n.color),p.bufferData(34962,t.colorArray,35048),v.enableAttribute(r.color),p.vertexAttribPointer(r.color,3,5126,!1,0,0)),v.disableUnusedAttributes(),p.drawArrays(4,0,t.count),t.count=0};var Tt=new Nt;this.renderBufferDirect=function(t,e,n,r,i,a){null===e&&(e=Tt);var o=i.isMesh&&i.matrixWorld.determinant()<0,s=Lt(t,e,r,i);v.setMaterial(r,o);var l=!1;H.geometry===n.id&&H.program===s.id&&H.wireframe===(!0===r.wireframe)||(H.geometry=n.id,H.program=s.id,H.wireframe=!0===r.wireframe,l=!0),(r.morphTargets||r.morphNormals)&&(L.update(i,n,r,s),l=!0);var u=n.index,c=n.attributes.position;if(null===u){if(void 0===c||0===c.count)return}else if(0===u.count)return;var h,d=1;!0===r.wireframe&&(u=T.getWireframeAttribute(n),d=2);var g=P;null!==u&&((h=S.get(u))?(g=R).setIndex(h):(console.log("mx attribute == null"),u=null)),l&&(function(t,e,n,r){if(!1!==m.isWebGL2||!t.isInstancedMesh&&!e.isInstancedBufferGeometry||null!==f.get("ANGLE_instanced_arrays")){v.initAttributes();var i=e.attributes,a=r.getAttributes(),o=n.defaultAttributeValues;for(var s in a){var l=a[s];if(0<=l){var u=i[s];if(void 0!==u){var c=u.normalized,h=u.itemSize;if(void 0===(_=S.get(u)))continue;var d=_.buffer,g=_.type,y=_.bytesPerElement;if(u.isInterleavedBufferAttribute){var x=u.data,b=x.stride,w=u.offset;x&&x.isInstancedInterleavedBuffer?(v.enableAttributeAndDivisor(l,x.meshPerAttribute),void 0===e.maxInstancedCount&&(e.maxInstancedCount=x.meshPerAttribute*x.count)):v.enableAttribute(l),p.bindBuffer(34962,d),p.vertexAttribPointer(l,h,g,c,b*y,w*y)}else u.isInstancedBufferAttribute?(v.enableAttributeAndDivisor(l,u.meshPerAttribute),void 0===e.maxInstancedCount&&(e.maxInstancedCount=u.meshPerAttribute*u.count)):v.enableAttribute(l),p.bindBuffer(34962,d),p.vertexAttribPointer(l,h,g,c,0,0)}else if("instanceMatrix"===s){var _;if(void 0===(_=S.get(t.instanceMatrix)))continue;d=_.buffer,g=_.type,v.enableAttributeAndDivisor(l+0,1),v.enableAttributeAndDivisor(l+1,1),v.enableAttributeAndDivisor(l+2,1),v.enableAttributeAndDivisor(l+3,1),p.bindBuffer(34962,d),p.vertexAttribPointer(l+0,4,g,!1,64,0),p.vertexAttribPointer(l+1,4,g,!1,64,16),p.vertexAttribPointer(l+2,4,g,!1,64,32),p.vertexAttribPointer(l+3,4,g,!1,64,48)}else if(void 0!==o){var M=o[s];if(void 0!==M)switch(M.length){case 2:p.vertexAttrib2fv(l,M);break;case 3:p.vertexAttrib3fv(l,M);break;case 4:p.vertexAttrib4fv(l,M);break;default:p.vertexAttrib1fv(l,M)}}}}v.disableUnusedAttributes()}}(i,n,r,s),null!==u&&p.bindBuffer(34963,h.buffer));var y=null!==u?u.count:c.count,x=n.drawRange.start*d,b=n.drawRange.count*d,w=null!==a?a.start*d:0,_=null!==a?a.count*d:1/0,M=Math.max(x,w),C=Math.min(y,x+b,w+_)-1,E=Math.max(0,C-M+1);if(0!==E){if(i.isMesh)!0===r.wireframe?(v.setLineWidth(r.wireframeLinewidth*ft()),g.setMode(1)):g.setMode(4);else if(i.isLine){var D=r.linewidth;void 0===D&&(D=1),v.setLineWidth(D*ft()),i.isLineSegments?g.setMode(1):i.isLineLoop?g.setMode(2):g.setMode(3)}else i.isPoints?g.setMode(0):i.isSprite&&g.setMode(4);i.isInstancedMesh?g.renderInstances(n,M,E,i.count):n.isInstancedBufferGeometry?g.renderInstances(n,M,E,n.maxInstancedCount):g.render(M,E)}},this.compile=function(t,e){(d=A.get(t,e)).init(),t.traverse(function(t){t.isLight&&(d.pushLight(t),t.castShadow&&d.pushShadow(t))}),d.setupLights(e);var n={};t.traverse(function(e){if(e.material)if(Array.isArray(e.material))for(var r=0;r<e.material.length;r++)e.material[r].uuid in n==0&&(Ot(e.material[r],t,e),n[e.material[r].uuid]=!0);else e.material.uuid in n==0&&(Ot(e.material,t,e),n[e.material.uuid]=!0)})};var Ct=null,Et=new Hn;function Dt(t,e,n,r){for(var i=0,a=t.length;i<a;i++){var o=t[i],s=o.object,l=o.geometry,u=void 0===r?o.material:r,c=o.group;if(n.isArrayCamera)if(J=n,vt.enabled&&yt.isAvailable())At(s,e,n,l,u,c);else for(var h=n.cameras,p=0,f=h.length;p<f;p++){var m=h[p];s.layers.test(m.layers)&&(v.viewport(q.copy(m.viewport)),d.setupLights(m),At(s,e,m,l,u,c))}else J=null,At(s,e,n,l,u,c)}}function At(t,e,n,r,i,a){if(t.onBeforeRender(k,e,n,r,i,a),d=A.get(e,J||n),t.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,t.matrixWorld),t.normalMatrix.getNormalMatrix(t.modelViewMatrix),t.isImmediateRenderObject){var o=Lt(n,e,i,t);v.setMaterial(i),H.geometry=null,H.program=null,H.wireframe=!1,s=o,t.render(function(t){k.renderBufferImmediate(t,s)})}else k.renderBufferDirect(n,e,r,i,t,a);var s;t.onAfterRender(k,e,n,r,i,a),d=A.get(e,J||n)}function Ot(t,e,n){var r=w.get(t),i=d.state.lights,a=d.state.shadowsArray,o=i.state.version,s=E.getParameters(t,i.state,a,e,lt.numPlanes,lt.numIntersection,n),l=E.getProgramCacheKey(s),u=r.program,c=!0;if(void 0===u)t.addEventListener("dispose",Mt);else if(u.cacheKey!==l)St(t);else if(r.lightsStateVersion!==o)r.lightsStateVersion=o,c=!1;else{if(void 0!==s.shaderID)return;c=!1}c&&(u=E.acquireProgram(s,l),r.program=u,r.uniforms=s.uniforms,r.environment=t.isMeshStandardMaterial?e.environment:null,r.outputEncoding=k.outputEncoding,t.program=u);var h=u.getAttributes();if(t.morphTargets)for(var p=t.numSupportedMorphTargets=0;p<k.maxMorphTargets;p++)0<=h["morphTarget"+p]&&t.numSupportedMorphTargets++;if(t.morphNormals)for(p=t.numSupportedMorphNormals=0;p<k.maxMorphNormals;p++)0<=h["morphNormal"+p]&&t.numSupportedMorphNormals++;var f,m=r.uniforms;(t.isShaderMaterial||t.isRawShaderMaterial)&&!0!==t.clipping||(r.numClippingPlanes=lt.numPlanes,r.numIntersection=lt.numIntersection,m.clippingPlanes=lt.uniform),r.fog=e.fog,r.needsLights=(f=t).isMeshLambertMaterial||f.isMeshToonMaterial||f.isMeshPhongMaterial||f.isMeshStandardMaterial||f.isShadowMaterial||f.isShaderMaterial&&!0===f.lights,r.lightsStateVersion=o,r.needsLights&&(m.ambientLightColor.value=i.state.ambient,m.lightProbe.value=i.state.probe,m.directionalLights.value=i.state.directional,m.spotLights.value=i.state.spot,m.rectAreaLights.value=i.state.rectArea,m.pointLights.value=i.state.point,m.hemisphereLights.value=i.state.hemi,m.directionalShadowMap.value=i.state.directionalShadowMap,m.directionalShadowMatrix.value=i.state.directionalShadowMatrix,m.spotShadowMap.value=i.state.spotShadowMap,m.spotShadowMatrix.value=i.state.spotShadowMatrix,m.pointShadowMap.value=i.state.pointShadowMap,m.pointShadowMatrix.value=i.state.pointShadowMatrix);var g=r.program.getUniforms(),v=Yr.seqWithValue(g.seq,m);r.uniformsList=v}function Lt(t,e,n,r){_.resetTextureUnits();var i=e.fog,a=n.isMeshStandardMaterial?e.environment:null,o=w.get(n),s=d.state.lights;if(ut&&(ct||t!==W)){var l=t===W&&n.id===U;lt.setState(n.clippingPlanes,n.clipIntersection,n.clipShadows,t,o,l)}n.version===o.__version?(void 0===o.program||n.fog&&o.fog!==i||o.environment!==a||o.needsLights&&o.lightsStateVersion!==s.state.version||void 0!==o.numClippingPlanes&&(o.numClippingPlanes!==lt.numPlanes||o.numIntersection!==lt.numIntersection)||o.outputEncoding!==k.outputEncoding)&&Ot(n,e,r):(w.update(n,"uniforms",n.uniforms),Ot(n,e,r),o.__version=n.version);var u,c,h,f,g,y,b,S,T,C,E,D,A=!1,O=!1,L=!1,P=o.program,R=P.getUniforms(),I=o.uniforms;if(v.useProgram(P.program)&&(L=O=A=!0),n.id!==U&&(U=n.id,O=!0),A||W!==t){if(0<P.numMultiviewViews?yt.updateCameraProjectionMatricesUniform(t,R):R.setValue(p,"projectionMatrix",t.projectionMatrix),m.logarithmicDepthBuffer&&R.setValue(p,"logDepthBufFC",2/(Math.log(t.far+1)/Math.LN2)),W!==t&&(W=t,L=O=!0),n.isShaderMaterial||n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshStandardMaterial||n.envMap){var B=R.map.cameraPosition;void 0!==B&&B.setValue(p,pt.setFromMatrixPosition(t.matrixWorld))}(n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial)&&R.setValue(p,"isOrthographic",!0===t.isOrthographicCamera),(n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial||n.skinning)&&(0<P.numMultiviewViews?yt.updateCameraViewMatricesUniform(t,R):R.setValue(p,"viewMatrix",t.matrixWorldInverse))}if(n.skinning){R.setOptional(p,r,"bindMatrix"),R.setOptional(p,r,"bindMatrixInverse");var F=r.skeleton;if(F){var N=F.bones;if(m.floatVertexTextures){if(void 0===F.boneTexture){var j=Math.sqrt(4*N.length);j=Q.ceilPowerOfTwo(j),j=Math.max(j,4);var z=new Float32Array(j*j*4);z.set(F.boneMatrices);var V=new jn(z,j,j,M,x);F.boneMatrices=z,F.boneTexture=V,F.boneTextureSize=j}R.setValue(p,"boneTexture",F.boneTexture,_),R.setValue(p,"boneTextureSize",F.boneTextureSize)}else R.setOptional(p,F,"boneMatrices")}}return!O&&o.receiveShadow===r.receiveShadow||(o.receiveShadow=r.receiveShadow,R.setValue(p,"receiveShadow",r.receiveShadow)),O&&(R.setValue(p,"toneMappingExposure",k.toneMappingExposure),R.setValue(p,"toneMappingWhitePoint",k.toneMappingWhitePoint),o.needsLights&&(D=L,(E=I).ambientLightColor.needsUpdate=D,E.lightProbe.needsUpdate=D,E.directionalLights.needsUpdate=D,E.pointLights.needsUpdate=D,E.spotLights.needsUpdate=D,E.rectAreaLights.needsUpdate=D,E.hemisphereLights.needsUpdate=D),i&&n.fog&&(C=i,(T=I).fogColor.value.copy(C.color),C.isFog?(T.fogNear.value=C.near,T.fogFar.value=C.far):C.isFogExp2&&(T.fogDensity.value=C.density)),n.isMeshBasicMaterial?Pt(I,n):n.isMeshLambertMaterial?(Pt(I,n),b=I,(S=n).emissiveMap&&(b.emissiveMap.value=S.emissiveMap)):n.isMeshToonMaterial?(Pt(I,n),function(t,e){t.specular.value.copy(e.specular),t.shininess.value=Math.max(e.shininess,1e-4),e.gradientMap&&(t.gradientMap.value=e.gradientMap),e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap),e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,1===e.side&&(t.bumpScale.value*=-1)),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),1===e.side&&t.normalScale.value.negate()),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(I,n)):n.isMeshPhongMaterial?(Pt(I,n),function(t,e){t.specular.value.copy(e.specular),t.shininess.value=Math.max(e.shininess,1e-4),e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap),e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,1===e.side&&(t.bumpScale.value*=-1)),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),1===e.side&&t.normalScale.value.negate()),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(I,n)):n.isMeshStandardMaterial?(Pt(I,n,a),(n.isMeshPhysicalMaterial?function(t,e,n){Rt(t,e,n),t.reflectivity.value=e.reflectivity,t.clearcoat.value=e.clearcoat,t.clearcoatRoughness.value=e.clearcoatRoughness,e.sheen&&t.sheen.value.copy(e.sheen),e.clearcoatNormalMap&&(t.clearcoatNormalScale.value.copy(e.clearcoatNormalScale),t.clearcoatNormalMap.value=e.clearcoatNormalMap,1===e.side&&t.clearcoatNormalScale.value.negate()),t.transparency.value=e.transparency}:Rt)(I,n,a)):n.isMeshMatcapMaterial?(Pt(I,n),function(t,e){e.matcap&&(t.matcap.value=e.matcap),e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,1===e.side&&(t.bumpScale.value*=-1)),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),1===e.side&&t.normalScale.value.negate()),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(I,n)):n.isMeshDepthMaterial?(Pt(I,n),g=I,(y=n).displacementMap&&(g.displacementMap.value=y.displacementMap,g.displacementScale.value=y.displacementScale,g.displacementBias.value=y.displacementBias)):n.isMeshDistanceMaterial?(Pt(I,n),function(t,e){e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias),t.referencePosition.value.copy(e.referencePosition),t.nearDistance.value=e.nearDistance,t.farDistance.value=e.farDistance}(I,n)):n.isMeshNormalMaterial?(Pt(I,n),function(t,e){e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,1===e.side&&(t.bumpScale.value*=-1)),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),1===e.side&&t.normalScale.value.negate()),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(I,n)):n.isLineBasicMaterial?(f=n,(h=I).diffuse.value.copy(f.color),h.opacity.value=f.opacity,n.isLineDashedMaterial&&(c=n,(u=I).dashSize.value=c.dashSize,u.totalSize.value=c.dashSize+c.gapSize,u.scale.value=c.scale)):n.isPointsMaterial?function(t,e){var n;t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.size.value=e.size*K,t.scale.value=.5*$,e.map&&(t.map.value=e.map),e.alphaMap&&(t.alphaMap.value=e.alphaMap),e.map?n=e.map:e.alphaMap&&(n=e.alphaMap),void 0!==n&&(!0===n.matrixAutoUpdate&&n.updateMatrix(),t.uvTransform.value.copy(n.matrix))}(I,n):n.isSpriteMaterial?function(t,e){var n;t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.rotation.value=e.rotation,e.map&&(t.map.value=e.map),e.alphaMap&&(t.alphaMap.value=e.alphaMap),e.map?n=e.map:e.alphaMap&&(n=e.alphaMap),void 0!==n&&(!0===n.matrixAutoUpdate&&n.updateMatrix(),t.uvTransform.value.copy(n.matrix))}(I,n):n.isShadowMaterial&&(I.color.value.copy(n.color),I.opacity.value=n.opacity),void 0!==I.ltc_1&&(I.ltc_1.value=Un.LTC_1),void 0!==I.ltc_2&&(I.ltc_2.value=Un.LTC_2),Yr.upload(p,o.uniformsList,I,_),n.isShaderMaterial&&(n.uniformsNeedUpdate=!1)),n.isShaderMaterial&&!0===n.uniformsNeedUpdate&&(Yr.upload(p,o.uniformsList,I,_),n.uniformsNeedUpdate=!1),n.isSpriteMaterial&&R.setValue(p,"center",r.center),0<P.numMultiviewViews?yt.updateObjectMatricesUniforms(r,t,R):(R.setValue(p,"modelViewMatrix",r.modelViewMatrix),R.setValue(p,"normalMatrix",r.normalMatrix)),R.setValue(p,"modelMatrix",r.matrixWorld),P}function Pt(t,e,n){t.opacity.value=e.opacity,e.color&&t.diffuse.value.copy(e.color),e.emissive&&t.emissive.value.copy(e.emissive).multiplyScalar(e.emissiveIntensity),e.map&&(t.map.value=e.map),e.alphaMap&&(t.alphaMap.value=e.alphaMap),e.specularMap&&(t.specularMap.value=e.specularMap);var r,i,a=e.envMap||n;a&&(t.envMap.value=a,t.flipEnvMap.value=a.isCubeTexture?-1:1,t.reflectivity.value=e.reflectivity,t.refractionRatio.value=e.refractionRatio,t.maxMipLevel.value=w.get(a).__maxMipLevel),e.lightMap&&(t.lightMap.value=e.lightMap,t.lightMapIntensity.value=e.lightMapIntensity),e.aoMap&&(t.aoMap.value=e.aoMap,t.aoMapIntensity.value=e.aoMapIntensity),e.map?r=e.map:e.specularMap?r=e.specularMap:e.displacementMap?r=e.displacementMap:e.normalMap?r=e.normalMap:e.bumpMap?r=e.bumpMap:e.roughnessMap?r=e.roughnessMap:e.metalnessMap?r=e.metalnessMap:e.alphaMap?r=e.alphaMap:e.emissiveMap&&(r=e.emissiveMap),void 0!==r&&(r.isWebGLRenderTarget&&(r=r.texture),!0===r.matrixAutoUpdate&&r.updateMatrix(),t.uvTransform.value.copy(r.matrix)),e.aoMap?i=e.aoMap:e.lightMap&&(i=e.lightMap),void 0!==i&&(i.isWebGLRenderTarget&&(i=i.texture),!0===i.matrixAutoUpdate&&i.updateMatrix(),t.uv2Transform.value.copy(i.matrix))}function Rt(t,e,n){t.roughness.value=e.roughness,t.metalness.value=e.metalness,e.roughnessMap&&(t.roughnessMap.value=e.roughnessMap),e.metalnessMap&&(t.metalnessMap.value=e.metalnessMap),e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap),e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,1===e.side&&(t.bumpScale.value*=-1)),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),1===e.side&&t.normalScale.value.negate()),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias),(e.envMap||n)&&(t.envMapIntensity.value=e.envMapIntensity)}Et.setAnimationLoop(function(t){vt.isPresenting||Ct&&Ct(t)}),"undefined"!=typeof window&&Et.setContext(window),this.setAnimationLoop=function(t){Ct=t,vt.setAnimationLoop(t),Et.start()},this.render=function(t,e){var n,r;if(void 0!==arguments[2]&&(console.warn("THREE.WebGLRenderer.render(): the renderTarget argument has been removed. Use .setRenderTarget() instead."),n=arguments[2]),void 0!==arguments[3]&&(console.warn("THREE.WebGLRenderer.render(): the forceClear argument has been removed. Use .clear() instead."),r=arguments[3]),e&&e.isCamera){if(!B){H.geometry=null,H.program=null,H.wireframe=!1,U=-1,!(W=null)===t.autoUpdate&&t.updateMatrixWorld(),null===e.parent&&e.updateMatrixWorld(),vt.enabled&&vt.isPresenting&&(e=vt.getCamera(e)),(d=A.get(t,e)).init(),t.onBeforeRender(k,t,e,n||V),dt.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),st.setFromProjectionMatrix(dt),ct=this.localClippingEnabled,ut=lt.init(this.clippingPlanes,ct,e),(h=D.get(t,e)).init(),function t(e,n,r,i){if(!1!==e.visible){if(e.layers.test(n.layers))if(e.isGroup)r=e.renderOrder;else if(e.isLOD)!0===e.autoUpdate&&e.update(n);else if(e.isLight)d.pushLight(e),e.castShadow&&d.pushShadow(e);else if(e.isSprite){if(!e.frustumCulled||st.intersectsSprite(e)){i&&pt.setFromMatrixPosition(e.matrixWorld).applyMatrix4(dt);var a=C.update(e);(o=e.material).visible&&h.push(e,a,o,r,pt.z,null)}}else if(e.isImmediateRenderObject)i&&pt.setFromMatrixPosition(e.matrixWorld).applyMatrix4(dt),h.push(e,null,e.material,r,pt.z,null);else if((e.isMesh||e.isLine||e.isPoints)&&(e.isSkinnedMesh&&e.skeleton.frame!==y.render.frame&&(e.skeleton.update(),e.skeleton.frame=y.render.frame),!e.frustumCulled||st.intersectsObject(e))){i&&pt.setFromMatrixPosition(e.matrixWorld).applyMatrix4(dt),a=C.update(e);var o=e.material;if(Array.isArray(o))for(var s=a.groups,l=0,u=s.length;l<u;l++){var c=s[l],p=o[c.materialIndex];p&&p.visible&&h.push(e,a,p,r,pt.z,c)}else o.visible&&h.push(e,a,o,r,pt.z,null)}var f=e.children;for(l=0,u=f.length;l<u;l++)t(f[l],n,r,i)}}(t,e,0,k.sortObjects),!0===k.sortObjects&&h.sort(et,nt),ut&<.beginShadows();var i=d.state.shadowsArray;bt.render(i,t,e),d.setupLights(e),ut&<.endShadows(),this.info.autoReset&&this.info.reset(),void 0!==n&&this.setRenderTarget(n),vt.enabled&&yt.isAvailable()&&yt.attachCamera(e),O.render(h,t,e,r);var a=h.opaque,o=h.transparent;if(t.overrideMaterial){var s=t.overrideMaterial;a.length&&Dt(a,t,e,s),o.length&&Dt(o,t,e,s)}else a.length&&Dt(a,t,e),o.length&&Dt(o,t,e);t.onAfterRender(k,t,e),null!==V&&(_.updateRenderTargetMipmap(V),_.updateMultisampleRenderTarget(V)),v.buffers.depth.setTest(!0),v.buffers.depth.setMask(!0),v.buffers.color.setMask(!0),v.setPolygonOffset(!1),vt.enabled&&yt.isAvailable()&&yt.detachCamera(e),d=h=null}}else console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")},this.mxRenderObject=function(t,e,n,r,i){At(t,e,n,C.update(t),r,i)},this.setFramebuffer=function(t){F!==t&&null===V&&p.bindFramebuffer(36160,t),F=t},this.getActiveCubeFace=function(){return N},this.getActiveMipmapLevel=function(){return z},this.getRenderTarget=function(){return V},this.setRenderTarget=function(t,e,n){N=e,z=n,(V=t)&&void 0===w.get(t).__webglFramebuffer&&_.setupRenderTarget(t);var r=F,i=!1;if(t){var a=w.get(t).__webglFramebuffer;t.isWebGLCubeRenderTarget?(r=a[e||0],i=!0):r=t.isWebGLMultisampleRenderTarget?w.get(t).__webglMultisampledFramebuffer:a,q.copy(t.viewport),X.copy(t.scissor),Y=t.scissorTest}else q.copy(rt).multiplyScalar(K).floor(),X.copy(it).multiplyScalar(K).floor(),Y=ot;if(G!==r&&(p.bindFramebuffer(36160,r),G=r),v.viewport(q),v.scissor(X),v.setScissorTest(Y),i){var o=w.get(t.texture);p.framebufferTexture2D(36160,36064,34069+(e||0),o.__webglTexture,n||0)}},this.readRenderTargetPixels=function(t,e,n,r,i,a,o){if(t&&t.isWebGLRenderTarget){var s=w.get(t).__webglFramebuffer;if(t.isWebGLCubeRenderTarget&&void 0!==o&&(s=s[o]),s){var l=!1;s!==G&&(p.bindFramebuffer(36160,s),l=!0);try{var u=t.texture,c=u.format,h=u.type;if(c!==M&&I.convert(c)!==p.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(!(h===g||I.convert(h)===p.getParameter(35738)||h===x&&(m.isWebGL2||f.get("OES_texture_float")||f.get("WEBGL_color_buffer_float"))||h===b&&(m.isWebGL2?f.get("EXT_color_buffer_float"):f.get("EXT_color_buffer_half_float"))))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");36053===p.checkFramebufferStatus(36160)?0<=e&&e<=t.width-r&&0<=n&&n<=t.height-i&&p.readPixels(e,n,r,i,I.convert(c),I.convert(h),a):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{l&&p.bindFramebuffer(36160,G)}}}else console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")},this.copyFramebufferToTexture=function(t,e,n){void 0===n&&(n=0);var r=Math.pow(2,-n),i=Math.floor(e.image.width*r),a=Math.floor(e.image.height*r),o=I.convert(e.format);_.setTexture2D(e,0),p.copyTexImage2D(3553,n,o,t.x,t.y,i,a,0),v.unbindTexture()},this.copyTextureToTexture=function(t,e,n,r){var i=e.image.width,a=e.image.height,o=I.convert(n.format),s=I.convert(n.type);_.setTexture2D(n,0),e.isDataTexture?p.texSubImage2D(3553,r||0,t.x,t.y,i,a,o,s,e.image.data):p.texSubImage2D(3553,r||0,t.x,t.y,o,s,e.image),v.unbindTexture()},this.initTexture=function(t){_.setTexture2D(t,0),v.unbindTexture()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}function Pi(t,e){this.name="",this.color=new De(t),this.density=void 0!==e?e:25e-5}function Ri(t,e,n){this.name="",this.color=new De(t),this.near=void 0!==e?e:1,this.far=void 0!==n?n:1e3}function Ii(t,e){this.array=t,this.stride=e,this.count=void 0!==t?t.length/e:0,this.usage=q,this.updateRange={offset:0,count:-1},this.version=0}((bi.prototype=Object.create(Ie.prototype)).constructor=bi).prototype.isMeshDepthMaterial=!0,bi.prototype.copy=function(t){return Ie.prototype.copy.call(this,t),this.depthPacking=t.depthPacking,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this},((wi.prototype=Object.create(Ie.prototype)).constructor=wi).prototype.isMeshDistanceMaterial=!0,wi.prototype.copy=function(t){return Ie.prototype.copy.call(this,t),this.referencePosition.copy(t.referencePosition),this.nearDistance=t.nearDistance,this.farDistance=t.farDistance,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this},Ci.prototype=Object.assign(Object.create(ot.prototype),{constructor:Ci,isWebGLMultiviewRenderTarget:!0,copy:function(t){return ot.prototype.copy.call(this,t),this.numViews=t.numViews,this},setNumViews:function(t){return this.numViews!==t&&(this.numViews=t,this.dispose()),this}}),Di.prototype=Object.assign(Object.create(Bn.prototype),{constructor:Di,isArrayCamera:!0}),Ai.prototype=Object.assign(Object.create(Ft.prototype),{constructor:Ai,isGroup:!0}),Object.assign(Oi.prototype,Y.prototype),Object.assign(Pi.prototype,{isFogExp2:!0,clone:function(){return new Pi(this.color,this.density)},toJSON:function(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}),Object.assign(Ri.prototype,{isFog:!0,clone:function(){return new Ri(this.color,this.near,this.far)},toJSON:function(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}),Object.defineProperty(Ii.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(Ii.prototype,{isInterleavedBuffer:!0,onUploadCallback:function(){},setUsage:function(t){return this.usage=t,this},copy:function(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this},copyAt:function(t,e,n){t*=this.stride,n*=e.stride;for(var r=0,i=this.stride;r<i;r++)this.array[t+r]=e.array[n+r];return this},set:function(t,e){return void 0===e&&(e=0),this.array.set(t,e),this},clone:function(){return(new this.constructor).copy(this)},onUpload:function(t){return this.onUploadCallback=t,this}});var ki,Bi=new ht;function Fi(t,e,n,r){this.data=t,this.itemSize=e,this.offset=n,this.normalized=!0===r}function Ni(t){Ie.call(this),this.type="SpriteMaterial",this.color=new De(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.setValues(t)}Object.defineProperties(Fi.prototype,{count:{get:function(){return this.data.count}},array:{get:function(){return this.data.array}}}),Object.assign(Fi.prototype,{isInterleavedBufferAttribute:!0,applyMatrix4:function(t){for(var e=0,n=this.data.count;e<n;e++)Bi.x=this.getX(e),Bi.y=this.getY(e),Bi.z=this.getZ(e),Bi.applyMatrix4(t),this.setXYZ(e,Bi.x,Bi.y,Bi.z);return this},setX:function(t,e){return this.data.array[t*this.data.stride+this.offset]=e,this},setY:function(t,e){return this.data.array[t*this.data.stride+this.offset+1]=e,this},setZ:function(t,e){return this.data.array[t*this.data.stride+this.offset+2]=e,this},setW:function(t,e){return this.data.array[t*this.data.stride+this.offset+3]=e,this},getX:function(t){return this.data.array[t*this.data.stride+this.offset]},getY:function(t){return this.data.array[t*this.data.stride+this.offset+1]},getZ:function(t){return this.data.array[t*this.data.stride+this.offset+2]},getW:function(t){return this.data.array[t*this.data.stride+this.offset+3]},setXY:function(t,e,n){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=n,this},setXYZ:function(t,e,n,r){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=n,this.data.array[t+2]=r,this},setXYZW:function(t,e,n,r,i){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=n,this.data.array[t+2]=r,this.data.array[t+3]=i,this}}),((Ni.prototype=Object.create(Ie.prototype)).constructor=Ni).prototype.isSpriteMaterial=!0,Ni.prototype.copy=function(t){return Ie.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.rotation=t.rotation,this.sizeAttenuation=t.sizeAttenuation,this};var ji=new ht,zi=new ht,Vi=new ht,Gi=new tt,Ui=new tt,Hi=new xt,Wi=new ht,Ji=new ht,qi=new ht,Xi=new tt,Yi=new tt,Zi=new tt;function $i(t){if(Ft.call(this),this.type="Sprite",void 0===ki){ki=new nn;var e=new Ii(new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),5);ki.setIndex([0,1,2,0,2,3]),ki.setAttribute("position",new Fi(e,3,0,!1)),ki.setAttribute("uv",new Fi(e,2,3,!1))}this.geometry=ki,this.material=void 0!==t?t:new Ni,this.center=new tt(.5,.5)}function Ki(t,e,n,r,i,a){Gi.subVectors(t,n).addScalar(.5).multiply(r),void 0!==i?(Ui.x=a*Gi.x-i*Gi.y,Ui.y=i*Gi.x+a*Gi.y):Ui.copy(Gi),t.copy(e),t.x+=Ui.x,t.y+=Ui.y,t.applyMatrix4(Hi)}$i.prototype=Object.assign(Object.create(Ft.prototype),{constructor:$i,isSprite:!0,raycast:function(t,e){null===t.camera&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),zi.setFromMatrixScale(this.matrixWorld),Hi.copy(t.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(t.camera.matrixWorldInverse,this.matrixWorld),Vi.setFromMatrixPosition(this.modelViewMatrix),t.camera.isPerspectiveCamera&&!1===this.material.sizeAttenuation&&zi.multiplyScalar(-Vi.z);var n,r,i=this.material.rotation;0!==i&&(r=Math.cos(i),n=Math.sin(i));var a=this.center;Ki(Wi.set(-.5,-.5,0),Vi,a,zi,n,r),Ki(Ji.set(.5,-.5,0),Vi,a,zi,n,r),Ki(qi.set(.5,.5,0),Vi,a,zi,n,r),Xi.set(0,0),Yi.set(1,0),Zi.set(1,1);var o=t.ray.intersectTriangle(Wi,Ji,qi,!1,ji);if(null!==o||(Ki(Ji.set(-.5,.5,0),Vi,a,zi,n,r),Yi.set(0,1),null!==(o=t.ray.intersectTriangle(Wi,qi,Ji,!1,ji)))){var s=t.ray.origin.distanceTo(ji);s<t.near||s>t.far||e.push({distance:s,point:ji.clone(),uv:Se.getUV(ji,Wi,Ji,qi,Xi,Yi,Zi,new tt),face:null,object:this})}},clone:function(){return new this.constructor(this.material).copy(this)},copy:function(t){return Ft.prototype.copy.call(this,t),void 0!==t.center&&this.center.copy(t.center),this}});var Qi=new ht,ta=new ht;function ea(){Ft.call(this),this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}function na(t,e){t&&t.isGeometry&&console.error("THREE.SkinnedMesh no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."),wn.call(this,t,e),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new xt,this.bindMatrixInverse=new xt}ea.prototype=Object.assign(Object.create(Ft.prototype),{constructor:ea,isLOD:!0,copy:function(t){Ft.prototype.copy.call(this,t,!1);for(var e=t.levels,n=0,r=e.length;n<r;n++){var i=e[n];this.addLevel(i.object.clone(),i.distance)}return this.autoUpdate=t.autoUpdate,this},addLevel:function(t,e){void 0===e&&(e=0),e=Math.abs(e);for(var n=this.levels,r=0;r<n.length&&!(e<n[r].distance);r++);return n.splice(r,0,{distance:e,object:t}),this.add(t),this},getObjectForDistance:function(t){var e=this.levels;if(0<e.length){for(var n=1,r=e.length;n<r&&!(t<e[n].distance);n++);return e[n-1].object}return null},raycast:function(t,e){if(0<this.levels.length){Qi.setFromMatrixPosition(this.matrixWorld);var n=t.ray.origin.distanceTo(Qi);this.getObjectForDistance(n).raycast(t,e)}},update:function(t){var e=this.levels;if(1<e.length){Qi.setFromMatrixPosition(t.matrixWorld),ta.setFromMatrixPosition(this.matrixWorld);var n=Qi.distanceTo(ta);e[0].object.visible=!0;for(var r=1,i=e.length;r<i&&n>=e[r].distance;r++)e[r-1].object.visible=!1,e[r].object.visible=!0;for(;r<i;r++)e[r].object.visible=!1}},toJSON:function(t){var e=Ft.prototype.toJSON.call(this,t);!1===this.autoUpdate&&(e.object.autoUpdate=!1),e.object.levels=[];for(var n=this.levels,r=0,i=n.length;r<i;r++){var a=n[r];e.object.levels.push({object:a.object.uuid,distance:a.distance})}return e}}),na.prototype=Object.assign(Object.create(wn.prototype),{constructor:na,isSkinnedMesh:!0,bind:function(t,e){this.skeleton=t,void 0===e&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),e=this.matrixWorld),this.bindMatrix.copy(e),this.bindMatrixInverse.getInverse(e)},pose:function(){this.skeleton.pose()},normalizeSkinWeights:function(){for(var t=new at,e=this.geometry.attributes.skinWeight,n=0,r=e.count;n<r;n++){t.x=e.getX(n),t.y=e.getY(n),t.z=e.getZ(n),t.w=e.getW(n);var i=1/t.manhattanLength();i!=1/0?t.multiplyScalar(i):t.set(1,0,0,0),e.setXYZW(n,t.x,t.y,t.z,t.w)}},updateMatrixWorld:function(t){wn.prototype.updateMatrixWorld.call(this,t),"attached"===this.bindMode?this.bindMatrixInverse.getInverse(this.matrixWorld):"detached"===this.bindMode?this.bindMatrixInverse.getInverse(this.bindMatrix):console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});var ra=new xt,ia=new xt;function aa(t,e){if(t=t||[],this.bones=t.slice(0),this.boneMatrices=new Float32Array(16*this.bones.length),this.frame=-1,void 0===e)this.calculateInverses();else if(this.bones.length===e.length)this.boneInverses=e.slice(0);else{console.warn("THREE.Skeleton boneInverses is the wrong length."),this.boneInverses=[];for(var n=0,r=this.bones.length;n<r;n++)this.boneInverses.push(new xt)}}function oa(){Ft.call(this),this.type="Bone"}Object.assign(aa.prototype,{calculateInverses:function(){this.boneInverses=[];for(var t=0,e=this.bones.length;t<e;t++){var n=new xt;this.bones[t]&&n.getInverse(this.bones[t].matrixWorld),this.boneInverses.push(n)}},pose:function(){var t,e,n;for(e=0,n=this.bones.length;e<n;e++)(t=this.bones[e])&&t.matrixWorld.getInverse(this.boneInverses[e]);for(e=0,n=this.bones.length;e<n;e++)(t=this.bones[e])&&(t.parent&&t.parent.isBone?(t.matrix.getInverse(t.parent.matrixWorld),t.matrix.multiply(t.matrixWorld)):t.matrix.copy(t.matrixWorld),t.matrix.decompose(t.position,t.quaternion,t.scale))},update:function(){for(var t=this.bones,e=this.boneInverses,n=this.boneMatrices,r=this.boneTexture,i=0,a=t.length;i<a;i++){var o=t[i]?t[i].matrixWorld:ia;ra.multiplyMatrices(o,e[i]),ra.toArray(n,16*i)}void 0!==r&&(r.needsUpdate=!0)},clone:function(){return new aa(this.bones,this.boneInverses)},getBoneByName:function(t){for(var e=0,n=this.bones.length;e<n;e++){var r=this.bones[e];if(r.name===t)return r}}}),oa.prototype=Object.assign(Object.create(Ft.prototype),{constructor:oa,isBone:!0});var sa=new xt,la=new xt,ua=[],ca=new wn;function ha(t,e,n){wn.call(this,t,e),this.instanceMatrix=new Fe(new Float32Array(16*n),16),this.count=n,this.frustumCulled=!1}function da(t){Ie.call(this),this.type="LineBasicMaterial",this.color=new De(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.setValues(t)}ha.prototype=Object.assign(Object.create(wn.prototype),{constructor:ha,isInstancedMesh:!0,getMatrixAt:function(t,e){e.fromArray(this.instanceMatrix.array,16*t)},raycast:function(t,e){var n=this.matrixWorld,r=this.count;if(ca.geometry=this.geometry,ca.material=this.material,void 0!==ca.material)for(var i=0;i<r;i++)this.getMatrixAt(i,sa),la.multiplyMatrices(n,sa),ca.matrixWorld=la,ca.raycast(t,ua),0<ua.length&&(ua[0].instanceId=i,ua[0].object=this,e.push(ua[0]),ua.length=0)},setMatrixAt:function(t,e){e.toArray(this.instanceMatrix.array,16*t)},updateMorphTargets:function(){}}),((da.prototype=Object.create(Ie.prototype)).constructor=da).prototype.isLineBasicMaterial=!0,da.prototype.copy=function(t){return Ie.prototype.copy.call(this,t),this.color.copy(t.color),this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this};var pa=new ht,fa=new ht,ma=new xt,ga=new ue,va=new ee;function ya(t,e,n){1===n&&console.error("THREE.Line: parameter THREE.LinePieces no longer supported. Use THREE.LineSegments instead."),Ft.call(this),this.type="Line",this.geometry=void 0!==t?t:new nn,this.material=void 0!==e?e:new da}ya.prototype=Object.assign(Object.create(Ft.prototype),{constructor:ya,isLine:!0,computeLineDistances:function(){var t=this.geometry;if(t.isBufferGeometry)if(null===t.index){for(var e=t.attributes.position,n=[0],r=1,i=e.count;r<i;r++)pa.fromBufferAttribute(e,r-1),fa.fromBufferAttribute(e,r),n[r]=n[r-1],n[r]+=pa.distanceTo(fa);t.setAttribute("lineDistance",new We(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(t.isGeometry){var a=t.vertices;for((n=t.lineDistances)[0]=0,r=1,i=a.length;r<i;r++)n[r]=n[r-1],n[r]+=a[r-1].distanceTo(a[r])}return this},raycast:function(t,e){var n=t.linePrecision,r=this.geometry,i=this.matrixWorld;if(null===r.boundingSphere&&r.computeBoundingSphere(),va.copy(r.boundingSphere),va.applyMatrix4(i),va.radius+=n,!1!==t.ray.intersectsSphere(va)){ma.getInverse(i),ga.copy(t.ray).applyMatrix4(ma);var a=n/((this.scale.x+this.scale.y+this.scale.z)/3),o=a*a,s=new ht,l=new ht,u=new ht,c=new ht,h=this&&this.isLineSegments?2:1;if(r.isBufferGeometry){var d=r.index,p=r.attributes.position.array;if(null!==d)for(var f=d.array,m=0,g=f.length-1;m<g;m+=h){var v=f[m],y=f[m+1];s.fromArray(p,3*v),l.fromArray(p,3*y),o<ga.distanceSqToSegment(s,l,c,u)||(c.applyMatrix4(this.matrixWorld),(w=t.ray.origin.distanceTo(c))<t.near||w>t.far||e.push({distance:w,point:u.clone().applyMatrix4(this.matrixWorld),index:m,face:null,faceIndex:null,object:this}))}else for(m=0,g=p.length/3-1;m<g;m+=h)s.fromArray(p,3*m),l.fromArray(p,3*m+3),o<ga.distanceSqToSegment(s,l,c,u)||(c.applyMatrix4(this.matrixWorld),(w=t.ray.origin.distanceTo(c))<t.near||w>t.far||e.push({distance:w,point:u.clone().applyMatrix4(this.matrixWorld),index:m,face:null,faceIndex:null,object:this}))}else if(r.isGeometry){var x=r.vertices,b=x.length;for(m=0;m<b-1;m+=h){var w;o<ga.distanceSqToSegment(x[m],x[m+1],c,u)||(c.applyMatrix4(this.matrixWorld),(w=t.ray.origin.distanceTo(c))<t.near||w>t.far||e.push({distance:w,point:u.clone().applyMatrix4(this.matrixWorld),index:m,face:null,faceIndex:null,object:this}))}}}},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});var xa=new ht,ba=new ht;function wa(t,e){ya.call(this,t,e),this.type="LineSegments"}function _a(t,e){ya.call(this,t,e),this.type="LineLoop"}function Ma(t){Ie.call(this),this.type="PointsMaterial",this.color=new De(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.morphTargets=!1,this.setValues(t)}wa.prototype=Object.assign(Object.create(ya.prototype),{constructor:wa,isLineSegments:!0,computeLineDistances:function(){var t=this.geometry;if(t.isBufferGeometry)if(null===t.index){for(var e=t.attributes.position,n=[],r=0,i=e.count;r<i;r+=2)xa.fromBufferAttribute(e,r),ba.fromBufferAttribute(e,r+1),n[r]=0===r?0:n[r-1],n[r+1]=n[r]+xa.distanceTo(ba);t.setAttribute("lineDistance",new We(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(t.isGeometry){var a=t.vertices;for(n=t.lineDistances,r=0,i=a.length;r<i;r+=2)xa.copy(a[r]),ba.copy(a[r+1]),n[r]=0===r?0:n[r-1],n[r+1]=n[r]+xa.distanceTo(ba)}return this}}),_a.prototype=Object.assign(Object.create(ya.prototype),{constructor:_a,isLineLoop:!0}),((Ma.prototype=Object.create(Ie.prototype)).constructor=Ma).prototype.isPointsMaterial=!0,Ma.prototype.copy=function(t){return Ie.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.size=t.size,this.sizeAttenuation=t.sizeAttenuation,this.morphTargets=t.morphTargets,this};var Sa=new xt,Ta=new ue,Ca=new ee,Ea=new ht;function Da(t,e){Ft.call(this),this.type="Points",this.geometry=void 0!==t?t:new nn,this.material=void 0!==e?e:new Ma,this.updateMorphTargets()}function Aa(t,e,n,r,i,a,o){var s=Ta.distanceSqToPoint(t);if(s<n){var l=new ht;Ta.closestPointToPoint(t,l),l.applyMatrix4(r);var u=i.ray.origin.distanceTo(l);if(u<i.near||u>i.far)return;a.push({distance:u,distanceToRay:Math.sqrt(s),point:l,index:e,face:null,object:o})}}function Oa(t,e,n,r,i,a,o,s,l){it.call(this,t,e,n,r,i,a,o,s,l),this.format=void 0!==o?o:_,this.minFilter=void 0!==a?a:p,this.magFilter=void 0!==i?i:p,this.generateMipmaps=!1}function La(t,e,n,r,i,a,o,s,l,u,c,h){it.call(this,null,a,o,s,l,u,r,i,c,h),this.image={width:e,height:n},this.mipmaps=t,this.flipY=!1,this.generateMipmaps=!1}function Pa(t,e,n,r,i,a,o,s,l){it.call(this,t,e,n,r,i,a,o,s,l),this.needsUpdate=!0}function Ra(t,e,n,r,i,a,o,s,l,u){if((u=void 0!==u?u:S)!==S&&u!==T)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&u===S&&(n=v),void 0===n&&u===T&&(n=w),it.call(this,null,r,i,a,o,s,u,n,l),this.image={width:t,height:e},this.magFilter=void 0!==o?o:c,this.minFilter=void 0!==s?s:c,this.flipY=!1,this.generateMipmaps=!1}function Ia(t){nn.call(this),this.type="WireframeGeometry";var e,n,r,i,a,o,s,l,u,c,h=[],d=[0,0],p={},f=["a","b","c"];if(t&&t.isGeometry){var m=t.faces;for(e=0,r=m.length;e<r;e++){var g=m[e];for(n=0;n<3;n++)s=g[f[n]],l=g[f[(n+1)%3]],d[0]=Math.min(s,l),d[1]=Math.max(s,l),void 0===p[u=d[0]+","+d[1]]&&(p[u]={index1:d[0],index2:d[1]})}for(u in p)o=p[u],c=t.vertices[o.index1],h.push(c.x,c.y,c.z),c=t.vertices[o.index2],h.push(c.x,c.y,c.z)}else if(t&&t.isBufferGeometry){var v,y,x,b,w,_;if(c=new ht,null!==t.index){for(v=t.attributes.position,y=t.index,0===(x=t.groups).length&&(x=[{start:0,count:y.count,materialIndex:0}]),i=0,a=x.length;i<a;++i)for(r=(e=(b=x[i]).start)+b.count;e<r;e+=3)for(n=0;n<3;n++)s=y.getX(e+n),l=y.getX(e+(n+1)%3),d[0]=Math.min(s,l),d[1]=Math.max(s,l),void 0===p[u=d[0]+","+d[1]]&&(p[u]={index1:d[0],index2:d[1]});for(u in p)o=p[u],c.fromBufferAttribute(v,o.index1),h.push(c.x,c.y,c.z),c.fromBufferAttribute(v,o.index2),h.push(c.x,c.y,c.z)}else for(e=0,r=(v=t.attributes.position).count/3;e<r;e++)for(n=0;n<3;n++)w=3*e+n,c.fromBufferAttribute(v,w),h.push(c.x,c.y,c.z),_=3*e+(n+1)%3,c.fromBufferAttribute(v,_),h.push(c.x,c.y,c.z)}this.setAttribute("position",new We(h,3))}function ka(t,e,n){Dn.call(this),this.type="ParametricGeometry",this.parameters={func:t,slices:e,stacks:n},this.fromBufferGeometry(new Ba(t,e,n)),this.mergeVertices()}function Ba(t,e,n){nn.call(this),this.type="ParametricBufferGeometry",this.parameters={func:t,slices:e,stacks:n};var r,i,a=[],o=[],s=[],l=[],u=new ht,c=new ht,h=new ht,d=new ht,p=new ht;t.length<3&&console.error("THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter.");var f=e+1;for(r=0;r<=n;r++){var m=r/n;for(i=0;i<=e;i++){var g=i/e;t(g,m,c),o.push(c.x,c.y,c.z),0<=g-1e-5?(t(g-1e-5,m,h),d.subVectors(c,h)):(t(1e-5+g,m,h),d.subVectors(h,c)),0<=m-1e-5?(t(g,m-1e-5,h),p.subVectors(c,h)):(t(g,1e-5+m,h),p.subVectors(h,c)),u.crossVectors(d,p).normalize(),s.push(u.x,u.y,u.z),l.push(g,m)}}for(r=0;r<n;r++)for(i=0;i<e;i++){var v=r*f+i,y=r*f+i+1,x=(r+1)*f+i+1,b=(r+1)*f+i;a.push(v,y,b),a.push(y,x,b)}this.setIndex(a),this.setAttribute("position",new We(o,3)),this.setAttribute("normal",new We(s,3)),this.setAttribute("uv",new We(l,2))}function Fa(t,e,n,r){Dn.call(this),this.type="PolyhedronGeometry",this.parameters={vertices:t,indices:e,radius:n,detail:r},this.fromBufferGeometry(new Na(t,e,n,r)),this.mergeVertices()}function Na(t,e,n,r){nn.call(this),this.type="PolyhedronBufferGeometry",this.parameters={vertices:t,indices:e,radius:n,detail:r},n=n||1;var i=[],a=[];function o(t,e,n,r){var i,a,o=Math.pow(2,r),l=[];for(i=0;i<=o;i++){l[i]=[];var u=t.clone().lerp(n,i/o),c=e.clone().lerp(n,i/o),h=o-i;for(a=0;a<=h;a++)l[i][a]=0===a&&i===o?u:u.clone().lerp(c,a/h)}for(i=0;i<o;i++)for(a=0;a<2*(o-i)-1;a++){var d=Math.floor(a/2);a%2==0?(s(l[i][d+1]),s(l[i+1][d]),s(l[i][d])):(s(l[i][d+1]),s(l[i+1][d+1]),s(l[i+1][d]))}}function s(t){i.push(t.x,t.y,t.z)}function l(e,n){var r=3*e;n.x=t[0+r],n.y=t[1+r],n.z=t[2+r]}function u(t,e,n,r){r<0&&1===t.x&&(a[e]=t.x-1),0===n.x&&0===n.z&&(a[e]=r/2/Math.PI+.5)}function c(t){return Math.atan2(t.z,-t.x)}!function(t){for(var n=new ht,r=new ht,i=new ht,a=0;a<e.length;a+=3)l(e[a+0],n),l(e[a+1],r),l(e[a+2],i),o(n,r,i,t)}(r=r||0),function(t){for(var e=new ht,n=0;n<i.length;n+=3)e.x=i[n+0],e.y=i[n+1],e.z=i[n+2],e.normalize().multiplyScalar(t),i[n+0]=e.x,i[n+1]=e.y,i[n+2]=e.z}(n),function(){for(var t=new ht,e=0;e<i.length;e+=3){t.x=i[e+0],t.y=i[e+1],t.z=i[e+2];var n=c(t)/2/Math.PI+.5,r=(o=t,Math.atan2(-o.y,Math.sqrt(o.x*o.x+o.z*o.z))/Math.PI+.5);a.push(n,1-r)}var o;(function(){for(var t=new ht,e=new ht,n=new ht,r=new ht,o=new tt,s=new tt,l=new tt,h=0,d=0;h<i.length;h+=9,d+=6){t.set(i[h+0],i[h+1],i[h+2]),e.set(i[h+3],i[h+4],i[h+5]),n.set(i[h+6],i[h+7],i[h+8]),o.set(a[d+0],a[d+1]),s.set(a[d+2],a[d+3]),l.set(a[d+4],a[d+5]),r.copy(t).add(e).add(n).divideScalar(3);var p=c(r);u(o,d+0,t,p),u(s,d+2,e,p),u(l,d+4,n,p)}})(),function(){for(var t=0;t<a.length;t+=6){var e=a[t+0],n=a[t+2],r=a[t+4],i=Math.max(e,n,r),o=Math.min(e,n,r);.9<i&&o<.1&&(e<.2&&(a[t+0]+=1),n<.2&&(a[t+2]+=1),r<.2&&(a[t+4]+=1))}}()}(),this.setAttribute("position",new We(i,3)),this.setAttribute("normal",new We(i.slice(),3)),this.setAttribute("uv",new We(a,2)),0===r?this.computeVertexNormals():this.normalizeNormals()}function ja(t,e){Dn.call(this),this.type="TetrahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new za(t,e)),this.mergeVertices()}function za(t,e){Na.call(this,[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],t,e),this.type="TetrahedronBufferGeometry",this.parameters={radius:t,detail:e}}function Va(t,e){Dn.call(this),this.type="OctahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new Ga(t,e)),this.mergeVertices()}function Ga(t,e){Na.call(this,[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],t,e),this.type="OctahedronBufferGeometry",this.parameters={radius:t,detail:e}}function Ua(t,e){Dn.call(this),this.type="IcosahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new Ha(t,e)),this.mergeVertices()}function Ha(t,e){var n=(1+Math.sqrt(5))/2;Na.call(this,[-1,n,0,1,n,0,-1,-n,0,1,-n,0,0,-1,n,0,1,n,0,-1,-n,0,1,-n,n,0,-1,n,0,1,-n,0,-1,-n,0,1],[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],t,e),this.type="IcosahedronBufferGeometry",this.parameters={radius:t,detail:e}}function Wa(t,e){Dn.call(this),this.type="DodecahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new Ja(t,e)),this.mergeVertices()}function Ja(t,e){var n=(1+Math.sqrt(5))/2,r=1/n;Na.call(this,[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-r,-n,0,-r,n,0,r,-n,0,r,n,-r,-n,0,-r,n,0,r,-n,0,r,n,0,-n,0,-r,n,0,-r,-n,0,r,n,0,r],[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],t,e),this.type="DodecahedronBufferGeometry",this.parameters={radius:t,detail:e}}function qa(t,e,n,r,i,a){Dn.call(this),this.type="TubeGeometry",this.parameters={path:t,tubularSegments:e,radius:n,radialSegments:r,closed:i},void 0!==a&&console.warn("THREE.TubeGeometry: taper has been removed.");var o=new Xa(t,e,n,r,i);this.tangents=o.tangents,this.normals=o.normals,this.binormals=o.binormals,this.fromBufferGeometry(o),this.mergeVertices()}function Xa(t,e,n,r,i){nn.call(this),this.type="TubeBufferGeometry",this.parameters={path:t,tubularSegments:e,radius:n,radialSegments:r,closed:i},e=e||64,n=n||1,r=r||8,i=i||!1;var a=t.computeFrenetFrames(e,i);this.tangents=a.tangents,this.normals=a.normals,this.binormals=a.binormals;var o,s,l=new ht,u=new ht,c=new tt,h=new ht,d=[],p=[],f=[],m=[];function g(i){h=t.getPointAt(i/e,h);var o=a.normals[i],c=a.binormals[i];for(s=0;s<=r;s++){var f=s/r*Math.PI*2,m=Math.sin(f),g=-Math.cos(f);u.x=g*o.x+m*c.x,u.y=g*o.y+m*c.y,u.z=g*o.z+m*c.z,u.normalize(),p.push(u.x,u.y,u.z),l.x=h.x+n*u.x,l.y=h.y+n*u.y,l.z=h.z+n*u.z,d.push(l.x,l.y,l.z)}}!function(){for(o=0;o<e;o++)g(o);g(!1===i?e:0),function(){for(o=0;o<=e;o++)for(s=0;s<=r;s++)c.x=o/e,c.y=s/r,f.push(c.x,c.y)}(),function(){for(s=1;s<=e;s++)for(o=1;o<=r;o++){var t=(r+1)*(s-1)+(o-1),n=(r+1)*s+(o-1),i=(r+1)*s+o,a=(r+1)*(s-1)+o;m.push(t,n,a),m.push(n,i,a)}}()}(),this.setIndex(m),this.setAttribute("position",new We(d,3)),this.setAttribute("normal",new We(p,3)),this.setAttribute("uv",new We(f,2))}function Ya(t,e,n,r,i,a,o){Dn.call(this),this.type="TorusKnotGeometry",this.parameters={radius:t,tube:e,tubularSegments:n,radialSegments:r,p:i,q:a},void 0!==o&&console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),this.fromBufferGeometry(new Za(t,e,n,r,i,a)),this.mergeVertices()}function Za(t,e,n,r,i,a){nn.call(this),this.type="TorusKnotBufferGeometry",this.parameters={radius:t,tube:e,tubularSegments:n,radialSegments:r,p:i,q:a},t=t||1,e=e||.4,n=Math.floor(n)||64,r=Math.floor(r)||8,i=i||2,a=a||3;var o,s,l=[],u=[],c=[],h=[],d=new ht,p=new ht,f=new ht,m=new ht,g=new ht,v=new ht,y=new ht;for(o=0;o<=n;++o){var x=o/n*i*Math.PI*2;for(E(x,i,a,t,f),E(.01+x,i,a,t,m),v.subVectors(m,f),y.addVectors(m,f),g.crossVectors(v,y),y.crossVectors(g,v),g.normalize(),y.normalize(),s=0;s<=r;++s){var b=s/r*Math.PI*2,w=-e*Math.cos(b),_=e*Math.sin(b);d.x=f.x+(w*y.x+_*g.x),d.y=f.y+(w*y.y+_*g.y),d.z=f.z+(w*y.z+_*g.z),u.push(d.x,d.y,d.z),p.subVectors(d,f).normalize(),c.push(p.x,p.y,p.z),h.push(o/n),h.push(s/r)}}for(s=1;s<=n;s++)for(o=1;o<=r;o++){var M=(r+1)*(s-1)+(o-1),S=(r+1)*s+(o-1),T=(r+1)*s+o,C=(r+1)*(s-1)+o;l.push(M,S,C),l.push(S,T,C)}function E(t,e,n,r,i){var a=Math.cos(t),o=Math.sin(t),s=n/e*t,l=Math.cos(s);i.x=r*(2+l)*.5*a,i.y=r*(2+l)*o*.5,i.z=r*Math.sin(s)*.5}this.setIndex(l),this.setAttribute("position",new We(u,3)),this.setAttribute("normal",new We(c,3)),this.setAttribute("uv",new We(h,2))}function $a(t,e,n,r,i){Dn.call(this),this.type="TorusGeometry",this.parameters={radius:t,tube:e,radialSegments:n,tubularSegments:r,arc:i},this.fromBufferGeometry(new Ka(t,e,n,r,i)),this.mergeVertices()}function Ka(t,e,n,r,i){nn.call(this),this.type="TorusBufferGeometry",this.parameters={radius:t,tube:e,radialSegments:n,tubularSegments:r,arc:i},t=t||1,e=e||.4,n=Math.floor(n)||8,r=Math.floor(r)||6,i=i||2*Math.PI;var a,o,s=[],l=[],u=[],c=[],h=new ht,d=new ht,p=new ht;for(a=0;a<=n;a++)for(o=0;o<=r;o++){var f=o/r*i,m=a/n*Math.PI*2;d.x=(t+e*Math.cos(m))*Math.cos(f),d.y=(t+e*Math.cos(m))*Math.sin(f),d.z=e*Math.sin(m),l.push(d.x,d.y,d.z),h.x=t*Math.cos(f),h.y=t*Math.sin(f),p.subVectors(d,h).normalize(),u.push(p.x,p.y,p.z),c.push(o/r),c.push(a/n)}for(a=1;a<=n;a++)for(o=1;o<=r;o++){var g=(r+1)*a+o-1,v=(r+1)*(a-1)+o-1,y=(r+1)*(a-1)+o,x=(r+1)*a+o;s.push(g,v,x),s.push(v,y,x)}this.setIndex(s),this.setAttribute("position",new We(l,3)),this.setAttribute("normal",new We(u,3)),this.setAttribute("uv",new We(c,2))}function Qa(t,e,n,r,i){var a,o;if(i===0<function(t,e,n,r){for(var i=0,a=e,o=n-r;a<n;a+=r)i+=(t[o]-t[a])*(t[a+1]+t[o+1]),o=a;return i}(t,e,n,r))for(a=e;a<n;a+=r)o=vo(a,t[a],t[a+1],o);else for(a=n-r;e<=a;a-=r)o=vo(a,t[a],t[a+1],o);return o&&po(o,o.next)&&(yo(o),o=o.next),o}function to(t,e){if(!t)return t;e=e||t;var n,r=t;do{if(n=!1,r.steiner||!po(r,r.next)&&0!==ho(r.prev,r,r.next))r=r.next;else{if(yo(r),(r=e=r.prev)===r.next)break;n=!0}}while(n||r!==e);return e}function eo(t,e,n,r,i,a,o){if(t){!o&&a&&function(t,e,n,r){for(var i=t;null===i.z&&(i.z=lo(i.x,i.y,e,n,r)),i.prevZ=i.prev,i.nextZ=i.next,(i=i.next)!==t;);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,n,r,i,a,o,s,l,u=1;do{for(n=t,a=t=null,o=0;n;){for(o++,r=n,e=s=0;e<u&&(s++,r=r.nextZ);e++);for(l=u;0<s||0<l&&r;)0!==s&&(0===l||!r||n.z<=r.z)?(n=(i=n).nextZ,s--):(r=(i=r).nextZ,l--),a?a.nextZ=i:t=i,i.prevZ=a,a=i;n=r}a.nextZ=null,u*=2}while(1<o)}(i)}(t,r,i,a);for(var s,l,u=t;t.prev!==t.next;)if(s=t.prev,l=t.next,a?ro(t,r,i,a):no(t))e.push(s.i/n),e.push(t.i/n),e.push(l.i/n),yo(t),t=l.next,u=l.next;else if((t=l)===u){o?1===o?eo(t=io(t,e,n),e,n,r,i,a,2):2===o&&ao(t,e,n,r,i,a):eo(to(t),e,n,r,i,a,1);break}}}function no(t){var e=t.prev,n=t,r=t.next;if(!(0<=ho(e,n,r))){for(var i=t.next.next;i!==t.prev;){if(co(e.x,e.y,n.x,n.y,r.x,r.y,i.x,i.y)&&0<=ho(i.prev,i,i.next))return;i=i.next}return 1}}function ro(t,e,n,r){var i=t.prev,a=t,o=t.next;if(!(0<=ho(i,a,o))){for(var s=i.x<a.x?i.x<o.x?i.x:o.x:a.x<o.x?a.x:o.x,l=i.y<a.y?i.y<o.y?i.y:o.y:a.y<o.y?a.y:o.y,u=i.x>a.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,c=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,h=lo(s,l,e,n,r),d=lo(u,c,e,n,r),p=t.prevZ,f=t.nextZ;p&&p.z>=h&&f&&f.z<=d;){if(p!==t.prev&&p!==t.next&&co(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&0<=ho(p.prev,p,p.next))return;if(p=p.prevZ,f!==t.prev&&f!==t.next&&co(i.x,i.y,a.x,a.y,o.x,o.y,f.x,f.y)&&0<=ho(f.prev,f,f.next))return;f=f.nextZ}for(;p&&p.z>=h;){if(p!==t.prev&&p!==t.next&&co(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&0<=ho(p.prev,p,p.next))return;p=p.prevZ}for(;f&&f.z<=d;){if(f!==t.prev&&f!==t.next&&co(i.x,i.y,a.x,a.y,o.x,o.y,f.x,f.y)&&0<=ho(f.prev,f,f.next))return;f=f.nextZ}return 1}}function io(t,e,n){var r=t;do{var i=r.prev,a=r.next.next;!po(i,a)&&fo(i,r,r.next,a)&&mo(i,a)&&mo(a,i)&&(e.push(i.i/n),e.push(r.i/n),e.push(a.i/n),yo(r),yo(r.next),r=t=a),r=r.next}while(r!==t);return r}function ao(t,e,n,r,i,a){var o,s,l=t;do{for(var u=l.next.next;u!==l.prev;){if(l.i!==u.i&&(s=u,(o=l).next.i!==s.i&&o.prev.i!==s.i&&!function(t,e){var n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&fo(n,n.next,t,e))return 1;n=n.next}while(n!==t)}(o,s)&&mo(o,s)&&mo(s,o)&&function(t,e){for(var n=t,r=!1,i=(t.x+e.x)/2,a=(t.y+e.y)/2;n.y>a!=n.next.y>a&&n.next.y!==n.y&&i<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(r=!r),(n=n.next)!==t;);return r}(o,s))){var c=go(l,u);return l=to(l,l.next),c=to(c,c.next),eo(l,e,n,r,i,a),void eo(c,e,n,r,i,a)}u=u.next}l=l.next}while(l!==t)}function oo(t,e){return t.x-e.x}function so(t,e){if(e=function(t,e){var n,r=e,i=t.x,a=t.y,o=-1/0;do{if(a<=r.y&&a>=r.next.y&&r.next.y!==r.y){var s=r.x+(a-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=i&&o<s){if((o=s)===i){if(a===r.y)return r;if(a===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}r=r.next}while(r!==e);if(!n)return null;if(i===o)return n.prev;var l,u=n,c=n.x,h=n.y,d=1/0;for(r=n.next;r!==u;)i>=r.x&&r.x>=c&&i!==r.x&&co(a<h?i:o,a,c,h,a<h?o:i,a,r.x,r.y)&&((l=Math.abs(a-r.y)/(i-r.x))<d||l===d&&r.x>n.x)&&mo(r,t)&&(n=r,d=l),r=r.next;return n}(t,e)){var n=go(e,t);to(n,n.next)}}function lo(t,e,n,r,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*i)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)*i)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function uo(t){for(var e=t,n=t;(e.x<n.x||e.x===n.x&&e.y<n.y)&&(n=e),(e=e.next)!==t;);return n}function co(t,e,n,r,i,a,o,s){return 0<=(i-o)*(e-s)-(t-o)*(a-s)&&0<=(t-o)*(r-s)-(n-o)*(e-s)&&0<=(n-o)*(a-s)-(i-o)*(r-s)}function ho(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function po(t,e){return t.x===e.x&&t.y===e.y}function fo(t,e,n,r){return po(t,n)&&po(e,r)||po(t,r)&&po(n,e)||0<ho(t,e,n)!=0<ho(t,e,r)&&0<ho(n,r,t)!=0<ho(n,r,e)}function mo(t,e){return ho(t.prev,t,t.next)<0?0<=ho(t,e,t.next)&&0<=ho(t,t.prev,e):ho(t,e,t.prev)<0||ho(t,t.next,e)<0}function go(t,e){var n=new xo(t.i,t.x,t.y),r=new xo(e.i,e.x,e.y),i=t.next,a=e.prev;return(t.next=e).prev=t,(n.next=i).prev=n,(r.next=n).prev=r,(a.next=r).prev=a,r}function vo(t,e,n,r){var i=new xo(t,e,n);return r?(i.next=r.next,(i.prev=r).next.prev=i,r.next=i):(i.prev=i).next=i,i}function yo(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function xo(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}Da.prototype=Object.assign(Object.create(Ft.prototype),{constructor:Da,isPoints:!0,raycast:function(t,e){var n=this.geometry,r=this.matrixWorld,i=t.params.Points.threshold;if(null===n.boundingSphere&&n.computeBoundingSphere(),Ca.copy(n.boundingSphere),Ca.applyMatrix4(r),Ca.radius+=i,!1!==t.ray.intersectsSphere(Ca)){Sa.getInverse(r),Ta.copy(t.ray).applyMatrix4(Sa);var a=i/((this.scale.x+this.scale.y+this.scale.z)/3),o=a*a;if(n.isBufferGeometry){var s=n.index,l=n.attributes.position.array;if(null!==s)for(var u=s.array,c=0,h=u.length;c<h;c++){var d=u[c];Ea.fromArray(l,3*d),Aa(Ea,d,o,r,t,e,this)}else{c=0;for(var p=l.length/3;c<p;c++)Ea.fromArray(l,3*c),Aa(Ea,c,o,r,t,e,this)}}else{var f=n.vertices;for(c=0,p=f.length;c<p;c++)Aa(f[c],c,o,r,t,e,this)}}},updateMorphTargets:function(){var t,e,n,r=this.geometry;if(r.isBufferGeometry){var i=r.morphAttributes,a=Object.keys(i);if(0<a.length){var o=i[a[0]];if(void 0!==o)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},t=0,e=o.length;t<e;t++)n=o[t].name||String(t),this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=t}}else{var s=r.morphTargets;void 0!==s&&0<s.length&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),Oa.prototype=Object.assign(Object.create(it.prototype),{constructor:Oa,isVideoTexture:!0,update:function(){var t=this.image;t.readyState>=t.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}),((La.prototype=Object.create(it.prototype)).constructor=La).prototype.isCompressedTexture=!0,((Pa.prototype=Object.create(it.prototype)).constructor=Pa).prototype.isCanvasTexture=!0,((Ra.prototype=Object.create(it.prototype)).constructor=Ra).prototype.isDepthTexture=!0,(Ia.prototype=Object.create(nn.prototype)).constructor=Ia,(ka.prototype=Object.create(Dn.prototype)).constructor=ka,(Ba.prototype=Object.create(nn.prototype)).constructor=Ba,(Fa.prototype=Object.create(Dn.prototype)).constructor=Fa,(Na.prototype=Object.create(nn.prototype)).constructor=Na,(ja.prototype=Object.create(Dn.prototype)).constructor=ja,(za.prototype=Object.create(Na.prototype)).constructor=za,(Va.prototype=Object.create(Dn.prototype)).constructor=Va,(Ga.prototype=Object.create(Na.prototype)).constructor=Ga,(Ua.prototype=Object.create(Dn.prototype)).constructor=Ua,(Ha.prototype=Object.create(Na.prototype)).constructor=Ha,(Wa.prototype=Object.create(Dn.prototype)).constructor=Wa,(Ja.prototype=Object.create(Na.prototype)).constructor=Ja,(qa.prototype=Object.create(Dn.prototype)).constructor=qa,((Xa.prototype=Object.create(nn.prototype)).constructor=Xa).prototype.toJSON=function(){var t=nn.prototype.toJSON.call(this);return t.path=this.parameters.path.toJSON(),t},(Ya.prototype=Object.create(Dn.prototype)).constructor=Ya,(Za.prototype=Object.create(nn.prototype)).constructor=Za,($a.prototype=Object.create(Dn.prototype)).constructor=$a,(Ka.prototype=Object.create(nn.prototype)).constructor=Ka;var bo={area:function(t){for(var e=t.length,n=0,r=e-1,i=0;i<e;r=i++)n+=t[r].x*t[i].y-t[i].x*t[r].y;return.5*n},isClockWise:function(t){return bo.area(t)<0},triangulateShape:function(t,e){var n=[],r=[],i=[];wo(t),_o(n,t);var a=t.length;e.forEach(wo);for(var o=0;o<e.length;o++)r.push(a),a+=e[o].length,_o(n,e[o]);var s=function(t,e,n){n=n||2;var r,i,a,o,s,l,u,c=e&&e.length,h=c?e[0]*n:t.length,d=Qa(t,0,h,n,!0),p=[];if(!d||d.next===d.prev)return p;if(c&&(d=function(t,e,n,r){var i,a,o,s=[];for(i=0,a=e.length;i<a;i++)(o=Qa(t,e[i]*r,i<a-1?e[i+1]*r:t.length,r,!1))===o.next&&(o.steiner=!0),s.push(uo(o));for(s.sort(oo),i=0;i<s.length;i++)so(s[i],n),n=to(n,n.next);return n}(t,e,d,n)),t.length>80*n){r=a=t[0],i=o=t[1];for(var f=n;f<h;f+=n)(s=t[f])<r&&(r=s),(l=t[f+1])<i&&(i=l),a<s&&(a=s),o<l&&(o=l);u=0!==(u=Math.max(a-r,o-i))?1/u:0}return eo(d,p,n,r,i,u),p}(n,r);for(o=0;o<s.length;o+=3)i.push(s.slice(o,o+3));return i}};function wo(t){var e=t.length;2<e&&t[e-1].equals(t[0])&&t.pop()}function _o(t,e){for(var n=0;n<e.length;n++)t.push(e[n].x),t.push(e[n].y)}function Mo(t,e){Dn.call(this),this.type="ExtrudeGeometry",this.parameters={shapes:t,options:e},this.fromBufferGeometry(new So(t,e)),this.mergeVertices()}function So(t,e){nn.call(this),this.type="ExtrudeBufferGeometry",this.parameters={shapes:t,options:e};for(var n=this,r=[],i=[],a=0,o=(t=Array.isArray(t)?t:[t]).length;a<o;a++)s(t[a]);function s(t){var a=[],o=void 0!==e.curveSegments?e.curveSegments:12,s=void 0!==e.steps?e.steps:1,l=void 0!==e.depth?e.depth:100,u=void 0===e.bevelEnabled||e.bevelEnabled,c=void 0!==e.bevelThickness?e.bevelThickness:6,h=void 0!==e.bevelSize?e.bevelSize:c-2,d=void 0!==e.bevelOffset?e.bevelOffset:0,p=void 0!==e.bevelSegments?e.bevelSegments:3,f=e.extrudePath,m=void 0!==e.UVGenerator?e.UVGenerator:To;void 0!==e.amount&&(console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."),l=e.amount);var g,v,y,x,b,w,_,M,S=!1;f&&(g=f.getSpacedPoints(s),u=!(S=!0),v=f.computeFrenetFrames(s,!1),y=new ht,x=new ht,b=new ht),u||(d=h=c=p=0);var T=t.extractPoints(o),C=T.shape,E=T.holes;if(!bo.isClockWise(C))for(C=C.reverse(),_=0,M=E.length;_<M;_++)w=E[_],bo.isClockWise(w)&&(E[_]=w.reverse());var D=bo.triangulateShape(C,E),A=C;for(_=0,M=E.length;_<M;_++)w=E[_],C=C.concat(w);function O(t,e,n){return e||console.error("THREE.ExtrudeGeometry: vec does not exist"),e.clone().multiplyScalar(n).add(t)}var L,P,R,I,k,B,F=C.length,N=D.length;function j(t,e,n){var r,i,a,o=t.x-e.x,s=t.y-e.y,l=n.x-t.x,u=n.y-t.y,c=o*o+s*s,h=o*u-s*l;if(Math.abs(h)>Number.EPSILON){var d=Math.sqrt(c),p=Math.sqrt(l*l+u*u),f=e.x-s/d,m=e.y+o/d,g=((n.x-u/p-f)*u-(n.y+l/p-m)*l)/(o*u-s*l),v=(r=f+o*g-t.x)*r+(i=m+s*g-t.y)*i;if(v<=2)return new tt(r,i);a=Math.sqrt(v/2)}else{var y=!1;o>Number.EPSILON?l>Number.EPSILON&&(y=!0):o<-Number.EPSILON?l<-Number.EPSILON&&(y=!0):Math.sign(s)===Math.sign(u)&&(y=!0),a=y?(r=-s,i=o,Math.sqrt(c)):(r=o,i=s,Math.sqrt(c/2))}return new tt(r/a,i/a)}for(var z=[],V=0,G=A.length,U=G-1,H=V+1;V<G;V++,U++,H++)U===G&&(U=0),H===G&&(H=0),z[V]=j(A[V],A[U],A[H]);var W,J,q=[],X=z.concat();for(_=0,M=E.length;_<M;_++){for(w=E[_],W=[],V=0,U=(G=w.length)-1,H=V+1;V<G;V++,U++,H++)U===G&&(U=0),H===G&&(H=0),W[V]=j(w[V],w[U],w[H]);q.push(W),X=X.concat(W)}for(L=0;L<p;L++){for(R=L/p,I=c*Math.cos(R*Math.PI/2),P=h*Math.sin(R*Math.PI/2)+d,V=0,G=A.length;V<G;V++)Z((k=O(A[V],z[V],P)).x,k.y,-I);for(_=0,M=E.length;_<M;_++)for(w=E[_],W=q[_],V=0,G=w.length;V<G;V++)Z((k=O(w[V],W[V],P)).x,k.y,-I)}for(P=h+d,V=0;V<F;V++)k=u?O(C[V],X[V],P):C[V],S?(x.copy(v.normals[0]).multiplyScalar(k.x),y.copy(v.binormals[0]).multiplyScalar(k.y),b.copy(g[0]).add(x).add(y),Z(b.x,b.y,b.z)):Z(k.x,k.y,0);for(J=1;J<=s;J++)for(V=0;V<F;V++)k=u?O(C[V],X[V],P):C[V],S?(x.copy(v.normals[J]).multiplyScalar(k.x),y.copy(v.binormals[J]).multiplyScalar(k.y),b.copy(g[J]).add(x).add(y),Z(b.x,b.y,b.z)):Z(k.x,k.y,l/s*J);for(L=p-1;0<=L;L--){for(R=L/p,I=c*Math.cos(R*Math.PI/2),P=h*Math.sin(R*Math.PI/2)+d,V=0,G=A.length;V<G;V++)Z((k=O(A[V],z[V],P)).x,k.y,l+I);for(_=0,M=E.length;_<M;_++)for(w=E[_],W=q[_],V=0,G=w.length;V<G;V++)k=O(w[V],W[V],P),S?Z(k.x,k.y+g[s-1].y,g[s-1].x+I):Z(k.x,k.y,l+I)}function Y(t,e){var n,r;for(V=t.length;0<=--V;){(r=(n=V)-1)<0&&(r=t.length-1);var i=0,a=s+2*p;for(i=0;i<a;i++){var o=F*i,l=F*(i+1);K(e+n+o,e+r+o,e+r+l,e+n+l)}}}function Z(t,e,n){a.push(t),a.push(e),a.push(n)}function $(t,e,i){Q(t),Q(e),Q(i);var a=r.length/3,o=m.generateTopUV(n,r,a-3,a-2,a-1);et(o[0]),et(o[1]),et(o[2])}function K(t,e,i,a){Q(t),Q(e),Q(a),Q(e),Q(i),Q(a);var o=r.length/3,s=m.generateSideWallUV(n,r,o-6,o-3,o-2,o-1);et(s[0]),et(s[1]),et(s[3]),et(s[1]),et(s[2]),et(s[3])}function Q(t){r.push(a[3*t+0]),r.push(a[3*t+1]),r.push(a[3*t+2])}function et(t){i.push(t.x),i.push(t.y)}!function(){var t=r.length/3;if(u){var e=0,i=F*e;for(V=0;V<N;V++)$((B=D[V])[2]+i,B[1]+i,B[0]+i);for(i=F*(e=s+2*p),V=0;V<N;V++)$((B=D[V])[0]+i,B[1]+i,B[2]+i)}else{for(V=0;V<N;V++)$((B=D[V])[2],B[1],B[0]);for(V=0;V<N;V++)$((B=D[V])[0]+F*s,B[1]+F*s,B[2]+F*s)}n.addGroup(t,r.length/3-t,0)}(),function(){var t=r.length/3,e=0;for(Y(A,e),e+=A.length,_=0,M=E.length;_<M;_++)Y(w=E[_],e),e+=w.length;n.addGroup(t,r.length/3-t,1)}()}this.setAttribute("position",new We(r,3)),this.setAttribute("uv",new We(i,2)),this.computeVertexNormals()}((Mo.prototype=Object.create(Dn.prototype)).constructor=Mo).prototype.toJSON=function(){var t=Dn.prototype.toJSON.call(this);return Co(this.parameters.shapes,this.parameters.options,t)},((So.prototype=Object.create(nn.prototype)).constructor=So).prototype.toJSON=function(){var t=nn.prototype.toJSON.call(this);return Co(this.parameters.shapes,this.parameters.options,t)};var To={generateTopUV:function(t,e,n,r,i){var a=e[3*n],o=e[3*n+1],s=e[3*r],l=e[3*r+1],u=e[3*i],c=e[3*i+1];return[new tt(a,o),new tt(s,l),new tt(u,c)]},generateSideWallUV:function(t,e,n,r,i,a){var o=e[3*n],s=e[3*n+1],l=e[3*n+2],u=e[3*r],c=e[3*r+1],h=e[3*r+2],d=e[3*i],p=e[3*i+1],f=e[3*i+2],m=e[3*a],g=e[3*a+1],v=e[3*a+2];return Math.abs(s-c)<.01?[new tt(o,1-l),new tt(u,1-h),new tt(d,1-f),new tt(m,1-v)]:[new tt(s,1-l),new tt(c,1-h),new tt(p,1-f),new tt(g,1-v)]}};function Co(t,e,n){if(n.shapes=[],Array.isArray(t))for(var r=0,i=t.length;r<i;r++){var a=t[r];n.shapes.push(a.uuid)}else n.shapes.push(t.uuid);return void 0!==e.extrudePath&&(n.options.extrudePath=e.extrudePath.toJSON()),n}function Eo(t,e){Dn.call(this),this.type="TextGeometry",this.parameters={text:t,parameters:e},this.fromBufferGeometry(new Do(t,e)),this.mergeVertices()}function Do(t,e){var n=(e=e||{}).font;if(!n||!n.isFont)return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),new Dn;var r=n.generateShapes(t,e.size);e.depth=void 0!==e.height?e.height:50,void 0===e.bevelThickness&&(e.bevelThickness=10),void 0===e.bevelSize&&(e.bevelSize=8),void 0===e.bevelEnabled&&(e.bevelEnabled=!1),So.call(this,r,e),this.type="TextBufferGeometry"}function Ao(t,e,n,r,i,a,o){Dn.call(this),this.type="SphereGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:n,phiStart:r,phiLength:i,thetaStart:a,thetaLength:o},this.fromBufferGeometry(new Oo(t,e,n,r,i,a,o)),this.mergeVertices()}function Oo(t,e,n,r,i,a,o){nn.call(this),this.type="SphereBufferGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:n,phiStart:r,phiLength:i,thetaStart:a,thetaLength:o},t=t||1,e=Math.max(3,Math.floor(e)||8),n=Math.max(2,Math.floor(n)||6),r=void 0!==r?r:0,i=void 0!==i?i:2*Math.PI,a=void 0!==a?a:0,o=void 0!==o?o:Math.PI;var s,l,u=Math.min(a+o,Math.PI),c=0,h=[],d=new ht,p=new ht,f=[],m=[],g=[],v=[];for(l=0;l<=n;l++){var y=[],x=l/n,b=0;for(0==l&&0==a?b=.5/e:l==n&&u==Math.PI&&(b=-.5/e),s=0;s<=e;s++){var w=s/e;d.x=-t*Math.cos(r+w*i)*Math.sin(a+x*o),d.y=t*Math.cos(a+x*o),d.z=t*Math.sin(r+w*i)*Math.sin(a+x*o),m.push(d.x,d.y,d.z),p.copy(d).normalize(),g.push(p.x,p.y,p.z),v.push(w+b,1-x),y.push(c++)}h.push(y)}for(l=0;l<n;l++)for(s=0;s<e;s++){var _=h[l][s+1],M=h[l][s],S=h[l+1][s],T=h[l+1][s+1];(0!==l||0<a)&&f.push(_,M,T),(l!==n-1||u<Math.PI)&&f.push(M,S,T)}this.setIndex(f),this.setAttribute("position",new We(m,3)),this.setAttribute("normal",new We(g,3)),this.setAttribute("uv",new We(v,2))}function Lo(t,e,n,r,i,a){Dn.call(this),this.type="RingGeometry",this.parameters={innerRadius:t,outerRadius:e,thetaSegments:n,phiSegments:r,thetaStart:i,thetaLength:a},this.fromBufferGeometry(new Po(t,e,n,r,i,a)),this.mergeVertices()}function Po(t,e,n,r,i,a){nn.call(this),this.type="RingBufferGeometry",this.parameters={innerRadius:t,outerRadius:e,thetaSegments:n,phiSegments:r,thetaStart:i,thetaLength:a},t=t||.5,e=e||1,i=void 0!==i?i:0,a=void 0!==a?a:2*Math.PI,n=void 0!==n?Math.max(3,n):8;var o,s,l,u=[],c=[],h=[],d=[],p=t,f=(e-t)/(r=void 0!==r?Math.max(1,r):1),m=new ht,g=new tt;for(s=0;s<=r;s++){for(l=0;l<=n;l++)o=i+l/n*a,m.x=p*Math.cos(o),m.y=p*Math.sin(o),c.push(m.x,m.y,m.z),h.push(0,0,1),g.x=(m.x/e+1)/2,g.y=(m.y/e+1)/2,d.push(g.x,g.y);p+=f}for(s=0;s<r;s++){var v=s*(n+1);for(l=0;l<n;l++){var y=o=l+v,x=o+n+1,b=o+n+2,w=o+1;u.push(y,x,w),u.push(x,b,w)}}this.setIndex(u),this.setAttribute("position",new We(c,3)),this.setAttribute("normal",new We(h,3)),this.setAttribute("uv",new We(d,2))}function Ro(t,e,n,r){Dn.call(this),this.type="LatheGeometry",this.parameters={points:t,segments:e,phiStart:n,phiLength:r},this.fromBufferGeometry(new Io(t,e,n,r)),this.mergeVertices()}function Io(t,e,n,r){nn.call(this),this.type="LatheBufferGeometry",this.parameters={points:t,segments:e,phiStart:n,phiLength:r},e=Math.floor(e)||12,n=n||0,r=r||2*Math.PI,r=Q.clamp(r,0,2*Math.PI);var i,a,o,s=[],l=[],u=[],c=1/e,h=new ht,d=new tt;for(a=0;a<=e;a++){var p=n+a*c*r,f=Math.sin(p),m=Math.cos(p);for(o=0;o<=t.length-1;o++)h.x=t[o].x*f,h.y=t[o].y,h.z=t[o].x*m,l.push(h.x,h.y,h.z),d.x=a/e,d.y=o/(t.length-1),u.push(d.x,d.y)}for(a=0;a<e;a++)for(o=0;o<t.length-1;o++){var g=i=o+a*t.length,v=i+t.length,y=i+t.length+1,x=i+1;s.push(g,v,x),s.push(v,y,x)}if(this.setIndex(s),this.setAttribute("position",new We(l,3)),this.setAttribute("uv",new We(u,2)),this.computeVertexNormals(),r===2*Math.PI){var b=this.attributes.normal.array,w=new ht,_=new ht,M=new ht;for(i=e*t.length*3,o=a=0;a<t.length;a++,o+=3)w.x=b[o+0],w.y=b[o+1],w.z=b[o+2],_.x=b[i+o+0],_.y=b[i+o+1],_.z=b[i+o+2],M.addVectors(w,_).normalize(),b[o+0]=b[i+o+0]=M.x,b[o+1]=b[i+o+1]=M.y,b[o+2]=b[i+o+2]=M.z}}function ko(t,e){Dn.call(this),this.type="ShapeGeometry","object"==typeof e&&(console.warn("THREE.ShapeGeometry: Options parameter has been removed."),e=e.curveSegments),this.parameters={shapes:t,curveSegments:e},this.fromBufferGeometry(new Bo(t,e)),this.mergeVertices()}function Bo(t,e){nn.call(this),this.type="ShapeBufferGeometry",this.parameters={shapes:t,curveSegments:e},e=e||12;var n=[],r=[],i=[],a=[],o=0,s=0;if(!1===Array.isArray(t))u(t);else for(var l=0;l<t.length;l++)u(t[l]),this.addGroup(o,s,l),o+=s,s=0;function u(t){var o,l,u,c=r.length/3,h=t.extractPoints(e),d=h.shape,p=h.holes;for(!1===bo.isClockWise(d)&&(d=d.reverse()),o=0,l=p.length;o<l;o++)u=p[o],!0===bo.isClockWise(u)&&(p[o]=u.reverse());var f=bo.triangulateShape(d,p);for(o=0,l=p.length;o<l;o++)u=p[o],d=d.concat(u);for(o=0,l=d.length;o<l;o++){var m=d[o];r.push(m.x,m.y,0),i.push(0,0,1),a.push(m.x,m.y)}for(o=0,l=f.length;o<l;o++){var g=f[o],v=g[0]+c,y=g[1]+c,x=g[2]+c;n.push(v,y,x),s+=3}}this.setIndex(n),this.setAttribute("position",new We(r,3)),this.setAttribute("normal",new We(i,3)),this.setAttribute("uv",new We(a,2))}function Fo(t,e){if(e.shapes=[],Array.isArray(t))for(var n=0,r=t.length;n<r;n++){var i=t[n];e.shapes.push(i.uuid)}else e.shapes.push(t.uuid);return e}function No(t,e){nn.call(this),this.type="EdgesGeometry",this.parameters={thresholdAngle:e},e=void 0!==e?e:1;var n,r,i,a,o=[],s=Math.cos(Q.DEG2RAD*e),l=[0,0],u={},c=["a","b","c"];t.isBufferGeometry?(a=new Dn).fromBufferGeometry(t):a=t.clone(),a.mergeVertices(),a.computeFaceNormals();for(var h=a.vertices,d=a.faces,p=0,f=d.length;p<f;p++)for(var m=d[p],g=0;g<3;g++)n=m[c[g]],r=m[c[(g+1)%3]],l[0]=Math.min(n,r),l[1]=Math.max(n,r),void 0===u[i=l[0]+","+l[1]]?u[i]={index1:l[0],index2:l[1],face1:p,face2:void 0}:u[i].face2=p;for(i in u){var v=u[i];if(void 0===v.face2||d[v.face1].normal.dot(d[v.face2].normal)<=s){var y=h[v.index1];o.push(y.x,y.y,y.z),y=h[v.index2],o.push(y.x,y.y,y.z)}}this.setAttribute("position",new We(o,3))}function jo(t,e,n,r,i,a,o,s){Dn.call(this),this.type="CylinderGeometry",this.parameters={radiusTop:t,radiusBottom:e,height:n,radialSegments:r,heightSegments:i,openEnded:a,thetaStart:o,thetaLength:s},this.fromBufferGeometry(new zo(t,e,n,r,i,a,o,s)),this.mergeVertices()}function zo(t,e,n,r,i,a,o,s){nn.call(this),this.type="CylinderBufferGeometry",this.parameters={radiusTop:t,radiusBottom:e,height:n,radialSegments:r,heightSegments:i,openEnded:a,thetaStart:o,thetaLength:s};var l=this;t=void 0!==t?t:1,e=void 0!==e?e:1,n=n||1,r=Math.floor(r)||8,i=Math.floor(i)||1,a=void 0!==a&&a,o=void 0!==o?o:0,s=void 0!==s?s:2*Math.PI;var u=[],c=[],h=[],d=[],p=0,f=[],m=n/2,g=0;function v(n){var i,a,f,v=new tt,y=new ht,x=0,b=!0===n?t:e,w=!0===n?1:-1;for(a=p,i=1;i<=r;i++)c.push(0,m*w,0),h.push(0,w,0),d.push(.5,.5),p++;for(f=p,i=0;i<=r;i++){var _=i/r*s+o,M=Math.cos(_),S=Math.sin(_);y.x=b*S,y.y=m*w,y.z=b*M,c.push(y.x,y.y,y.z),h.push(0,w,0),v.x=.5*M+.5,v.y=.5*S*w+.5,d.push(v.x,v.y),p++}for(i=0;i<r;i++){var T=a+i,C=f+i;!0===n?u.push(C,C+1,T):u.push(C+1,C,T),x+=3}l.addGroup(g,x,!0===n?1:2),g+=x}!function(){var a,v,y=new ht,x=new ht,b=0,w=(e-t)/n;for(v=0;v<=i;v++){var _=[],M=v/i,S=M*(e-t)+t;for(a=0;a<=r;a++){var T=a/r,C=T*s+o,E=Math.sin(C),D=Math.cos(C);x.x=S*E,x.y=-M*n+m,x.z=S*D,c.push(x.x,x.y,x.z),y.set(E,w,D).normalize(),h.push(y.x,y.y,y.z),d.push(T,1-M),_.push(p++)}f.push(_)}for(a=0;a<r;a++)for(v=0;v<i;v++){var A=f[v][a],O=f[v+1][a],L=f[v+1][a+1],P=f[v][a+1];u.push(A,O,P),u.push(O,L,P),b+=6}l.addGroup(g,b,0),g+=b}(),!1===a&&(0<t&&v(!0),0<e&&v(!1)),this.setIndex(u),this.setAttribute("position",new We(c,3)),this.setAttribute("normal",new We(h,3)),this.setAttribute("uv",new We(d,2))}function Vo(t,e,n,r,i,a,o){jo.call(this,0,t,e,n,r,i,a,o),this.type="ConeGeometry",this.parameters={radius:t,height:e,radialSegments:n,heightSegments:r,openEnded:i,thetaStart:a,thetaLength:o}}function Go(t,e,n,r,i,a,o){zo.call(this,0,t,e,n,r,i,a,o),this.type="ConeBufferGeometry",this.parameters={radius:t,height:e,radialSegments:n,heightSegments:r,openEnded:i,thetaStart:a,thetaLength:o}}function Uo(t,e,n,r){Dn.call(this),this.type="CircleGeometry",this.parameters={radius:t,segments:e,thetaStart:n,thetaLength:r},this.fromBufferGeometry(new Ho(t,e,n,r)),this.mergeVertices()}function Ho(t,e,n,r){nn.call(this),this.type="CircleBufferGeometry",this.parameters={radius:t,segments:e,thetaStart:n,thetaLength:r},t=t||1,e=void 0!==e?Math.max(3,e):8,n=void 0!==n?n:0,r=void 0!==r?r:2*Math.PI;var i,a,o=[],s=[],l=[],u=[],c=new ht,h=new tt;for(s.push(0,0,0),l.push(0,0,1),u.push(.5,.5),a=0,i=3;a<=e;a++,i+=3){var d=n+a/e*r;c.x=t*Math.cos(d),c.y=t*Math.sin(d),s.push(c.x,c.y,c.z),l.push(0,0,1),h.x=(s[i]/t+1)/2,h.y=(s[i+1]/t+1)/2,u.push(h.x,h.y)}for(i=1;i<=e;i++)o.push(i,i+1,0);this.setIndex(o),this.setAttribute("position",new We(s,3)),this.setAttribute("normal",new We(l,3)),this.setAttribute("uv",new We(u,2))}(Eo.prototype=Object.create(Dn.prototype)).constructor=Eo,(Do.prototype=Object.create(So.prototype)).constructor=Do,(Ao.prototype=Object.create(Dn.prototype)).constructor=Ao,(Oo.prototype=Object.create(nn.prototype)).constructor=Oo,(Lo.prototype=Object.create(Dn.prototype)).constructor=Lo,(Po.prototype=Object.create(nn.prototype)).constructor=Po,(Ro.prototype=Object.create(Dn.prototype)).constructor=Ro,(Io.prototype=Object.create(nn.prototype)).constructor=Io,((ko.prototype=Object.create(Dn.prototype)).constructor=ko).prototype.toJSON=function(){var t=Dn.prototype.toJSON.call(this);return Fo(this.parameters.shapes,t)},((Bo.prototype=Object.create(nn.prototype)).constructor=Bo).prototype.toJSON=function(){var t=nn.prototype.toJSON.call(this);return Fo(this.parameters.shapes,t)},(No.prototype=Object.create(nn.prototype)).constructor=No,(jo.prototype=Object.create(Dn.prototype)).constructor=jo,(zo.prototype=Object.create(nn.prototype)).constructor=zo,(Vo.prototype=Object.create(jo.prototype)).constructor=Vo,(Go.prototype=Object.create(zo.prototype)).constructor=Go,(Uo.prototype=Object.create(Dn.prototype)).constructor=Uo,(Ho.prototype=Object.create(nn.prototype)).constructor=Ho;var Wo=Object.freeze({__proto__:null,WireframeGeometry:Ia,ParametricGeometry:ka,ParametricBufferGeometry:Ba,TetrahedronGeometry:ja,TetrahedronBufferGeometry:za,OctahedronGeometry:Va,OctahedronBufferGeometry:Ga,IcosahedronGeometry:Ua,IcosahedronBufferGeometry:Ha,DodecahedronGeometry:Wa,DodecahedronBufferGeometry:Ja,PolyhedronGeometry:Fa,PolyhedronBufferGeometry:Na,TubeGeometry:qa,TubeBufferGeometry:Xa,TorusKnotGeometry:Ya,TorusKnotBufferGeometry:Za,TorusGeometry:$a,TorusBufferGeometry:Ka,TextGeometry:Eo,TextBufferGeometry:Do,SphereGeometry:Ao,SphereBufferGeometry:Oo,RingGeometry:Lo,RingBufferGeometry:Po,PlaneGeometry:Wn,PlaneBufferGeometry:Jn,LatheGeometry:Ro,LatheBufferGeometry:Io,ShapeGeometry:ko,ShapeBufferGeometry:Bo,ExtrudeGeometry:Mo,ExtrudeBufferGeometry:So,EdgesGeometry:No,ConeGeometry:Vo,ConeBufferGeometry:Go,CylinderGeometry:jo,CylinderBufferGeometry:zo,CircleGeometry:Uo,CircleBufferGeometry:Ho,BoxGeometry:An,BoxBufferGeometry:On});function Jo(t){Ie.call(this),this.type="ShadowMaterial",this.color=new De(0),this.transparent=!0,this.setValues(t)}function qo(t){In.call(this,t),this.type="RawShaderMaterial"}function Xo(t){Ie.call(this),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new De(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new De(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new tt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function Yo(t){Xo.call(this),this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.reflectivity=.5,this.clearcoat=0,this.clearcoatRoughness=0,this.sheen=null,this.clearcoatNormalScale=new tt(1,1),this.clearcoatNormalMap=null,this.transparency=0,this.setValues(t)}function Zo(t){Ie.call(this),this.type="MeshPhongMaterial",this.color=new De(16777215),this.specular=new De(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new De(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new tt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function $o(t){Ie.call(this),this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new De(16777215),this.specular=new De(1118481),this.shininess=30,this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new De(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new tt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function Ko(t){Ie.call(this),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new tt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function Qo(t){Ie.call(this),this.type="MeshLambertMaterial",this.color=new De(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new De(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function ts(t){Ie.call(this),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new De(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new tt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function es(t){da.call(this),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(t)}((Jo.prototype=Object.create(Ie.prototype)).constructor=Jo).prototype.isShadowMaterial=!0,Jo.prototype.copy=function(t){return Ie.prototype.copy.call(this,t),this.color.copy(t.color),this},((qo.prototype=Object.create(In.prototype)).constructor=qo).prototype.isRawShaderMaterial=!0,((Xo.prototype=Object.create(Ie.prototype)).constructor=Xo).prototype.isMeshStandardMaterial=!0,Xo.prototype.copy=function(t){return Ie.prototype.copy.call(this,t),this.defines={STANDARD:""},this.color.copy(t.color),this.roughness=t.roughness,this.metalness=t.metalness,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.roughnessMap=t.roughnessMap,this.metalnessMap=t.metalnessMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapIntensity=t.envMapIntensity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},((Yo.prototype=Object.create(Xo.prototype)).constructor=Yo).prototype.isMeshPhysicalMaterial=!0,Yo.prototype.copy=function(t){return Xo.prototype.copy.call(this,t),this.defines={STANDARD:"",PHYSICAL:""},this.reflectivity=t.reflectivity,this.clearcoat=t.clearcoat,this.clearcoatRoughness=t.clearcoatRoughness,t.sheen?this.sheen=(this.sheen||new De).copy(t.sheen):this.sheen=null,this.clearcoatNormalMap=t.clearcoatNormalMap,this.clearcoatNormalScale.copy(t.clearcoatNormalScale),this.transparency=t.transparency,this},((Zo.prototype=Object.create(Ie.prototype)).constructor=Zo).prototype.isMeshPhongMaterial=!0,Zo.prototype.copy=function(t){return Ie.prototype.copy.call(this,t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},(($o.prototype=Object.create(Ie.prototype)).constructor=$o).prototype.isMeshToonMaterial=!0,$o.prototype.copy=function(t){return Ie.prototype.copy.call(this,t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.gradientMap=t.gradientMap,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},((Ko.prototype=Object.create(Ie.prototype)).constructor=Ko).prototype.isMeshNormalMaterial=!0,Ko.prototype.copy=function(t){return Ie.prototype.copy.call(this,t),this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},((Qo.prototype=Object.create(Ie.prototype)).constructor=Qo).prototype.isMeshLambertMaterial=!0,Qo.prototype.copy=function(t){return Ie.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},((ts.prototype=Object.create(Ie.prototype)).constructor=ts).prototype.isMeshMatcapMaterial=!0,ts.prototype.copy=function(t){return Ie.prototype.copy.call(this,t),this.defines={MATCAP:""},this.color.copy(t.color),this.matcap=t.matcap,this.map=t.map,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},((es.prototype=Object.create(da.prototype)).constructor=es).prototype.isLineDashedMaterial=!0,es.prototype.copy=function(t){return da.prototype.copy.call(this,t),this.scale=t.scale,this.dashSize=t.dashSize,this.gapSize=t.gapSize,this};var ns=Object.freeze({__proto__:null,ShadowMaterial:Jo,SpriteMaterial:Ni,RawShaderMaterial:qo,ShaderMaterial:In,PointsMaterial:Ma,MeshPhysicalMaterial:Yo,MeshStandardMaterial:Xo,MeshPhongMaterial:Zo,MeshToonMaterial:$o,MeshNormalMaterial:Ko,MeshLambertMaterial:Qo,MeshDepthMaterial:bi,MeshDistanceMaterial:wi,MeshBasicMaterial:ke,MeshMatcapMaterial:ts,LineDashedMaterial:es,LineBasicMaterial:da,Material:Ie}),rs={arraySlice:function(t,e,n){return rs.isTypedArray(t)?new t.constructor(t.subarray(e,void 0!==n?n:t.length)):t.slice(e,n)},convertArray:function(t,e,n){return!t||!n&&t.constructor===e?t:"number"==typeof e.BYTES_PER_ELEMENT?new e(t):Array.prototype.slice.call(t)},isTypedArray:function(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)},getKeyframeOrder:function(t){for(var e=t.length,n=new Array(e),r=0;r!==e;++r)n[r]=r;return n.sort(function(e,n){return t[e]-t[n]}),n},sortedArray:function(t,e,n){for(var r=t.length,i=new t.constructor(r),a=0,o=0;o!==r;++a)for(var s=n[a]*e,l=0;l!==e;++l)i[o++]=t[s+l];return i},flattenJSON:function(t,e,n,r){for(var i=1,a=t[0];void 0!==a&&void 0===a[r];)a=t[i++];if(void 0!==a){var o=a[r];if(void 0!==o)if(Array.isArray(o))for(;void 0!==(o=a[r])&&(e.push(a.time),n.push.apply(n,o)),void 0!==(a=t[i++]););else if(void 0!==o.toArray)for(;void 0!==(o=a[r])&&(e.push(a.time),o.toArray(n,n.length)),void 0!==(a=t[i++]););else for(;void 0!==(o=a[r])&&(e.push(a.time),n.push(o)),void 0!==(a=t[i++]););}},subclip:function(t,e,n,r,i){i=i||30;var a=t.clone();a.name=e;for(var o=[],s=0;s<a.tracks.length;++s){for(var l=a.tracks[s],u=l.getValueSize(),c=[],h=[],d=0;d<l.times.length;++d){var p=l.times[d]*i;if(!(p<n||r<=p)){c.push(l.times[d]);for(var f=0;f<u;++f)h.push(l.values[d*u+f])}}0!==c.length&&(l.times=rs.convertArray(c,l.times.constructor),l.values=rs.convertArray(h,l.values.constructor),o.push(l))}a.tracks=o;var m=1/0;for(s=0;s<a.tracks.length;++s)m>a.tracks[s].times[0]&&(m=a.tracks[s].times[0]);for(s=0;s<a.tracks.length;++s)a.tracks[s].shift(-1*m);return a.resetDuration(),a}};function is(t,e,n,r){this.parameterPositions=t,this._cachedIndex=0,this.resultBuffer=void 0!==r?r:new e.constructor(n),this.sampleValues=e,this.valueSize=n}function as(t,e,n,r){is.call(this,t,e,n,r),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0}function os(t,e,n,r){is.call(this,t,e,n,r)}function ss(t,e,n,r){is.call(this,t,e,n,r)}function ls(t,e,n,r){if(void 0===t)throw new Error("THREE.KeyframeTrack: track name is undefined");if(void 0===e||0===e.length)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+t);this.name=t,this.times=rs.convertArray(e,this.TimeBufferType),this.values=rs.convertArray(n,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation)}function us(t,e,n){ls.call(this,t,e,n)}function cs(t,e,n,r){ls.call(this,t,e,n,r)}function hs(t,e,n,r){ls.call(this,t,e,n,r)}function ds(t,e,n,r){is.call(this,t,e,n,r)}function ps(t,e,n,r){ls.call(this,t,e,n,r)}function fs(t,e,n,r){ls.call(this,t,e,n,r)}function ms(t,e,n,r){ls.call(this,t,e,n,r)}function gs(t,e,n){this.name=t,this.tracks=n,this.duration=void 0!==e?e:-1,this.uuid=Q.generateUUID(),this.duration<0&&this.resetDuration()}function vs(t){if(void 0===t.type)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");var e=function(t){switch(t.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return hs;case"vector":case"vector2":case"vector3":case"vector4":return ms;case"color":return cs;case"quaternion":return ps;case"bool":case"boolean":return us;case"string":return fs}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+t)}(t.type);if(void 0===t.times){var n=[],r=[];rs.flattenJSON(t.keys,n,r,"value"),t.times=n,t.values=r}return void 0!==e.parse?e.parse(t):new e(t.name,t.times,t.values,t.interpolation)}Object.assign(is.prototype,{evaluate:function(t){var e=this.parameterPositions,n=this._cachedIndex,r=e[n],i=e[n-1];t:{e:{var a;n:{r:if(!(t<r)){for(var o=n+2;;){if(void 0===r){if(t<i)break r;return n=e.length,this._cachedIndex=n,this.afterEnd_(n-1,t,i)}if(n===o)break;if(i=r,t<(r=e[++n]))break e}a=e.length;break n}if(i<=t)break t;var s=e[1];for(t<s&&(n=2,i=s),o=n-2;;){if(void 0===i)return this._cachedIndex=0,this.beforeStart_(0,t,r);if(n===o)break;if(r=i,(i=e[--n-1])<=t)break e}a=n,n=0}for(;n<a;){var l=n+a>>>1;t<e[l]?a=l:n=1+l}if(r=e[n],void 0===(i=e[n-1]))return this._cachedIndex=0,this.beforeStart_(0,t,r);if(void 0===r)return n=e.length,this._cachedIndex=n,this.afterEnd_(n-1,i,t)}this._cachedIndex=n,this.intervalChanged_(n,i,r)}return this.interpolate_(n,i,t,r)},settings:null,DefaultSettings_:{},getSettings_:function(){return this.settings||this.DefaultSettings_},copySampleValue_:function(t){for(var e=this.resultBuffer,n=this.sampleValues,r=this.valueSize,i=t*r,a=0;a!==r;++a)e[a]=n[i+a];return e},interpolate_:function(){throw new Error("call to abstract method")},intervalChanged_:function(){}}),Object.assign(is.prototype,{beforeStart_:is.prototype.copySampleValue_,afterEnd_:is.prototype.copySampleValue_}),as.prototype=Object.assign(Object.create(is.prototype),{constructor:as,DefaultSettings_:{endingStart:B,endingEnd:B},intervalChanged_:function(t,e,n){var r=this.parameterPositions,i=t-2,a=t+1,o=r[i],s=r[a];if(void 0===o)switch(this.getSettings_().endingStart){case F:i=t,o=2*e-n;break;case N:o=e+r[i=r.length-2]-r[i+1];break;default:i=t,o=n}if(void 0===s)switch(this.getSettings_().endingEnd){case F:a=t,s=2*n-e;break;case N:s=n+r[a=1]-r[0];break;default:a=t-1,s=e}var l=.5*(n-e),u=this.valueSize;this._weightPrev=l/(e-o),this._weightNext=l/(s-n),this._offsetPrev=i*u,this._offsetNext=a*u},interpolate_:function(t,e,n,r){for(var i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=t*o,l=s-o,u=this._offsetPrev,c=this._offsetNext,h=this._weightPrev,d=this._weightNext,p=(n-e)/(r-e),f=p*p,m=f*p,g=-h*m+2*h*f-h*p,v=(1+h)*m+(-1.5-2*h)*f+(-.5+h)*p+1,y=(-1-d)*m+(1.5+d)*f+.5*p,x=d*m-d*f,b=0;b!==o;++b)i[b]=g*a[u+b]+v*a[l+b]+y*a[s+b]+x*a[c+b];return i}}),os.prototype=Object.assign(Object.create(is.prototype),{constructor:os,interpolate_:function(t,e,n,r){for(var i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=t*o,l=s-o,u=(n-e)/(r-e),c=1-u,h=0;h!==o;++h)i[h]=a[l+h]*c+a[s+h]*u;return i}}),ss.prototype=Object.assign(Object.create(is.prototype),{constructor:ss,interpolate_:function(t){return this.copySampleValue_(t-1)}}),Object.assign(ls,{toJSON:function(t){var e,n=t.constructor;if(void 0!==n.toJSON)e=n.toJSON(t);else{e={name:t.name,times:rs.convertArray(t.times,Array),values:rs.convertArray(t.values,Array)};var r=t.getInterpolation();r!==t.DefaultInterpolation&&(e.interpolation=r)}return e.type=t.ValueTypeName,e}}),Object.assign(ls.prototype,{constructor:ls,TimeBufferType:Float32Array,ValueBufferType:Float32Array,DefaultInterpolation:k,InterpolantFactoryMethodDiscrete:function(t){return new ss(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodLinear:function(t){return new os(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:function(t){return new as(this.times,this.values,this.getValueSize(),t)},setInterpolation:function(t){var e;switch(t){case I:e=this.InterpolantFactoryMethodDiscrete;break;case k:e=this.InterpolantFactoryMethodLinear;break;case 2302:e=this.InterpolantFactoryMethodSmooth}if(void 0!==e)return this.createInterpolant=e,this;var n="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(t===this.DefaultInterpolation)throw new Error(n);this.setInterpolation(this.DefaultInterpolation)}return console.warn("THREE.KeyframeTrack:",n),this},getInterpolation:function(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return I;case this.InterpolantFactoryMethodLinear:return k;case this.InterpolantFactoryMethodSmooth:return 2302}},getValueSize:function(){return this.values.length/this.times.length},shift:function(t){if(0!==t)for(var e=this.times,n=0,r=e.length;n!==r;++n)e[n]+=t;return this},scale:function(t){if(1!==t)for(var e=this.times,n=0,r=e.length;n!==r;++n)e[n]*=t;return this},trim:function(t,e){for(var n=this.times,r=n.length,i=0,a=r-1;i!==r&&n[i]<t;)++i;for(;-1!==a&&n[a]>e;)--a;if(++a,0!==i||a!==r){a<=i&&(i=(a=Math.max(a,1))-1);var o=this.getValueSize();this.times=rs.arraySlice(n,i,a),this.values=rs.arraySlice(this.values,i*o,a*o)}return this},validate:function(){var t=!0,e=this.getValueSize();e-Math.floor(e)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);var n=this.times,r=this.values,i=n.length;0===i&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);for(var a=null,o=0;o!==i;o++){var s=n[o];if("number"==typeof s&&isNaN(s)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,o,s),t=!1;break}if(null!==a&&s<a){console.error("THREE.KeyframeTrack: Out of order keys.",this,o,s,a),t=!1;break}a=s}if(void 0!==r&&rs.isTypedArray(r)){o=0;for(var l=r.length;o!==l;++o){var u=r[o];if(isNaN(u)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,o,u),t=!1;break}}}return t},optimize:function(){for(var t=rs.arraySlice(this.times),e=rs.arraySlice(this.values),n=this.getValueSize(),r=2302===this.getInterpolation(),i=1,a=t.length-1,o=1;o<a;++o){var s=!1,l=t[o];if(l!==t[o+1]&&(1!==o||l!==l[0]))if(r)s=!0;else for(var u=o*n,c=u-n,h=u+n,d=0;d!==n;++d){var p=e[u+d];if(p!==e[c+d]||p!==e[h+d]){s=!0;break}}if(s){if(o!==i){t[i]=t[o];var f=o*n,m=i*n;for(d=0;d!==n;++d)e[m+d]=e[f+d]}++i}}if(0<a){for(t[i]=t[a],f=a*n,m=i*n,d=0;d!==n;++d)e[m+d]=e[f+d];++i}return i!==t.length?(this.times=rs.arraySlice(t,0,i),this.values=rs.arraySlice(e,0,i*n)):(this.times=t,this.values=e),this},clone:function(){var t=rs.arraySlice(this.times,0),e=rs.arraySlice(this.values,0),n=new this.constructor(this.name,t,e);return n.createInterpolant=this.createInterpolant,n}}),us.prototype=Object.assign(Object.create(ls.prototype),{constructor:us,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:I,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),cs.prototype=Object.assign(Object.create(ls.prototype),{constructor:cs,ValueTypeName:"color"}),hs.prototype=Object.assign(Object.create(ls.prototype),{constructor:hs,ValueTypeName:"number"}),ds.prototype=Object.assign(Object.create(is.prototype),{constructor:ds,interpolate_:function(t,e,n,r){for(var i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=t*o,l=(n-e)/(r-e),u=s+o;s!==u;s+=4)lt.slerpFlat(i,0,a,s-o,a,s,l);return i}}),ps.prototype=Object.assign(Object.create(ls.prototype),{constructor:ps,ValueTypeName:"quaternion",DefaultInterpolation:k,InterpolantFactoryMethodLinear:function(t){return new ds(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:void 0}),fs.prototype=Object.assign(Object.create(ls.prototype),{constructor:fs,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:I,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),ms.prototype=Object.assign(Object.create(ls.prototype),{constructor:ms,ValueTypeName:"vector"}),Object.assign(gs,{parse:function(t){for(var e=[],n=t.tracks,r=1/(t.fps||1),i=0,a=n.length;i!==a;++i)e.push(vs(n[i]).scale(r));return new gs(t.name,t.duration,e)},toJSON:function(t){for(var e=[],n=t.tracks,r={name:t.name,duration:t.duration,tracks:e,uuid:t.uuid},i=0,a=n.length;i!==a;++i)e.push(ls.toJSON(n[i]));return r},CreateFromMorphTargetSequence:function(t,e,n,r){for(var i=e.length,a=[],o=0;o<i;o++){var s=[],l=[];s.push((o+i-1)%i,o,(o+1)%i),l.push(0,1,0);var u=rs.getKeyframeOrder(s);s=rs.sortedArray(s,1,u),l=rs.sortedArray(l,1,u),r||0!==s[0]||(s.push(i),l.push(l[0])),a.push(new hs(".morphTargetInfluences["+e[o].name+"]",s,l).scale(1/n))}return new gs(t,-1,a)},findByName:function(t,e){var n=t;Array.isArray(t)||(n=t.geometry&&t.geometry.animations||t.animations);for(var r=0;r<n.length;r++)if(n[r].name===e)return n[r];return null},CreateClipsFromMorphTargetSequences:function(t,e,n){for(var r={},i=/^([\w-]*?)([\d]+)$/,a=0,o=t.length;a<o;a++){var s=t[a],l=s.name.match(i);if(l&&1<l.length){var u=r[h=l[1]];u||(r[h]=u=[]),u.push(s)}}var c=[];for(var h in r)c.push(gs.CreateFromMorphTargetSequence(h,r[h],e,n));return c},parseAnimation:function(t,e){if(!t)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;for(var n=function(t,e,n,r,i){if(0!==n.length){var a=[],o=[];rs.flattenJSON(n,a,o,r),0!==a.length&&i.push(new t(e,a,o))}},r=[],i=t.name||"default",a=t.length||-1,o=t.fps||30,s=t.hierarchy||[],l=0;l<s.length;l++){var u=s[l].keys;if(u&&0!==u.length)if(u[0].morphTargets){for(var c={},h=0;h<u.length;h++)if(u[h].morphTargets)for(var d=0;d<u[h].morphTargets.length;d++)c[u[h].morphTargets[d]]=-1;for(var p in c){var f=[],m=[];for(d=0;d!==u[h].morphTargets.length;++d){var g=u[h];f.push(g.time),m.push(g.morphTarget===p?1:0)}r.push(new hs(".morphTargetInfluence["+p+"]",f,m))}a=c.length*(o||1)}else{var v=".bones["+e[l].name+"]";n(ms,v+".position",u,"pos",r),n(ps,v+".quaternion",u,"rot",r),n(ms,v+".scale",u,"scl",r)}}return 0===r.length?null:new gs(i,a,r)}}),Object.assign(gs.prototype,{resetDuration:function(){for(var t=0,e=0,n=this.tracks.length;e!==n;++e){var r=this.tracks[e];t=Math.max(t,r.times[r.times.length-1])}return this.duration=t,this},trim:function(){for(var t=0;t<this.tracks.length;t++)this.tracks[t].trim(0,this.duration);return this},validate:function(){for(var t=!0,e=0;e<this.tracks.length;e++)t=t&&this.tracks[e].validate();return t},optimize:function(){for(var t=0;t<this.tracks.length;t++)this.tracks[t].optimize();return this},clone:function(){for(var t=[],e=0;e<this.tracks.length;e++)t.push(this.tracks[e].clone());return new gs(this.name,this.duration,t)}});var ys={enabled:!1,files:{},add:function(t,e){!1!==this.enabled&&(this.files[t]=e)},get:function(t){if(!1!==this.enabled)return this.files[t]},remove:function(t){delete this.files[t]},clear:function(){this.files={}}};function xs(t,e,n){var r=this,i=!1,a=0,o=0,s=void 0,l=[];this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=n,this.itemStart=function(t){o++,!1===i&&void 0!==r.onStart&&r.onStart(t,a,o),i=!0},this.itemEnd=function(t){a++,void 0!==r.onProgress&&r.onProgress(t,a,o),a===o&&(i=!1,void 0!==r.onLoad&&r.onLoad())},this.itemError=function(t){void 0!==r.onError&&r.onError(t)},this.resolveURL=function(t){return s?s(t):t},this.setURLModifier=function(t){return s=t,this},this.addHandler=function(t,e){return l.push(t,e),this},this.removeHandler=function(t){var e=l.indexOf(t);return-1!==e&&l.splice(e,2),this},this.getHandler=function(t){for(var e=0,n=l.length;e<n;e+=2){var r=l[e],i=l[e+1];if(r.global&&(r.lastIndex=0),r.test(t))return i}return null}}var bs=new xs;function ws(t){this.manager=void 0!==t?t:bs,this.crossOrigin="anonymous",this.path="",this.resourcePath=""}Object.assign(ws.prototype,{load:function(){},parse:function(){},setCrossOrigin:function(t){return this.crossOrigin=t,this},setPath:function(t){return this.path=t,this},setResourcePath:function(t){return this.resourcePath=t,this}});var _s={};function Ms(t){ws.call(this,t)}function Ss(t){ws.call(this,t)}function Ts(t){ws.call(this,t)}function Cs(t){ws.call(this,t)}function Es(t){ws.call(this,t)}function Ds(t){ws.call(this,t)}function As(t){ws.call(this,t)}function Os(){this.type="Curve",this.arcLengthDivisions=200}function Ls(t,e,n,r,i,a,o,s){Os.call(this),this.type="EllipseCurve",this.aX=t||0,this.aY=e||0,this.xRadius=n||1,this.yRadius=r||1,this.aStartAngle=i||0,this.aEndAngle=a||2*Math.PI,this.aClockwise=o||!1,this.aRotation=s||0}function Ps(t,e,n,r,i,a){Ls.call(this,t,e,n,n,r,i,a),this.type="ArcCurve"}function Rs(){var t=0,e=0,n=0,r=0;function i(i,a,o,s){n=-3*(t=i)+3*a-2*(e=o)-s,r=2*i-2*a+o+s}return{initCatmullRom:function(t,e,n,r,a){i(e,n,a*(n-t),a*(r-e))},initNonuniformCatmullRom:function(t,e,n,r,a,o,s){var l=(e-t)/a-(n-t)/(a+o)+(n-e)/o,u=(n-e)/o-(r-e)/(o+s)+(r-n)/s;i(e,n,l*=o,u*=o)},calc:function(i){var a=i*i;return t+e*i+n*a+r*(a*i)}}}Ms.prototype=Object.assign(Object.create(ws.prototype),{constructor:Ms,load:function(t,e,n,r){void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);var i=this,a=ys.get(t);if(void 0!==a)return i.manager.itemStart(t),setTimeout(function(){e&&e(a),i.manager.itemEnd(t)},0),a;if(void 0===_s[t]){var o=t.match(/^data:(.*?)(;base64)?,(.*)$/);if(o){var s=o[1],l=!!o[2],u=o[3];u=decodeURIComponent(u),l&&(u=atob(u));try{var c,h=(this.responseType||"").toLowerCase();switch(h){case"arraybuffer":case"blob":for(var d=new Uint8Array(u.length),p=0;p<u.length;p++)d[p]=u.charCodeAt(p);c="blob"===h?new Blob([d.buffer],{type:s}):d.buffer;break;case"document":var f=new DOMParser;c=f.parseFromString(u,s);break;case"json":c=JSON.parse(u);break;default:c=u}setTimeout(function(){e&&e(c),i.manager.itemEnd(t)},0)}catch(e){setTimeout(function(){r&&r(e),i.manager.itemError(t),i.manager.itemEnd(t)},0)}}else{_s[t]=[],_s[t].push({onLoad:e,onProgress:n,onError:r});var m=new XMLHttpRequest;for(var g in m.open("GET",t,!0),m.addEventListener("load",function(e){var n=this.response,r=_s[t];if(delete _s[t],200===this.status||0===this.status){0===this.status&&console.warn("THREE.FileLoader: HTTP Status 0 received."),ys.add(t,n);for(var a=0,o=r.length;a<o;a++)(s=r[a]).onLoad&&s.onLoad(n);i.manager.itemEnd(t)}else{for(a=0,o=r.length;a<o;a++){var s;(s=r[a]).onError&&s.onError(e)}i.manager.itemError(t),i.manager.itemEnd(t)}},!1),m.addEventListener("progress",function(e){for(var n=_s[t],r=0,i=n.length;r<i;r++){var a=n[r];a.onProgress&&a.onProgress(e)}},!1),m.addEventListener("error",function(e){var n=_s[t];delete _s[t];for(var r=0,a=n.length;r<a;r++){var o=n[r];o.onError&&o.onError(e)}i.manager.itemError(t),i.manager.itemEnd(t)},!1),m.addEventListener("abort",function(e){var n=_s[t];delete _s[t];for(var r=0,a=n.length;r<a;r++){var o=n[r];o.onError&&o.onError(e)}i.manager.itemError(t),i.manager.itemEnd(t)},!1),void 0!==this.responseType&&(m.responseType=this.responseType),void 0!==this.withCredentials&&(m.withCredentials=this.withCredentials),m.overrideMimeType&&m.overrideMimeType(void 0!==this.mimeType?this.mimeType:"text/plain"),this.requestHeader)m.setRequestHeader(g,this.requestHeader[g]);m.send(null)}return i.manager.itemStart(t),m}_s[t].push({onLoad:e,onProgress:n,onError:r})},setResponseType:function(t){return this.responseType=t,this},setWithCredentials:function(t){return this.withCredentials=t,this},setMimeType:function(t){return this.mimeType=t,this},setRequestHeader:function(t){return this.requestHeader=t,this}}),Ss.prototype=Object.assign(Object.create(ws.prototype),{constructor:Ss,load:function(t,e,n,r){var i=this,a=new Ms(i.manager);a.setPath(i.path),a.load(t,function(t){e(i.parse(JSON.parse(t)))},n,r)},parse:function(t){for(var e=[],n=0;n<t.length;n++){var r=gs.parse(t[n]);e.push(r)}return e}}),Ts.prototype=Object.assign(Object.create(ws.prototype),{constructor:Ts,load:function(t,e,n,r){var i=this,a=[],o=new La;o.image=a;var s=new Ms(this.manager);function l(l){s.load(t[l],function(t){var n=i.parse(t,!0);a[l]={width:n.width,height:n.height,format:n.format,mipmaps:n.mipmaps},6===(u+=1)&&(1===n.mipmapCount&&(o.minFilter=p),o.format=n.format,o.needsUpdate=!0,e&&e(o))},n,r)}if(s.setPath(this.path),s.setResponseType("arraybuffer"),Array.isArray(t))for(var u=0,c=0,h=t.length;c<h;++c)l(c);else s.load(t,function(t){var n=i.parse(t,!0);if(n.isCubemap)for(var r=n.mipmaps.length/n.mipmapCount,s=0;s<r;s++){a[s]={mipmaps:[]};for(var l=0;l<n.mipmapCount;l++)a[s].mipmaps.push(n.mipmaps[s*n.mipmapCount+l]),a[s].format=n.format,a[s].width=n.width,a[s].height=n.height}else o.image.width=n.width,o.image.height=n.height,o.mipmaps=n.mipmaps;1===n.mipmapCount&&(o.minFilter=p),o.format=n.format,o.needsUpdate=!0,e&&e(o)},n,r);return o}}),Cs.prototype=Object.assign(Object.create(ws.prototype),{constructor:Cs,load:function(t,e,n,r){var i=this,a=new jn,o=new Ms(this.manager);return o.setResponseType("arraybuffer"),o.setPath(this.path),o.load(t,function(t){var n=i.parse(t);n&&(void 0!==n.image?a.image=n.image:void 0!==n.data&&(a.image.width=n.width,a.image.height=n.height,a.image.data=n.data),a.wrapS=void 0!==n.wrapS?n.wrapS:l,a.wrapT=void 0!==n.wrapT?n.wrapT:l,a.magFilter=void 0!==n.magFilter?n.magFilter:p,a.minFilter=void 0!==n.minFilter?n.minFilter:p,a.anisotropy=void 0!==n.anisotropy?n.anisotropy:1,void 0!==n.format&&(a.format=n.format),void 0!==n.type&&(a.type=n.type),void 0!==n.mipmaps&&(a.mipmaps=n.mipmaps,a.minFilter=m),1===n.mipmapCount&&(a.minFilter=p),a.needsUpdate=!0,e&&e(a,n))},n,r),a}}),Es.prototype=Object.assign(Object.create(ws.prototype),{constructor:Es,load:function(t,e,n,r){void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);var i=this,a=ys.get(t);if(void 0!==a)return i.manager.itemStart(t),setTimeout(function(){e&&e(a),i.manager.itemEnd(t)},0),a;var o=document.createElementNS("http://www.w3.org/1999/xhtml","img");function s(){o.removeEventListener("load",s,!1),o.removeEventListener("error",l,!1),ys.add(t,this),e&&e(this),i.manager.itemEnd(t)}function l(e){o.removeEventListener("load",s,!1),o.removeEventListener("error",l,!1),r&&r(e),i.manager.itemError(t),i.manager.itemEnd(t)}return o.addEventListener("load",s,!1),o.addEventListener("error",l,!1),"data:"!==t.substr(0,5)&&void 0!==this.crossOrigin&&(o.crossOrigin=this.crossOrigin),i.manager.itemStart(t),o.src=t,o}}),Ds.prototype=Object.assign(Object.create(ws.prototype),{constructor:Ds,load:function(t,e,n,r){var i=new Kn,a=new Es(this.manager);a.setCrossOrigin(this.crossOrigin),a.setPath(this.path);var o=0;function s(n){a.load(t[n],function(t){i.images[n]=t,6==++o&&(i.needsUpdate=!0,e&&e(i))},void 0,r)}for(var l=0;l<t.length;++l)s(l);return i}}),As.prototype=Object.assign(Object.create(ws.prototype),{constructor:As,load:function(t,e,n,r){var i=new it,a=new Es(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setPath(this.path),a.load(t,function(n){i.image=n;var r=0<t.search(/\.jpe?g($|\?)/i)||0===t.search(/^data\:image\/jpeg/);i.format=r?_:M,i.needsUpdate=!0,void 0!==e&&e(i)},n,r),i}}),Object.assign(Os.prototype,{getPoint:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},getPointAt:function(t,e){var n=this.getUtoTmapping(t);return this.getPoint(n,e)},getPoints:function(t){void 0===t&&(t=5);for(var e=[],n=0;n<=t;n++)e.push(this.getPoint(n/t));return e},getSpacedPoints:function(t){void 0===t&&(t=5);for(var e=[],n=0;n<=t;n++)e.push(this.getPointAt(n/t));return e},getLength:function(){var t=this.getLengths();return t[t.length-1]},getLengths:function(t){if(void 0===t&&(t=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var e,n,r=[],i=this.getPoint(0),a=0;for(r.push(0),n=1;n<=t;n++)a+=(e=this.getPoint(n/t)).distanceTo(i),r.push(a),i=e;return this.cacheArcLengths=r},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(t,e){var n,r=this.getLengths(),i=0,a=r.length;n=e||t*r[a-1];for(var o,s=0,l=a-1;s<=l;)if((o=r[i=Math.floor(s+(l-s)/2)]-n)<0)s=i+1;else{if(!(0<o)){l=i;break}l=i-1}if(r[i=l]===n)return i/(a-1);var u=r[i];return(i+(n-u)/(r[i+1]-u))/(a-1)},getTangent:function(t){var e=t-1e-4,n=t+1e-4;e<0&&(e=0),1<n&&(n=1);var r=this.getPoint(e);return this.getPoint(n).clone().sub(r).normalize()},getTangentAt:function(t){var e=this.getUtoTmapping(t);return this.getTangent(e)},computeFrenetFrames:function(t,e){var n,r,i,a=new ht,o=[],s=[],l=[],u=new ht,c=new xt;for(n=0;n<=t;n++)r=n/t,o[n]=this.getTangentAt(r),o[n].normalize();s[0]=new ht,l[0]=new ht;var h=Number.MAX_VALUE,d=Math.abs(o[0].x),p=Math.abs(o[0].y),f=Math.abs(o[0].z);for(d<=h&&(h=d,a.set(1,0,0)),p<=h&&(h=p,a.set(0,1,0)),f<=h&&a.set(0,0,1),u.crossVectors(o[0],a).normalize(),s[0].crossVectors(o[0],u),l[0].crossVectors(o[0],s[0]),n=1;n<=t;n++)s[n]=s[n-1].clone(),l[n]=l[n-1].clone(),u.crossVectors(o[n-1],o[n]),u.length()>Number.EPSILON&&(u.normalize(),i=Math.acos(Q.clamp(o[n-1].dot(o[n]),-1,1)),s[n].applyMatrix4(c.makeRotationAxis(u,i))),l[n].crossVectors(o[n],s[n]);if(!0===e)for(i=Math.acos(Q.clamp(s[0].dot(s[t]),-1,1)),i/=t,0<o[0].dot(u.crossVectors(s[0],s[t]))&&(i=-i),n=1;n<=t;n++)s[n].applyMatrix4(c.makeRotationAxis(o[n],i*n)),l[n].crossVectors(o[n],s[n]);return{tangents:o,normals:s,binormals:l}},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.arcLengthDivisions=t.arcLengthDivisions,this},toJSON:function(){var t={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t},fromJSON:function(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}),((Ls.prototype=Object.create(Os.prototype)).constructor=Ls).prototype.isEllipseCurve=!0,Ls.prototype.getPoint=function(t,e){for(var n=e||new tt,r=2*Math.PI,i=this.aEndAngle-this.aStartAngle,a=Math.abs(i)<Number.EPSILON;i<0;)i+=r;for(;r<i;)i-=r;i<Number.EPSILON&&(i=a?0:r),!0!==this.aClockwise||a||(i===r?i=-r:i-=r);var o=this.aStartAngle+t*i,s=this.aX+this.xRadius*Math.cos(o),l=this.aY+this.yRadius*Math.sin(o);if(0!==this.aRotation){var u=Math.cos(this.aRotation),c=Math.sin(this.aRotation),h=s-this.aX,d=l-this.aY;s=h*u-d*c+this.aX,l=h*c+d*u+this.aY}return n.set(s,l)},Ls.prototype.copy=function(t){return Os.prototype.copy.call(this,t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this},Ls.prototype.toJSON=function(){var t=Os.prototype.toJSON.call(this);return t.aX=this.aX,t.aY=this.aY,t.xRadius=this.xRadius,t.yRadius=this.yRadius,t.aStartAngle=this.aStartAngle,t.aEndAngle=this.aEndAngle,t.aClockwise=this.aClockwise,t.aRotation=this.aRotation,t},Ls.prototype.fromJSON=function(t){return Os.prototype.fromJSON.call(this,t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this},((Ps.prototype=Object.create(Ls.prototype)).constructor=Ps).prototype.isArcCurve=!0;var Is=new ht,ks=new Rs,Bs=new Rs,Fs=new Rs;function Ns(t,e,n,r){Os.call(this),this.type="CatmullRomCurve3",this.points=t||[],this.closed=e||!1,this.curveType=n||"centripetal",this.tension=r||.5}function js(t,e,n,r,i){var a=.5*(r-e),o=.5*(i-n),s=t*t;return(2*n-2*r+a+o)*(t*s)+(-3*n+3*r-2*a-o)*s+a*t+n}function zs(t,e,n,r){return(o=1-t)*o*e+2*(1-(a=t))*a*n+(i=t)*i*r;var i,a,o}function Vs(t,e,n,r,i){return(u=1-t)*u*u*e+3*(l=1-(s=t))*l*s*n+3*(1-(o=t))*o*o*r+(a=t)*a*a*i;var a,o,s,l,u}function Gs(t,e,n,r){Os.call(this),this.type="CubicBezierCurve",this.v0=t||new tt,this.v1=e||new tt,this.v2=n||new tt,this.v3=r||new tt}function Us(t,e,n,r){Os.call(this),this.type="CubicBezierCurve3",this.v0=t||new ht,this.v1=e||new ht,this.v2=n||new ht,this.v3=r||new ht}function Hs(t,e){Os.call(this),this.type="LineCurve",this.v1=t||new tt,this.v2=e||new tt}function Ws(t,e){Os.call(this),this.type="LineCurve3",this.v1=t||new ht,this.v2=e||new ht}function Js(t,e,n){Os.call(this),this.type="QuadraticBezierCurve",this.v0=t||new tt,this.v1=e||new tt,this.v2=n||new tt}function qs(t,e,n){Os.call(this),this.type="QuadraticBezierCurve3",this.v0=t||new ht,this.v1=e||new ht,this.v2=n||new ht}function Xs(t){Os.call(this),this.type="SplineCurve",this.points=t||[]}((Ns.prototype=Object.create(Os.prototype)).constructor=Ns).prototype.isCatmullRomCurve3=!0,Ns.prototype.getPoint=function(t,e){var n,r,i,a,o=e||new ht,s=this.points,l=s.length,u=(l-(this.closed?0:1))*t,c=Math.floor(u),h=u-c;if(this.closed?c+=0<c?0:(Math.floor(Math.abs(c)/l)+1)*l:0===h&&c===l-1&&(c=l-2,h=1),n=this.closed||0<c?s[(c-1)%l]:(Is.subVectors(s[0],s[1]).add(s[0]),Is),r=s[c%l],i=s[(c+1)%l],a=this.closed||c+2<l?s[(c+2)%l]:(Is.subVectors(s[l-1],s[l-2]).add(s[l-1]),Is),"centripetal"===this.curveType||"chordal"===this.curveType){var d="chordal"===this.curveType?.5:.25,p=Math.pow(n.distanceToSquared(r),d),f=Math.pow(r.distanceToSquared(i),d),m=Math.pow(i.distanceToSquared(a),d);f<1e-4&&(f=1),p<1e-4&&(p=f),m<1e-4&&(m=f),ks.initNonuniformCatmullRom(n.x,r.x,i.x,a.x,p,f,m),Bs.initNonuniformCatmullRom(n.y,r.y,i.y,a.y,p,f,m),Fs.initNonuniformCatmullRom(n.z,r.z,i.z,a.z,p,f,m)}else"catmullrom"===this.curveType&&(ks.initCatmullRom(n.x,r.x,i.x,a.x,this.tension),Bs.initCatmullRom(n.y,r.y,i.y,a.y,this.tension),Fs.initCatmullRom(n.z,r.z,i.z,a.z,this.tension));return o.set(ks.calc(h),Bs.calc(h),Fs.calc(h)),o},Ns.prototype.copy=function(t){Os.prototype.copy.call(this,t),this.points=[];for(var e=0,n=t.points.length;e<n;e++){var r=t.points[e];this.points.push(r.clone())}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this},Ns.prototype.toJSON=function(){var t=Os.prototype.toJSON.call(this);t.points=[];for(var e=0,n=this.points.length;e<n;e++){var r=this.points[e];t.points.push(r.toArray())}return t.closed=this.closed,t.curveType=this.curveType,t.tension=this.tension,t},Ns.prototype.fromJSON=function(t){Os.prototype.fromJSON.call(this,t),this.points=[];for(var e=0,n=t.points.length;e<n;e++){var r=t.points[e];this.points.push((new ht).fromArray(r))}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this},((Gs.prototype=Object.create(Os.prototype)).constructor=Gs).prototype.isCubicBezierCurve=!0,Gs.prototype.getPoint=function(t,e){var n=e||new tt,r=this.v0,i=this.v1,a=this.v2,o=this.v3;return n.set(Vs(t,r.x,i.x,a.x,o.x),Vs(t,r.y,i.y,a.y,o.y)),n},Gs.prototype.copy=function(t){return Os.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this},Gs.prototype.toJSON=function(){var t=Os.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t},Gs.prototype.fromJSON=function(t){return Os.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this},((Us.prototype=Object.create(Os.prototype)).constructor=Us).prototype.isCubicBezierCurve3=!0,Us.prototype.getPoint=function(t,e){var n=e||new ht,r=this.v0,i=this.v1,a=this.v2,o=this.v3;return n.set(Vs(t,r.x,i.x,a.x,o.x),Vs(t,r.y,i.y,a.y,o.y),Vs(t,r.z,i.z,a.z,o.z)),n},Us.prototype.copy=function(t){return Os.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this},Us.prototype.toJSON=function(){var t=Os.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t},Us.prototype.fromJSON=function(t){return Os.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this},((Hs.prototype=Object.create(Os.prototype)).constructor=Hs).prototype.isLineCurve=!0,Hs.prototype.getPoint=function(t,e){var n=e||new tt;return 1===t?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(t).add(this.v1)),n},Hs.prototype.getPointAt=function(t,e){return this.getPoint(t,e)},Hs.prototype.getTangent=function(){return this.v2.clone().sub(this.v1).normalize()},Hs.prototype.copy=function(t){return Os.prototype.copy.call(this,t),this.v1.copy(t.v1),this.v2.copy(t.v2),this},Hs.prototype.toJSON=function(){var t=Os.prototype.toJSON.call(this);return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},Hs.prototype.fromJSON=function(t){return Os.prototype.fromJSON.call(this,t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},((Ws.prototype=Object.create(Os.prototype)).constructor=Ws).prototype.isLineCurve3=!0,Ws.prototype.getPoint=function(t,e){var n=e||new ht;return 1===t?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(t).add(this.v1)),n},Ws.prototype.getPointAt=function(t,e){return this.getPoint(t,e)},Ws.prototype.copy=function(t){return Os.prototype.copy.call(this,t),this.v1.copy(t.v1),this.v2.copy(t.v2),this},Ws.prototype.toJSON=function(){var t=Os.prototype.toJSON.call(this);return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},Ws.prototype.fromJSON=function(t){return Os.prototype.fromJSON.call(this,t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},((Js.prototype=Object.create(Os.prototype)).constructor=Js).prototype.isQuadraticBezierCurve=!0,Js.prototype.getPoint=function(t,e){var n=e||new tt,r=this.v0,i=this.v1,a=this.v2;return n.set(zs(t,r.x,i.x,a.x),zs(t,r.y,i.y,a.y)),n},Js.prototype.copy=function(t){return Os.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this},Js.prototype.toJSON=function(){var t=Os.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},Js.prototype.fromJSON=function(t){return Os.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},((qs.prototype=Object.create(Os.prototype)).constructor=qs).prototype.isQuadraticBezierCurve3=!0,qs.prototype.getPoint=function(t,e){var n=e||new ht,r=this.v0,i=this.v1,a=this.v2;return n.set(zs(t,r.x,i.x,a.x),zs(t,r.y,i.y,a.y),zs(t,r.z,i.z,a.z)),n},qs.prototype.copy=function(t){return Os.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this},qs.prototype.toJSON=function(){var t=Os.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},qs.prototype.fromJSON=function(t){return Os.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},((Xs.prototype=Object.create(Os.prototype)).constructor=Xs).prototype.isSplineCurve=!0,Xs.prototype.getPoint=function(t,e){var n=e||new tt,r=this.points,i=(r.length-1)*t,a=Math.floor(i),o=i-a,s=r[0===a?a:a-1],l=r[a],u=r[a>r.length-2?r.length-1:a+1],c=r[a>r.length-3?r.length-1:a+2];return n.set(js(o,s.x,l.x,u.x,c.x),js(o,s.y,l.y,u.y,c.y)),n},Xs.prototype.copy=function(t){Os.prototype.copy.call(this,t),this.points=[];for(var e=0,n=t.points.length;e<n;e++){var r=t.points[e];this.points.push(r.clone())}return this},Xs.prototype.toJSON=function(){var t=Os.prototype.toJSON.call(this);t.points=[];for(var e=0,n=this.points.length;e<n;e++){var r=this.points[e];t.points.push(r.toArray())}return t},Xs.prototype.fromJSON=function(t){Os.prototype.fromJSON.call(this,t),this.points=[];for(var e=0,n=t.points.length;e<n;e++){var r=t.points[e];this.points.push((new tt).fromArray(r))}return this};var Ys=Object.freeze({__proto__:null,ArcCurve:Ps,CatmullRomCurve3:Ns,CubicBezierCurve:Gs,CubicBezierCurve3:Us,EllipseCurve:Ls,LineCurve:Hs,LineCurve3:Ws,QuadraticBezierCurve:Js,QuadraticBezierCurve3:qs,SplineCurve:Xs});function Zs(){Os.call(this),this.type="CurvePath",this.curves=[],this.autoClose=!1}function $s(t){Zs.call(this),this.type="Path",this.currentPoint=new tt,t&&this.setFromPoints(t)}function Ks(t){$s.call(this,t),this.uuid=Q.generateUUID(),this.type="Shape",this.holes=[]}function Qs(t,e){Ft.call(this),this.type="Light",this.color=new De(t),this.intensity=void 0!==e?e:1,this.receiveShadow=void 0}function tl(t,e,n){Qs.call(this,t,n),this.type="HemisphereLight",this.castShadow=void 0,this.position.copy(Ft.DefaultUp),this.updateMatrix(),this.groundColor=new De(e)}function el(t){this.camera=t,this.bias=0,this.radius=1,this.mapSize=new tt(512,512),this.map=null,this.mapPass=null,this.matrix=new xt,this._frustum=new Gn,this._frameExtents=new tt(1,1),this._viewportCount=1,this._viewports=[new at(0,0,1,1)]}function nl(){el.call(this,new Bn(50,1,.5,500))}function rl(t,e,n,r,i,a){Qs.call(this,t,e),this.type="SpotLight",this.position.copy(Ft.DefaultUp),this.updateMatrix(),this.target=new Ft,Object.defineProperty(this,"power",{get:function(){return this.intensity*Math.PI},set:function(t){this.intensity=t/Math.PI}}),this.distance=void 0!==n?n:0,this.angle=void 0!==r?r:Math.PI/3,this.penumbra=void 0!==i?i:0,this.decay=void 0!==a?a:1,this.shadow=new nl}function il(){el.call(this,new Bn(90,1,.5,500)),this._frameExtents=new tt(4,2),this._viewportCount=6,this._viewports=[new at(2,1,1,1),new at(0,1,1,1),new at(3,1,1,1),new at(1,1,1,1),new at(3,0,1,1),new at(1,0,1,1)],this._cubeDirections=[new ht(1,0,0),new ht(-1,0,0),new ht(0,0,1),new ht(0,0,-1),new ht(0,1,0),new ht(0,-1,0)],this._cubeUps=[new ht(0,1,0),new ht(0,1,0),new ht(0,1,0),new ht(0,1,0),new ht(0,0,1),new ht(0,0,-1)]}function al(t,e,n,r){Qs.call(this,t,e),this.type="PointLight",Object.defineProperty(this,"power",{get:function(){return 4*this.intensity*Math.PI},set:function(t){this.intensity=t/(4*Math.PI)}}),this.distance=void 0!==n?n:0,this.decay=void 0!==r?r:1,this.shadow=new il}function ol(t,e,n,r,i,a){kn.call(this),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=void 0!==t?t:-1,this.right=void 0!==e?e:1,this.top=void 0!==n?n:1,this.bottom=void 0!==r?r:-1,this.near=void 0!==i?i:.1,this.far=void 0!==a?a:2e3,this.updateProjectionMatrix()}function sl(){el.call(this,new ol(-5,5,5,-5,.5,500))}function ll(t,e){Qs.call(this,t,e),this.type="DirectionalLight",this.position.copy(Ft.DefaultUp),this.updateMatrix(),this.target=new Ft,this.shadow=new sl}function ul(t,e){Qs.call(this,t,e),this.type="AmbientLight",this.castShadow=void 0}function cl(t,e,n,r){Qs.call(this,t,e),this.type="RectAreaLight",this.width=void 0!==n?n:10,this.height=void 0!==r?r:10}function hl(t){ws.call(this,t),this.textures={}}Zs.prototype=Object.assign(Object.create(Os.prototype),{constructor:Zs,add:function(t){this.curves.push(t)},closePath:function(){var t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);t.equals(e)||this.curves.push(new Hs(e,t))},getPoint:function(t){for(var e=t*this.getLength(),n=this.getCurveLengths(),r=0;r<n.length;){if(n[r]>=e){var i=n[r]-e,a=this.curves[r],o=a.getLength(),s=0===o?0:1-i/o;return a.getPointAt(s)}r++}return null},getLength:function(){var t=this.getCurveLengths();return t[t.length-1]},updateArcLengths:function(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()},getCurveLengths:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var t=[],e=0,n=0,r=this.curves.length;n<r;n++)e+=this.curves[n].getLength(),t.push(e);return this.cacheLengths=t},getSpacedPoints:function(t){void 0===t&&(t=40);for(var e=[],n=0;n<=t;n++)e.push(this.getPoint(n/t));return this.autoClose&&e.push(e[0]),e},getPoints:function(t){t=t||12;for(var e,n=[],r=0,i=this.curves;r<i.length;r++)for(var a=i[r],o=a&&a.isEllipseCurve?2*t:a&&(a.isLineCurve||a.isLineCurve3)?1:a&&a.isSplineCurve?t*a.points.length:t,s=a.getPoints(o),l=0;l<s.length;l++){var u=s[l];e&&e.equals(u)||(n.push(u),e=u)}return this.autoClose&&1<n.length&&!n[n.length-1].equals(n[0])&&n.push(n[0]),n},copy:function(t){Os.prototype.copy.call(this,t),this.curves=[];for(var e=0,n=t.curves.length;e<n;e++){var r=t.curves[e];this.curves.push(r.clone())}return this.autoClose=t.autoClose,this},toJSON:function(){var t=Os.prototype.toJSON.call(this);t.autoClose=this.autoClose,t.curves=[];for(var e=0,n=this.curves.length;e<n;e++){var r=this.curves[e];t.curves.push(r.toJSON())}return t},fromJSON:function(t){Os.prototype.fromJSON.call(this,t),this.autoClose=t.autoClose,this.curves=[];for(var e=0,n=t.curves.length;e<n;e++){var r=t.curves[e];this.curves.push((new Ys[r.type]).fromJSON(r))}return this}}),$s.prototype=Object.assign(Object.create(Zs.prototype),{constructor:$s,setFromPoints:function(t){this.moveTo(t[0].x,t[0].y);for(var e=1,n=t.length;e<n;e++)this.lineTo(t[e].x,t[e].y);return this},moveTo:function(t,e){return this.currentPoint.set(t,e),this},lineTo:function(t,e){var n=new Hs(this.currentPoint.clone(),new tt(t,e));return this.curves.push(n),this.currentPoint.set(t,e),this},quadraticCurveTo:function(t,e,n,r){var i=new Js(this.currentPoint.clone(),new tt(t,e),new tt(n,r));return this.curves.push(i),this.currentPoint.set(n,r),this},bezierCurveTo:function(t,e,n,r,i,a){var o=new Gs(this.currentPoint.clone(),new tt(t,e),new tt(n,r),new tt(i,a));return this.curves.push(o),this.currentPoint.set(i,a),this},splineThru:function(t){var e=new Xs([this.currentPoint.clone()].concat(t));return this.curves.push(e),this.currentPoint.copy(t[t.length-1]),this},arc:function(t,e,n,r,i,a){var o=this.currentPoint.x,s=this.currentPoint.y;return this.absarc(t+o,e+s,n,r,i,a),this},absarc:function(t,e,n,r,i,a){return this.absellipse(t,e,n,n,r,i,a),this},ellipse:function(t,e,n,r,i,a,o,s){var l=this.currentPoint.x,u=this.currentPoint.y;return this.absellipse(t+l,e+u,n,r,i,a,o,s),this},absellipse:function(t,e,n,r,i,a,o,s){var l=new Ls(t,e,n,r,i,a,o,s);if(0<this.curves.length){var u=l.getPoint(0);u.equals(this.currentPoint)||this.lineTo(u.x,u.y)}this.curves.push(l);var c=l.getPoint(1);return this.currentPoint.copy(c),this},copy:function(t){return Zs.prototype.copy.call(this,t),this.currentPoint.copy(t.currentPoint),this},toJSON:function(){var t=Zs.prototype.toJSON.call(this);return t.currentPoint=this.currentPoint.toArray(),t},fromJSON:function(t){return Zs.prototype.fromJSON.call(this,t),this.currentPoint.fromArray(t.currentPoint),this}}),Ks.prototype=Object.assign(Object.create($s.prototype),{constructor:Ks,getPointsHoles:function(t){for(var e=[],n=0,r=this.holes.length;n<r;n++)e[n]=this.holes[n].getPoints(t);return e},extractPoints:function(t){return{shape:this.getPoints(t),holes:this.getPointsHoles(t)}},copy:function(t){$s.prototype.copy.call(this,t),this.holes=[];for(var e=0,n=t.holes.length;e<n;e++){var r=t.holes[e];this.holes.push(r.clone())}return this},toJSON:function(){var t=$s.prototype.toJSON.call(this);t.uuid=this.uuid,t.holes=[];for(var e=0,n=this.holes.length;e<n;e++){var r=this.holes[e];t.holes.push(r.toJSON())}return t},fromJSON:function(t){$s.prototype.fromJSON.call(this,t),this.uuid=t.uuid,this.holes=[];for(var e=0,n=t.holes.length;e<n;e++){var r=t.holes[e];this.holes.push((new $s).fromJSON(r))}return this}}),Qs.prototype=Object.assign(Object.create(Ft.prototype),{constructor:Qs,isLight:!0,copy:function(t){return Ft.prototype.copy.call(this,t),this.color.copy(t.color),this.intensity=t.intensity,this},toJSON:function(t){var e=Ft.prototype.toJSON.call(this,t);return e.object.color=this.color.getHex(),e.object.intensity=this.intensity,void 0!==this.groundColor&&(e.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(e.object.distance=this.distance),void 0!==this.angle&&(e.object.angle=this.angle),void 0!==this.decay&&(e.object.decay=this.decay),void 0!==this.penumbra&&(e.object.penumbra=this.penumbra),void 0!==this.shadow&&(e.object.shadow=this.shadow.toJSON()),e}}),tl.prototype=Object.assign(Object.create(Qs.prototype),{constructor:tl,isHemisphereLight:!0,copy:function(t){return Qs.prototype.copy.call(this,t),this.groundColor.copy(t.groundColor),this}}),Object.assign(el.prototype,{_projScreenMatrix:new xt,_lightPositionWorld:new ht,_lookTarget:new ht,getViewportCount:function(){return this._viewportCount},getFrustum:function(){return this._frustum},updateMatrices:function(t){var e=this.camera,n=this.matrix,r=this._projScreenMatrix,i=this._lookTarget,a=this._lightPositionWorld;a.setFromMatrixPosition(t.matrixWorld),e.position.copy(a),i.setFromMatrixPosition(t.target.matrixWorld),e.lookAt(i),e.updateMatrixWorld(),r.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),this._frustum.setFromProjectionMatrix(r),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(e.projectionMatrix),n.multiply(e.matrixWorldInverse)},getViewport:function(t){return this._viewports[t]},getFrameExtents:function(){return this._frameExtents},copy:function(t){return this.camera=t.camera.clone(),this.bias=t.bias,this.radius=t.radius,this.mapSize.copy(t.mapSize),this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){var t={};return 0!==this.bias&&(t.bias=this.bias),1!==this.radius&&(t.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(t.mapSize=this.mapSize.toArray()),t.camera=this.camera.toJSON(!1).object,delete t.camera.matrix,t}}),nl.prototype=Object.assign(Object.create(el.prototype),{constructor:nl,isSpotLightShadow:!0,updateMatrices:function(t){var e=this.camera,n=2*Q.RAD2DEG*t.angle,r=this.mapSize.width/this.mapSize.height,i=t.distance||e.far;n===e.fov&&r===e.aspect&&i===e.far||(e.fov=n,e.aspect=r,e.far=i,e.updateProjectionMatrix()),el.prototype.updateMatrices.call(this,t)}}),rl.prototype=Object.assign(Object.create(Qs.prototype),{constructor:rl,isSpotLight:!0,copy:function(t){return Qs.prototype.copy.call(this,t),this.distance=t.distance,this.angle=t.angle,this.penumbra=t.penumbra,this.decay=t.decay,this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}),il.prototype=Object.assign(Object.create(el.prototype),{constructor:il,isPointLightShadow:!0,updateMatrices:function(t,e){void 0===e&&(e=0);var n=this.camera,r=this.matrix,i=this._lightPositionWorld,a=this._lookTarget,o=this._projScreenMatrix;i.setFromMatrixPosition(t.matrixWorld),n.position.copy(i),a.copy(n.position),a.add(this._cubeDirections[e]),n.up.copy(this._cubeUps[e]),n.lookAt(a),n.updateMatrixWorld(),r.makeTranslation(-i.x,-i.y,-i.z),o.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(o)}}),al.prototype=Object.assign(Object.create(Qs.prototype),{constructor:al,isPointLight:!0,copy:function(t){return Qs.prototype.copy.call(this,t),this.distance=t.distance,this.decay=t.decay,this.shadow=t.shadow.clone(),this}}),ol.prototype=Object.assign(Object.create(kn.prototype),{constructor:ol,isOrthographicCamera:!0,copy:function(t,e){return kn.prototype.copy.call(this,t,e),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=null===t.view?null:Object.assign({},t.view),this},setViewOffset:function(t,e,n,r,i,a){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=a,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,r=(this.top+this.bottom)/2,i=n-t,a=n+t,o=r+e,s=r-e;if(null!==this.view&&this.view.enabled){var l=(this.right-this.left)/this.view.fullWidth/this.zoom,u=(this.top-this.bottom)/this.view.fullHeight/this.zoom;a=(i+=l*this.view.offsetX)+l*this.view.width,s=(o-=u*this.view.offsetY)-u*this.view.height}this.projectionMatrix.makeOrthographic(i,a,o,s,this.near,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(t){var e=Ft.prototype.toJSON.call(this,t);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,null!==this.view&&(e.object.view=Object.assign({},this.view)),e}}),sl.prototype=Object.assign(Object.create(el.prototype),{constructor:sl,isDirectionalLightShadow:!0,updateMatrices:function(t){el.prototype.updateMatrices.call(this,t)}}),ll.prototype=Object.assign(Object.create(Qs.prototype),{constructor:ll,isDirectionalLight:!0,copy:function(t){return Qs.prototype.copy.call(this,t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}),ul.prototype=Object.assign(Object.create(Qs.prototype),{constructor:ul,isAmbientLight:!0}),cl.prototype=Object.assign(Object.create(Qs.prototype),{constructor:cl,isRectAreaLight:!0,copy:function(t){return Qs.prototype.copy.call(this,t),this.width=t.width,this.height=t.height,this},toJSON:function(t){var e=Qs.prototype.toJSON.call(this,t);return e.object.width=this.width,e.object.height=this.height,e}}),hl.prototype=Object.assign(Object.create(ws.prototype),{constructor:hl,load:function(t,e,n,r){var i=this,a=new Ms(i.manager);a.setPath(i.path),a.load(t,function(t){e(i.parse(JSON.parse(t)))},n,r)},parse:function(t){var e=this.textures;function n(t){return void 0===e[t]&&console.warn("THREE.MaterialLoader: Undefined texture",t),e[t]}var r=new ns[t.type];if(void 0!==t.uuid&&(r.uuid=t.uuid),void 0!==t.name&&(r.name=t.name),void 0!==t.color&&r.color.setHex(t.color),void 0!==t.roughness&&(r.roughness=t.roughness),void 0!==t.metalness&&(r.metalness=t.metalness),void 0!==t.sheen&&(r.sheen=(new De).setHex(t.sheen)),void 0!==t.emissive&&r.emissive.setHex(t.emissive),void 0!==t.specular&&r.specular.setHex(t.specular),void 0!==t.shininess&&(r.shininess=t.shininess),void 0!==t.clearcoat&&(r.clearcoat=t.clearcoat),void 0!==t.clearcoatRoughness&&(r.clearcoatRoughness=t.clearcoatRoughness),void 0!==t.vertexColors&&(r.vertexColors=t.vertexColors),void 0!==t.fog&&(r.fog=t.fog),void 0!==t.flatShading&&(r.flatShading=t.flatShading),void 0!==t.blending&&(r.blending=t.blending),void 0!==t.combine&&(r.combine=t.combine),void 0!==t.side&&(r.side=t.side),void 0!==t.opacity&&(r.opacity=t.opacity),void 0!==t.transparent&&(r.transparent=t.transparent),void 0!==t.alphaTest&&(r.alphaTest=t.alphaTest),void 0!==t.depthTest&&(r.depthTest=t.depthTest),void 0!==t.depthWrite&&(r.depthWrite=t.depthWrite),void 0!==t.colorWrite&&(r.colorWrite=t.colorWrite),void 0!==t.stencilWrite&&(r.stencilWrite=t.stencilWrite),void 0!==t.stencilWriteMask&&(r.stencilWriteMask=t.stencilWriteMask),void 0!==t.stencilFunc&&(r.stencilFunc=t.stencilFunc),void 0!==t.stencilRef&&(r.stencilRef=t.stencilRef),void 0!==t.stencilFuncMask&&(r.stencilFuncMask=t.stencilFuncMask),void 0!==t.stencilFail&&(r.stencilFail=t.stencilFail),void 0!==t.stencilZFail&&(r.stencilZFail=t.stencilZFail),void 0!==t.stencilZPass&&(r.stencilZPass=t.stencilZPass),void 0!==t.wireframe&&(r.wireframe=t.wireframe),void 0!==t.wireframeLinewidth&&(r.wireframeLinewidth=t.wireframeLinewidth),void 0!==t.wireframeLinecap&&(r.wireframeLinecap=t.wireframeLinecap),void 0!==t.wireframeLinejoin&&(r.wireframeLinejoin=t.wireframeLinejoin),void 0!==t.rotation&&(r.rotation=t.rotation),1!==t.linewidth&&(r.linewidth=t.linewidth),void 0!==t.dashSize&&(r.dashSize=t.dashSize),void 0!==t.gapSize&&(r.gapSize=t.gapSize),void 0!==t.scale&&(r.scale=t.scale),void 0!==t.polygonOffset&&(r.polygonOffset=t.polygonOffset),void 0!==t.polygonOffsetFactor&&(r.polygonOffsetFactor=t.polygonOffsetFactor),void 0!==t.polygonOffsetUnits&&(r.polygonOffsetUnits=t.polygonOffsetUnits),void 0!==t.skinning&&(r.skinning=t.skinning),void 0!==t.morphTargets&&(r.morphTargets=t.morphTargets),void 0!==t.morphNormals&&(r.morphNormals=t.morphNormals),void 0!==t.dithering&&(r.dithering=t.dithering),void 0!==t.visible&&(r.visible=t.visible),void 0!==t.toneMapped&&(r.toneMapped=t.toneMapped),void 0!==t.userData&&(r.userData=t.userData),void 0!==t.uniforms)for(var i in t.uniforms){var a=t.uniforms[i];switch(r.uniforms[i]={},a.type){case"t":r.uniforms[i].value=n(a.value);break;case"c":r.uniforms[i].value=(new De).setHex(a.value);break;case"v2":r.uniforms[i].value=(new tt).fromArray(a.value);break;case"v3":r.uniforms[i].value=(new ht).fromArray(a.value);break;case"v4":r.uniforms[i].value=(new at).fromArray(a.value);break;case"m3":r.uniforms[i].value=(new et).fromArray(a.value);case"m4":r.uniforms[i].value=(new xt).fromArray(a.value);break;default:r.uniforms[i].value=a.value}}if(void 0!==t.defines&&(r.defines=t.defines),void 0!==t.vertexShader&&(r.vertexShader=t.vertexShader),void 0!==t.fragmentShader&&(r.fragmentShader=t.fragmentShader),void 0!==t.extensions)for(var o in t.extensions)r.extensions[o]=t.extensions[o];if(void 0!==t.shading&&(r.flatShading=1===t.shading),void 0!==t.size&&(r.size=t.size),void 0!==t.sizeAttenuation&&(r.sizeAttenuation=t.sizeAttenuation),void 0!==t.map&&(r.map=n(t.map)),void 0!==t.matcap&&(r.matcap=n(t.matcap)),void 0!==t.alphaMap&&(r.alphaMap=n(t.alphaMap),r.transparent=!0),void 0!==t.bumpMap&&(r.bumpMap=n(t.bumpMap)),void 0!==t.bumpScale&&(r.bumpScale=t.bumpScale),void 0!==t.normalMap&&(r.normalMap=n(t.normalMap)),void 0!==t.normalMapType&&(r.normalMapType=t.normalMapType),void 0!==t.normalScale){var s=t.normalScale;!1===Array.isArray(s)&&(s=[s,s]),r.normalScale=(new tt).fromArray(s)}return void 0!==t.displacementMap&&(r.displacementMap=n(t.displacementMap)),void 0!==t.displacementScale&&(r.displacementScale=t.displacementScale),void 0!==t.displacementBias&&(r.displacementBias=t.displacementBias),void 0!==t.roughnessMap&&(r.roughnessMap=n(t.roughnessMap)),void 0!==t.metalnessMap&&(r.metalnessMap=n(t.metalnessMap)),void 0!==t.emissiveMap&&(r.emissiveMap=n(t.emissiveMap)),void 0!==t.emissiveIntensity&&(r.emissiveIntensity=t.emissiveIntensity),void 0!==t.specularMap&&(r.specularMap=n(t.specularMap)),void 0!==t.envMap&&(r.envMap=n(t.envMap)),void 0!==t.envMapIntensity&&(r.envMapIntensity=t.envMapIntensity),void 0!==t.reflectivity&&(r.reflectivity=t.reflectivity),void 0!==t.refractionRatio&&(r.refractionRatio=t.refractionRatio),void 0!==t.lightMap&&(r.lightMap=n(t.lightMap)),void 0!==t.lightMapIntensity&&(r.lightMapIntensity=t.lightMapIntensity),void 0!==t.aoMap&&(r.aoMap=n(t.aoMap)),void 0!==t.aoMapIntensity&&(r.aoMapIntensity=t.aoMapIntensity),void 0!==t.gradientMap&&(r.gradientMap=n(t.gradientMap)),void 0!==t.clearcoatNormalMap&&(r.clearcoatNormalMap=n(t.clearcoatNormalMap)),void 0!==t.clearcoatNormalScale&&(r.clearcoatNormalScale=(new tt).fromArray(t.clearcoatNormalScale)),r},setTextures:function(t){return this.textures=t,this}});var dl={decodeText:function(t){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(t);for(var e="",n=0,r=t.length;n<r;n++)e+=String.fromCharCode(t[n]);try{return decodeURIComponent(escape(e))}catch(t){return e}},extractUrlBase:function(t){var e=t.lastIndexOf("/");return-1===e?"./":t.substr(0,e+1)}};function pl(){nn.call(this),this.type="InstancedBufferGeometry",this.maxInstancedCount=void 0}function fl(t,e,n,r){"number"==typeof n&&(r=n,n=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),Fe.call(this,t,e,n),this.meshPerAttribute=r||1}function ml(t){ws.call(this,t)}pl.prototype=Object.assign(Object.create(nn.prototype),{constructor:pl,isInstancedBufferGeometry:!0,copy:function(t){return nn.prototype.copy.call(this,t),this.maxInstancedCount=t.maxInstancedCount,this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){var t=nn.prototype.toJSON.call(this);return t.maxInstancedCount=this.maxInstancedCount,t.isInstancedBufferGeometry=!0,t}}),fl.prototype=Object.assign(Object.create(Fe.prototype),{constructor:fl,isInstancedBufferAttribute:!0,copy:function(t){return Fe.prototype.copy.call(this,t),this.meshPerAttribute=t.meshPerAttribute,this},toJSON:function(){var t=Fe.prototype.toJSON.call(this);return t.meshPerAttribute=this.meshPerAttribute,t.isInstancedBufferAttribute=!0,t}}),ml.prototype=Object.assign(Object.create(ws.prototype),{constructor:ml,load:function(t,e,n,r){var i=this,a=new Ms(i.manager);a.setPath(i.path),a.load(t,function(t){e(i.parse(JSON.parse(t)))},n,r)},parse:function(t){var e=new(t.isInstancedBufferGeometry?pl:nn),n=t.data.index;if(void 0!==n){var r=new gl[n.type](n.array);e.setIndex(new Fe(r,1))}var i=t.data.attributes;for(var a in i){var o=i[a],s=(r=new gl[o.type](o.array),new(o.isInstancedBufferAttribute?fl:Fe)(r,o.itemSize,o.normalized));void 0!==o.name&&(s.name=o.name),e.setAttribute(a,s)}var l=t.data.morphAttributes;if(l)for(var a in l){for(var u=l[a],c=[],h=0,d=u.length;h<d;h++)o=u[h],s=new Fe(r=new gl[o.type](o.array),o.itemSize,o.normalized),void 0!==o.name&&(s.name=o.name),c.push(s);e.morphAttributes[a]=c}t.data.morphTargetsRelative&&(e.morphTargetsRelative=!0);var p=t.data.groups||t.data.drawcalls||t.data.offsets;if(void 0!==p){h=0;for(var f=p.length;h!==f;++h){var m=p[h];e.addGroup(m.start,m.count,m.materialIndex)}}var g=t.data.boundingSphere;if(void 0!==g){var v=new ht;void 0!==g.center&&v.fromArray(g.center),e.boundingSphere=new ee(v,g.radius)}return t.name&&(e.name=t.name),t.userData&&(e.userData=t.userData),e}});var gl={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:"undefined"!=typeof Uint8ClampedArray?Uint8ClampedArray:Uint8Array,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};function vl(t){ws.call(this,t)}vl.prototype=Object.assign(Object.create(ws.prototype),{constructor:vl,load:function(t,e,n,r){var i=this,a=""===this.path?dl.extractUrlBase(t):this.path;this.resourcePath=this.resourcePath||a;var o=new Ms(i.manager);o.setPath(this.path),o.load(t,function(n){var a=null;try{a=JSON.parse(n)}catch(n){return void 0!==r&&r(n),void console.error("THREE:ObjectLoader: Can't parse "+t+".",n.message)}var o=a.metadata;void 0!==o&&void 0!==o.type&&"geometry"!==o.type.toLowerCase()?i.parse(a,e):console.error("THREE.ObjectLoader: Can't load "+t)},n,r)},parse:function(t,e){var n=this.parseShape(t.shapes),r=this.parseGeometries(t.geometries,n),i=this.parseImages(t.images,function(){void 0!==e&&e(s)}),a=this.parseTextures(t.textures,i),o=this.parseMaterials(t.materials,a),s=this.parseObject(t.object,r,o);return t.animations&&(s.animations=this.parseAnimations(t.animations)),void 0!==t.images&&0!==t.images.length||void 0!==e&&e(s),s},parseShape:function(t){var e={};if(void 0!==t)for(var n=0,r=t.length;n<r;n++){var i=(new Ks).fromJSON(t[n]);e[i.uuid]=i}return e},parseGeometries:function(t,e){var n={};if(void 0!==t)for(var r=new ml,i=0,a=t.length;i<a;i++){var o,s=t[i];switch(s.type){case"PlaneGeometry":case"PlaneBufferGeometry":o=new Wo[s.type](s.width,s.height,s.widthSegments,s.heightSegments);break;case"BoxGeometry":case"BoxBufferGeometry":case"CubeGeometry":o=new Wo[s.type](s.width,s.height,s.depth,s.widthSegments,s.heightSegments,s.depthSegments);break;case"CircleGeometry":case"CircleBufferGeometry":o=new Wo[s.type](s.radius,s.segments,s.thetaStart,s.thetaLength);break;case"CylinderGeometry":case"CylinderBufferGeometry":o=new Wo[s.type](s.radiusTop,s.radiusBottom,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);break;case"ConeGeometry":case"ConeBufferGeometry":o=new Wo[s.type](s.radius,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);break;case"SphereGeometry":case"SphereBufferGeometry":o=new Wo[s.type](s.radius,s.widthSegments,s.heightSegments,s.phiStart,s.phiLength,s.thetaStart,s.thetaLength);break;case"DodecahedronGeometry":case"DodecahedronBufferGeometry":case"IcosahedronGeometry":case"IcosahedronBufferGeometry":case"OctahedronGeometry":case"OctahedronBufferGeometry":case"TetrahedronGeometry":case"TetrahedronBufferGeometry":o=new Wo[s.type](s.radius,s.detail);break;case"RingGeometry":case"RingBufferGeometry":o=new Wo[s.type](s.innerRadius,s.outerRadius,s.thetaSegments,s.phiSegments,s.thetaStart,s.thetaLength);break;case"TorusGeometry":case"TorusBufferGeometry":o=new Wo[s.type](s.radius,s.tube,s.radialSegments,s.tubularSegments,s.arc);break;case"TorusKnotGeometry":case"TorusKnotBufferGeometry":o=new Wo[s.type](s.radius,s.tube,s.tubularSegments,s.radialSegments,s.p,s.q);break;case"TubeGeometry":case"TubeBufferGeometry":o=new Wo[s.type]((new Ys[s.path.type]).fromJSON(s.path),s.tubularSegments,s.radius,s.radialSegments,s.closed);break;case"LatheGeometry":case"LatheBufferGeometry":o=new Wo[s.type](s.points,s.segments,s.phiStart,s.phiLength);break;case"PolyhedronGeometry":case"PolyhedronBufferGeometry":o=new Wo[s.type](s.vertices,s.indices,s.radius,s.details);break;case"ShapeGeometry":case"ShapeBufferGeometry":for(var l=[],u=0,c=s.shapes.length;u<c;u++){var h=e[s.shapes[u]];l.push(h)}o=new Wo[s.type](l,s.curveSegments);break;case"ExtrudeGeometry":case"ExtrudeBufferGeometry":for(l=[],u=0,c=s.shapes.length;u<c;u++)h=e[s.shapes[u]],l.push(h);var d=s.options.extrudePath;void 0!==d&&(s.options.extrudePath=(new Ys[d.type]).fromJSON(d)),o=new Wo[s.type](l,s.options);break;case"BufferGeometry":case"InstancedBufferGeometry":o=r.parse(s);break;case"Geometry":"THREE"in window&&"LegacyJSONLoader"in THREE?o=(new THREE.LegacyJSONLoader).parse(s,this.resourcePath).geometry:console.error('THREE.ObjectLoader: You have to import LegacyJSONLoader in order load geometry data of type "Geometry".');break;default:console.warn('THREE.ObjectLoader: Unsupported geometry type "'+s.type+'"');continue}o.uuid=s.uuid,void 0!==s.name&&(o.name=s.name),!0===o.isBufferGeometry&&void 0!==s.userData&&(o.userData=s.userData),n[s.uuid]=o}return n},parseMaterials:function(t,e){var n={},r={};if(void 0!==t){var i=new hl;i.setTextures(e);for(var a=0,o=t.length;a<o;a++){var s=t[a];if("MultiMaterial"===s.type){for(var l=[],u=0;u<s.materials.length;u++){var c=s.materials[u];void 0===n[c.uuid]&&(n[c.uuid]=i.parse(c)),l.push(n[c.uuid])}r[s.uuid]=l}else void 0===n[s.uuid]&&(n[s.uuid]=i.parse(s)),r[s.uuid]=n[s.uuid]}}return r},parseAnimations:function(t){for(var e=[],n=0;n<t.length;n++){var r=t[n],i=gs.parse(r);void 0!==r.uuid&&(i.uuid=r.uuid),e.push(i)}return e},parseImages:function(t,e){var n=this,r={};function i(t){return n.manager.itemStart(t),a.load(t,function(){n.manager.itemEnd(t)},void 0,function(){n.manager.itemError(t),n.manager.itemEnd(t)})}if(void 0!==t&&0<t.length){var a=new Es(new xs(e));a.setCrossOrigin(this.crossOrigin);for(var o=0,s=t.length;o<s;o++){var l=t[o],u=l.url;if(Array.isArray(u)){r[l.uuid]=[];for(var c=0,h=u.length;c<h;c++){var d=u[c],p=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(d)?d:n.resourcePath+d;r[l.uuid].push(i(p))}}else p=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(l.url)?l.url:n.resourcePath+l.url,r[l.uuid]=i(p)}}return r},parseTextures:function(t,e){function n(t,e){return"number"==typeof t?t:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",t),e[t])}var r={};if(void 0!==t)for(var i=0,a=t.length;i<a;i++){var o,s=t[i];void 0===s.image&&console.warn('THREE.ObjectLoader: No "image" specified for',s.uuid),void 0===e[s.image]&&console.warn("THREE.ObjectLoader: Undefined image",s.image),(o=new(Array.isArray(e[s.image])?Kn:it)(e[s.image])).needsUpdate=!0,o.uuid=s.uuid,void 0!==s.name&&(o.name=s.name),void 0!==s.mapping&&(o.mapping=n(s.mapping,xl)),void 0!==s.offset&&o.offset.fromArray(s.offset),void 0!==s.repeat&&o.repeat.fromArray(s.repeat),void 0!==s.center&&o.center.fromArray(s.center),void 0!==s.rotation&&(o.rotation=s.rotation),void 0!==s.wrap&&(o.wrapS=n(s.wrap[0],bl),o.wrapT=n(s.wrap[1],bl)),void 0!==s.format&&(o.format=s.format),void 0!==s.type&&(o.type=s.type),void 0!==s.encoding&&(o.encoding=s.encoding),void 0!==s.minFilter&&(o.minFilter=n(s.minFilter,wl)),void 0!==s.magFilter&&(o.magFilter=n(s.magFilter,wl)),void 0!==s.anisotropy&&(o.anisotropy=s.anisotropy),void 0!==s.flipY&&(o.flipY=s.flipY),void 0!==s.premultiplyAlpha&&(o.premultiplyAlpha=s.premultiplyAlpha),void 0!==s.unpackAlignment&&(o.unpackAlignment=s.unpackAlignment),r[s.uuid]=o}return r},parseObject:function(t,e,n){var r;function i(t){return void 0===e[t]&&console.warn("THREE.ObjectLoader: Undefined geometry",t),e[t]}function a(t){if(void 0!==t){if(Array.isArray(t)){for(var e=[],r=0,i=t.length;r<i;r++){var a=t[r];void 0===n[a]&&console.warn("THREE.ObjectLoader: Undefined material",a),e.push(n[a])}return e}return void 0===n[t]&&console.warn("THREE.ObjectLoader: Undefined material",t),n[t]}}switch(t.type){case"Scene":r=new Nt,void 0!==t.background&&Number.isInteger(t.background)&&(r.background=new De(t.background)),void 0!==t.fog&&("Fog"===t.fog.type?r.fog=new Ri(t.fog.color,t.fog.near,t.fog.far):"FogExp2"===t.fog.type&&(r.fog=new Pi(t.fog.color,t.fog.density)));break;case"PerspectiveCamera":r=new Bn(t.fov,t.aspect,t.near,t.far),void 0!==t.focus&&(r.focus=t.focus),void 0!==t.zoom&&(r.zoom=t.zoom),void 0!==t.filmGauge&&(r.filmGauge=t.filmGauge),void 0!==t.filmOffset&&(r.filmOffset=t.filmOffset),void 0!==t.view&&(r.view=Object.assign({},t.view));break;case"OrthographicCamera":r=new ol(t.left,t.right,t.top,t.bottom,t.near,t.far),void 0!==t.zoom&&(r.zoom=t.zoom),void 0!==t.view&&(r.view=Object.assign({},t.view));break;case"AmbientLight":r=new ul(t.color,t.intensity);break;case"DirectionalLight":r=new ll(t.color,t.intensity);break;case"PointLight":r=new al(t.color,t.intensity,t.distance,t.decay);break;case"RectAreaLight":r=new cl(t.color,t.intensity,t.width,t.height);break;case"SpotLight":r=new rl(t.color,t.intensity,t.distance,t.angle,t.penumbra,t.decay);break;case"HemisphereLight":r=new tl(t.color,t.groundColor,t.intensity);break;case"SkinnedMesh":console.warn("THREE.ObjectLoader.parseObject() does not support SkinnedMesh yet.");case"Mesh":var o=i(t.geometry),s=a(t.material);r=new(o.bones&&0<o.bones.length?na:wn)(o,s);break;case"InstancedMesh":o=i(t.geometry),s=a(t.material);var l=t.count,u=t.instanceMatrix;(r=new ha(o,s,l)).instanceMatrix=new Fe(new Float32Array(u.array),16);break;case"LOD":r=new ea;break;case"Line":r=new ya(i(t.geometry),a(t.material),t.mode);break;case"LineLoop":r=new _a(i(t.geometry),a(t.material));break;case"LineSegments":r=new wa(i(t.geometry),a(t.material));break;case"PointCloud":case"Points":r=new Da(i(t.geometry),a(t.material));break;case"Sprite":r=new $i(a(t.material));break;case"Group":r=new Ai;break;default:r=new Ft}if(r.uuid=t.uuid,void 0!==t.name&&(r.name=t.name),void 0!==t.matrix?(r.matrix.fromArray(t.matrix),void 0!==t.matrixAutoUpdate&&(r.matrixAutoUpdate=t.matrixAutoUpdate),r.matrixAutoUpdate&&r.matrix.decompose(r.position,r.quaternion,r.scale)):(void 0!==t.position&&r.position.fromArray(t.position),void 0!==t.rotation&&r.rotation.fromArray(t.rotation),void 0!==t.quaternion&&r.quaternion.fromArray(t.quaternion),void 0!==t.scale&&r.scale.fromArray(t.scale)),void 0!==t.castShadow&&(r.castShadow=t.castShadow),void 0!==t.receiveShadow&&(r.receiveShadow=t.receiveShadow),t.shadow&&(void 0!==t.shadow.bias&&(r.shadow.bias=t.shadow.bias),void 0!==t.shadow.radius&&(r.shadow.radius=t.shadow.radius),void 0!==t.shadow.mapSize&&r.shadow.mapSize.fromArray(t.shadow.mapSize),void 0!==t.shadow.camera&&(r.shadow.camera=this.parseObject(t.shadow.camera))),void 0!==t.visible&&(r.visible=t.visible),void 0!==t.frustumCulled&&(r.frustumCulled=t.frustumCulled),void 0!==t.renderOrder&&(r.renderOrder=t.renderOrder),void 0!==t.userData&&(r.userData=t.userData),void 0!==t.layers&&(r.layers.mask=t.layers),void 0!==t.children)for(var c=t.children,h=0;h<c.length;h++)r.add(this.parseObject(c[h],e,n));if("LOD"===t.type){void 0!==t.autoUpdate&&(r.autoUpdate=t.autoUpdate);for(var d=t.levels,p=0;p<d.length;p++){var f=d[p],m=r.getObjectByProperty("uuid",f.object);void 0!==m&&r.addLevel(m,f.distance)}}return r}});var yl,xl={UVMapping:300,CubeReflectionMapping:n,CubeRefractionMapping:r,EquirectangularReflectionMapping:303,EquirectangularRefractionMapping:i,SphericalReflectionMapping:305,CubeUVReflectionMapping:a,CubeUVRefractionMapping:o},bl={RepeatWrapping:s,ClampToEdgeWrapping:l,MirroredRepeatWrapping:u},wl={NearestFilter:c,NearestMipmapNearestFilter:h,NearestMipmapLinearFilter:d,LinearFilter:p,LinearMipmapNearestFilter:f,LinearMipmapLinearFilter:m};function _l(t){"undefined"==typeof createImageBitmap&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),"undefined"==typeof fetch&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),ws.call(this,t),this.options=void 0}function Ml(){this.type="ShapePath",this.color=new De,this.subPaths=[],this.currentPath=null}function Sl(t){this.type="Font",this.data=t}function Tl(t,e,n,r,i){var a=i.glyphs[t]||i.glyphs["?"];if(a){var o,s,l,u,c,h,d,p,f=new Ml;if(a.o)for(var m=a._cachedOutline||(a._cachedOutline=a.o.split(" ")),g=0,v=m.length;g<v;)switch(m[g++]){case"m":o=m[g++]*e+n,s=m[g++]*e+r,f.moveTo(o,s);break;case"l":o=m[g++]*e+n,s=m[g++]*e+r,f.lineTo(o,s);break;case"q":l=m[g++]*e+n,u=m[g++]*e+r,c=m[g++]*e+n,h=m[g++]*e+r,f.quadraticCurveTo(c,h,l,u);break;case"b":l=m[g++]*e+n,u=m[g++]*e+r,c=m[g++]*e+n,h=m[g++]*e+r,d=m[g++]*e+n,p=m[g++]*e+r,f.bezierCurveTo(c,h,d,p,l,u)}return{offsetX:a.ha*e,path:f}}console.error('THREE.Font: character "'+t+'" does not exists in font family '+i.familyName+".")}function Cl(t){ws.call(this,t)}_l.prototype=Object.assign(Object.create(ws.prototype),{constructor:_l,setOptions:function(t){return this.options=t,this},load:function(t,e,n,r){void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);var i=this,a=ys.get(t);if(void 0!==a)return i.manager.itemStart(t),setTimeout(function(){e&&e(a),i.manager.itemEnd(t)},0),a;fetch(t).then(function(t){return t.blob()}).then(function(t){return void 0===i.options?createImageBitmap(t):createImageBitmap(t,i.options)}).then(function(n){ys.add(t,n),e&&e(n),i.manager.itemEnd(t)}).catch(function(e){r&&r(e),i.manager.itemError(t),i.manager.itemEnd(t)}),i.manager.itemStart(t)}}),Object.assign(Ml.prototype,{moveTo:function(t,e){return this.currentPath=new $s,this.subPaths.push(this.currentPath),this.currentPath.moveTo(t,e),this},lineTo:function(t,e){return this.currentPath.lineTo(t,e),this},quadraticCurveTo:function(t,e,n,r){return this.currentPath.quadraticCurveTo(t,e,n,r),this},bezierCurveTo:function(t,e,n,r,i,a){return this.currentPath.bezierCurveTo(t,e,n,r,i,a),this},splineThru:function(t){return this.currentPath.splineThru(t),this},toShapes:function(t,e){function n(t){for(var e=[],n=0,r=t.length;n<r;n++){var i=t[n],a=new Ks;a.curves=i.curves,e.push(a)}return e}function r(t,e){for(var n=e.length,r=!1,i=n-1,a=0;a<n;i=a++){var o=e[i],s=e[a],l=s.x-o.x,u=s.y-o.y;if(Math.abs(u)>Number.EPSILON){if(u<0&&(o=e[a],l=-l,s=e[i],u=-u),t.y<o.y||t.y>s.y)continue;if(t.y===o.y){if(t.x===o.x)return 1}else{var c=u*(t.x-o.x)-l*(t.y-o.y);if(0==c)return 1;if(c<0)continue;r=!r}}else{if(t.y!==o.y)continue;if(s.x<=t.x&&t.x<=o.x||o.x<=t.x&&t.x<=s.x)return 1}}return r}var i=bo.isClockWise,a=this.subPaths;if(0===a.length)return[];if(!0===e)return n(a);var o,s,l,u=[];if(1===a.length)return s=a[0],(l=new Ks).curves=s.curves,u.push(l),u;var c=!i(a[0].getPoints());c=t?!c:c;var h,d,p=[],f=[],m=[],g=0;f[g]=void 0,m[g]=[];for(var v=0,y=a.length;v<y;v++)o=i(h=(s=a[v]).getPoints()),(o=t?!o:o)?(!c&&f[g]&&g++,f[g]={s:new Ks,p:h},f[g].s.curves=s.curves,c&&g++,m[g]=[]):m[g].push({h:s,p:h[0]});if(!f[0])return n(a);if(1<f.length){for(var x=!1,b=[],w=0,_=f.length;w<_;w++)p[w]=[];for(w=0,_=f.length;w<_;w++)for(var M=m[w],S=0;S<M.length;S++){for(var T=M[S],C=!0,E=0;E<f.length;E++)r(T.p,f[E].p)&&(w!==E&&b.push({froms:w,tos:E,hole:S}),C?(C=!1,p[E].push(T)):x=!0);C&&p[w].push(T)}0<b.length&&(x||(m=p))}v=0;for(var D=f.length;v<D;v++){l=f[v].s,u.push(l);for(var A=0,O=(d=m[v]).length;A<O;A++)l.holes.push(d[A].h)}return u}}),Object.assign(Sl.prototype,{isFont:!0,generateShapes:function(t,e){void 0===e&&(e=100);for(var n=[],r=function(t,e,n){for(var r=Array.from?Array.from(t):String(t).split(""),i=e/n.resolution,a=(n.boundingBox.yMax-n.boundingBox.yMin+n.underlineThickness)*i,o=[],s=0,l=0,u=0;u<r.length;u++){var c=r[u];if("\n"===c)s=0,l-=a;else{var h=Tl(c,i,s,l,n);s+=h.offsetX,o.push(h.path)}}return o}(t,e,this.data),i=0,a=r.length;i<a;i++)Array.prototype.push.apply(n,r[i].toShapes());return n}}),Cl.prototype=Object.assign(Object.create(ws.prototype),{constructor:Cl,load:function(t,e,n,r){var i=this,a=new Ms(this.manager);a.setPath(this.path),a.load(t,function(t){var n;try{n=JSON.parse(t)}catch(r){console.warn("THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead."),n=JSON.parse(t.substring(65,t.length-2))}var r=i.parse(n);e&&e(r)},n,r)},parse:function(t){return new Sl(t)}});var El={getContext:function(){return void 0===yl&&(yl=new(window.AudioContext||window.webkitAudioContext)),yl},setContext:function(t){yl=t}};function Dl(t){ws.call(this,t)}function Al(){this.coefficients=[];for(var t=0;t<9;t++)this.coefficients.push(new ht)}function Ol(t,e){Qs.call(this,void 0,e),this.sh=void 0!==t?t:new Al}function Ll(t,e,n){Ol.call(this,void 0,n);var r=(new De).set(t),i=(new De).set(e),a=new ht(r.r,r.g,r.b),o=new ht(i.r,i.g,i.b),s=Math.sqrt(Math.PI),l=s*Math.sqrt(.75);this.sh.coefficients[0].copy(a).add(o).multiplyScalar(s),this.sh.coefficients[1].copy(a).sub(o).multiplyScalar(l)}function Pl(t,e){Ol.call(this,void 0,e);var n=(new De).set(t);this.sh.coefficients[0].set(n.r,n.g,n.b).multiplyScalar(2*Math.sqrt(Math.PI))}Dl.prototype=Object.assign(Object.create(ws.prototype),{constructor:Dl,load:function(t,e,n,r){var i=new Ms(this.manager);i.setResponseType("arraybuffer"),i.setPath(this.path),i.load(t,function(t){var n=t.slice(0);El.getContext().decodeAudioData(n,function(t){e(t)})},n,r)}}),Object.assign(Al.prototype,{isSphericalHarmonics3:!0,set:function(t){for(var e=0;e<9;e++)this.coefficients[e].copy(t[e]);return this},zero:function(){for(var t=0;t<9;t++)this.coefficients[t].set(0,0,0);return this},getAt:function(t,e){var n=t.x,r=t.y,i=t.z,a=this.coefficients;return e.copy(a[0]).multiplyScalar(.282095),e.addScale(a[1],.488603*r),e.addScale(a[2],.488603*i),e.addScale(a[3],.488603*n),e.addScale(a[4],n*r*1.092548),e.addScale(a[5],r*i*1.092548),e.addScale(a[6],.315392*(3*i*i-1)),e.addScale(a[7],n*i*1.092548),e.addScale(a[8],.546274*(n*n-r*r)),e},getIrradianceAt:function(t,e){var n=t.x,r=t.y,i=t.z,a=this.coefficients;return e.copy(a[0]).multiplyScalar(.886227),e.addScale(a[1],1.023328*r),e.addScale(a[2],1.023328*i),e.addScale(a[3],1.023328*n),e.addScale(a[4],.858086*n*r),e.addScale(a[5],.858086*r*i),e.addScale(a[6],.743125*i*i-.247708),e.addScale(a[7],.858086*n*i),e.addScale(a[8],.429043*(n*n-r*r)),e},add:function(t){for(var e=0;e<9;e++)this.coefficients[e].add(t.coefficients[e]);return this},scale:function(t){for(var e=0;e<9;e++)this.coefficients[e].multiplyScalar(t);return this},lerp:function(t,e){for(var n=0;n<9;n++)this.coefficients[n].lerp(t.coefficients[n],e);return this},equals:function(t){for(var e=0;e<9;e++)if(!this.coefficients[e].equals(t.coefficients[e]))return!1;return!0},copy:function(t){return this.set(t.coefficients)},clone:function(){return(new this.constructor).copy(this)},fromArray:function(t,e){void 0===e&&(e=0);for(var n=this.coefficients,r=0;r<9;r++)n[r].fromArray(t,e+3*r);return this},toArray:function(t,e){void 0===t&&(t=[]),void 0===e&&(e=0);for(var n=this.coefficients,r=0;r<9;r++)n[r].toArray(t,e+3*r);return t}}),Object.assign(Al,{getBasisAt:function(t,e){var n=t.x,r=t.y,i=t.z;e[0]=.282095,e[1]=.488603*r,e[2]=.488603*i,e[3]=.488603*n,e[4]=1.092548*n*r,e[5]=1.092548*r*i,e[6]=.315392*(3*i*i-1),e[7]=1.092548*n*i,e[8]=.546274*(n*n-r*r)}}),Ol.prototype=Object.assign(Object.create(Qs.prototype),{constructor:Ol,isLightProbe:!0,copy:function(t){return Qs.prototype.copy.call(this,t),this.sh.copy(t.sh),this.intensity=t.intensity,this},toJSON:function(t){return Qs.prototype.toJSON.call(this,t)}}),Ll.prototype=Object.assign(Object.create(Ol.prototype),{constructor:Ll,isHemisphereLightProbe:!0,copy:function(t){return Ol.prototype.copy.call(this,t),this},toJSON:function(t){return Ol.prototype.toJSON.call(this,t)}}),Pl.prototype=Object.assign(Object.create(Ol.prototype),{constructor:Pl,isAmbientLightProbe:!0,copy:function(t){return Ol.prototype.copy.call(this,t),this},toJSON:function(t){return Ol.prototype.toJSON.call(this,t)}});var Rl=new xt,Il=new xt;function kl(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Bn,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Bn,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}function Bl(t){this.autoStart=void 0===t||t,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}Object.assign(kl.prototype,{update:function(t){var e=this._cache;if(e.focus!==t.focus||e.fov!==t.fov||e.aspect!==t.aspect*this.aspect||e.near!==t.near||e.far!==t.far||e.zoom!==t.zoom||e.eyeSep!==this.eyeSep){e.focus=t.focus,e.fov=t.fov,e.aspect=t.aspect*this.aspect,e.near=t.near,e.far=t.far,e.zoom=t.zoom,e.eyeSep=this.eyeSep;var n,r,i=t.projectionMatrix.clone(),a=e.eyeSep/2,o=a*e.near/e.focus,s=e.near*Math.tan(Q.DEG2RAD*e.fov*.5)/e.zoom;Il.elements[12]=-a,Rl.elements[12]=a,n=-s*e.aspect+o,r=s*e.aspect+o,i.elements[0]=2*e.near/(r-n),i.elements[8]=(r+n)/(r-n),this.cameraL.projectionMatrix.copy(i),n=-s*e.aspect-o,r=s*e.aspect-o,i.elements[0]=2*e.near/(r-n),i.elements[8]=(r+n)/(r-n),this.cameraR.projectionMatrix.copy(i)}this.cameraL.matrixWorld.copy(t.matrixWorld).multiply(Il),this.cameraR.matrixWorld.copy(t.matrixWorld).multiply(Rl)}}),Object.assign(Bl.prototype,{start:function(){this.startTime=("undefined"==typeof performance?Date:performance).now(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0},stop:function(){this.getElapsedTime(),this.running=!1,this.autoStart=!1},getElapsedTime:function(){return this.getDelta(),this.elapsedTime},getDelta:function(){var t=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){var e=("undefined"==typeof performance?Date:performance).now();t=(e-this.oldTime)/1e3,this.oldTime=e,this.elapsedTime+=t}return t}});var Fl=new ht,Nl=new lt,jl=new ht,zl=new ht;function Vl(){Ft.call(this),this.type="AudioListener",this.context=El.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new Bl}function Gl(t){Ft.call(this),this.type="Audio",this.listener=t,this.context=t.context,this.gain=this.context.createGain(),this.gain.connect(t.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.sourceType="empty",this._startedAt=0,this._pausedAt=0,this.filters=[]}Vl.prototype=Object.assign(Object.create(Ft.prototype),{constructor:Vl,getInput:function(){return this.gain},removeFilter:function(){return null!==this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this},getFilter:function(){return this.filter},setFilter:function(t){return null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=t,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this},getMasterVolume:function(){return this.gain.gain.value},setMasterVolume:function(t){return this.gain.gain.setTargetAtTime(t,this.context.currentTime,.01),this},updateMatrixWorld:function(t){Ft.prototype.updateMatrixWorld.call(this,t);var e=this.context.listener,n=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(Fl,Nl,jl),zl.set(0,0,-1).applyQuaternion(Nl),e.positionX){var r=this.context.currentTime+this.timeDelta;e.positionX.linearRampToValueAtTime(Fl.x,r),e.positionY.linearRampToValueAtTime(Fl.y,r),e.positionZ.linearRampToValueAtTime(Fl.z,r),e.forwardX.linearRampToValueAtTime(zl.x,r),e.forwardY.linearRampToValueAtTime(zl.y,r),e.forwardZ.linearRampToValueAtTime(zl.z,r),e.upX.linearRampToValueAtTime(n.x,r),e.upY.linearRampToValueAtTime(n.y,r),e.upZ.linearRampToValueAtTime(n.z,r)}else e.setPosition(Fl.x,Fl.y,Fl.z),e.setOrientation(zl.x,zl.y,zl.z,n.x,n.y,n.z)}}),Gl.prototype=Object.assign(Object.create(Ft.prototype),{constructor:Gl,getOutput:function(){return this.gain},setNodeSource:function(t){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=t,this.connect(),this},setMediaElementSource:function(t){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(t),this.connect(),this},setMediaStreamSource:function(t){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(t),this.connect(),this},setBuffer:function(t){return this.buffer=t,this.sourceType="buffer",this.autoplay&&this.play(),this},play:function(t){if(void 0===t&&(t=0),!0!==this.isPlaying){if(!1!==this.hasPlaybackControl){this._startedAt=this.context.currentTime+t;var e=this.context.createBufferSource();return e.buffer=this.buffer,e.loop=this.loop,e.loopStart=this.loopStart,e.loopEnd=this.loopEnd,e.onended=this.onEnded.bind(this),e.start(this._startedAt,this._pausedAt+this.offset,this.duration),this.isPlaying=!0,this.source=e,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}console.warn("THREE.Audio: this Audio has no playback control.")}else console.warn("THREE.Audio: Audio is already playing.")},pause:function(){if(!1!==this.hasPlaybackControl)return!0===this.isPlaying&&(this._pausedAt=(this.context.currentTime-this._startedAt)*this.playbackRate,this.source.stop(),this.source.onended=null,this.isPlaying=!1),this;console.warn("THREE.Audio: this Audio has no playback control.")},stop:function(){if(!1!==this.hasPlaybackControl)return this._pausedAt=0,this.source.stop(),this.source.onended=null,this.isPlaying=!1,this;console.warn("THREE.Audio: this Audio has no playback control.")},connect:function(){if(0<this.filters.length){this.source.connect(this.filters[0]);for(var t=1,e=this.filters.length;t<e;t++)this.filters[t-1].connect(this.filters[t]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this},disconnect:function(){if(0<this.filters.length){this.source.disconnect(this.filters[0]);for(var t=1,e=this.filters.length;t<e;t++)this.filters[t-1].disconnect(this.filters[t]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this},getFilters:function(){return this.filters},setFilters:function(t){return t=t||[],!0===this.isPlaying?(this.disconnect(),this.filters=t,this.connect()):this.filters=t,this},setDetune:function(t){if(this.detune=t,void 0!==this.source.detune)return!0===this.isPlaying&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this},getDetune:function(){return this.detune},getFilter:function(){return this.getFilters()[0]},setFilter:function(t){return this.setFilters(t?[t]:[])},setPlaybackRate:function(t){if(!1!==this.hasPlaybackControl)return this.playbackRate=t,!0===this.isPlaying&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this;console.warn("THREE.Audio: this Audio has no playback control.")},getPlaybackRate:function(){return this.playbackRate},onEnded:function(){this.isPlaying=!1},getLoop:function(){return!1===this.hasPlaybackControl?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop},setLoop:function(t){if(!1!==this.hasPlaybackControl)return this.loop=t,!0===this.isPlaying&&(this.source.loop=this.loop),this;console.warn("THREE.Audio: this Audio has no playback control.")},setLoopStart:function(t){return this.loopStart=t,this},setLoopEnd:function(t){return this.loopEnd=t,this},getVolume:function(){return this.gain.gain.value},setVolume:function(t){return this.gain.gain.setTargetAtTime(t,this.context.currentTime,.01),this}});var Ul=new ht,Hl=new lt,Wl=new ht,Jl=new ht;function ql(t){Gl.call(this,t),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}function Xl(t,e){this.analyser=t.context.createAnalyser(),this.analyser.fftSize=void 0!==e?e:2048,this.data=new Uint8Array(this.analyser.frequencyBinCount),t.getOutput().connect(this.analyser)}function Yl(t,e,n){this.binding=t,this.valueSize=n;var r,i=Float64Array;switch(e){case"quaternion":r=this._slerp;break;case"string":case"bool":i=Array,r=this._select;break;default:r=this._lerp}this.buffer=new i(4*n),this._mixBufferRegion=r,this.cumulativeWeight=0,this.useCount=0,this.referenceCount=0}ql.prototype=Object.assign(Object.create(Gl.prototype),{constructor:ql,getOutput:function(){return this.panner},getRefDistance:function(){return this.panner.refDistance},setRefDistance:function(t){return this.panner.refDistance=t,this},getRolloffFactor:function(){return this.panner.rolloffFactor},setRolloffFactor:function(t){return this.panner.rolloffFactor=t,this},getDistanceModel:function(){return this.panner.distanceModel},setDistanceModel:function(t){return this.panner.distanceModel=t,this},getMaxDistance:function(){return this.panner.maxDistance},setMaxDistance:function(t){return this.panner.maxDistance=t,this},setDirectionalCone:function(t,e,n){return this.panner.coneInnerAngle=t,this.panner.coneOuterAngle=e,this.panner.coneOuterGain=n,this},updateMatrixWorld:function(t){if(Ft.prototype.updateMatrixWorld.call(this,t),!0!==this.hasPlaybackControl||!1!==this.isPlaying){this.matrixWorld.decompose(Ul,Hl,Wl),Jl.set(0,0,1).applyQuaternion(Hl);var e=this.panner;if(e.positionX){var n=this.context.currentTime+this.listener.timeDelta;e.positionX.linearRampToValueAtTime(Ul.x,n),e.positionY.linearRampToValueAtTime(Ul.y,n),e.positionZ.linearRampToValueAtTime(Ul.z,n),e.orientationX.linearRampToValueAtTime(Jl.x,n),e.orientationY.linearRampToValueAtTime(Jl.y,n),e.orientationZ.linearRampToValueAtTime(Jl.z,n)}else e.setPosition(Ul.x,Ul.y,Ul.z),e.setOrientation(Jl.x,Jl.y,Jl.z)}}}),Object.assign(Xl.prototype,{getFrequencyData:function(){return this.analyser.getByteFrequencyData(this.data),this.data},getAverageFrequency:function(){for(var t=0,e=this.getFrequencyData(),n=0;n<e.length;n++)t+=e[n];return t/e.length}}),Object.assign(Yl.prototype,{accumulate:function(t,e){var n=this.buffer,r=this.valueSize,i=t*r+r,a=this.cumulativeWeight;if(0===a){for(var o=0;o!==r;++o)n[i+o]=n[o];a=e}else{var s=e/(a+=e);this._mixBufferRegion(n,i,0,s,r)}this.cumulativeWeight=a},apply:function(t){var e=this.valueSize,n=this.buffer,r=t*e+e,i=this.cumulativeWeight,a=this.binding;if(this.cumulativeWeight=0,i<1){var o=3*e;this._mixBufferRegion(n,r,o,1-i,e)}for(var s=e,l=e+e;s!==l;++s)if(n[s]!==n[s+e]){a.setValue(n,r);break}},saveOriginalState:function(){var t=this.binding,e=this.buffer,n=this.valueSize,r=3*n;t.getValue(e,r);for(var i=n,a=r;i!==a;++i)e[i]=e[r+i%n];this.cumulativeWeight=0},restoreOriginalState:function(){var t=3*this.valueSize;this.binding.setValue(this.buffer,t)},_select:function(t,e,n,r,i){if(.5<=r)for(var a=0;a!==i;++a)t[e+a]=t[n+a]},_slerp:function(t,e,n,r){lt.slerpFlat(t,e,t,e,t,n,r)},_lerp:function(t,e,n,r,i){for(var a=1-r,o=0;o!==i;++o){var s=e+o;t[s]=t[s]*a+t[n+o]*r}}});var Zl="\\[\\]\\.:\\/",$l=new RegExp("["+Zl+"]","g"),Kl="[^"+Zl+"]",Ql="[^"+Zl.replace("\\.","")+"]",tu=/((?:WC+[\/:])*)/.source.replace("WC",Kl),eu=/(WCOD+)?/.source.replace("WCOD",Ql),nu=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Kl),ru=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Kl),iu=new RegExp("^"+tu+eu+nu+ru+"$"),au=["material","materials","bones"];function ou(t,e,n){var r=n||su.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,r)}function su(t,e,n){this.path=e,this.parsedPath=n||su.parseTrackName(e),this.node=su.findNode(t,this.parsedPath.nodeName)||t,this.rootNode=t}function lu(){this.uuid=Q.generateUUID(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;var t={};this._indicesByUUID=t;for(var e=0,n=arguments.length;e!==n;++e)t[arguments[e].uuid]=e;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};var r=this;this.stats={objects:{get total(){return r._objects.length},get inUse(){return this.total-r.nCachedObjects_}},get bindingsPerObject(){return r._bindings.length}}}function uu(t,e,n){this._mixer=t,this._clip=e,this._localRoot=n||null;for(var r=e.tracks,i=r.length,a=new Array(i),o={endingStart:B,endingEnd:B},s=0;s!==i;++s){var l=r[s].createInterpolant(null);(a[s]=l).settings=o}this._interpolantSettings=o,this._interpolants=a,this._propertyBindings=new Array(i),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=2201,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}function cu(t){this._root=t,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}function hu(t){"string"==typeof t&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),t=arguments[1]),this.value=t}function du(t,e,n){Ii.call(this,t,e),this.meshPerAttribute=n||1}function pu(t,e,n,r){this.ray=new ue(t,e),this.near=n||0,this.far=r||1/0,this.camera=null,this.params={Mesh:{},Line:{},LOD:{},Points:{threshold:1},Sprite:{}},Object.defineProperties(this.params,{PointCloud:{get:function(){return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),this.Points}}})}function fu(t,e){return t.distance-e.distance}function mu(t,e,n,r){if(!1!==t.visible&&(t.raycast(e,n),!0===r))for(var i=t.children,a=0,o=i.length;a<o;a++)mu(i[a],e,n,!0)}function gu(t,e,n){return this.radius=void 0!==t?t:1,this.phi=void 0!==e?e:0,this.theta=void 0!==n?n:0,this}function vu(t,e,n){return this.radius=void 0!==t?t:1,this.theta=void 0!==e?e:0,this.y=void 0!==n?n:0,this}Object.assign(ou.prototype,{getValue:function(t,e){this.bind();var n=this._targetGroup.nCachedObjects_,r=this._bindings[n];void 0!==r&&r.getValue(t,e)},setValue:function(t,e){for(var n=this._bindings,r=this._targetGroup.nCachedObjects_,i=n.length;r!==i;++r)n[r].setValue(t,e)},bind:function(){for(var t=this._bindings,e=this._targetGroup.nCachedObjects_,n=t.length;e!==n;++e)t[e].bind()},unbind:function(){for(var t=this._bindings,e=this._targetGroup.nCachedObjects_,n=t.length;e!==n;++e)t[e].unbind()}}),Object.assign(su,{Composite:ou,create:function(t,e,n){return t&&t.isAnimationObjectGroup?new su.Composite(t,e,n):new su(t,e,n)},sanitizeNodeName:function(t){return t.replace(/\s/g,"_").replace($l,"")},parseTrackName:function(t){var e=iu.exec(t);if(!e)throw new Error("PropertyBinding: Cannot parse trackName: "+t);var n={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},r=n.nodeName&&n.nodeName.lastIndexOf(".");if(void 0!==r&&-1!==r){var i=n.nodeName.substring(r+1);-1!==au.indexOf(i)&&(n.nodeName=n.nodeName.substring(0,r),n.objectName=i)}if(null===n.propertyName||0===n.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return n},findNode:function(t,e){if(!e||""===e||"root"===e||"."===e||-1===e||e===t.name||e===t.uuid)return t;if(t.skeleton){var n=t.skeleton.getBoneByName(e);if(void 0!==n)return n}if(t.children){var r=function(t){for(var n=0;n<t.length;n++){var i=t[n];if(i.name===e||i.uuid===e)return i;var a=r(i.children);if(a)return a}return null},i=r(t.children);if(i)return i}return null}}),Object.assign(su.prototype,{_getValue_unavailable:function(){},_setValue_unavailable:function(){},BindingType:{Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Versioning:{None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},GetterByBindingType:[function(t,e){t[e]=this.node[this.propertyName]},function(t,e){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)t[e++]=n[r]},function(t,e){t[e]=this.resolvedProperty[this.propertyIndex]},function(t,e){this.resolvedProperty.toArray(t,e)}],SetterByBindingTypeAndVersioning:[[function(t,e){this.targetObject[this.propertyName]=t[e]},function(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.needsUpdate=!0},function(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)n[r]=t[e++]},function(t,e){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)n[r]=t[e++];this.targetObject.needsUpdate=!0},function(t,e){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)n[r]=t[e++];this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){this.resolvedProperty[this.propertyIndex]=t[e]},function(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.needsUpdate=!0},function(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){this.resolvedProperty.fromArray(t,e)},function(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.needsUpdate=!0},function(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.matrixWorldNeedsUpdate=!0}]],getValue:function(t,e){this.bind(),this.getValue(t,e)},setValue:function(t,e){this.bind(),this.setValue(t,e)},bind:function(){var t=this.node,e=this.parsedPath,n=e.objectName,r=e.propertyName,i=e.propertyIndex;if(t||(t=su.findNode(this.rootNode,e.nodeName)||this.rootNode,this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,t){if(n){var a=e.objectIndex;switch(n){case"materials":if(!t.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!t.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);t=t.material.materials;break;case"bones":if(!t.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);t=t.skeleton.bones;for(var o=0;o<t.length;o++)if(t[o].name===a){a=o;break}break;default:if(void 0===t[n])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);t=t[n]}if(void 0!==a){if(void 0===t[a])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,t);t=t[a]}}var s=t[r];if(void 0!==s){var l=this.Versioning.None;void 0!==(this.targetObject=t).needsUpdate?l=this.Versioning.NeedsUpdate:void 0!==t.matrixWorldNeedsUpdate&&(l=this.Versioning.MatrixWorldNeedsUpdate);var u=this.BindingType.Direct;if(void 0!==i){if("morphTargetInfluences"===r){if(!t.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(t.geometry.isBufferGeometry){if(!t.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);for(o=0;o<this.node.geometry.morphAttributes.position.length;o++)if(t.geometry.morphAttributes.position[o].name===i){i=o;break}}else{if(!t.geometry.morphTargets)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphTargets.",this);for(o=0;o<this.node.geometry.morphTargets.length;o++)if(t.geometry.morphTargets[o].name===i){i=o;break}}}u=this.BindingType.ArrayElement,this.resolvedProperty=s,this.propertyIndex=i}else void 0!==s.fromArray&&void 0!==s.toArray?(u=this.BindingType.HasFromToArray,this.resolvedProperty=s):Array.isArray(s)?(u=this.BindingType.EntireArray,this.resolvedProperty=s):this.propertyName=r;this.getValue=this.GetterByBindingType[u],this.setValue=this.SetterByBindingTypeAndVersioning[u][l]}else{var c=e.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+c+"."+r+" but it wasn't found.",t)}}else console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.")},unbind:function(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}),Object.assign(su.prototype,{_getValue_unbound:su.prototype.getValue,_setValue_unbound:su.prototype.setValue}),Object.assign(lu.prototype,{isAnimationObjectGroup:!0,add:function(){for(var t=this._objects,e=t.length,n=this.nCachedObjects_,r=this._indicesByUUID,i=this._paths,a=this._parsedPaths,o=this._bindings,s=o.length,l=void 0,u=0,c=arguments.length;u!==c;++u){var h=arguments[u],d=h.uuid,p=r[d];if(void 0===p){p=e++,r[d]=p,t.push(h);for(var f=0,m=s;f!==m;++f)o[f].push(new su(h,i[f],a[f]))}else if(p<n){l=t[p];var g=--n,v=t[g];for(t[r[v.uuid]=p]=v,t[r[d]=g]=h,f=0,m=s;f!==m;++f){var y=o[f],x=y[g],b=y[p];y[p]=x,void 0===b&&(b=new su(h,i[f],a[f])),y[g]=b}}else t[p]!==l&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=n},remove:function(){for(var t=this._objects,e=this.nCachedObjects_,n=this._indicesByUUID,r=this._bindings,i=r.length,a=0,o=arguments.length;a!==o;++a){var s=arguments[a],l=s.uuid,u=n[l];if(void 0!==u&&e<=u){var c=e++,h=t[c];t[n[h.uuid]=u]=h,t[n[l]=c]=s;for(var d=0,p=i;d!==p;++d){var f=r[d],m=f[c],g=f[u];f[u]=m,f[c]=g}}}this.nCachedObjects_=e},uncache:function(){for(var t=this._objects,e=t.length,n=this.nCachedObjects_,r=this._indicesByUUID,i=this._bindings,a=i.length,o=0,s=arguments.length;o!==s;++o){var l=arguments[o].uuid,u=r[l];if(void 0!==u)if(delete r[l],u<n){var c=--n,h=t[c],d=t[v=--e];t[r[h.uuid]=u]=h,t[r[d.uuid]=c]=d,t.pop();for(var p=0,f=a;p!==f;++p){var m=(y=i[p])[c],g=y[v];y[u]=m,y[c]=g,y.pop()}}else{var v;for(t[r[(d=t[v=--e]).uuid]=u]=d,t.pop(),p=0,f=a;p!==f;++p){var y;(y=i[p])[u]=y[v],y.pop()}}}this.nCachedObjects_=n},subscribe_:function(t,e){var n=this._bindingsIndicesByPath,r=n[t],i=this._bindings;if(void 0!==r)return i[r];var a=this._paths,o=this._parsedPaths,s=this._objects,l=s.length,u=this.nCachedObjects_,c=new Array(l);r=i.length,n[t]=r,a.push(t),o.push(e),i.push(c);for(var h=u,d=s.length;h!==d;++h){var p=s[h];c[h]=new su(p,t,e)}return c},unsubscribe_:function(t){var e=this._bindingsIndicesByPath,n=e[t];if(void 0!==n){var r=this._paths,i=this._parsedPaths,a=this._bindings,o=a.length-1,s=a[o];a[e[t[o]]=n]=s,a.pop(),i[n]=i[o],i.pop(),r[n]=r[o],r.pop()}}}),Object.assign(uu.prototype,{play:function(){return this._mixer._activateAction(this),this},stop:function(){return this._mixer._deactivateAction(this),this.reset()},reset:function(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()},isRunning:function(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)},isScheduled:function(){return this._mixer._isActiveAction(this)},startAt:function(t){return this._startTime=t,this},setLoop:function(t,e){return this.loop=t,this.repetitions=e,this},setEffectiveWeight:function(t){return this.weight=t,this._effectiveWeight=this.enabled?t:0,this.stopFading()},getEffectiveWeight:function(){return this._effectiveWeight},fadeIn:function(t){return this._scheduleFading(t,0,1)},fadeOut:function(t){return this._scheduleFading(t,1,0)},crossFadeFrom:function(t,e,n){if(t.fadeOut(e),this.fadeIn(e),n){var r=this._clip.duration,i=t._clip.duration,a=i/r,o=r/i;t.warp(1,a,e),this.warp(o,1,e)}return this},crossFadeTo:function(t,e,n){return t.crossFadeFrom(this,e,n)},stopFading:function(){var t=this._weightInterpolant;return null!==t&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this},setEffectiveTimeScale:function(t){return this.timeScale=t,this._effectiveTimeScale=this.paused?0:t,this.stopWarping()},getEffectiveTimeScale:function(){return this._effectiveTimeScale},setDuration:function(t){return this.timeScale=this._clip.duration/t,this.stopWarping()},syncWith:function(t){return this.time=t.time,this.timeScale=t.timeScale,this.stopWarping()},halt:function(t){return this.warp(this._effectiveTimeScale,0,t)},warp:function(t,e,n){var r=this._mixer,i=r.time,a=this._timeScaleInterpolant,o=this.timeScale;null===a&&(a=r._lendControlInterpolant(),this._timeScaleInterpolant=a);var s=a.parameterPositions,l=a.sampleValues;return s[0]=i,s[1]=i+n,l[0]=t/o,l[1]=e/o,this},stopWarping:function(){var t=this._timeScaleInterpolant;return null!==t&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this},getMixer:function(){return this._mixer},getClip:function(){return this._clip},getRoot:function(){return this._localRoot||this._mixer._root},_update:function(t,e,n,r){if(this.enabled){var i=this._startTime;if(null!==i){var a=(t-i)*n;if(a<0||0===n)return;this._startTime=null,e=n*a}e*=this._updateTimeScale(t);var o=this._updateTime(e),s=this._updateWeight(t);if(0<s)for(var l=this._interpolants,u=this._propertyBindings,c=0,h=l.length;c!==h;++c)l[c].evaluate(o),u[c].accumulate(r,s)}else this._updateWeight(t)},_updateWeight:function(t){var e=0;if(this.enabled){e=this.weight;var n=this._weightInterpolant;if(null!==n){var r=n.evaluate(t)[0];e*=r,t>n.parameterPositions[1]&&(this.stopFading(),0===r&&(this.enabled=!1))}}return this._effectiveWeight=e},_updateTimeScale:function(t){var e=0;if(!this.paused){e=this.timeScale;var n=this._timeScaleInterpolant;null!==n&&(e*=n.evaluate(t)[0],t>n.parameterPositions[1]&&(this.stopWarping(),0===e?this.paused=!0:this.timeScale=e))}return this._effectiveTimeScale=e},_updateTime:function(t){var e=this.time+t,n=this._clip.duration,r=this.loop,i=this._loopCount,a=2202===r;if(0===t)return-1!==i&&a&&1==(1&i)?n-e:e;if(2200===r){-1===i&&(this._loopCount=0,this._setEndings(!0,!0,!1));t:{if(n<=e)e=n;else{if(!(e<0)){this.time=e;break t}e=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=e,this._mixer.dispatchEvent({type:"finished",action:this,direction:t<0?-1:1})}}else{if(-1===i&&(0<=t?(i=0,this._setEndings(!0,0===this.repetitions,a)):this._setEndings(0===this.repetitions,!0,a)),n<=e||e<0){var o=Math.floor(e/n);e-=n*o,i+=Math.abs(o);var s=this.repetitions-i;if(s<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,e=0<t?n:0,this.time=e,this._mixer.dispatchEvent({type:"finished",action:this,direction:0<t?1:-1});else{if(1==s){var l=t<0;this._setEndings(l,!l,a)}else this._setEndings(!1,!1,a);this._loopCount=i,this.time=e,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:o})}}else this.time=e;if(a&&1==(1&i))return n-e}return e},_setEndings:function(t,e,n){var r=this._interpolantSettings;n?(r.endingStart=F,r.endingEnd=F):(r.endingStart=t?this.zeroSlopeAtStart?F:B:N,r.endingEnd=e?this.zeroSlopeAtEnd?F:B:N)},_scheduleFading:function(t,e,n){var r=this._mixer,i=r.time,a=this._weightInterpolant;null===a&&(a=r._lendControlInterpolant(),this._weightInterpolant=a);var o=a.parameterPositions,s=a.sampleValues;return o[0]=i,s[0]=e,o[1]=i+t,s[1]=n,this}}),cu.prototype=Object.assign(Object.create(Y.prototype),{constructor:cu,_bindAction:function(t,e){var n=t._localRoot||this._root,r=t._clip.tracks,i=r.length,a=t._propertyBindings,o=t._interpolants,s=n.uuid,l=this._bindingsByRootAndName,u=l[s];void 0===u&&(u={},l[s]=u);for(var c=0;c!==i;++c){var h=r[c],d=h.name,p=u[d];if(void 0!==p)a[c]=p;else{if(void 0!==(p=a[c])){null===p._cacheIndex&&(++p.referenceCount,this._addInactiveBinding(p,s,d));continue}var f=e&&e._propertyBindings[c].binding.parsedPath;++(p=new Yl(su.create(n,d,f),h.ValueTypeName,h.getValueSize())).referenceCount,this._addInactiveBinding(p,s,d),a[c]=p}o[c].resultBuffer=p.buffer}},_activateAction:function(t){if(!this._isActiveAction(t)){if(null===t._cacheIndex){var e=(t._localRoot||this._root).uuid,n=t._clip.uuid,r=this._actionsByClip[n];this._bindAction(t,r&&r.knownActions[0]),this._addInactiveAction(t,n,e)}for(var i=t._propertyBindings,a=0,o=i.length;a!==o;++a){var s=i[a];0==s.useCount++&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(t)}},_deactivateAction:function(t){if(this._isActiveAction(t)){for(var e=t._propertyBindings,n=0,r=e.length;n!==r;++n){var i=e[n];0==--i.useCount&&(i.restoreOriginalState(),this._takeBackBinding(i))}this._takeBackAction(t)}},_initMemoryManager:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;var t=this;this.stats={actions:{get total(){return t._actions.length},get inUse(){return t._nActiveActions}},bindings:{get total(){return t._bindings.length},get inUse(){return t._nActiveBindings}},controlInterpolants:{get total(){return t._controlInterpolants.length},get inUse(){return t._nActiveControlInterpolants}}}},_isActiveAction:function(t){var e=t._cacheIndex;return null!==e&&e<this._nActiveActions},_addInactiveAction:function(t,e,n){var r=this._actions,i=this._actionsByClip,a=i[e];if(void 0===a)a={knownActions:[t],actionByRoot:{}},t._byClipCacheIndex=0,i[e]=a;else{var o=a.knownActions;t._byClipCacheIndex=o.length,o.push(t)}t._cacheIndex=r.length,r.push(t),a.actionByRoot[n]=t},_removeInactiveAction:function(t){var e=this._actions,n=e[e.length-1],r=t._cacheIndex;e[n._cacheIndex=r]=n,e.pop(),t._cacheIndex=null;var i=t._clip.uuid,a=this._actionsByClip,o=a[i],s=o.knownActions,l=s[s.length-1],u=t._byClipCacheIndex;s[l._byClipCacheIndex=u]=l,s.pop(),t._byClipCacheIndex=null,delete o.actionByRoot[(t._localRoot||this._root).uuid],0===s.length&&delete a[i],this._removeInactiveBindingsForAction(t)},_removeInactiveBindingsForAction:function(t){for(var e=t._propertyBindings,n=0,r=e.length;n!==r;++n){var i=e[n];0==--i.referenceCount&&this._removeInactiveBinding(i)}},_lendAction:function(t){var e=this._actions,n=t._cacheIndex,r=this._nActiveActions++,i=e[r];e[t._cacheIndex=r]=t,e[i._cacheIndex=n]=i},_takeBackAction:function(t){var e=this._actions,n=t._cacheIndex,r=--this._nActiveActions,i=e[r];e[t._cacheIndex=r]=t,e[i._cacheIndex=n]=i},_addInactiveBinding:function(t,e,n){var r=this._bindingsByRootAndName,i=r[e],a=this._bindings;void 0===i&&(i={},r[e]=i),(i[n]=t)._cacheIndex=a.length,a.push(t)},_removeInactiveBinding:function(t){var e=this._bindings,n=t.binding,r=n.rootNode.uuid,i=n.path,a=this._bindingsByRootAndName,o=a[r],s=e[e.length-1],l=t._cacheIndex;e[s._cacheIndex=l]=s,e.pop(),delete o[i],0===Object.keys(o).length&&delete a[r]},_lendBinding:function(t){var e=this._bindings,n=t._cacheIndex,r=this._nActiveBindings++,i=e[r];e[t._cacheIndex=r]=t,e[i._cacheIndex=n]=i},_takeBackBinding:function(t){var e=this._bindings,n=t._cacheIndex,r=--this._nActiveBindings,i=e[r];e[t._cacheIndex=r]=t,e[i._cacheIndex=n]=i},_lendControlInterpolant:function(){var t=this._controlInterpolants,e=this._nActiveControlInterpolants++,n=t[e];return void 0===n&&(t[(n=new os(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer)).__cacheIndex=e]=n),n},_takeBackControlInterpolant:function(t){var e=this._controlInterpolants,n=t.__cacheIndex,r=--this._nActiveControlInterpolants,i=e[r];e[t.__cacheIndex=r]=t,e[i.__cacheIndex=n]=i},_controlInterpolantsResultBuffer:new Float32Array(1),clipAction:function(t,e){var n=e||this._root,r=n.uuid,i="string"==typeof t?gs.findByName(n,t):t,a=null!==i?i.uuid:t,o=this._actionsByClip[a],s=null;if(void 0!==o){var l=o.actionByRoot[r];if(void 0!==l)return l;s=o.knownActions[0],null===i&&(i=s._clip)}if(null===i)return null;var u=new uu(this,i,e);return this._bindAction(u,s),this._addInactiveAction(u,a,r),u},existingAction:function(t,e){var n=e||this._root,r=n.uuid,i="string"==typeof t?gs.findByName(n,t):t,a=i?i.uuid:t,o=this._actionsByClip[a];return void 0!==o&&o.actionByRoot[r]||null},stopAllAction:function(){var t=this._actions,e=this._nActiveActions,n=this._bindings,r=this._nActiveBindings;this._nActiveActions=0;for(var i=this._nActiveBindings=0;i!==e;++i)t[i].reset();for(i=0;i!==r;++i)n[i].useCount=0;return this},update:function(t){t*=this.timeScale;for(var e=this._actions,n=this._nActiveActions,r=this.time+=t,i=Math.sign(t),a=this._accuIndex^=1,o=0;o!==n;++o)e[o]._update(r,t,i,a);var s=this._bindings,l=this._nActiveBindings;for(o=0;o!==l;++o)s[o].apply(a);return this},setTime:function(t){for(var e=this.time=0;e<this._actions.length;e++)this._actions[e].time=0;return this.update(t)},getRoot:function(){return this._root},uncacheClip:function(t){var e=this._actions,n=t.uuid,r=this._actionsByClip,i=r[n];if(void 0!==i){for(var a=i.knownActions,o=0,s=a.length;o!==s;++o){var l=a[o];this._deactivateAction(l);var u=l._cacheIndex,c=e[e.length-1];l._cacheIndex=null,l._byClipCacheIndex=null,e[c._cacheIndex=u]=c,e.pop(),this._removeInactiveBindingsForAction(l)}delete r[n]}},uncacheRoot:function(t){var e=t.uuid,n=this._actionsByClip;for(var r in n){var i=n[r].actionByRoot[e];void 0!==i&&(this._deactivateAction(i),this._removeInactiveAction(i))}var a=this._bindingsByRootAndName[e];if(void 0!==a)for(var o in a){var s=a[o];s.restoreOriginalState(),this._removeInactiveBinding(s)}},uncacheAction:function(t,e){var n=this.existingAction(t,e);null!==n&&(this._deactivateAction(n),this._removeInactiveAction(n))}}),hu.prototype.clone=function(){return new hu(void 0===this.value.clone?this.value:this.value.clone())},du.prototype=Object.assign(Object.create(Ii.prototype),{constructor:du,isInstancedInterleavedBuffer:!0,copy:function(t){return Ii.prototype.copy.call(this,t),this.meshPerAttribute=t.meshPerAttribute,this}}),Object.assign(pu.prototype,{linePrecision:1,set:function(t,e){this.ray.set(t,e)},setFromCamera:function(t,e){e&&e.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(t.x,t.y,.5).unproject(e).sub(this.ray.origin).normalize(),this.camera=e):e&&e.isOrthographicCamera?(this.ray.origin.set(t.x,t.y,(e.near+e.far)/(e.near-e.far)).unproject(e),this.ray.direction.set(0,0,-1).transformDirection(e.matrixWorld),this.camera=e):console.error("THREE.Raycaster: Unsupported camera type.")},intersectObject:function(t,e,n){var r=n||[];return mu(t,this,r,e),r.sort(fu),r},intersectObjects:function(t,e,n){var r=n||[];if(!1===Array.isArray(t))return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),r;for(var i=0,a=t.length;i<a;i++)mu(t[i],this,r,e);return r.sort(fu),r}}),Object.assign(gu.prototype,{set:function(t,e,n){return this.radius=t,this.phi=e,this.theta=n,this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.radius=t.radius,this.phi=t.phi,this.theta=t.theta,this},makeSafe:function(){return this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi)),this},setFromVector3:function(t){return this.setFromCartesianCoords(t.x,t.y,t.z)},setFromCartesianCoords:function(t,e,n){return this.radius=Math.sqrt(t*t+e*e+n*n),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(t,n),this.phi=Math.acos(Q.clamp(e/this.radius,-1,1))),this}}),Object.assign(vu.prototype,{set:function(t,e,n){return this.radius=t,this.theta=e,this.y=n,this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.radius=t.radius,this.theta=t.theta,this.y=t.y,this},setFromVector3:function(t){return this.setFromCartesianCoords(t.x,t.y,t.z)},setFromCartesianCoords:function(t,e,n){return this.radius=Math.sqrt(t*t+n*n),this.theta=Math.atan2(t,n),this.y=e,this}});var yu=new tt;function xu(t,e){this.min=void 0!==t?t:new tt(1/0,1/0),this.max=void 0!==e?e:new tt(-1/0,-1/0)}Object.assign(xu.prototype,{set:function(t,e){return this.min.copy(t),this.max.copy(e),this},setFromPoints:function(t){this.makeEmpty();for(var e=0,n=t.length;e<n;e++)this.expandByPoint(t[e]);return this},setFromCenterAndSize:function(t,e){var n=yu.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(n),this.max.copy(t).add(n),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.min.copy(t.min),this.max.copy(t.max),this},makeEmpty:function(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y},getCenter:function(t){return void 0===t&&(console.warn("THREE.Box2: .getCenter() target is now required"),t=new tt),this.isEmpty()?t.set(0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(t){return void 0===t&&(console.warn("THREE.Box2: .getSize() target is now required"),t=new tt),this.isEmpty()?t.set(0,0):t.subVectors(this.max,this.min)},expandByPoint:function(t){return this.min.min(t),this.max.max(t),this},expandByVector:function(t){return this.min.sub(t),this.max.add(t),this},expandByScalar:function(t){return this.min.addScalar(-t),this.max.addScalar(t),this},containsPoint:function(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y)},containsBox:function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y},getParameter:function(t,e){return void 0===e&&(console.warn("THREE.Box2: .getParameter() target is now required"),e=new tt),e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y))},intersectsBox:function(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y)},clampPoint:function(t,e){return void 0===e&&(console.warn("THREE.Box2: .clampPoint() target is now required"),e=new tt),e.copy(t).clamp(this.min,this.max)},distanceToPoint:function(t){return yu.copy(t).clamp(this.min,this.max).sub(t).length()},intersect:function(t){return this.min.max(t.min),this.max.min(t.max),this},union:function(t){return this.min.min(t.min),this.max.max(t.max),this},translate:function(t){return this.min.add(t),this.max.add(t),this},equals:function(t){return t.min.equals(this.min)&&t.max.equals(this.max)}});var bu=new ht,wu=new ht;function _u(t,e){this.start=void 0!==t?t:new ht,this.end=void 0!==e?e:new ht}function Mu(t){Ft.call(this),this.material=t,this.render=function(){}}Object.assign(_u.prototype,{set:function(t,e){return this.start.copy(t),this.end.copy(e),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.start.copy(t.start),this.end.copy(t.end),this},getCenter:function(t){return void 0===t&&(console.warn("THREE.Line3: .getCenter() target is now required"),t=new ht),t.addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(t){return void 0===t&&(console.warn("THREE.Line3: .delta() target is now required"),t=new ht),t.subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(t,e){return void 0===e&&(console.warn("THREE.Line3: .at() target is now required"),e=new ht),this.delta(e).multiplyScalar(t).add(this.start)},closestPointToPointParameter:function(t,e){bu.subVectors(t,this.start),wu.subVectors(this.end,this.start);var n=wu.dot(wu),r=wu.dot(bu)/n;return e&&(r=Q.clamp(r,0,1)),r},closestPointToPoint:function(t,e,n){var r=this.closestPointToPointParameter(t,e);return void 0===n&&(console.warn("THREE.Line3: .closestPointToPoint() target is now required"),n=new ht),this.delta(n).multiplyScalar(r).add(this.start)},applyMatrix4:function(t){return this.start.applyMatrix4(t),this.end.applyMatrix4(t),this},equals:function(t){return t.start.equals(this.start)&&t.end.equals(this.end)}}),((Mu.prototype=Object.create(Ft.prototype)).constructor=Mu).prototype.isImmediateRenderObject=!0;var Su=new ht;function Tu(t,e){Ft.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=e;for(var n=new nn,r=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1],i=0,a=1;i<32;i++,a++){var o=i/32*Math.PI*2,s=a/32*Math.PI*2;r.push(Math.cos(o),Math.sin(o),1,Math.cos(s),Math.sin(s),1)}n.setAttribute("position",new We(r,3));var l=new da({fog:!1});this.cone=new wa(n,l),this.add(this.cone),this.update()}((Tu.prototype=Object.create(Ft.prototype)).constructor=Tu).prototype.dispose=function(){this.cone.geometry.dispose(),this.cone.material.dispose()},Tu.prototype.update=function(){this.light.updateMatrixWorld();var t=this.light.distance?this.light.distance:1e3,e=t*Math.tan(this.light.angle);this.cone.scale.set(e,e,t),Su.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(Su),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)};var Cu=new ht,Eu=new xt,Du=new xt;function Au(t){for(var e=function t(e){var n=[];e&&e.isBone&&n.push(e);for(var r=0;r<e.children.length;r++)n.push.apply(n,t(e.children[r]));return n}(t),n=new nn,r=[],i=[],a=new De(0,0,1),o=new De(0,1,0),s=0;s<e.length;s++){var l=e[s];l.parent&&l.parent.isBone&&(r.push(0,0,0),r.push(0,0,0),i.push(a.r,a.g,a.b),i.push(o.r,o.g,o.b))}n.setAttribute("position",new We(r,3)),n.setAttribute("color",new We(i,3));var u=new da({vertexColors:2,depthTest:!1,depthWrite:!1,transparent:!0});wa.call(this,n,u),this.root=t,this.bones=e,this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1}function Ou(t,e,n){this.light=t,this.light.updateMatrixWorld(),this.color=n;var r=new Oo(e,4,2),i=new ke({wireframe:!0,fog:!1});wn.call(this,r,i),this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}((Au.prototype=Object.create(wa.prototype)).constructor=Au).prototype.updateMatrixWorld=function(t){var e=this.bones,n=this.geometry,r=n.getAttribute("position");Du.getInverse(this.root.matrixWorld);for(var i=0,a=0;i<e.length;i++){var o=e[i];o.parent&&o.parent.isBone&&(Eu.multiplyMatrices(Du,o.matrixWorld),Cu.setFromMatrixPosition(Eu),r.setXYZ(a,Cu.x,Cu.y,Cu.z),Eu.multiplyMatrices(Du,o.parent.matrixWorld),Cu.setFromMatrixPosition(Eu),r.setXYZ(a+1,Cu.x,Cu.y,Cu.z),a+=2)}n.getAttribute("position").needsUpdate=!0,Ft.prototype.updateMatrixWorld.call(this,t)},((Ou.prototype=Object.create(wn.prototype)).constructor=Ou).prototype.dispose=function(){this.geometry.dispose(),this.material.dispose()},Ou.prototype.update=function(){void 0!==this.color?this.material.color.set(this.color):this.material.color.copy(this.light.color)};var Lu=new ht,Pu=new De,Ru=new De;function Iu(t,e,n){Ft.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=n;var r=new Ga(e);r.rotateY(.5*Math.PI),this.material=new ke({wireframe:!0,fog:!1}),void 0===this.color&&(this.material.vertexColors=2);var i=r.getAttribute("position"),a=new Float32Array(3*i.count);r.setAttribute("color",new Fe(a,3)),this.add(new wn(r,this.material)),this.update()}function ku(t,e,n,r){t=t||10,e=e||10,n=new De(void 0!==n?n:4473924),r=new De(void 0!==r?r:8947848);for(var i=e/2,a=t/e,o=t/2,s=[],l=[],u=0,c=0,h=-o;u<=e;u++,h+=a){s.push(-o,0,h,o,0,h),s.push(h,0,-o,h,0,o);var d=u===i?n:r;d.toArray(l,c),c+=3,d.toArray(l,c),c+=3,d.toArray(l,c),c+=3,d.toArray(l,c),c+=3}var p=new nn;p.setAttribute("position",new We(s,3)),p.setAttribute("color",new We(l,3));var f=new da({vertexColors:2});wa.call(this,p,f)}function Bu(t,e,n,r,i,a){t=t||10,e=e||16,n=n||8,r=r||64,i=new De(void 0!==i?i:4473924),a=new De(void 0!==a?a:8947848);var o,s,l,u,c,h,d,p=[],f=[];for(u=0;u<=e;u++)l=u/e*(2*Math.PI),o=Math.sin(l)*t,s=Math.cos(l)*t,p.push(0,0,0),p.push(o,0,s),d=1&u?i:a,f.push(d.r,d.g,d.b),f.push(d.r,d.g,d.b);for(u=0;u<=n;u++)for(d=1&u?i:a,h=t-t/n*u,c=0;c<r;c++)l=c/r*(2*Math.PI),o=Math.sin(l)*h,s=Math.cos(l)*h,p.push(o,0,s),f.push(d.r,d.g,d.b),l=(c+1)/r*(2*Math.PI),o=Math.sin(l)*h,s=Math.cos(l)*h,p.push(o,0,s),f.push(d.r,d.g,d.b);var m=new nn;m.setAttribute("position",new We(p,3)),m.setAttribute("color",new We(f,3));var g=new da({vertexColors:2});wa.call(this,m,g)}((Iu.prototype=Object.create(Ft.prototype)).constructor=Iu).prototype.dispose=function(){this.children[0].geometry.dispose(),this.children[0].material.dispose()},Iu.prototype.update=function(){var t=this.children[0];if(void 0!==this.color)this.material.color.set(this.color);else{var e=t.geometry.getAttribute("color");Pu.copy(this.light.color),Ru.copy(this.light.groundColor);for(var n=0,r=e.count;n<r;n++){var i=n<r/2?Pu:Ru;e.setXYZ(n,i.r,i.g,i.b)}e.needsUpdate=!0}t.lookAt(Lu.setFromMatrixPosition(this.light.matrixWorld).negate())},ku.prototype=Object.assign(Object.create(wa.prototype),{constructor:ku,copy:function(t){return wa.prototype.copy.call(this,t),this.geometry.copy(t.geometry),this.material.copy(t.material),this},clone:function(){return(new this.constructor).copy(this)}}),(Bu.prototype=Object.create(wa.prototype)).constructor=Bu;var Fu=new ht,Nu=new ht,ju=new ht;function zu(t,e,n){Ft.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,void 0===e&&(e=1);var r=new nn;r.setAttribute("position",new We([-e,e,0,e,e,0,e,-e,0,-e,-e,0,-e,e,0],3));var i=new da({fog:!1});this.lightPlane=new ya(r,i),this.add(this.lightPlane),(r=new nn).setAttribute("position",new We([0,0,0,0,0,1],3)),this.targetLine=new ya(r,i),this.add(this.targetLine),this.update()}((zu.prototype=Object.create(Ft.prototype)).constructor=zu).prototype.dispose=function(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()},zu.prototype.update=function(){Fu.setFromMatrixPosition(this.light.matrixWorld),Nu.setFromMatrixPosition(this.light.target.matrixWorld),ju.subVectors(Nu,Fu),this.lightPlane.lookAt(Nu),void 0!==this.color?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(Nu),this.targetLine.scale.z=ju.length()};var Vu=new ht,Gu=new kn;function Uu(t){var e=new nn,n=new da({color:16777215,vertexColors:1}),r=[],i=[],a={},o=new De(16755200),s=new De(16711680),l=new De(43775),u=new De(16777215),c=new De(3355443);function h(t,e,n){d(t,n),d(e,n)}function d(t,e){r.push(0,0,0),i.push(e.r,e.g,e.b),void 0===a[t]&&(a[t]=[]),a[t].push(r.length/3-1)}h("n1","n2",o),h("n2","n4",o),h("n4","n3",o),h("n3","n1",o),h("f1","f2",o),h("f2","f4",o),h("f4","f3",o),h("f3","f1",o),h("n1","f1",o),h("n2","f2",o),h("n3","f3",o),h("n4","f4",o),h("p","n1",s),h("p","n2",s),h("p","n3",s),h("p","n4",s),h("u1","u2",l),h("u2","u3",l),h("u3","u1",l),h("c","t",u),h("p","c",c),h("cn1","cn2",c),h("cn3","cn4",c),h("cf1","cf2",c),h("cf3","cf4",c),e.setAttribute("position",new We(r,3)),e.setAttribute("color",new We(i,3)),wa.call(this,e,n),this.camera=t,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=a,this.update()}function Hu(t,e,n,r,i,a,o){Vu.set(i,a,o).unproject(r);var s=e[t];if(void 0!==s)for(var l=n.getAttribute("position"),u=0,c=s.length;u<c;u++)l.setXYZ(s[u],Vu.x,Vu.y,Vu.z)}((Uu.prototype=Object.create(wa.prototype)).constructor=Uu).prototype.update=function(){var t=this.geometry,e=this.pointMap;Gu.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),Hu("c",e,t,Gu,0,0,-1),Hu("t",e,t,Gu,0,0,1),Hu("n1",e,t,Gu,-1,-1,-1),Hu("n2",e,t,Gu,1,-1,-1),Hu("n3",e,t,Gu,-1,1,-1),Hu("n4",e,t,Gu,1,1,-1),Hu("f1",e,t,Gu,-1,-1,1),Hu("f2",e,t,Gu,1,-1,1),Hu("f3",e,t,Gu,-1,1,1),Hu("f4",e,t,Gu,1,1,1),Hu("u1",e,t,Gu,.7,1.1,-1),Hu("u2",e,t,Gu,-.7,1.1,-1),Hu("u3",e,t,Gu,0,2,-1),Hu("cf1",e,t,Gu,-1,0,1),Hu("cf2",e,t,Gu,1,0,1),Hu("cf3",e,t,Gu,0,-1,1),Hu("cf4",e,t,Gu,0,1,1),Hu("cn1",e,t,Gu,-1,0,-1),Hu("cn2",e,t,Gu,1,0,-1),Hu("cn3",e,t,Gu,0,-1,-1),Hu("cn4",e,t,Gu,0,1,-1),t.getAttribute("position").needsUpdate=!0};var Wu=new Kt;function Ju(t,e){this.object=t,void 0===e&&(e=16776960);var n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=new Float32Array(24),i=new nn;i.setIndex(new Fe(n,1)),i.setAttribute("position",new Fe(r,3)),wa.call(this,i,new da({color:e})),this.matrixAutoUpdate=!1,this.update()}function qu(t,e){this.type="Box3Helper",this.box=t,e=e||16776960;var n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=new nn;r.setIndex(new Fe(n,1)),r.setAttribute("position",new We([1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],3)),wa.call(this,r,new da({color:e})),this.geometry.computeBoundingSphere()}function Xu(t,e,n){this.type="PlaneHelper",this.plane=t,this.size=void 0===e?1:e;var r=void 0!==n?n:16776960,i=new nn;i.setAttribute("position",new We([1,-1,1,-1,1,1,-1,-1,1,1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,0,0,1,0,0,0],3)),i.computeBoundingSphere(),ya.call(this,i,new da({color:r}));var a=new nn;a.setAttribute("position",new We([1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,1],3)),a.computeBoundingSphere(),this.add(new wn(a,new ke({color:r,opacity:.2,transparent:!0,depthWrite:!1})))}((Ju.prototype=Object.create(wa.prototype)).constructor=Ju).prototype.update=function(t){if(void 0!==t&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),void 0!==this.object&&Wu.setFromObject(this.object),!Wu.isEmpty()){var e=Wu.min,n=Wu.max,r=this.geometry.attributes.position,i=r.array;i[0]=n.x,i[1]=n.y,i[2]=n.z,i[3]=e.x,i[4]=n.y,i[5]=n.z,i[6]=e.x,i[7]=e.y,i[8]=n.z,i[9]=n.x,i[10]=e.y,i[11]=n.z,i[12]=n.x,i[13]=n.y,i[14]=e.z,i[15]=e.x,i[16]=n.y,i[17]=e.z,i[18]=e.x,i[19]=e.y,i[20]=e.z,i[21]=n.x,i[22]=e.y,i[23]=e.z,r.needsUpdate=!0,this.geometry.computeBoundingSphere()}},Ju.prototype.setFromObject=function(t){return this.object=t,this.update(),this},Ju.prototype.copy=function(t){return wa.prototype.copy.call(this,t),this.object=t.object,this},Ju.prototype.clone=function(){return(new this.constructor).copy(this)},((qu.prototype=Object.create(wa.prototype)).constructor=qu).prototype.updateMatrixWorld=function(t){var e=this.box;e.isEmpty()||(e.getCenter(this.position),e.getSize(this.scale),this.scale.multiplyScalar(.5),Ft.prototype.updateMatrixWorld.call(this,t))},((Xu.prototype=Object.create(ya.prototype)).constructor=Xu).prototype.updateMatrixWorld=function(t){var e=-this.plane.constant;Math.abs(e)<1e-8&&(e=1e-8),this.scale.set(.5*this.size,.5*this.size,e),this.children[0].material.side=e<0?1:0,this.lookAt(this.plane.normal),Ft.prototype.updateMatrixWorld.call(this,t)};var Yu,Zu,$u=new ht;function Ku(t,e,n,r,i,a){Ft.call(this),void 0===t&&(t=new ht(0,0,1)),void 0===e&&(e=new ht(0,0,0)),void 0===n&&(n=1),void 0===r&&(r=16776960),void 0===i&&(i=.2*n),void 0===a&&(a=.2*i),void 0===Yu&&((Yu=new nn).setAttribute("position",new We([0,0,0,0,1,0],3)),(Zu=new zo(0,.5,1,5,1)).translate(0,-.5,0)),this.position.copy(e),this.line=new ya(Yu,new da({color:r})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new wn(Zu,new ke({color:r})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(t),this.setLength(n,i,a)}function Qu(t){var e=[0,0,0,t=t||1,0,0,0,0,0,0,t,0,0,0,0,0,0,t],n=new nn;n.setAttribute("position",new We(e,3)),n.setAttribute("color",new We([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3));var r=new da({vertexColors:2});wa.call(this,n,r)}((Ku.prototype=Object.create(Ft.prototype)).constructor=Ku).prototype.setDirection=function(t){if(.99999<t.y)this.quaternion.set(0,0,0,1);else if(t.y<-.99999)this.quaternion.set(1,0,0,0);else{$u.set(t.z,0,-t.x).normalize();var e=Math.acos(t.y);this.quaternion.setFromAxisAngle($u,e)}},Ku.prototype.setLength=function(t,e,n){void 0===e&&(e=.2*t),void 0===n&&(n=.2*e),this.line.scale.set(1,Math.max(1e-4,t-e),1),this.line.updateMatrix(),this.cone.scale.set(n,e,n),this.cone.position.y=t,this.cone.updateMatrix()},Ku.prototype.setColor=function(t){this.line.material.color.set(t),this.cone.material.color.set(t)},Ku.prototype.copy=function(t){return Ft.prototype.copy.call(this,t,!1),this.line.copy(t.line),this.cone.copy(t.cone),this},Ku.prototype.clone=function(){return(new this.constructor).copy(this)},(Qu.prototype=Object.create(wa.prototype)).constructor=Qu;var tc,ec=Math.pow(2,8),nc=[.125,.215,.35,.446,.526,.582],rc=5+nc.length,ic=20,ac={3000:0,3001:1,3002:2,3004:3,3005:4,3006:5,3007:6},oc=new ol,sc=((tc=new qo({defines:{n:20},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:new Float32Array(20)},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:new ht(0,1,0)},inputEncoding:{value:ac[j]},outputEncoding:{value:ac[j]}},vertexShader:"\nprecision mediump float;\nprecision mediump int;\nattribute vec3 position;\nattribute vec2 uv;\nattribute float faceIndex;\nvarying vec3 vOutputDirection;\nvec3 getDirection(vec2 uv, float face) {\n\tuv = 2.0 * uv - 1.0;\n\tvec3 direction = vec3(uv, 1.0);\n\tif (face == 0.0) {\n\t\tdirection = direction.zyx;\n\t\tdirection.z *= -1.0;\n\t} else if (face == 1.0) {\n\t\tdirection = direction.xzy;\n\t\tdirection.z *= -1.0;\n\t} else if (face == 3.0) {\n\t\tdirection = direction.zyx;\n\t\tdirection.x *= -1.0;\n\t} else if (face == 4.0) {\n\t\tdirection = direction.xzy;\n\t\tdirection.y *= -1.0;\n\t} else if (face == 5.0) {\n\t\tdirection.xz *= -1.0;\n\t}\n\treturn direction;\n}\nvoid main() {\n\tvOutputDirection = getDirection(uv, faceIndex);\n\tgl_Position = vec4( position, 1.0 );\n}\n\t",fragmentShader:"\nprecision mediump float;\nprecision mediump int;\nvarying vec3 vOutputDirection;\nuniform sampler2D envMap;\nuniform int samples;\nuniform float weights[n];\nuniform bool latitudinal;\nuniform float dTheta;\nuniform float mipInt;\nuniform vec3 poleAxis;\n\n\nuniform int inputEncoding;\nuniform int outputEncoding;\n\n#include <encodings_pars_fragment>\n\nvec4 inputTexelToLinear(vec4 value){\n\tif(inputEncoding == 0){\n\t\treturn value;\n\t}else if(inputEncoding == 1){\n\t\treturn sRGBToLinear(value);\n\t}else if(inputEncoding == 2){\n\t\treturn RGBEToLinear(value);\n\t}else if(inputEncoding == 3){\n\t\treturn RGBMToLinear(value, 7.0);\n\t}else if(inputEncoding == 4){\n\t\treturn RGBMToLinear(value, 16.0);\n\t}else if(inputEncoding == 5){\n\t\treturn RGBDToLinear(value, 256.0);\n\t}else{\n\t\treturn GammaToLinear(value, 2.2);\n\t}\n}\n\nvec4 linearToOutputTexel(vec4 value){\n\tif(outputEncoding == 0){\n\t\treturn value;\n\t}else if(outputEncoding == 1){\n\t\treturn LinearTosRGB(value);\n\t}else if(outputEncoding == 2){\n\t\treturn LinearToRGBE(value);\n\t}else if(outputEncoding == 3){\n\t\treturn LinearToRGBM(value, 7.0);\n\t}else if(outputEncoding == 4){\n\t\treturn LinearToRGBM(value, 16.0);\n\t}else if(outputEncoding == 5){\n\t\treturn LinearToRGBD(value, 256.0);\n\t}else{\n\t\treturn LinearToGamma(value, 2.2);\n\t}\n}\n\nvec4 envMapTexelToLinear(vec4 color) {\n\treturn inputTexelToLinear(color);\n}\n\t\n\n#define ENVMAP_TYPE_CUBE_UV\n#include <cube_uv_reflection_fragment>\n\nvoid main() {\n\tgl_FragColor = vec4(0.0);\n\tfor (int i = 0; i < n; i++) {\n\t\tif (i >= samples)\n\t\t\tbreak;\n\t\tfor (int dir = -1; dir < 2; dir += 2) {\n\t\t\tif (i == 0 && dir == 1)\n\t\t\t\tcontinue;\n\t\t\tvec3 axis = latitudinal ? poleAxis : cross(poleAxis, vOutputDirection);\n\t\t\tif (all(equal(axis, vec3(0.0))))\n\t\t\t\taxis = cross(vec3(0.0, 1.0, 0.0), vOutputDirection);\n\t\t\taxis = normalize(axis);\n\t\t\tfloat theta = dTheta * float(dir * i);\n\t\t\tfloat cosTheta = cos(theta);\n\t\t\t// Rodrigues' axis-angle rotation\n\t\t\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t\t\t\t+ cross(axis, vOutputDirection) * sin(theta)\n\t\t\t\t\t+ axis * dot(axis, vOutputDirection) * (1.0 - cosTheta);\n\t\t\tgl_FragColor.rgb +=\n\t\t\t\t\tweights[i] * bilinearCubeUV(envMap, sampleDirection, mipInt);\n\t\t}\n\t}\n\tgl_FragColor = linearToOutputTexel(gl_FragColor);\n}\n\t\t",blending:0,depthTest:!1,depthWrite:!1})).type="SphericalGaussianBlur",tc),lc=null,uc=null,cc=function(){for(var t=[],e=[],n=[],r=8,i=0;i<rc;i++){var a=Math.pow(2,r);e.push(a);var o=1/a;4<i?o=nc[i-8+4-1]:0==i&&(o=0),n.push(o);for(var s=1/(a-1),l=-s/2,u=1+s/2,c=[l,l,u,l,u,u,l,l,u,u,l,u],h=new Float32Array(108),d=new Float32Array(72),p=new Float32Array(36),f=0;f<6;f++){var m=f%3*2/3-1,g=2<f?0:-1,v=[m,g,0,m+2/3,g,0,m+2/3,1+g,0,m,g,0,m+2/3,1+g,0,m,1+g,0];h.set(v,18*f),d.set(c,12*f);var y=[f,f,f,f,f,f];p.set(y,6*f)}var x=new nn;x.setAttribute("position",new Fe(h,3)),x.setAttribute("uv",new Fe(d,2)),x.setAttribute("faceIndex",new Fe(p,1)),t.push(x),4<r&&r--}return{_lodPlanes:t,_sizeLods:e,_sigmas:n}}(),hc=cc._lodPlanes,dc=cc._sizeLods,pc=cc._sigmas,fc=null,mc=null,gc=null,vc=(1+Math.sqrt(5))/2,yc=1/vc,xc=[new ht(1,1,1),new ht(-1,1,1),new ht(1,1,-1),new ht(-1,1,-1),new ht(0,vc,yc),new ht(0,vc,-yc),new ht(yc,0,vc),new ht(-yc,0,vc),new ht(vc,yc,0),new ht(-vc,yc,0)];function bc(t){mc=t,Mc(sc)}function wc(t){var e={magFilter:c,minFilter:c,generateMipmaps:!1,type:t?t.type:g,format:t?t.format:1023,encoding:t?t.encoding:G,depthBuffer:!1,stencilBuffer:!1},n=Sc(e);return n.depthBuffer=!t,fc=Sc(e),n}function _c(t){fc.dispose(),mc.setRenderTarget(gc),t.scissorTest=!1,t.setSize(t.width,t.height)}function Mc(t){var e=new Nt;e.add(new wn(hc[0],t)),mc.compile(e,oc)}function Sc(t){var e=new ot(3*ec,3*ec,t);return e.texture.mapping=a,e.texture.name="PMREM.cubeUv",e.scissorTest=!0,e}function Tc(t,e,n,r,i){t.viewport.set(e,n,r,i),t.scissor.set(e,n,r,i)}function Cc(t){var e=mc.autoClear;mc.autoClear=!1;for(var n=1;n<rc;n++)Ec(t,n-1,n,Math.sqrt(pc[n]*pc[n]-pc[n-1]*pc[n-1]),xc[(n-1)%xc.length]);mc.autoClear=e}function Ec(t,e,n,r,i){Dc(t,fc,e,n,r,"latitudinal",i),Dc(fc,t,n,n,r,"longitudinal",i)}function Dc(t,e,n,r,i,a,o){"latitudinal"!==a&&"longitudinal"!==a&&console.error("blur direction must be either latitudinal or longitudinal!");var s=new Nt;s.add(new wn(hc[r],sc));var l=sc.uniforms,u=dc[n]-1,c=isFinite(i)?Math.PI/(2*u):2*Math.PI/39,h=i/c,d=isFinite(i)?1+Math.floor(3*h):ic;ic<d&&console.warn("sigmaRadians, "+i+", is too large and will clip, as it requested "+d+" samples when the maximum is set to "+ic);for(var p=[],f=0,m=0;m<ic;++m){var g=m/h,v=Math.exp(-g*g/2);p.push(v),0==m?f+=v:m<d&&(f+=2*v)}for(m=0;m<p.length;m++)p[m]=p[m]/f;l.envMap.value=t.texture,l.samples.value=d,l.weights.value=p,l.latitudinal.value="latitudinal"===a,o&&(l.poleAxis.value=o),l.dTheta.value=c,l.mipInt.value=8-n,l.inputEncoding.value=ac[t.texture.encoding],l.outputEncoding.value=ac[t.texture.encoding];var y=dc[r];Tc(e,g=3*Math.max(0,ec-2*y),(0===r?0:2*ec)+2*y*(4<r?r-8+4:0),3*y,2*y),mc.setRenderTarget(e),mc.render(s,oc)}function Ac(){var t=new qo({uniforms:{envMap:{value:null},texelSize:{value:new tt(1,1)},inputEncoding:{value:ac[j]},outputEncoding:{value:ac[j]}},vertexShader:"\nprecision mediump float;\nprecision mediump int;\nattribute vec3 position;\nattribute vec2 uv;\nattribute float faceIndex;\nvarying vec3 vOutputDirection;\nvec3 getDirection(vec2 uv, float face) {\n\tuv = 2.0 * uv - 1.0;\n\tvec3 direction = vec3(uv, 1.0);\n\tif (face == 0.0) {\n\t\tdirection = direction.zyx;\n\t\tdirection.z *= -1.0;\n\t} else if (face == 1.0) {\n\t\tdirection = direction.xzy;\n\t\tdirection.z *= -1.0;\n\t} else if (face == 3.0) {\n\t\tdirection = direction.zyx;\n\t\tdirection.x *= -1.0;\n\t} else if (face == 4.0) {\n\t\tdirection = direction.xzy;\n\t\tdirection.y *= -1.0;\n\t} else if (face == 5.0) {\n\t\tdirection.xz *= -1.0;\n\t}\n\treturn direction;\n}\nvoid main() {\n\tvOutputDirection = getDirection(uv, faceIndex);\n\tgl_Position = vec4( position, 1.0 );\n}\n\t",fragmentShader:"\nprecision mediump float;\nprecision mediump int;\nvarying vec3 vOutputDirection;\nuniform sampler2D envMap;\nuniform vec2 texelSize;\n\n\nuniform int inputEncoding;\nuniform int outputEncoding;\n\n#include <encodings_pars_fragment>\n\nvec4 inputTexelToLinear(vec4 value){\n\tif(inputEncoding == 0){\n\t\treturn value;\n\t}else if(inputEncoding == 1){\n\t\treturn sRGBToLinear(value);\n\t}else if(inputEncoding == 2){\n\t\treturn RGBEToLinear(value);\n\t}else if(inputEncoding == 3){\n\t\treturn RGBMToLinear(value, 7.0);\n\t}else if(inputEncoding == 4){\n\t\treturn RGBMToLinear(value, 16.0);\n\t}else if(inputEncoding == 5){\n\t\treturn RGBDToLinear(value, 256.0);\n\t}else{\n\t\treturn GammaToLinear(value, 2.2);\n\t}\n}\n\nvec4 linearToOutputTexel(vec4 value){\n\tif(outputEncoding == 0){\n\t\treturn value;\n\t}else if(outputEncoding == 1){\n\t\treturn LinearTosRGB(value);\n\t}else if(outputEncoding == 2){\n\t\treturn LinearToRGBE(value);\n\t}else if(outputEncoding == 3){\n\t\treturn LinearToRGBM(value, 7.0);\n\t}else if(outputEncoding == 4){\n\t\treturn LinearToRGBM(value, 16.0);\n\t}else if(outputEncoding == 5){\n\t\treturn LinearToRGBD(value, 256.0);\n\t}else{\n\t\treturn LinearToGamma(value, 2.2);\n\t}\n}\n\nvec4 envMapTexelToLinear(vec4 color) {\n\treturn inputTexelToLinear(color);\n}\n\t\n\n#define RECIPROCAL_PI 0.31830988618\n#define RECIPROCAL_PI2 0.15915494\n\nvoid main() {\n\tgl_FragColor = vec4(0.0);\n\tvec3 outputDirection = normalize(vOutputDirection);\n\tvec2 uv;\n\tuv.y = asin(clamp(outputDirection.y, -1.0, 1.0)) * RECIPROCAL_PI + 0.5;\n\tuv.x = atan(outputDirection.z, outputDirection.x) * RECIPROCAL_PI2 + 0.5;\n\tvec2 f = fract(uv / texelSize - 0.5);\n\tuv -= f * texelSize;\n\tvec3 tl = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n\tuv.x += texelSize.x;\n\tvec3 tr = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n\tuv.y += texelSize.y;\n\tvec3 br = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n\tuv.x -= texelSize.x;\n\tvec3 bl = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n\tvec3 tm = mix(tl, tr, f.x);\n\tvec3 bm = mix(bl, br, f.x);\n\tgl_FragColor.rgb = mix(tm, bm, f.y);\n\tgl_FragColor = linearToOutputTexel(gl_FragColor);\n}\n\t\t",blending:0,depthTest:!1,depthWrite:!1});return t.type="EquirectangularToCubeUV",t}function Oc(){var t=new qo({uniforms:{envMap:{value:null},inputEncoding:{value:ac[j]},outputEncoding:{value:ac[j]}},vertexShader:"\nprecision mediump float;\nprecision mediump int;\nattribute vec3 position;\nattribute vec2 uv;\nattribute float faceIndex;\nvarying vec3 vOutputDirection;\nvec3 getDirection(vec2 uv, float face) {\n\tuv = 2.0 * uv - 1.0;\n\tvec3 direction = vec3(uv, 1.0);\n\tif (face == 0.0) {\n\t\tdirection = direction.zyx;\n\t\tdirection.z *= -1.0;\n\t} else if (face == 1.0) {\n\t\tdirection = direction.xzy;\n\t\tdirection.z *= -1.0;\n\t} else if (face == 3.0) {\n\t\tdirection = direction.zyx;\n\t\tdirection.x *= -1.0;\n\t} else if (face == 4.0) {\n\t\tdirection = direction.xzy;\n\t\tdirection.y *= -1.0;\n\t} else if (face == 5.0) {\n\t\tdirection.xz *= -1.0;\n\t}\n\treturn direction;\n}\nvoid main() {\n\tvOutputDirection = getDirection(uv, faceIndex);\n\tgl_Position = vec4( position, 1.0 );\n}\n\t",fragmentShader:"\nprecision mediump float;\nprecision mediump int;\nvarying vec3 vOutputDirection;\nuniform samplerCube envMap;\n\n\nuniform int inputEncoding;\nuniform int outputEncoding;\n\n#include <encodings_pars_fragment>\n\nvec4 inputTexelToLinear(vec4 value){\n\tif(inputEncoding == 0){\n\t\treturn value;\n\t}else if(inputEncoding == 1){\n\t\treturn sRGBToLinear(value);\n\t}else if(inputEncoding == 2){\n\t\treturn RGBEToLinear(value);\n\t}else if(inputEncoding == 3){\n\t\treturn RGBMToLinear(value, 7.0);\n\t}else if(inputEncoding == 4){\n\t\treturn RGBMToLinear(value, 16.0);\n\t}else if(inputEncoding == 5){\n\t\treturn RGBDToLinear(value, 256.0);\n\t}else{\n\t\treturn GammaToLinear(value, 2.2);\n\t}\n}\n\nvec4 linearToOutputTexel(vec4 value){\n\tif(outputEncoding == 0){\n\t\treturn value;\n\t}else if(outputEncoding == 1){\n\t\treturn LinearTosRGB(value);\n\t}else if(outputEncoding == 2){\n\t\treturn LinearToRGBE(value);\n\t}else if(outputEncoding == 3){\n\t\treturn LinearToRGBM(value, 7.0);\n\t}else if(outputEncoding == 4){\n\t\treturn LinearToRGBM(value, 16.0);\n\t}else if(outputEncoding == 5){\n\t\treturn LinearToRGBD(value, 256.0);\n\t}else{\n\t\treturn LinearToGamma(value, 2.2);\n\t}\n}\n\nvec4 envMapTexelToLinear(vec4 color) {\n\treturn inputTexelToLinear(color);\n}\n\t\n\nvoid main() {\n\tgl_FragColor = vec4(0.0);\n\tgl_FragColor.rgb = envMapTexelToLinear(textureCube(envMap, vec3( - vOutputDirection.x, vOutputDirection.yz ))).rgb;\n\tgl_FragColor = linearToOutputTexel(gl_FragColor);\n}\n\t\t",blending:0,depthTest:!1,depthWrite:!1});return t.type="CubemapToCubeUV",t}function Lc(t){console.warn("THREE.ClosedSplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),Ns.call(this,t),this.type="catmullrom",this.closed=!0}function Pc(t){console.warn("THREE.SplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),Ns.call(this,t),this.type="catmullrom"}function Rc(t){console.warn("THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead."),Ns.call(this,t),this.type="catmullrom"}bc.prototype={constructor:bc,fromScene:function(t,e,n,r){void 0===e&&(e=0),void 0===n&&(n=.1),void 0===r&&(r=100),gc=mc.getRenderTarget();var i=wc();return function(t,e,n,r){var i=new Bn(90,1,e,n),a=[1,1,1,1,-1,1],o=[1,1,-1,-1,-1,1],s=mc.outputEncoding,l=mc.toneMapping,u=mc.toneMappingExposure,c=mc.getClearColor(),h=mc.getClearAlpha();mc.toneMapping=1,mc.toneMappingExposure=1,mc.outputEncoding=j,t.scale.z*=-1;var d=t.background;if(d&&d.isColor){d.convertSRGBToLinear();var p=Math.max(d.r,d.g,d.b),f=Math.min(Math.max(Math.ceil(Math.log2(p)),-128),127);d=d.multiplyScalar(Math.pow(2,-f));var m=(f+128)/255;mc.setClearColor(d,m),t.background=null}for(var g=0;g<6;g++){var v=g%3;0==v?(i.up.set(0,a[g],0),i.lookAt(o[g],0,0)):1==v?(i.up.set(0,0,a[g]),i.lookAt(0,o[g],0)):(i.up.set(0,a[g],0),i.lookAt(0,0,o[g])),Tc(r,v*ec,2<g?ec:0,ec,ec),mc.setRenderTarget(r),mc.render(t,i)}mc.toneMapping=l,mc.toneMappingExposure=u,mc.outputEncoding=s,mc.setClearColor(c,h),t.scale.z*=-1}(t,n,r,i),0<e&&Ec(i,0,0,e),Cc(i),_c(i),i},fromEquirectangular:function(t){return t.magFilter=c,t.minFilter=c,t.generateMipmaps=!1,this.fromCubemap(t)},fromCubemap:function(t){gc=mc.getRenderTarget();var e=wc(t);return function(t,e){var n=new Nt;t.isCubeTexture?null==uc&&(uc=Oc()):null==lc&&(lc=Ac());var r=t.isCubeTexture?uc:lc;n.add(new wn(hc[0],r));var i=r.uniforms;(i.envMap.value=t).isCubeTexture||i.texelSize.value.set(1/t.image.width,1/t.image.height),i.inputEncoding.value=ac[t.encoding],i.outputEncoding.value=ac[t.encoding],Tc(e,0,0,3*ec,2*ec),mc.setRenderTarget(e),mc.render(n,oc)}(t,e),Cc(e),_c(e),e},compileCubemapShader:function(){null==uc&&Mc(uc=Oc())},compileEquirectangularShader:function(){null==lc&&Mc(lc=Ac())},dispose:function(){sc.dispose(),null!=uc&&uc.dispose(),null!=lc&&lc.dispose();for(var t=0;t<hc.length;t++)hc[t].dispose()}},Os.create=function(t,e){return console.log("THREE.Curve.create() has been deprecated"),t.prototype=Object.create(Os.prototype),(t.prototype.constructor=t).prototype.getPoint=e,t},Object.assign(Zs.prototype,{createPointsGeometry:function(t){console.warn("THREE.CurvePath: .createPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");var e=this.getPoints(t);return this.createGeometry(e)},createSpacedPointsGeometry:function(t){console.warn("THREE.CurvePath: .createSpacedPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");var e=this.getSpacedPoints(t);return this.createGeometry(e)},createGeometry:function(t){console.warn("THREE.CurvePath: .createGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");for(var e=new Dn,n=0,r=t.length;n<r;n++){var i=t[n];e.vertices.push(new ht(i.x,i.y,i.z||0))}return e}}),Object.assign($s.prototype,{fromPoints:function(t){return console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(t)}}),Lc.prototype=Object.create(Ns.prototype),Pc.prototype=Object.create(Ns.prototype),Rc.prototype=Object.create(Ns.prototype),Object.assign(Rc.prototype,{initFromArray:function(){console.error("THREE.Spline: .initFromArray() has been removed.")},getControlPointsArray:function(){console.error("THREE.Spline: .getControlPointsArray() has been removed.")},reparametrizeByArcLength:function(){console.error("THREE.Spline: .reparametrizeByArcLength() has been removed.")}}),ku.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},Au.prototype.update=function(){console.error("THREE.SkeletonHelper: update() no longer needs to be called.")},Object.assign(ws.prototype,{extractUrlBase:function(t){return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."),dl.extractUrlBase(t)}}),ws.Handlers={add:function(){console.error("THREE.Loader: Handlers.add() has been removed. Use LoadingManager.addHandler() instead.")},get:function(){console.error("THREE.Loader: Handlers.get() has been removed. Use LoadingManager.getHandler() instead.")}},Object.assign(vl.prototype,{setTexturePath:function(t){return console.warn("THREE.ObjectLoader: .setTexturePath() has been renamed to .setResourcePath()."),this.setResourcePath(t)}}),Object.assign(xu.prototype,{center:function(t){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(t)},empty:function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(t){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},size:function(t){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(t)}}),Object.assign(Kt.prototype,{center:function(t){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(t)},empty:function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(t){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},isIntersectionSphere:function(t){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(t)},size:function(t){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(t)}}),Gn.prototype.setFromMatrix=function(t){return console.warn("THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix()."),this.setFromProjectionMatrix(t)},_u.prototype.center=function(t){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(t)},Object.assign(Q,{random16:function(){return console.warn("THREE.Math: .random16() has been deprecated. Use Math.random() instead."),Math.random()},nearestPowerOfTwo:function(t){return console.warn("THREE.Math: .nearestPowerOfTwo() has been renamed to .floorPowerOfTwo()."),Q.floorPowerOfTwo(t)},nextPowerOfTwo:function(t){return console.warn("THREE.Math: .nextPowerOfTwo() has been renamed to .ceilPowerOfTwo()."),Q.ceilPowerOfTwo(t)}}),Object.assign(et.prototype,{flattenToArrayOffset:function(t,e){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(t,e)},multiplyVector3:function(t){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),t.applyMatrix3(this)},multiplyVector3Array:function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")},applyToBufferAttribute:function(t){return console.warn("THREE.Matrix3: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix3( matrix ) instead."),t.applyMatrix3(this)},applyToVector3Array:function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")}}),Object.assign(xt.prototype,{extractPosition:function(t){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(t)},flattenToArrayOffset:function(t,e){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(t,e)},getPosition:function(){return console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),(new ht).setFromMatrixColumn(this,3)},setRotationFromQuaternion:function(t){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(t)},multiplyToArray:function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")},multiplyVector3:function(t){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},multiplyVector4:function(t){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},multiplyVector3Array:function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")},rotateAxis:function(t){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),t.transformDirection(this)},crossVector:function(t){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},translate:function(){console.error("THREE.Matrix4: .translate() has been removed.")},rotateX:function(){console.error("THREE.Matrix4: .rotateX() has been removed.")},rotateY:function(){console.error("THREE.Matrix4: .rotateY() has been removed.")},rotateZ:function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")},rotateByAxis:function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},applyToBufferAttribute:function(t){return console.warn("THREE.Matrix4: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},applyToVector3Array:function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},makeFrustum:function(t,e,n,r,i,a){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(t,e,r,n,i,a)}}),pe.prototype.isIntersectionLine=function(t){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(t)},lt.prototype.multiplyVector3=function(t){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),t.applyQuaternion(this)},Object.assign(ue.prototype,{isIntersectionBox:function(t){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},isIntersectionPlane:function(t){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(t)},isIntersectionSphere:function(t){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(t)}}),Object.assign(Se.prototype,{area:function(){return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."),this.getArea()},barycoordFromPoint:function(t,e){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),this.getBarycoord(t,e)},midpoint:function(t){return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."),this.getMidpoint(t)},normal:function(t){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),this.getNormal(t)},plane:function(t){return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."),this.getPlane(t)}}),Object.assign(Se,{barycoordFromPoint:function(t,e,n,r,i){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),Se.getBarycoord(t,e,n,r,i)},normal:function(t,e,n,r){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),Se.getNormal(t,e,n,r)}}),Object.assign(Ks.prototype,{extractAllPoints:function(t){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(t)},extrude:function(t){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new Mo(this,t)},makeGeometry:function(t){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new ko(this,t)}}),Object.assign(tt.prototype,{fromAttribute:function(t,e,n){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,n)},distanceToManhattan:function(t){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(t)},lengthManhattan:function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(ht.prototype,{setEulerFromRotationMatrix:function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},setEulerFromQuaternion:function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},getPositionFromMatrix:function(t){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(t)},getScaleFromMatrix:function(t){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(t)},getColumnFromMatrix:function(t,e){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(e,t)},applyProjection:function(t){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(t)},fromAttribute:function(t,e,n){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,n)},distanceToManhattan:function(t){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(t)},lengthManhattan:function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(at.prototype,{fromAttribute:function(t,e,n){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,n)},lengthManhattan:function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(Dn.prototype,{computeTangents:function(){console.error("THREE.Geometry: .computeTangents() has been removed.")},computeLineDistances:function(){console.error("THREE.Geometry: .computeLineDistances() has been removed. Use THREE.Line.computeLineDistances() instead.")},applyMatrix:function(t){return console.warn("THREE.Geometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(t)}}),Object.assign(Ft.prototype,{getChildByName:function(t){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(t)},renderDepth:function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},translate:function(t,e){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(e,t)},getWorldRotation:function(){console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.")},applyMatrix:function(t){return console.warn("THREE.Object3D: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(t)}}),Object.defineProperties(Ft.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(t){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=t}},useQuaternion:{get:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}}),Object.assign(wn.prototype,{setDrawMode:function(){console.error("THREE.Mesh: .setDrawMode() has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}),Object.defineProperties(wn.prototype,{drawMode:{get:function(){return console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode."),0},set:function(){console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}}),Object.defineProperties(ea.prototype,{objects:{get:function(){return console.warn("THREE.LOD: .objects has been renamed to .levels."),this.levels}}}),Object.defineProperty(aa.prototype,"useVertexTexture",{get:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")},set:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")}}),na.prototype.initBones=function(){console.error("THREE.SkinnedMesh: initBones() has been removed.")},Object.defineProperty(Os.prototype,"__arcLengthDivisions",{get:function(){return console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions},set:function(t){console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions=t}}),Bn.prototype.setLens=function(t,e){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),void 0!==e&&(this.filmGauge=e),this.setFocalLength(t)},Object.defineProperties(Qs.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(t){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=t}},shadowCameraLeft:{set:function(t){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=t}},shadowCameraRight:{set:function(t){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=t}},shadowCameraTop:{set:function(t){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=t}},shadowCameraBottom:{set:function(t){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=t}},shadowCameraNear:{set:function(t){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=t}},shadowCameraFar:{set:function(t){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=t}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(t){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=t}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(t){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=t}},shadowMapHeight:{set:function(t){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=t}}}),Object.defineProperties(Fe.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."),this.array.length}},dynamic:{get:function(){return console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.usage===X},set:function(){console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.setUsage(X)}}}),Object.assign(Fe.prototype,{setDynamic:function(t){return console.warn("THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===t?X:q),this},copyIndicesArray:function(){console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed.")},setArray:function(){console.error("THREE.BufferAttribute: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")}}),Object.assign(nn.prototype,{addIndex:function(t){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(t)},addAttribute:function(t,e){return console.warn("THREE.BufferGeometry: .addAttribute() has been renamed to .setAttribute()."),e&&e.isBufferAttribute||e&&e.isInterleavedBufferAttribute?"index"===t?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(e),this):this.setAttribute(t,e):(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.setAttribute(t,new Fe(e,arguments[2])))},addDrawCall:function(t,e,n){void 0!==n&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(t,e)},clearDrawCalls:function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()},computeTangents:function(){console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")},computeOffsets:function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")},removeAttribute:function(t){return console.warn("THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute()."),this.deleteAttribute(t)},applyMatrix:function(t){return console.warn("THREE.BufferGeometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(t)}}),Object.defineProperties(nn.prototype,{drawcalls:{get:function(){return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),this.groups}},offsets:{get:function(){return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),this.groups}}}),Object.defineProperties(Ii.prototype,{dynamic:{get:function(){return console.warn("THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead."),this.usage===X},set:function(t){console.warn("THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead."),this.setUsage(t)}}}),Object.assign(Ii.prototype,{setDynamic:function(t){return console.warn("THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===t?X:q),this},setArray:function(){console.error("THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")}}),Object.assign(So.prototype,{getArrays:function(){console.error("THREE.ExtrudeBufferGeometry: .getArrays() has been removed.")},addShapeList:function(){console.error("THREE.ExtrudeBufferGeometry: .addShapeList() has been removed.")},addShape:function(){console.error("THREE.ExtrudeBufferGeometry: .addShape() has been removed.")}}),Object.defineProperties(hu.prototype,{dynamic:{set:function(){console.warn("THREE.Uniform: .dynamic has been removed. Use object.onBeforeRender() instead.")}},onUpdate:{value:function(){return console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead."),this}}}),Object.defineProperties(Ie.prototype,{wrapAround:{get:function(){console.warn("THREE.Material: .wrapAround has been removed.")},set:function(){console.warn("THREE.Material: .wrapAround has been removed.")}},overdraw:{get:function(){console.warn("THREE.Material: .overdraw has been removed.")},set:function(){console.warn("THREE.Material: .overdraw has been removed.")}},wrapRGB:{get:function(){return console.warn("THREE.Material: .wrapRGB has been removed."),new De}},shading:{get:function(){console.error("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(t){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===t}},stencilMask:{get:function(){return console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask},set:function(t){console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask=t}}}),Object.defineProperties(Zo.prototype,{metal:{get:function(){return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),!1},set:function(){console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")}}}),Object.defineProperties(In.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(t){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=t}}}),Object.assign(Li.prototype,{clearTarget:function(t,e,n,r){console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."),this.setRenderTarget(t),this.clear(e,n,r)},animate:function(t){console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."),this.setAnimationLoop(t)},getCurrentRenderTarget:function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()},getMaxAnisotropy:function(){return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."),this.capabilities.getMaxAnisotropy()},getPrecision:function(){return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."),this.capabilities.precision},resetGLState:function(){return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."),this.state.reset()},supportsFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")},supportsHalfFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")},supportsStandardDerivatives:function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")},supportsCompressedTextureS3TC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")},supportsCompressedTexturePVRTC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")},supportsBlendMinMax:function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")},supportsVertexTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures},supportsInstancedArrays:function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")},enableScissorTest:function(t){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(t)},initMaterial:function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},addPrePlugin:function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},addPostPlugin:function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},updateShadowMap:function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")},setFaceCulling:function(){console.warn("THREE.WebGLRenderer: .setFaceCulling() has been removed.")},allocTextureUnit:function(){console.warn("THREE.WebGLRenderer: .allocTextureUnit() has been removed.")},setTexture:function(){console.warn("THREE.WebGLRenderer: .setTexture() has been removed.")},setTexture2D:function(){console.warn("THREE.WebGLRenderer: .setTexture2D() has been removed.")},setTextureCube:function(){console.warn("THREE.WebGLRenderer: .setTextureCube() has been removed.")},getActiveMipMapLevel:function(){return console.warn("THREE.WebGLRenderer: .getActiveMipMapLevel() is now .getActiveMipmapLevel()."),this.getActiveMipmapLevel()}}),Object.defineProperties(Li.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(t){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=t}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(t){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=t}},shadowMapCullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")}},context:{get:function(){return console.warn("THREE.WebGLRenderer: .context has been removed. Use .getContext() instead."),this.getContext()}},vr:{get:function(){return console.warn("THREE.WebGLRenderer: .vr has been renamed to .xr"),this.xr}},gammaInput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead."),!1},set:function(){console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead.")}},gammaOutput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),!1},set:function(t){console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),this.outputEncoding=!0===t?z:j}}}),Object.defineProperties(_i.prototype,{cullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")}},renderReverseSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")}},renderSingleSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")}}}),Object.defineProperties(ot.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(t){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=t}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(t){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=t}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(t){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=t}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(t){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=t}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(t){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=t}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(t){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=t}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(t){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=t}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(t){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=t}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(t){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=t}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(t){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=t}}}),Object.defineProperties(Gl.prototype,{load:{value:function(t){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");var e=this;return(new Dl).load(t,function(t){e.setBuffer(t)}),this}},startTime:{set:function(){console.warn("THREE.Audio: .startTime is now .play( delay ).")}}}),Xl.prototype.getData=function(){return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."),this.getFrequencyData()},Fn.prototype.updateCubeMap=function(t,e){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update()."),this.update(t,e)};var Ic={merge:function(t,e,n){var r;console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead."),e.isMesh&&(e.matrixAutoUpdate&&e.updateMatrix(),r=e.matrix,e=e.geometry),t.merge(e,r,n)},center:function(t){return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),t.center()}};nt.crossOrigin=void 0,nt.loadTexture=function(t,e,n,r){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");var i=new As;i.setCrossOrigin(this.crossOrigin);var a=i.load(t,n,void 0,r);return e&&(a.mapping=e),a},nt.loadTextureCube=function(t,e,n,r){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");var i=new Ds;i.setCrossOrigin(this.crossOrigin);var a=i.load(t,n,void 0,r);return e&&(a.mapping=e),a},nt.loadCompressedTexture=function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},nt.loadCompressedTextureCube=function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")};var kc={createMultiMaterialObject:function(){console.error("THREE.SceneUtils has been moved to /examples/js/utils/SceneUtils.js")},detach:function(){console.error("THREE.SceneUtils has been moved to /examples/js/utils/SceneUtils.js")},attach:function(){console.error("THREE.SceneUtils has been moved to /examples/js/utils/SceneUtils.js")}};"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:"113"}})),t.ACESFilmicToneMapping=5,t.AddEquation=e,t.AddOperation=2,t.AdditiveBlending=2,t.AlphaFormat=1021,t.AlwaysDepth=1,t.AlwaysStencilFunc=519,t.AmbientLight=ul,t.AmbientLightProbe=Pl,t.AnimationClip=gs,t.AnimationLoader=Ss,t.AnimationMixer=cu,t.AnimationObjectGroup=lu,t.AnimationUtils=rs,t.ArcCurve=Ps,t.ArrayCamera=Di,t.ArrowHelper=Ku,t.Audio=Gl,t.AudioAnalyser=Xl,t.AudioContext=El,t.AudioListener=Vl,t.AudioLoader=Dl,t.AxesHelper=Qu,t.AxisHelper=function(t){return console.warn("THREE.AxisHelper has been renamed to THREE.AxesHelper."),new Qu(t)},t.BackSide=1,t.BasicDepthPacking=3200,t.BasicShadowMap=0,t.BinaryTextureLoader=function(t){return console.warn("THREE.BinaryTextureLoader has been renamed to THREE.DataTextureLoader."),new Cs(t)},t.Bone=oa,t.BooleanKeyframeTrack=us,t.BoundingBoxHelper=function(t,e){return console.warn("THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead."),new Ju(t,e)},t.Box2=xu,t.Box3=Kt,t.Box3Helper=qu,t.BoxBufferGeometry=On,t.BoxGeometry=An,t.BoxHelper=Ju,t.BufferAttribute=Fe,t.BufferGeometry=nn,t.BufferGeometryLoader=ml,t.ByteType=1010,t.Cache=ys,t.Camera=kn,t.CameraHelper=Uu,t.CanvasRenderer=function(){console.error("THREE.CanvasRenderer has been removed")},t.CanvasTexture=Pa,t.CatmullRomCurve3=Ns,t.CineonToneMapping=4,t.CircleBufferGeometry=Ho,t.CircleGeometry=Uo,t.ClampToEdgeWrapping=l,t.Clock=Bl,t.ClosedSplineCurve3=Lc,t.Color=De,t.ColorKeyframeTrack=cs,t.CompressedTexture=La,t.CompressedTextureLoader=Ts,t.ConeBufferGeometry=Go,t.ConeGeometry=Vo,t.CubeCamera=Fn,t.CubeGeometry=An,t.CubeReflectionMapping=n,t.CubeRefractionMapping=r,t.CubeTexture=Kn,t.CubeTextureLoader=Ds,t.CubeUVReflectionMapping=a,t.CubeUVRefractionMapping=o,t.CubicBezierCurve=Gs,t.CubicBezierCurve3=Us,t.CubicInterpolant=as,t.CullFaceBack=1,t.CullFaceFront=2,t.CullFaceFrontBack=3,t.CullFaceNone=0,t.Curve=Os,t.CurvePath=Zs,t.CustomBlending=5,t.CylinderBufferGeometry=zo,t.CylinderGeometry=jo,t.Cylindrical=vu,t.DataTexture=jn,t.DataTexture2DArray=Qn,t.DataTexture3D=tr,t.DataTextureLoader=Cs,t.DecrementStencilOp=7683,t.DecrementWrapStencilOp=34056,t.DefaultLoadingManager=bs,t.DepthFormat=S,t.DepthStencilFormat=T,t.DepthTexture=Ra,t.DirectionalLight=ll,t.DirectionalLightHelper=zu,t.DirectionalLightShadow=sl,t.DiscreteInterpolant=ss,t.DodecahedronBufferGeometry=Ja,t.DodecahedronGeometry=Wa,t.DoubleSide=2,t.DstAlphaFactor=206,t.DstColorFactor=208,t.DynamicBufferAttribute=function(t,e){return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setUsage( THREE.DynamicDrawUsage ) instead."),new Fe(t,e).setUsage(X)},t.DynamicCopyUsage=35050,t.DynamicDrawUsage=X,t.DynamicReadUsage=35049,t.EdgesGeometry=No,t.EdgesHelper=function(t,e){return console.warn("THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead."),new wa(new No(t.geometry),new da({color:void 0!==e?e:16777215}))},t.EllipseCurve=Ls,t.EqualDepth=4,t.EqualStencilFunc=514,t.EquirectangularReflectionMapping=303,t.EquirectangularRefractionMapping=i,t.Euler=_t,t.EventDispatcher=Y,t.ExtrudeBufferGeometry=So,t.ExtrudeGeometry=Mo,t.Face3=Pe,t.Face4=function(t,e,n,r,i,a,o){return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),new Pe(t,e,n,i,a,o)},t.FaceColors=1,t.FileLoader=Ms,t.FlatShading=1,t.Float32Attribute=function(t,e){return console.warn("THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead."),new We(t,e)},t.Float32BufferAttribute=We,t.Float64Attribute=function(t,e){return console.warn("THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead."),new Je(t,e)},t.Float64BufferAttribute=Je,t.FloatType=x,t.Fog=Ri,t.FogExp2=Pi,t.Font=Sl,t.FontLoader=Cl,t.FrontFaceDirectionCCW=1,t.FrontFaceDirectionCW=0,t.FrontSide=0,t.Frustum=Gn,t.GammaEncoding=V,t.Geometry=Dn,t.GeometryUtils=Ic,t.GreaterDepth=6,t.GreaterEqualDepth=5,t.GreaterEqualStencilFunc=518,t.GreaterStencilFunc=516,t.GridHelper=ku,t.Group=Ai,t.HalfFloatType=b,t.HemisphereLight=tl,t.HemisphereLightHelper=Iu,t.HemisphereLightProbe=Ll,t.IcosahedronBufferGeometry=Ha,t.IcosahedronGeometry=Ua,t.ImageBitmapLoader=_l,t.ImageLoader=Es,t.ImageUtils=nt,t.ImmediateRenderObject=Mu,t.IncrementStencilOp=7682,t.IncrementWrapStencilOp=34055,t.InstancedBufferAttribute=fl,t.InstancedBufferGeometry=pl,t.InstancedInterleavedBuffer=du,t.InstancedMesh=ha,t.Int16Attribute=function(t,e){return console.warn("THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead."),new Ve(t,e)},t.Int16BufferAttribute=Ve,t.Int32Attribute=function(t,e){return console.warn("THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead."),new Ue(t,e)},t.Int32BufferAttribute=Ue,t.Int8Attribute=function(t,e){return console.warn("THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead."),new Ne(t,e)},t.Int8BufferAttribute=Ne,t.IntType=1013,t.InterleavedBuffer=Ii,t.InterleavedBufferAttribute=Fi,t.Interpolant=is,t.InterpolateDiscrete=I,t.InterpolateLinear=k,t.InterpolateSmooth=2302,t.InvertStencilOp=5386,t.JSONLoader=function(){console.error("THREE.JSONLoader has been removed.")},t.KeepStencilOp=J,t.KeyframeTrack=ls,t.LOD=ea,t.LatheBufferGeometry=Io,t.LatheGeometry=Ro,t.Layers=Mt,t.LensFlare=function(){console.error("THREE.LensFlare has been moved to /examples/js/objects/Lensflare.js")},t.LessDepth=2,t.LessEqualDepth=3,t.LessEqualStencilFunc=515,t.LessStencilFunc=513,t.Light=Qs,t.LightProbe=Ol,t.LightShadow=el,t.Line=ya,t.Line3=_u,t.LineBasicMaterial=da,t.LineCurve=Hs,t.LineCurve3=Ws,t.LineDashedMaterial=es,t.LineLoop=_a,t.LinePieces=1,t.LineSegments=wa,t.LineStrip=0,t.LinearEncoding=j,t.LinearFilter=p,t.LinearInterpolant=os,t.LinearMipMapLinearFilter=1008,t.LinearMipMapNearestFilter=1007,t.LinearMipmapLinearFilter=m,t.LinearMipmapNearestFilter=f,t.LinearToneMapping=1,t.Loader=ws,t.LoaderUtils=dl,t.LoadingManager=xs,t.LogLuvEncoding=3003,t.LoopOnce=2200,t.LoopPingPong=2202,t.LoopRepeat=2201,t.LuminanceAlphaFormat=1025,t.LuminanceFormat=1024,t.MOUSE={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},t.Material=Ie,t.MaterialLoader=hl,t.Math=Q,t.MathUtils=Q,t.Matrix3=et,t.Matrix4=xt,t.MaxEquation=104,t.Mesh=wn,t.MeshBasicMaterial=ke,t.MeshDepthMaterial=bi,t.MeshDistanceMaterial=wi,t.MeshFaceMaterial=function(t){return console.warn("THREE.MeshFaceMaterial has been removed. Use an Array instead."),t},t.MeshLambertMaterial=Qo,t.MeshMatcapMaterial=ts,t.MeshNormalMaterial=Ko,t.MeshPhongMaterial=Zo,t.MeshPhysicalMaterial=Yo,t.MeshStandardMaterial=Xo,t.MeshToonMaterial=$o,t.MinEquation=103,t.MirroredRepeatWrapping=u,t.MixOperation=1,t.MultiMaterial=function(t){return void 0===t&&(t=[]),console.warn("THREE.MultiMaterial has been removed. Use an Array instead."),t.isMultiMaterial=!0,(t.materials=t).clone=function(){return t.slice()},t},t.MultiplyBlending=4,t.MultiplyOperation=0,t.NearestFilter=c,t.NearestMipMapLinearFilter=1005,t.NearestMipMapNearestFilter=1004,t.NearestMipmapLinearFilter=d,t.NearestMipmapNearestFilter=h,t.NeverDepth=0,t.NeverStencilFunc=512,t.NoBlending=0,t.NoColors=0,t.NoToneMapping=0,t.NormalBlending=1,t.NotEqualDepth=7,t.NotEqualStencilFunc=517,t.NumberKeyframeTrack=hs,t.Object3D=Ft,t.ObjectLoader=vl,t.ObjectSpaceNormalMap=1,t.OctahedronBufferGeometry=Ga,t.OctahedronGeometry=Va,t.OneFactor=201,t.OneMinusDstAlphaFactor=207,t.OneMinusDstColorFactor=209,t.OneMinusSrcAlphaFactor=205,t.OneMinusSrcColorFactor=203,t.OrthographicCamera=ol,t.PCFShadowMap=1,t.PCFSoftShadowMap=2,t.PMREMGenerator=bc,t.ParametricBufferGeometry=Ba,t.ParametricGeometry=ka,t.Particle=function(t){return console.warn("THREE.Particle has been renamed to THREE.Sprite."),new $i(t)},t.ParticleBasicMaterial=function(t){return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),new Ma(t)},t.ParticleSystem=function(t,e){return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),new Da(t,e)},t.ParticleSystemMaterial=function(t){return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),new Ma(t)},t.Path=$s,t.PerspectiveCamera=Bn,t.Plane=pe,t.PlaneBufferGeometry=Jn,t.PlaneGeometry=Wn,t.PlaneHelper=Xu,t.PointCloud=function(t,e){return console.warn("THREE.PointCloud has been renamed to THREE.Points."),new Da(t,e)},t.PointCloudMaterial=function(t){return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),new Ma(t)},t.PointLight=al,t.PointLightHelper=Ou,t.Points=Da,t.PointsMaterial=Ma,t.PolarGridHelper=Bu,t.PolyhedronBufferGeometry=Na,t.PolyhedronGeometry=Fa,t.PositionalAudio=ql,t.PropertyBinding=su,t.PropertyMixer=Yl,t.QuadraticBezierCurve=Js,t.QuadraticBezierCurve3=qs,t.Quaternion=lt,t.QuaternionKeyframeTrack=ps,t.QuaternionLinearInterpolant=ds,t.REVISION="113",t.RGBADepthPacking=3201,t.RGBAFormat=M,t.RGBAIntegerFormat=1033,t.RGBA_ASTC_10x10_Format=37819,t.RGBA_ASTC_10x5_Format=37816,t.RGBA_ASTC_10x6_Format=37817,t.RGBA_ASTC_10x8_Format=37818,t.RGBA_ASTC_12x10_Format=37820,t.RGBA_ASTC_12x12_Format=37821,t.RGBA_ASTC_4x4_Format=37808,t.RGBA_ASTC_5x4_Format=37809,t.RGBA_ASTC_5x5_Format=37810,t.RGBA_ASTC_6x5_Format=37811,t.RGBA_ASTC_6x6_Format=37812,t.RGBA_ASTC_8x5_Format=37813,t.RGBA_ASTC_8x6_Format=37814,t.RGBA_ASTC_8x8_Format=37815,t.RGBA_PVRTC_2BPPV1_Format=R,t.RGBA_PVRTC_4BPPV1_Format=P,t.RGBA_S3TC_DXT1_Format=E,t.RGBA_S3TC_DXT3_Format=D,t.RGBA_S3TC_DXT5_Format=A,t.RGBDEncoding=W,t.RGBEEncoding=G,t.RGBEFormat=1023,t.RGBFormat=_,t.RGBIntegerFormat=1032,t.RGBM16Encoding=H,t.RGBM7Encoding=U,t.RGB_ETC1_Format=36196,t.RGB_PVRTC_2BPPV1_Format=L,t.RGB_PVRTC_4BPPV1_Format=O,t.RGB_S3TC_DXT1_Format=C,t.RGFormat=1030,t.RGIntegerFormat=1031,t.RawShaderMaterial=qo,t.Ray=ue,t.Raycaster=pu,t.RectAreaLight=cl,t.RedFormat=1028,t.RedIntegerFormat=1029,t.ReinhardToneMapping=2,t.RepeatWrapping=s,t.ReplaceStencilOp=7681,t.ReverseSubtractEquation=102,t.RingBufferGeometry=Po,t.RingGeometry=Lo,t.Scene=Nt,t.SceneUtils=kc,t.ShaderChunk=qn,t.ShaderLib=Xn,t.ShaderMaterial=In,t.ShadowMaterial=Jo,t.Shape=Ks,t.ShapeBufferGeometry=Bo,t.ShapeGeometry=ko,t.ShapePath=Ml,t.ShapeUtils=bo,t.ShortType=1011,t.Skeleton=aa,t.SkeletonHelper=Au,t.SkinnedMesh=na,t.SmoothShading=2,t.Sphere=ee,t.SphereBufferGeometry=Oo,t.SphereGeometry=Ao,t.Spherical=gu,t.SphericalHarmonics3=Al,t.SphericalReflectionMapping=305,t.Spline=Rc,t.SplineCurve=Xs,t.SplineCurve3=Pc,t.SpotLight=rl,t.SpotLightHelper=Tu,t.SpotLightShadow=nl,t.Sprite=$i,t.SpriteMaterial=Ni,t.SrcAlphaFactor=204,t.SrcAlphaSaturateFactor=210,t.SrcColorFactor=202,t.StaticCopyUsage=35046,t.StaticDrawUsage=q,t.StaticReadUsage=35045,t.StereoCamera=kl,t.StreamCopyUsage=35042,t.StreamDrawUsage=35040,t.StreamReadUsage=35041,t.StringKeyframeTrack=fs,t.SubtractEquation=101,t.SubtractiveBlending=3,t.TOUCH={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},t.TangentSpaceNormalMap=0,t.TetrahedronBufferGeometry=za,t.TetrahedronGeometry=ja,t.TextBufferGeometry=Do,t.TextGeometry=Eo,t.Texture=it,t.TextureLoader=As,t.TorusBufferGeometry=Ka,t.TorusGeometry=$a,t.TorusKnotBufferGeometry=Za,t.TorusKnotGeometry=Ya,t.Triangle=Se,t.TriangleFanDrawMode=2,t.TriangleStripDrawMode=1,t.TrianglesDrawMode=0,t.TubeBufferGeometry=Xa,t.TubeGeometry=qa,t.UVMapping=300,t.Uint16Attribute=function(t,e){return console.warn("THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead."),new Ge(t,e)},t.Uint16BufferAttribute=Ge,t.Uint32Attribute=function(t,e){return console.warn("THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead."),new He(t,e)},t.Uint32BufferAttribute=He,t.Uint8Attribute=function(t,e){return console.warn("THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead."),new je(t,e)},t.Uint8BufferAttribute=je,t.Uint8ClampedAttribute=function(t,e){return console.warn("THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead."),new ze(t,e)},t.Uint8ClampedBufferAttribute=ze,t.Uncharted2ToneMapping=3,t.Uniform=hu,t.UniformsLib=Un,t.UniformsUtils=Rn,t.UnsignedByteType=g,t.UnsignedInt248Type=w,t.UnsignedIntType=y,t.UnsignedShort4444Type=1017,t.UnsignedShort5551Type=1018,t.UnsignedShort565Type=1019,t.UnsignedShortType=v,t.VSMShadowMap=3,t.Vector2=tt,t.Vector3=ht,t.Vector4=at,t.VectorKeyframeTrack=ms,t.Vertex=function(t,e,n){return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),new ht(t,e,n)},t.VertexColors=2,t.VideoTexture=Oa,t.WebGLCubeRenderTarget=Nn,t.WebGLMultisampleRenderTarget=st,t.WebGLRenderTarget=ot,t.WebGLRenderTargetCube=function(t,e,n){return console.warn("THREE.WebGLRenderTargetCube( width, height, options ) is now WebGLCubeRenderTarget( size, options )."),new Nn(t,n)},t.WebGLRenderer=Li,t.WebGLUtils=Ti,t.WireframeGeometry=Ia,t.WireframeHelper=function(t,e){return console.warn("THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead."),new wa(new Ia(t.geometry),new da({color:void 0!==e?e:16777215}))},t.WrapAroundEnding=N,t.XHRLoader=function(t){return console.warn("THREE.XHRLoader has been renamed to THREE.FileLoader."),new Ms(t)},t.ZeroCurvatureEnding=B,t.ZeroFactor=200,t.ZeroSlopeEnding=F,t.ZeroStencilOp=0,t.sRGBEncoding=z,Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof n&&void 0!==e?i(n):"function"==typeof define&&define.amd?define(["exports"],i):i((r=r||self).THREE={})},{}],20:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MrxDbgUtils=void 0;var r,i=t("./Operate/MxEntSelJig"),a=t("./Operate/MxJigCmdManager"),o=t("./UI/MxUiVue");(r=n.MrxDbgUtils||(n.MrxDbgUtils={})).findEntAtPoint=function(t,e,n){return void 0===n&&(n=null),new Promise(function(r){if(t.isMxCAD())t.callCommand("MxCAD_FindEntAtPoint",JSON.stringify(e),function(t){if("string"!=typeof t||t.length<1)r([]);else{var e=JSON.parse(t);r(e.ids)}});else{for(var i=t.findMxEntityAtPoint(e,!0),a=[],o=i.length,s=0;s<o;s++){var l=i[s];if(!n||!n.type||n.type==l.getTypeName()){var u=l.objectId();a.push(u)}}r(a)}})},r.selectEnt=function(t,e){return void 0===e&&(e=null),new Promise(function(n){var r=new i.MxEntSelJig;t&&o.MxUiVue.acutPrintf(t),r.filter=e,r.callRet=function(t){n(t)},a.MxJigCmdManager.runCmd(r)})}},{"./Operate/MxEntSelJig":55,"./Operate/MxJigCmdManager":58,"./UI/MxUiVue":67}],21:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxCADSyncDisplay=n.MxCADDisplayFun=n.MxCADDatabase=n.MxCADLayerTable=n.MxCADLayerTableRecord=n.MxCADDisplayBlockTable=n.MxCADDisplayBlockRecord=n.MxCADDisplayLayerTable=n.MxCADDisplayLayerRecord=n.MxCADDisplayMemorySections=n.MxCADDisplayMemorySection=n.MxCADDisplayMemorySectionType=n.MxCADDisplayBlockInstance=n.MxCADDisplayBlockRef=n.MxCADDisplayClipPlans=n.MxCADDisplayClipPlan=void 0;var r=t("three"),i=t("../MxFun"),a=t("../MxShader"),o=t("./MxCADNetData"),s=t("../MxManager");n.MxCADDisplayClipPlan=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0};var l=function(){this.id=1,this.clipPlanArray=new Array};n.MxCADDisplayClipPlans=l;var u,c,h=function(){this.mat=new r.Matrix4,this.blkRecId=-1,this.blkOwnerId=0,this.layerId=-1,this.color=0,this.clipPlans=new l};n.MxCADDisplayBlockRef=h,n.MxCADDisplayBlockInstance=function(){this.mat=new r.Matrix4,this.clipPlans=new l},(c=u=n.MxCADDisplayMemorySectionType||(n.MxCADDisplayMemorySectionType={}))[c.kLinesType=1]="kLinesType",c[c.kTriangleType=2]="kTriangleType";var d=function(){this.id=0,this.type=u.kLinesType,this.blockId=0,this.layerId=0,this.color=0,this.points=[]};n.MxCADDisplayMemorySection=d;var p=(f.prototype.add=function(t){this.datas.set(t.id,t)},f.prototype.get=function(t){return this.datas.get(t)},f.prototype.remove=function(t){this.datas.delete(t)},f.prototype.has=function(t){return this.datas.has(t)},f.prototype.clearAll=function(){this.datas=new Map},f);function f(){this.datas=new Map}n.MxCADDisplayMemorySections=p;var m=(g.prototype.addColorByLayerMaterial=function(t,e){this.mapColorByLayerMaterial.set(t,e)},g.prototype.upColorToByLayerMaterial=function(t){this.mapColorByLayerMaterial.forEach(function(e){e.uniformsNeedUpdate=!0,e.needsUpdate=!0,e.uniforms={color:{value:t}}})},g.prototype.getId=function(){return this.id},g.prototype.getBlockRecordId=function(){return this.blockRecId},g.prototype.createMemorySectionToEntityArray=function(t){var e=this.mapMemorySectionIdToEntity.get(t);return e||(e=new Array,this.mapMemorySectionIdToEntity.set(t,e),e)},g.prototype.show=function(t){this.mapMemorySectionIdToEntity.forEach(function(e){for(var n in e)e[n].visible=t})},g.prototype.addEntity=function(t,e){this.createMemorySectionToEntityArray(t).push(e)},g.prototype.deleteMemorySectionEntitys=function(t,e){var n=this.mapMemorySectionIdToEntity.get(t);if(!n)return!1;for(var r=n.length,a=0;a<r;a++)i.MxFun.removeThreejsObject(n[a],e);return this.mapMemorySectionIdToEntity.delete(t),this.mapColorByLayerMaterial.delete(t),!0},g.prototype.addClipMaterial=function(t){this.material_clip.push(t)},g.prototype.updataClipMaterial=function(t){for(var e=this.material_clip.length,n=.5*t.width,r=.5*t.height,i=0;i<e;i++)this.material_clip[i].uniforms.vieww.value=n,this.material_clip[i].uniforms.viewh.value=r},g);function g(t,e){this.id=0,this.blockRecId=0,this.mapMemorySectionIdToEntity=new Map,this.mapColorByLayerMaterial=new Map,this.material_clip=[],this.id=t,this.blockRecId=e}n.MxCADDisplayLayerRecord=m;var v=(y.prototype.createLayerRecord=function(t){var e=this.layers.get(t);return e||(e=new m(t,this.blockRecId),this.layers.set(t,e),e)},y.prototype.getLayerRecord=function(t){return this.layers.get(t)},y);function y(t){this.blockRecId=0,this.layers=new Map,this.blockRecId=t}n.MxCADDisplayLayerTable=v;var x=(b.prototype.getId=function(){return this.id},b.prototype.addBlkRef=function(t){this.blkRefs.set(t.id,t)},b.prototype.getAllBlkRef=function(){return this.blkRefs},b.prototype.addInstance=function(t){this.blkInstances.push(t)},b.prototype.deleteAllInstance=function(){this.blkInstances=new Array},b.prototype.deleteBlkRef=function(){this.blkRefs=new Map},b.prototype.getLayerTable=function(){return this.layerTable},b.prototype.getInstances=function(){return this.blkInstances},b.prototype.getInstances_class=function(){for(var t=[],e=new Map,n=this.blkInstances.length,r=0;r<n;r++){var i=this.blkInstances[r];if(0==i.clipPlans.clipPlanArray.length)t.push(i);else{var a=e.get(i.clipPlans.id);null==a&&(a=[],e.set(i.clipPlans.id,a)),a.push(i)}}var o={};return o.aryInstanceNoClip=t,o.mapInstanceClip=e,o},b);function b(t){this.id=0,this.blkRefs=new Map,this.blkInstances=new Array,this.id=t||0,this.layerTable=new v(this.id)}n.MxCADDisplayBlockRecord=x;var w=(_.prototype.crateBlockRecord=function(t){var e=this.blocks.get(t);return null==e&&(e=new x(t),this.blocks.set(t,e)),e},_.prototype.getBlockRecord=function(t){return this.blocks.get(t)},_.prototype.getAllBlockRecord=function(){return this.blocks},_.prototype.reInitData=function(t){this.blocks=new Map,this.curSpaceBlockRecId=t||0,this.crateBlockRecord(this.curSpaceBlockRecId)},_);function _(){this.blocks=new Map,this.curSpaceBlockRecId=0}n.MxCADDisplayBlockTable=w;var M=function(){};n.MxCADLayerTableRecord=M;var S=(T.prototype.add=function(t,e,n,r){var i=new M;i.id=t,i.name=n,i.color=e,i.off=r,this.mapData.set(t,i)},T.prototype.getAllLayerData=function(){for(var t,e=new Array,n=this.mapData.values();!(t=n.next()).done;){var r=new M;r.color=t.value.color,r.name=t.value.name,r.off=t.value.off,r.id=t.value.id,e.push(r)}return e},T.prototype.setZeroLayerId=function(t){this.zeroLayerId=t},T.prototype.getZeroLayerId=function(){return this.zeroLayerId},T.prototype.getLayerIdForName=function(t){for(var e,n=this.mapData.values();!(e=n.next()).done;)if(e.value.name==t)return e.value.id;return 0},T.prototype.getColor=function(t){var e=this.mapData.get(t);return e?e.color:0},T.prototype.getRecord=function(t){return this.mapData.get(t)},T.prototype.isOff=function(t){var e=this.mapData.get(t);return!e||e.off},T.prototype.upDisplayForLayerData=function(t,e){for(var n,r=e,i=r.length,a=!1,o=function(e){var i=r[e],o=i.id;if(0==o)return"continue";var l=s.getRecord(o);if(!l)return"continue";var u=i.color.split(",");if(u.length<3)return"continue";var c=255&parseInt(u[0])|parseInt(u[1])<<8&65280|parseInt(u[2])<<16&16711680;if((16777215&l.color)==c)return"continue";l.color=4278190080&l.color|c,(n=[]).push((255&l.color)/255,(l.color>>8&255)/255,(l.color>>16&255)/255),t.getDisplayBlockTable().getAllBlockRecord().forEach(function(t){var e=t.getLayerTable().getLayerRecord(o);e&&e.upColorToByLayerMaterial(n)}),a=!0},s=this,l=0;l<i;l++)o(l);var u=function(e){var n=r[e],i=n.id;if(0==i)return"continue";var o=c.getRecord(i);return o&&o.off!=n.off?(o.off=n.off,t.getDisplayBlockTable().getAllBlockRecord().forEach(function(t){var e=t.getLayerTable().getLayerRecord(i);e&&e.show(!o.off)}),void(a=!0)):"continue"},c=this;for(l=0;l<i;l++)u(l);return a},T);function T(){this.mapData=new Map,this.zeroLayerId=0}n.MxCADLayerTable=S;var C,E,D=(A.prototype.initRootBlockRef=function(t){t?this.dpRootBlkRef=t:(this.dpRootBlkRef=new h,this.dpRootBlkRef.mat=new r.Matrix4,this.dpRootBlkRef.blkRecId=0,this.dpRootBlkRef.blkOwnerId=-1,this.dpRootBlkRef.layerId=-1,this.dpRootBlkRef.color=16777215,this.dpRootBlkRef.id=0)},A.prototype.reInit=function(){this.dpBlockTable=new w,this.layerTable=new S,this.memSections=new p,this.initRootBlockRef()},A.prototype.getMxObj=function(){return this.mxObj},A.prototype.getDisplayRootBlockRef=function(){return this.dpRootBlkRef},A.prototype.getDisplayBlockTable=function(){return this.dpBlockTable},A.prototype.getLayerTable=function(){return this.layerTable},A.prototype.getMemSections=function(){return this.memSections},A);function A(t){this.dpBlockTable=new w,this.dpRootBlkRef=null,this.layerTable=new S,this.memSections=new p,this.mxObj=null,this.mxObj=t,this.initRootBlockRef()}n.MxCADDatabase=D,(E=C=n.MxCADDisplayFun||(n.MxCADDisplayFun={})).showLayer=function(t,e,n){t.getDisplayBlockTable().getAllBlockRecord().forEach(function(t){var r=t.getLayerTable().getLayerRecord(e);r&&r.show(n)})},E.createThreejsObjForMemData_Clip=function(t,e,n,i,o,l,c){if(0==t.length)return!1;var h=[],d=[],p=t[0].clipPlans.clipPlanArray[0];h.push(p.x1,p.y1),d.push(p.x2,p.y2);for(var f=[],m=[],g=[],v=[],y=[],x=0;x<t.length;x++){var b=t[x];f=f.concat(b.mat.elements.slice(0,4)),m=m.concat(b.mat.elements.slice(4,8)),g=g.concat(b.mat.elements.slice(8,12)),v=v.concat(b.mat.elements.slice(12,16)),y.push(0)}var w=e.color,_=16777216==(4278190080&w);_&&(w=o);var M=[];M.push(255&w,(65280&w)>>8,(16711680&w)>>16);var S=c.getCanvas(),T=.5*S.width,C=.5*S.height;if(e.type==u.kLinesType){var E=new r.RawShaderMaterial({uniforms:{color:{value:M},clippt1:{value:h},clippt2:{value:d},vieww:{value:T},viewh:{value:C}},vertexShader:a.MxShader.VSHADER_COLOR_POINT_CLIP_FORMXCAD,fragmentShader:a.MxShader.FSHADER_COLOR_POINT_CLIP_FORMXCAD,linewidth:1,transparent:!0,side:r.DoubleSide});n.addClipMaterial(E),(A=new r.InstancedBufferGeometry).maxInstancedCount=t.length,A.setAttribute("position",new r.Float32BufferAttribute(e.points,2)),A.setAttribute("tran1",new r.InstancedBufferAttribute(new Float32Array(f),4)),A.setAttribute("tran2",new r.InstancedBufferAttribute(new Float32Array(m),4)),A.setAttribute("tran3",new r.InstancedBufferAttribute(new Float32Array(g),4)),A.setAttribute("tran4",new r.InstancedBufferAttribute(new Float32Array(v),4)),A.setAttribute("ishide",new r.InstancedBufferAttribute(new Float32Array(y),1));var D=new r.LineSegments(A,E);D.frustumCulled=!1,D.renderOrder=s.MxData.iCADCurveRenderOrder,i.add(D),n.addEntity(e.id,D),_&&n.addColorByLayerMaterial(e.id,E)}else if(e.type==u.kTriangleType){var A;E=new r.RawShaderMaterial({uniforms:{color:{value:M},clippt1:{value:h},clippt2:{value:d},vieww:{value:T},viewh:{value:C}},vertexShader:a.MxShader.VSHADER_COLOR_POINT_CLIP_FORMXCAD,fragmentShader:a.MxShader.FSHADER_COLOR_POINT_CLIP_FORMXCAD,transparent:!0,side:r.DoubleSide}),n.addClipMaterial(E),(A=new r.InstancedBufferGeometry).maxInstancedCount=t.length,A.setAttribute("position",new r.Float32BufferAttribute(e.points,2)),A.setAttribute("tran1",new r.InstancedBufferAttribute(new Float32Array(f),4)),A.setAttribute("tran2",new r.InstancedBufferAttribute(new Float32Array(m),4)),A.setAttribute("tran3",new r.InstancedBufferAttribute(new Float32Array(g),4)),A.setAttribute("tran4",new r.InstancedBufferAttribute(new Float32Array(v),4)),A.setAttribute("ishide",new r.InstancedBufferAttribute(new Float32Array(y),1));var O=new r.Mesh(A,E);O.frustumCulled=!1,O.renderOrder=s.MxData.iCADMeshRenderOrder,i.add(O),n.addEntity(e.id,O),_&&n.addColorByLayerMaterial(e.id,E)}},E.createThreejsObjForMemData=function(t,e,n,i,o,l){if(0==t.length)return!1;for(var c=[],h=[],d=[],p=[],f=[],m=0;m<t.length;m++){var g=t[m];c=c.concat(g.mat.elements.slice(0,4)),h=h.concat(g.mat.elements.slice(4,8)),d=d.concat(g.mat.elements.slice(8,12)),p=p.concat(g.mat.elements.slice(12,16)),f.push(0)}var v=e.color,y=16777216==(4278190080&v);y&&(v=o);var x=[];if(x.push((255&v)/255,(v>>8&255)/255,(v>>16&255)/255),e.type==u.kLinesType){var b=new r.RawShaderMaterial({uniforms:{color:{value:x}},vertexShader:a.MxShader.VSHADER_COLOR_POINT_FORMXCAD,fragmentShader:a.MxShader.FSHADER_COLOR_POINT_FORMXCAD,linewidth:1,transparent:!0,side:r.DoubleSide});(_=new r.InstancedBufferGeometry).maxInstancedCount=t.length,_.setAttribute("position",new r.Float32BufferAttribute(e.points,2)),_.setAttribute("tran1",new r.InstancedBufferAttribute(new Float32Array(c),4)),_.setAttribute("tran2",new r.InstancedBufferAttribute(new Float32Array(h),4)),_.setAttribute("tran3",new r.InstancedBufferAttribute(new Float32Array(d),4)),_.setAttribute("tran4",new r.InstancedBufferAttribute(new Float32Array(p),4)),_.setAttribute("ishide",new r.InstancedBufferAttribute(new Float32Array(f),1));var w=new r.LineSegments(_,b);w.frustumCulled=!1,w.renderOrder=s.MxData.iCADCurveRenderOrder,w.visible=!l,i.add(w),n.addEntity(e.id,w),y&&n.addColorByLayerMaterial(e.id,b)}else if(e.type==u.kTriangleType){var _;b=new r.RawShaderMaterial({uniforms:{color:{value:x}},vertexShader:a.MxShader.VSHADER_COLOR_POINT_FORMXCAD,fragmentShader:a.MxShader.FSHADER_COLOR_POINT_FORMXCAD,transparent:!0,side:r.DoubleSide}),(_=new r.InstancedBufferGeometry).maxInstancedCount=t.length,_.setAttribute("position",new r.Float32BufferAttribute(e.points,2)),_.setAttribute("tran1",new r.InstancedBufferAttribute(new Float32Array(c),4)),_.setAttribute("tran2",new r.InstancedBufferAttribute(new Float32Array(h),4)),_.setAttribute("tran3",new r.InstancedBufferAttribute(new Float32Array(d),4)),_.setAttribute("tran4",new r.InstancedBufferAttribute(new Float32Array(p),4)),_.setAttribute("ishide",new r.InstancedBufferAttribute(new Float32Array(f),1));var M=new r.Mesh(_,b);M.frustumCulled=!1,M.renderOrder=s.MxData.iCADMeshRenderOrder,M.visible=!l,i.add(M),n.addEntity(e.id,M),y&&n.addColorByLayerMaterial(e.id,b)}};var O=(L.prototype.upDisplayFromChage_memData=function(t){var e=this.database.getDisplayBlockTable().getBlockRecord(t.blockId);if(null==e)return!1;var n=this.database.getLayerTable().getColor(t.layerId),r=this.database.getLayerTable().isOff(t.layerId),i=e.getLayerTable().createLayerRecord(t.layerId),a=this.mxObj.getScene(),o=e.getInstances_class();i.deleteMemorySectionEntitys(t.id,a);var s=o.aryInstanceNoClip,l=o.mapInstanceClip;0<s.length&&C.createThreejsObjForMemData(s,t,i,a,n,r);for(var u=l.values(),c=u.next();!c.done;){var h=c.value;C.createThreejsObjForMemData_Clip(h,t,i,a,n,r,this.mxObj),c=u.next()}},L.prototype.upDisplayFromChage=function(t){for(var e=t.length,n=0;n<e;n++){var r=t[n];this.upDisplayFromChage_memData(r)}},L.prototype.OnMessageDisplayMemorySectionsFromChange=function(t){for(var e=this.database.getMemSections(),n=new o.MxCADNetData(t),r=n.getMxCADPointMemorySectionsHeadFromChange(),i=r.nOffset,a=[],s=0;s<r.datacount;s++){var l=n.getMxCADPointMemorySectionHeadFromChange(i);i=l.offset;var u=new d;u.layerId=l.layerId,u.blockId=l.blkId,u.id=l.memId,u.color=l.memColor,u.type=l.memType;var c=l.pointCount;if(!(c<1)){for(var h=[],p=0;p<c;p++){var f=t.getFloat32(i,!0);i+=4;var m=t.getFloat32(i,!0);i+=4,h.push(f,m)}u.points=h,e.add(u),a.push(u)}}this.upDisplayFromChage(a)},L.prototype.deleteMemorySectionAndEntity=function(t){var e=this.database.getMemSections(),n=e.get(t);if(!n)return!1;var r=this.database.getDisplayBlockTable().getBlockRecord(n.blockId);if(null==r)return e.remove(n.id),console.log("mx:blkrec null assert(0)"),!1;var i=r.getLayerTable().createLayerRecord(n.layerId),a=this.mxObj.getScene();return i.deleteMemorySectionEntitys(n.id,a),e.remove(n.id),!0},L.prototype.OnMessageDisplayNotUseMemorySectionsForChage=function(t){for(var e=new o.MxCADNetData(t).getMxCADNotUseMemorySectionsHeadForChage(),n=e.nCount,r=e.nOffset,i=0;i<n;i++){var a=t.getInt32(r,!0);r+=4,this.deleteMemorySectionAndEntity(a)}},L);function L(t){this.database=null,this.mxObj=null,this.database=t,this.mxObj=t.getMxObj()}n.MxCADSyncDisplay=O},{"../MxFun":34,"../MxManager":36,"../MxShader":40,"./MxCADNetData":23,three:19}],22:[function(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0}),n.MxCADGripJig=n.MxCADGrip=n.MxCADGripData=void 0;var a=t("three"),o=t("../MxFun"),s=t("../MxThreeJS"),l=t("../Operate/MxJig"),u=t("../Operate/MxJigCmdManager"),c=t("../MxManager"),h=function(){this.threeObject=null};n.MxCADGripData=h;var d=(p.prototype.getParentObject=function(){return this.mxObj.getTheTempDrawContainer()},p.prototype.removeAllEntity=function(){var t=this.getParentObject();this.mapGrips.forEach(function(e,n,r){for(var i=e.length,a=0;a<i;a++){var s=e[a];o.MxFun.removeThreejsObject(s.threeObject,t)}}),this.mapGrips=new Map},p.prototype.deleteGripData=function(t){var e=this.getParentObject(),n=this.mapGrips.get(t);if(n)for(var r=n.length,i=0;i<r;i++){var a=n[i];o.MxFun.removeThreejsObject(a.threeObject,e)}this.mapGrips.delete(t)},p.prototype.deleteEntityData=function(t){this.mapEntityData.delete(t)},p.prototype.addGripData=function(t,e,n,r){var i=this.mapGrips.get(t);null==i&&(i=new Array,this.mapGrips.set(t,i));var o=new h;return o.iIndex=e,o.point=new a.Vector3(n,r,0),i.push(o),o},p.prototype.createGripDisplayObject=function(t){var e=this.getParentObject();t.geometry=new a.Geometry;var n=this.mxObj.screenCoordLong2Doc(8);t.geometry.vertices.push(new a.Vector3(t.point.x-n,t.point.y-n,0)),t.geometry.vertices.push(new a.Vector3(t.point.x-n,t.point.y+n,0)),t.geometry.vertices.push(new a.Vector3(t.point.x+n,t.point.y+n,0)),t.geometry.vertices.push(new a.Vector3(t.point.x+n,t.point.y-n,0)),t.geometry.faces.push(new a.Face3(0,1,2)),t.geometry.faces.push(new a.Face3(2,3,0)),t.geometry.computeFaceNormals(),t.geometry.computeVertexNormals();var r=new a.MeshBasicMaterial({color:255,transparent:!0,depthTest:!1,side:a.DoubleSide,opacity:.9}),i=new a.Mesh(t.geometry,r);i.renderOrder=c.MxData.iGripRenderOrder,e.add(i),t.threeObject=i},p.prototype.clearAll=function(){return this.mapEntityData=new Map,0!=this.mapGrips.size&&(this.removeAllEntity(),!0)},p.prototype.addEntityData=function(t,e){this.mapEntityData.set(t,e)},p.prototype.onIntelliSelect=function(t){for(var e=JSON.parse(t),n=e.vecEntityData.length,r=0;r<n;r++){var i=e.vecEntityData[r],a=i.lIdIndex;this.addEntityData(a,i.entity),this.deleteGripData(a);for(var o=i.vecGrip.length,s=0;s<o;s++){var l=i.vecGrip[s],u=this.addGripData(a,l.iIndex,l.ptx,l.pty);this.createGripDisplayObject(u)}}},p.prototype.onControlsChage=function(){if(0!=this.mapGrips.size){var t=this.mxObj.screenCoordLong2Doc(8);this.mapGrips.forEach(function(e,n,r){for(var i=e.length,a=0;a<i;a++){var o=e[a];4==o.geometry.vertices.length&&(o.geometry.vertices[0].x=o.point.x-t,o.geometry.vertices[0].y=o.point.y-t,o.geometry.vertices[1].x=o.point.x-t,o.geometry.vertices[1].y=o.point.y+t,o.geometry.vertices[2].x=o.point.x+t,o.geometry.vertices[2].y=o.point.y+t,o.geometry.vertices[3].x=o.point.x+t,o.geometry.vertices[3].y=o.point.y-t,o.geometry.computeFaceNormals(),o.geometry.computeVertexNormals(),o.geometry.verticesNeedUpdate=!0)}})}},p.prototype.hitTest=function(t){var e={grips:new Array,ids:new Array,pt:t},n=new a.Vector3(t.x,t.y,0),r=this.mxObj.screenCoordLong2Doc(32);return this.mapGrips.forEach(function(t,i){for(var a=t.length,o=0;o<a;o++){var s=t[o];if(s.point.distanceTo(n)<=r){e.grips.push(s),e.ids.push(i);break}}}),e},p.prototype.onMouseLBDown=function(t){var e=this.hitTest(t);return 0!=e.grips.length&&(o.MxFun.sendStringToExecute("Mx_GripEdit",e),!0)},p.prototype.gripEditImp=function(t){var e=t.grips,n=t.ids,r=t.pt,i=new m(r,e,n,this.mapEntityData);i.setDisableDynInput(!0),i.setDisableOsnap(!0),u.MxJigCmdManager.runCmd(i)},p);function p(t){this.mxObj=null,this.mapGrips=new Map,this.mapEntityData=new Map,this.mxObj=t}n.MxCADGrip=d;var f,m=(i(g,f=l.McEdJigCommand),g.prototype.sampler=function(){var t=u.MxJigCmdManager.InType.kGetBegan,e=this.acquirePoint(t);return e.status==u.MxJigCmdManager.DragStatus.kNormal&&(this.currPt=e.pt),e.status},g.prototype.getTypeName=function(){return"MxGripEdit"},g.prototype.done=function(t){if(t==u.MxJigCmdManager.DragStatus.kNormal){var e=[];e.push(this.currPt.x,this.currPt.y);for(var n=this.getMxObject(),r=n.getMxCAD().getGrip(),i=n.getMxCAD().getSelect(),a=this.grips.length,o=0;o<a;o++){var s=this.grips[o],l=this.ids[o];e.push(l,s.iIndex),r.deleteGripData(l),r.deleteEntityData(l),i.removeAllEntity()}n.callCommand("MxCAD_GridEdit",JSON.stringify(e),function(t){r.onIntelliSelect(t)})}return u.MxJigCmdManager.DoneStatius.kExitCommand},g.prototype.upDisplay_Line=function(t,e){var n=new a.Vector3(t.pt1x,t.pt1y,0),r=new a.Vector3(t.pt2x,t.pt2y,0);if(0==e.iIndex)n.x=this.currPt.x,n.y=this.currPt.y;else if(1==e.iIndex)r.x=this.currPt.x,r.y=this.currPt.y;else if(2==e.iIndex){var i=r.x+.5*(n.x-r.x),o=r.y+.5*(n.y-r.y),l=this.currPt.x-i,u=this.currPt.y-o;n.x+=l,n.y+=u,r.x+=l,r.y+=u}var c=s.MxThreeJS.createLine(n,r,16777215);this.drawEntity(c,31)},g.prototype.upDisplay=function(){for(var t=this.grips.length,e=0;e<t;e++){var n=this.grips[e],r=this.ids[e],i=this.mapEntityData.get(r);i&&"McDbLine"==i.name&&this.upDisplay_Line(i,n)}},g);function g(t,e,n,r){var i=f.call(this)||this;return i.pt=t,i.grips=e,i.ids=n,i.currPt=t,i.mapEntityData=r,i}n.MxCADGripJig=m},{"../MxFun":34,"../MxManager":36,"../MxThreeJS":44,"../Operate/MxJig":57,"../Operate/MxJigCmdManager":58,three:19}],23:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxCADNetData=void 0;var r=(i.prototype.getBlobHead=function(t){var e={};return e.type=this._dataView.getInt32(t,!0),t+=4,e.ver=this._dataView.getInt32(t,!0),t+=4,e.databaseIndex=this._dataView.getInt32(t,!0),t+=4,e.nOffset=t,e},i.prototype.getMxCADPointMemorySectionsHead=function(){var t=this.getBlobHead(0);return t.zeroLayerIdIndex=this._dataView.getInt32(t.nOffset,!0),t.nOffset+=4,t.datacount=this._dataView.getInt32(t.nOffset,!0),t.nOffset+=4,t.datasize=this._dataView.getInt32(t.nOffset,!0),t.nOffset+=4,t.datasize!=t.nOffset&&console.log("mx: sectionshead size assert(0)"),t},i.prototype.getMxCADPointMemorySectionsHeadFromChange=function(){var t=this.getBlobHead(0);return t.zeroLayerIdIndex=this._dataView.getInt32(t.nOffset,!0),t.nOffset+=4,t.datacount=this._dataView.getInt32(t.nOffset,!0),t.nOffset+=4,t.datasize=this._dataView.getInt32(t.nOffset,!0),t.nOffset+=4,t.datasize!=t.nOffset&&console.log("mx: sectionshead size assert(0)"),t},i.prototype.getMxCADPointMemorySectionHead=function(t){var e=this.getBlobHead(t);return t=e.nOffset,e.pointCount=this._dataView.getInt32(t,!0),t+=4,e.layerId=this._dataView.getInt32(t,!0),t+=4,e.blkId=this._dataView.getInt32(t,!0),t+=4,e.memColor=this._dataView.getInt32(t,!0),t+=4,e.memId=this._dataView.getInt32(t,!0),t+=4,e.memType=this._dataView.getInt32(t,!0),t+=4,e.offset=t,e},i.prototype.getMxCADPointMemorySectionHeadFromChange=function(t){var e=this.getBlobHead(t);return t=e.nOffset,e.pointCount=this._dataView.getInt32(t,!0),t+=4,e.layerId=this._dataView.getInt32(t,!0),t+=4,e.blkId=this._dataView.getInt32(t,!0),t+=4,e.memColor=this._dataView.getInt32(t,!0),t+=4,e.memId=this._dataView.getInt32(t,!0),t+=4,e.memType=this._dataView.getInt32(t,!0),t+=4,e.offset=t,e},i.prototype.getMxCADBlockRefsHead=function(){var t=this.getBlobHead(0);return t.nBlockRefCount=this._dataView.getInt32(t.nOffset,!0),t.nOffset+=4,t.datasize=this._dataView.getInt32(t.nOffset,!0),t.nOffset+=4,t.datasize!=t.nOffset&&console.log("mx: sectionshead size assert(0)"),t},i.prototype.getMxCADNotUseMemorySectionsHeadForChage=function(){var t=this.getBlobHead(0);return t.nCount=this._dataView.getInt32(t.nOffset,!0),t.nOffset+=4,t.datasize=this._dataView.getInt32(t.nOffset,!0),t.nOffset+=4,t.datasize!=t.nOffset&&console.log("mx: sectionshead size assert(0)"),t},i.prototype.getEntityDisplayDatasHead=function(){var t=this.getBlobHead(0);return t.nCount=this._dataView.getInt32(t.nOffset,!0),t.nOffset+=4,t.datasize=this._dataView.getInt32(t.nOffset,!0),t.nOffset+=4,t.datasize!=t.nOffset&&console.log("mx: sectionshead size assert(0)"),t},i.prototype.getEntityDisplayDataHead=function(t){var e=this.getBlobHead(t);return e.nCount=this._dataView.getInt32(e.nOffset,!0),e.nOffset+=4,e.type=this._dataView.getInt32(e.nOffset,!0),e.nOffset+=4,e.datasize=this._dataView.getInt32(e.nOffset,!0),e.nOffset+=4,e.datasize!=e.nOffset-t&&console.log("mx: sectionshead size assert(0)"),e},i);function i(t){this._dataView=t}n.MxCADNetData=r},{}],24:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxCADObject=void 0;var r=t("./MxCADEditDisplay"),i=t("./MxCADOpenDisplay"),a=t("./MxCADSelect"),o=t("./MxCADGrip"),s=(l.prototype.reInit=function(){this.openDisplay.reInit(),this.databsae.reInit(),this.mxObj.reInit()},l.prototype.getSelect=function(){return this.select},l.prototype.getGrip=function(){return this.grip},l.prototype.newFile=function(){this.reInit(),this.openFile("")},l.prototype.undo=function(){this.mxObj.undo()},l.prototype.openFile=function(t,e){var n=this;this.reInit(),this._openFile=t,this.mxObj.callCommand("MxCAD_OpenFile",JSON.stringify({file:t}),function(t){n.mxObj.callCommand("MxCAD_SendDisplay"),"string"!=typeof t||t.length<1?e&&e({}):e&&e(JSON.parse(t))})},l.prototype.saveFile=function(t,e){this.mxObj.callCommand("MxCAD_SaveFile",JSON.stringify({file:t}),function(t){e(JSON.parse(t))})},l.prototype.getDisplayFromServer=function(){this.reInit(),this.mxObj.callCommand("MxCAD_SendDisplay")},l.prototype.getFileName=function(){return this._openFile},l.prototype.getDatabase=function(){return this.databsae},l.prototype.getOpenDisplay=function(){return this.openDisplay},l.prototype.getSyncDisplay=function(){return this.syncDisplay},l.prototype.getAllLayerData=function(){return this.databsae.getLayerTable().getAllLayerData()},l);function l(t){this._openFile="",this.mxObj=null,this.databsae=null,this.openDisplay=null,this.syncDisplay=null,this.select=null,this.grip=null,this.mxObj=t,this.databsae=new r.MxCADDatabase(t),this.openDisplay=new i.MxCADOpenDisplay(this.databsae),this.syncDisplay=new r.MxCADSyncDisplay(this.databsae),this.select=new a.MxCADSelect(t),this.grip=new o.MxCADGrip(t)}n.MxCADObject=s},{"./MxCADEditDisplay":21,"./MxCADGrip":22,"./MxCADOpenDisplay":25,"./MxCADSelect":26}],25:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxCADOpenDisplay=void 0;var r=t("three"),i=t("./MxCADNetData"),a=t("./MxCADEditDisplay"),o=(s.prototype.createAllInstanceCall=function(t,e,n,i,o){if(!i.get(t.getId())){i.set(t.getId(),!0);var s=new a.MxCADDisplayBlockInstance;if(s.mat=new r.Matrix4,s.mat.copy(n),s.idBlkRef=e.id,s.mat.multiply(e.mat),0==e.clipPlans.clipPlanArray.length)s.clipPlans=o;else{s.clipPlans=e.clipPlans;for(var l=s.clipPlans.clipPlanArray.length,u=0;u<l;u++){var c=new r.Vector3(s.clipPlans.clipPlanArray[u].x1,s.clipPlans.clipPlanArray[u].y1,0),h=new r.Vector3(s.clipPlans.clipPlanArray[u].x2,s.clipPlans.clipPlanArray[u].y2,0);c.applyMatrix4(s.mat),h.applyMatrix4(s.mat),s.clipPlans.clipPlanArray[u].x1=c.x,s.clipPlans.clipPlanArray[u].y1=c.y,s.clipPlans.clipPlanArray[u].x2=h.x,s.clipPlans.clipPlanArray[u].y2=h.y}}t.addInstance(s);for(var d=this.database.getDisplayBlockTable(),p=t.getAllBlkRef().values(),f=p.next();!f.done;){var m=f.value;if(0!=m.blkRecId){var g=d.getBlockRecord(m.blkRecId);null!=g&&(this.createAllInstanceCall(g,m,s.mat,i,s.clipPlans),f=p.next())}}i.set(t.getId(),!1)}},s.prototype.deleteAllInstance=function(){for(var t=this.database.getDisplayBlockTable().getAllBlockRecord().values(),e=t.next();!e.done;)e.value.deleteAllInstance(),e=t.next()},s.prototype.createAllInstance=function(){this.deleteAllInstance();var t=this.database.getDisplayBlockTable().getBlockRecord(0);if(null==t)return!1;var e=this.database.getDisplayRootBlockRef(),n=new r.Matrix4,i=new Map,o=new a.MxCADDisplayClipPlans;return this.createAllInstanceCall(t,e,n,i,o),this.isCreateInstance=!0},s.prototype.creteDisplayForMemData=function(t){var e=this.database.getDisplayBlockTable().getBlockRecord(t.blockId);if(null==e)return!1;var n=e.getLayerTable().createLayerRecord(t.layerId),r=this.database.getLayerTable().getColor(t.layerId),i=this.database.getLayerTable().isOff(t.layerId),o=this.mxObj.getScene(),s=e.getInstances_class(),l=s.aryInstanceNoClip,u=s.mapInstanceClip;0<l.length&&a.MxCADDisplayFun.createThreejsObjForMemData(l,t,n,o,r,i);for(var c=u.values(),h=c.next();!h.done;){var d=h.value;a.MxCADDisplayFun.createThreejsObjForMemData_Clip(d,t,n,o,r,i,this.mxObj),h=c.next()}},s.prototype.creteDisplayForNewData=function(){if(this.isCreateInstance||this.isGetDisplayBlockRef&&this.isGetLayerTable&&this.createAllInstance(),this.isCreateInstance){for(var t=this.vecNewCreateDisplayData.length,e=0;e<t;e++){var n=this.vecNewCreateDisplayData[e];this.creteDisplayForMemData(n)}this.vecNewCreateDisplayData=[]}},s.prototype.reInit=function(){this.isGetDisplayBlockRef=!1,this.isCreateInstance=!1,this.isGetLayerTable=!1,this.vecNewCreateDisplayData=[]},s.prototype.getMxOb=function(){return this.mxObj},s.prototype.OnMessageLayerData=function(t){var e=this.database.getLayerTable(),n=JSON.parse(t);if(null!=n){var r=n.list;for(var i in r)e.add(r[i].id,r[i].colorvalue,r[i].name,1==r[i].off),1==r[i].zerolayer&&e.setZeroLayerId(r[i].id)}this.isGetLayerTable=!0,this.creteDisplayForNewData()},s.prototype.OnMessageDisplayBlockRef=function(t){var e=this.database.getDisplayBlockTable();e.reInitData(),this.isCreateInstance=!1;for(var n=new i.MxCADNetData(t).getMxCADBlockRefsHead(),o=n.nBlockRefCount,s=n.nOffset,l=1,u=0;u<o;u++){var c=t.getInt32(s,!0);s+=4;var h=t.getInt32(s,!0);s+=4;var d=t.getInt32(s,!0);s+=4;var p=t.getInt32(s,!0);s+=4;var f=t.getInt32(s,!0);s+=4;for(var m=new Array,g=0;g<16;g++){var v=t.getFloat32(s,!0);s+=4,m.push(v)}var y=t.getInt32(s,!0);s+=4;var x=new a.MxCADDisplayClipPlans;x.id=l,l++,x.clipPlanArray=[];for(var b=0;b<y;b++){var w=t.getFloat32(s,!0);s+=4;var _=t.getFloat32(s,!0);s+=4;var M=t.getFloat32(s,!0);s+=4;var S=t.getFloat32(s,!0);s+=4;var T=new a.MxCADDisplayClipPlan;T.x1=w,T.y1=_,T.x2=M,T.y2=S,x.clipPlanArray.push(T)}var C=new a.MxCADDisplayBlockRef;C.mat=new r.Matrix4,C.mat.fromArray(m),C.blkRecId=p,C.blkOwnerId=h,C.layerId=d,C.color=f,C.clipPlans=x,C.id=c,e.crateBlockRecord(p),e.crateBlockRecord(h);var E=e.getBlockRecord(h);E?E.addBlkRef(C):console.log("ownerBlkRec == null,assert(0)")}this.isGetDisplayBlockRef=!0,this.creteDisplayForNewData()},s.prototype.OnMessageDisplayMemorySections=function(t){for(var e=this.database.getMemSections(),n=new i.MxCADNetData(t),r=n.getMxCADPointMemorySectionsHead(),o=r.nOffset,s=0;s<r.datacount;s++){var l=n.getMxCADPointMemorySectionHead(o);o=l.offset;var u=new a.MxCADDisplayMemorySection;u.layerId=l.layerId,u.blockId=l.blkId,u.id=l.memId,u.color=l.memColor,u.type=l.memType;var c=l.pointCount;if(!(c<1)){for(var h=[],d=0;d<c;d++){var p=t.getFloat32(o,!0);o+=4;var f=t.getFloat32(o,!0);o+=4,h.push(p,f)}u.points=h,e.add(u),this.vecNewCreateDisplayData.push(u)}}this.creteDisplayForNewData()},s);function s(t){this.database=null,this.isGetDisplayBlockRef=!1,this.isCreateInstance=!1,this.isGetLayerTable=!1,this.vecNewCreateDisplayData=[],this.mxObj=null,this.database=t,this.mxObj=t.getMxObj()}n.MxCADOpenDisplay=o},{"./MxCADEditDisplay":21,"./MxCADNetData":23,three:19}],26:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxCADSelect=n.MxCADSelectDisplayEntityData=n.MxCADSelectDisplayEntityDataType=void 0;var r,i,a=t("three"),o=t("../MxFun"),s=t("three.meshline"),l=t("./MxCADNetData"),u=t("../MxManager");(i=r=n.MxCADSelectDisplayEntityDataType||(n.MxCADSelectDisplayEntityDataType={}))[i.kLinesType=1]="kLinesType",i[i.kTriangleType=2]="kTriangleType";var c=function(){this.type=r.kLinesType,this.points=[]};n.MxCADSelectDisplayEntityData=c;var h=(d.prototype.getParentObject=function(){return this.mxObj.getScene()},d.prototype.removeAllEntity=function(){for(var t=this.getParentObject(),e=this.aryThreeObject.length,n=0;n<e;n++)o.MxFun.removeThreejsObject(this.aryThreeObject[n],t);this.aryThreeObject=[]},d.prototype.clearAllSelect=function(t){return void 0===t&&(t=!0),t&&this.mxObj.callCommand("MxCAD_ClearSelect"),0!=this.aryThreeObject.length&&(this.removeAllEntity(),!0)},d.prototype.OnMessageEntityDisplayDatas=function(t){for(var e=new l.MxCADNetData(t),n=e.getEntityDisplayDatasHead(),i=n.nOffset,o=[],h=0;h<n.nCount;h++){var d=e.getEntityDisplayDataHead(i);i=d.nOffset,(M=new c).type=d.type;var p=d.nCount;if(!(p<1)){for(var f=[],m=0;m<p;m+=2){var g=t.getFloat32(i,!0);i+=4;var v=t.getFloat32(i,!0);i+=4,f.push(g,v)}M.points=f,o.push(M)}}var y=this.mxObj.getViewWidth(),x=this.mxObj.getViewHeight();this.material.resolution=new a.Vector2(y,x);for(var b=o.length,w=this.getParentObject(),_=0;_<b;_++){var M;if((M=o[_]).type==r.kLinesType)for(var S=M.points.length,T=0;T+3<S;T+=4){var C=new Float32Array(6);C[0]=M.points[T],C[1]=M.points[T+1],C[2]=0,C[3]=M.points[T+2],C[4]=M.points[T+3],C[5]=0;var E=new s.MeshLine;E.setGeometry(C);var D=new a.Mesh(E.geometry,this.material);D.renderOrder=u.MxData.iSelectRenderOrder,w.add(D),this.aryThreeObject.push(D)}else if(M.type==r.kTriangleType){S=M.points.length;var A=new a.Geometry,O=0;for(T=0;T+5<S;T+=6){var L=new a.Vector3(M.points[T],M.points[T+1],0),P=new a.Vector3(M.points[T+2],M.points[T+3],0),R=new a.Vector3(M.points[T+4],M.points[T+5],0);A.vertices.push(L),A.vertices.push(P),A.vertices.push(R);var I=new a.Face3(O,O+1,O+2);A.faces.push(I),O+=3}var k=new a.Mesh(A,this.materialFill);k.renderOrder=u.MxData.iSelectRenderOrder,w.add(k),this.aryThreeObject.push(k)}}},d);function d(t){this.aryThreeObject=[],this.mxObj=null,this.material=new s.MeshLineMaterial({useMap:!1,color:new a.Color(2641557),opacity:1,resolution:new a.Vector2(500,500),sizeAttenuation:!1,lineWidth:10,transparent:!0,depthTest:!1}),this.materialFill=new a.MeshBasicMaterial({color:new a.Color(2641557),opacity:.8,side:a.DoubleSide,transparent:!0,depthTest:!1}),this.mxObj=t}n.MxCADSelect=h},{"../MxFun":34,"../MxManager":36,"./MxCADNetData":23,three:19,"three.meshline":18}],27:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxCadSketchLayers=n.MxCadSketchLayer=void 0;var r=(i.prototype.addEntity=function(t){this._setEntityId.add(t)},i.prototype.getId=function(){return this.id},i.prototype.setId=function(t){this.id=t},i.prototype.removeEntity=function(t){this._setEntityId.delete(t)},i.prototype.show=function(t){var e=this;this._setEntityId.forEach(function(n){var r=e._mxobj.getEntity(n);if(null!=r)for(var i=0,a=r.length;i<a;i++)r[i].visible=t})},i);function i(t){this._setEntityId=new Set,this.id=0,this._mxobj=null,this._mxobj=t}n.MxCadSketchLayer=r;var a=(o.prototype.getLayer=function(t,e){var n=this._mapId2Layers.get(t);return null==n&&((n=new r(this._mxobj)).setId(t),this._mapId2Layers.set(t,n)),n},o.prototype.addEntity=function(t,e){this.getLayer(e).addEntity(t)},o.prototype.removeEntity=function(t){this._mapId2Layers.forEach(function(e){e.removeEntity(t)})},o.prototype.removeAllEntity=function(){this._mapId2Layers.clear()},o);function o(t){this._mxobj=null,this._mapId2Layers=new Map,this._mxobj=t}n.MxCadSketchLayers=a},{}],28:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxDrawCommands=void 0;var r=t("./MxFun"),i=t("./MxType"),a=t("./Operate/MxIntelliSelect"),o=t("./Operate/MxJigCmdManager"),s=t("./MxWindowsEvent"),l=t("./MxDrawData");function u(t){if(null!=t&&null!=t.pt1){var e=new a.MxIntelliSelectJig(t.pt1,!1);e.setDisableDynInput(!0),e.setDisableOsnap(!0);var n=t.pt1,i=r.MxFun.getCurrentMx();if(!l.MxDrawData.m_isMultipleSelect){var u=i.getMxCAD();u.getSelect().clearAllSelect(),u.getGrip().clearAll()}e.doPointSelect(r.MxFun.getCurrentMx(),t.pt1,function(t){if(0!=JSON.parse(t).lCount&&(i.getMxCAD().getGrip().onIntelliSelect(t),l.MxDrawData.m_isMultipleSelect)){var e=s.MxWindowsEvent.getCurrentMousePostion();if(i.screenCoord2Doc(e.x,e.y,0).distanceTo(n)<i.screenCoordLong2Doc(10)){var r=o.MxJigCmdManager.getCurCmd();r&&"MxIntelliSelect"==r.getTypeName()&&o.MxJigCmdManager.stopCmd()}}}),l.MxDrawData.m_isMultipleSelect&&o.MxJigCmdManager.runCmd(e)}}function c(t){null!=t&&null!=t.grips&&null!=t.ids&&r.MxFun.getCurrentMx().getMxCAD().getGrip().gripEditImp(t)}function h(t){if(null!=t&&null!=t.pt){var e=r.MxFun.getCurrentMx(),n=t.pt;if(!e.getMxDatabase().getGripManager().doPointSelect(n)&&l.MxDrawData.m_isMultipleSelect){var i=e.screenCoord2Doc(n.x,n.y,0),s=new a.MxIntelliSelectJig(i,!0);s.setDisableDynInput(!0),s.setDisableOsnap(!0),o.MxJigCmdManager.runCmd(s)}}}function d(t){null!=t&&null!=t.grips&&null!=t.ents&&r.MxFun.getCurrentMx().getMxDatabase().getGripManager().gripEditImp(t)}(n.MxDrawCommands||(n.MxDrawCommands={})).registerCommand=function(){r.MxFun.addCommand("Mx_IntelliSel",u,i.MxType.CommandFlags.MCRX_CMD_TRANSPARENT),r.MxFun.addCommand("Mx_GripEdit",c,i.MxType.CommandFlags.MCRX_CMD_TRANSPARENT),r.MxFun.addCommand("Mx_FrontEndWebpageIntelliSel",h,i.MxType.CommandFlags.MCRX_CMD_TRANSPARENT),r.MxFun.addCommand("Mx_FrontEndWebpageGripEdit",d,i.MxType.CommandFlags.MCRX_CMD_TRANSPARENT)}},{"./MxDrawData":29,"./MxFun":34,"./MxType":46,"./MxWindowsEvent":48,"./Operate/MxIntelliSelect":56,"./Operate/MxJigCmdManager":58}],29:[function(t,e,n){var r;Object.defineProperty(n,"__esModule",{value:!0}),n.MxDrawData=void 0,(r=n.MxDrawData||(n.MxDrawData={})).m_isEnableIntelliSelect=!1,r.m_isMultipleSelect=!0,r.m_isAutoResetRenderer=!1,r.m_isCorrectLargeCoordinates=!1,r.getCursorWidthPixels=function(){return 14},r.setIniset=function(t){void 0!==t.EnableIntelliSelect&&"boolean"==typeof t.EnableIntelliSelect&&(r.m_isEnableIntelliSelect=t.EnableIntelliSelect),void 0!==t.multipleSelect&&"boolean"==typeof t.multipleSelect&&(r.m_isMultipleSelect=t.multipleSelect),void 0!==t.autoResetRenderer&&"boolean"==typeof t.autoResetRenderer&&(r.m_isAutoResetRenderer=t.autoResetRenderer),void 0!==t.correctLargeCoordinates&&"boolean"==typeof t.autoResetRenderer&&(r.m_isCorrectLargeCoordinates=t.correctLargeCoordinates)}},{}],30:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxDrawObject=n.IniSetName=n.MxRunMode=void 0;var r,i,a,o=t("three"),s=t("./MxFun"),l=t("./MxCAD/MxCadSketchLayer"),u=t("./View/MxBrowseLayerData"),c=t("./View/MxBrowseDisplay"),h=t("./MxNetData"),d=t("./MxNetData"),p=t("./MxSelect"),f=t("./MxManager"),m=t("./MxSystemVariable"),g=t("./MxCAD/MxCADObject"),v=t("./MxLocalFileLoad"),y=t("./Operate/MxDrawObjectOsnap"),x=t("./View/MxDbDatabase"),b=t("./View/MxDrawMapBox"),w=t("./MxDrawObjectEvent");(i=r=n.MxRunMode||(n.MxRunMode={}))[i.kBrowse=1]="kBrowse",i[i.kMxCAD=2]="kMxCAD",i[i.kMxCADBrowseApp=3]="kMxCADBrowseApp",(a=n.IniSetName||(n.IniSetName={})).kEnableOsnapFunction="EnableOsnapFunction";var _=(M.prototype.getEventManager=function(){return this.eventManager},M.prototype.setCurrentLoadUrl=function(t){this._sCurrentLoadURL=t},M.prototype.getCurrentLoadUrl=function(){return this._sCurrentLoadURL},M.prototype.getMxDatabase=function(){return this.m_mxDatabase},M.prototype.updateCanvasSize=function(){this._onResizeFun&&this._onResizeFun()},M.prototype.mapBoxRender=function(t,e){this.camera.projectionMatrix=e,this.renderer.state.reset(),this.renderer.render(this.scene,this.camera)},M.prototype.mapBoxInitThreeJSObject=function(t,e,n){this.scene=t,this.camera=e,this.renderer=n},M.prototype.addMxEntity=function(t){return this.m_mxDatabase.addMxEntity(t)},M.prototype.getMxEntity=function(t){return this.m_mxDatabase.getEntity(t)},M.prototype.getMxEntityUserObject=function(t){var e=this.getMxEntity(t);return e?e.getUserObject():null},M.prototype.eraseAllMxEntity=function(){this.m_mxDatabase.eraseAllEntity()},M.prototype.eraseMxEntity=function(t){var e=this.m_mxDatabase.getEntity(t);return!!e&&e.erase()},M.prototype.getAllMxEntity=function(){var t=[];return this.m_mxDatabase.getAllEntity().forEach(function(e){e&&t.push(e.getUserObject())}),t},M.prototype.findMxEntityAtPoint=function(t,e){!e&&void 0!==e||(t=this.docCoord2Screen(t.x,t.y,0));var n=[],r=this.m_mxDatabase.getIntersectObjects(t);if(0==r.length)return n;var i=new Map;return r.forEach(function(t){var e=t.object.MxDbEntity;if(e){var n=e.objectId();i.has(n)||i.set(n,e.getUserObject())}}),i.forEach(function(t){n.push(t)}),n},M.prototype.getMxAllSelect=function(){var t=this.m_mxDatabase.getSelectManager().getAllSelect(),e=this.m_mxDatabase.getGripManager().getAllSelect(),n=new Set;return t.forEach(function(t){n.add(t)}),e.forEach(function(e){n.has(e)||t.push(e)}),t},M.prototype.getPrvCommandSelect=function(){return this.m_mxDatabase.getSelectManager().getPrvCommandSelect()},M.prototype.addMxCurrentSelect=function(t){this.m_mxDatabase.getGripManager().addSelect(t)},M.prototype.clearMxCurrentSelect=function(){var t=this.m_mxDatabase.clearMxCurrentSelect();if(this._mxCAD){var e=this._mxCAD.getSelect().clearAllSelect(),n=this._mxCAD.getGrip().clearAll();(e||n)&&(t=!0)}return t},M.prototype.addViewObject=function(t){this.secenView?this.threejsselectObjectsView.add(t):console.log("this.secenView is null")},M.prototype.removeViewObject=function(t){s.MxFun.removeThreejsObject(t,this.threejsselectObjectsView)},M.prototype.setOtherRefFile=function(t){this._tzDwgStaticFile=t},M.prototype.setRequestHeader=function(t){this._requestHeader=t},M.prototype.initZoomW=function(t,e){this._initZoomwCoordPt1=t.clone(),this._initZoomWCoordPt2=e.clone()},M.prototype.getMxCAD=function(){return this._mxCAD},M.prototype.setMouseRightRotate=function(t){this._mouseRightRotate=t,null!=this.controls&&(this.controls.mouseButtons.RIGHT=t?o.MOUSE.ROTATE:o.MOUSE.PAN)},M.prototype.setZoomSpeed=function(t){var e=this.controls.zoomSpeed;return this.controls.zoomSpeed=t,e},M.prototype.resetRenderer=function(){this.renderer.info.reset()},M.prototype.setMouseMiddlePan=function(t){this._isMouseMiddlePan=t?1:0,null!=this.controls&&(t?(this.controls.mouseButtons.LEFT=-1,this.controls.mouseButtons.RIGHT=-1,this.controls.mouseButtons.MIDDLE=o.MOUSE.PAN):(this.controls.mouseButtons.LEFT=o.MOUSE.PAN,this._mouseRightRotate?this.controls.mouseButtons.RIGHT=o.MOUSE.ROTATE:this.controls.mouseButtons.RIGHT=o.MOUSE.PAN,this.controls.mouseButtons.MIDDLE=1))},M.prototype.resetThreeJSControls=function(){this.controls&&(this.controls.saveState(),this.controls.reset())},M.prototype.enableZoom=function(t){null!=this.controls&&(this.controls.enableZoom=t)},M.prototype.enablePan=function(t){null!=this.controls&&(this.controls.enablePan=t)},M.prototype.getOrbitControls=function(){return this.controls},M.prototype.enableViewControls=function(t){this.controls.enabled=t},M.prototype.initRunMode=function(t){this._isCreate?console.log("iniRunMode failed,mxobject already created"):this._runMode=t},M.prototype.getRunMode=function(){return this._runMode},M.prototype.setStaticLocalLoad=function(t){this._isStaticLocalLoad=t},M.prototype.isStaticLocalLoad=function(){return this._isStaticLocalLoad},M.prototype.setStaticLocalLoadPath=function(t){this._staticLocalLoadPath=t},M.prototype.addEvent=function(t,e){this._event[t]=e},M.prototype.removeEvent=function(t){this._event[t]=void 0},M.prototype.getEvent=function(){return this._event},M.prototype.sysVariable=function(){return this.m_sysVariable},M.prototype.setIniset=function(t){this.m_iniSet=t},M.prototype.getInisetValue=function(t){return this.m_iniSet[t]},M.prototype.getViewColor=function(){return this._viewcolor},M.prototype.isWhiteViewColor=function(){return 16777215==this._viewcolor},M.prototype.initUserLoginData=function(t,e){this._userIdentitySign=t,this._userRandomToken=e},M.prototype.initRendererParam=function(t){this._rendererParam=t},M.prototype.automaticInversionColor=function(t){return 16777215!=this._viewcolor||16777215!=t?t:0},M.prototype.setViewColor=function(t){this._viewcolor=t,null!=this.scene&&(this.scene.background=new o.Color(t))},M.prototype.getViewAngle=function(){return this._viewangle},M.prototype.callInitCompleteEvent=function(){null!=this._event.loadComplete&&this._event.loadComplete()},M.prototype.callOpenFileComplete=function(t){null!=this._event.openFileComplete&&this._event.openFileComplete(t)},M.prototype.callEvent=function(t,e){return null!=this._event[t]&&(this._event[t](e),!0)},M.prototype.userLoginResult=function(t){null!=this._event.userLoginResult&&this._event.userLoginResult(t)},M.prototype.serverReturn=function(t){var e=JSON.parse(t);null!=this._event.serverReturn&&this._event.serverReturn(e)},M.prototype.openFileResult=function(t){JSON.parse(t).linkServer||console.log("link mx serverobj error"),null!=this._event.openFileResult&&this._event.openFileResult(t)},M.prototype.xzSize=function(t){var e=this._devicePixelRatio;if(e-1<=1e-4&&-1e-4<=e-1)return t;for(var n=9999999,r=t,i=0,a=t;i<100;i++){if((s=(o=a*e)-Math.floor(o))<=.001)return a;s<n&&(n=s,r=a),a+=1}for(a=t;i<100;i++){var o,s;if((s=(o=a*e)-Math.floor(o))<=.001)return a;s<n&&(n=s,r=a),--a}return r},M.prototype.setSize=function(t,e){this._viewWidth=t,this._viewHeight=e,null!=this._userCanvas&&(this._userCanvas.width=t,this._userCanvas.height=e,this._userCanvas.style.width=t+"px",this._userCanvas.style.height=e+"px"),this.onResizeImp(),this.updateDisplay()},M.prototype.getCurrentColor=function(){return this._color},M.prototype.setCurrentColor=function(t){this._color=t},M.prototype.getSelect=function(){return this._select},M.prototype.call=function(t,e,n){this._net.getSend().CallServerJS(t,e,n)},M.prototype.zoomAll=function(){this._is2d&&this.call("getDatabaseBoundHelp",'{"isBackground":1}',function(t){if(0!=t.length){var e=JSON.parse(t);this.zoomW(new o.Vector3(e[0],e[1],0),new o.Vector3(e[2],e[3],0))}})},M.prototype.tempDisableSelect=function(t){this._select.tmpDisable=t},M.prototype.getViewCenterDocCoord=function(){return null!=this._userCanvas?this.screenCoord2Doc(.5*this._userCanvas.clientWidth,.5*this._userCanvas.clientHeight,0):this.screenCoord2Doc(.5*this._viewWidth,.5*this._viewHeight,0)},M.prototype.closeWebSocket=function(){this._net.closeWebSocket()},M.prototype.isMxCAD=function(){return this._runMode==r.kMxCAD},M.prototype.onLoad=function(t){if(this._isStaticLocalLoad)this._net=new d.MxNet,this._net.init(this,!1),0<this._openFile.length&&(this._staticLocalNet=new v.MxLocalDwgFileLoad(this._net),this._staticLocalNet.load(encodeURIComponent(this._staticLocalLoadPath),encodeURIComponent(this._openFile)));else{this._net=new d.MxNet;var e=!0;if(this._runMode==r.kMxCAD?e=!0:(e=!s.MxFun.isStaticLoad(),this._is2d||(e=!0)),"wgh"==this._openFile.substring(this._openFile.lastIndexOf(".")+1).toLowerCase()&&(e=!1),0<this._staticLoadingOpenFiles.length&&(e=!1),this._net.init(this,e),!e&&(this._staticNet=new d.MxHFileLoad(this._net),this._staticNet.setRequestHeader(this._requestHeader),this._staticNet.setUrlParam(t),this._staticNet.load(this._openFile,this._staticLoadingOpenFiles),this._tzDwgStaticFile&&0<this._tzDwgStaticFile.length)){var n=new d.MxNet;n.init(this,!1),this._extRefManager.createTzDwgExternalReferences(99999),n.setCurrentDatabaseId(99999),this._staticLoadTzNet=new d.MxHFileLoad(n),this._staticLoadTzNet.setShowloading(!1),this._staticLoadTzNet.setRequestHeader(this._requestHeader),this._staticLoadTzNet.load(this._tzDwgStaticFile,[])}}},M.prototype.stopAllLoading=function(){this._staticNet&&this._staticNet.stopAllLoading()},M.prototype.getStaticNet=function(){return this._staticNet},M.prototype.isStaticFileNet=function(){return!this._isStaticLocalLoad&&null!=this._staticNet},M.prototype.getStaticLocalNet=function(){return this._staticLocalNet},M.prototype.getStaticLoadTzNet=function(){return this._staticLoadTzNet},M.prototype.getViewWidth=function(){return null!=this._userCanvas?this._userCanvas.clientWidth:this._viewWidth},M.prototype.getViewHeight=function(){return null!=this._userCanvas?this._userCanvas.clientHeight:this._viewHeight},M.prototype.makeCurrent=function(){f.MxManager.setCurrentMx(this)},M.prototype.createCanvasImageData=function(t,e){var n=this,r=0,i=0,a=!1;e&&e.width&&e.height&&(r=this.getViewWidth(),i=this.getViewHeight(),a=!0,this.setSize(e.width,e.height)),this._callCreateCanvasImageData=function(e){a&&n.setSize(r,i),t(e)},this.updateDisplay()},M.prototype.getIntersectObjects=function(t){var e=new o.Raycaster;e.linePrecision=this.screenCoordLong2Doc(4);var n=this.getCanvas(),r=n.clientWidth,i=n.clientHeight;return t=new o.Vector2(t.x/r*2-1,-t.y/i*2+1),e.setFromCamera(t,this.camera),e.intersectObjects(this.threejsselectObjects.children,!0)},M.prototype.addObject=function(t){this.threejsselectObjects.add(t)},M.prototype.removeAllSelectObject=function(){for(;this.threejsselectObjects.children.length;)this.threejsselectObjects.remove(this.threejsselectObjects.children[0])},M.prototype.removeObject=function(t){this.threejsselectObjects.remove(t)},M.prototype.render=function(){this.secenView?(this.renderer.autoClear=!0,this.renderer.render(this.secenView,this.cameraView),this.renderer.autoClear=!1):this.renderer.autoClear=!0,this.renderer.render(this.scene,this.camera),null!=this._callCreateCanvasImageData&&(this._callCreateCanvasImageData(this.renderer.domElement.toDataURL("image/png")),this._callCreateCanvasImageData=void 0),this.callEvent("render",this.renderer)},M.prototype.updateDisplay=function(t){void 0===t&&(t=!1),this.mxdrawThreeJS.updateDisplay(t)},M.prototype.updateDisplayImplement=function(t){function e(){n.m_mxDatabase.upDirtyDisplay(),n._isAnimation?(n._isAnimationStarting=!0,requestAnimationFrame(this.needRander)):n._isWaiteCount=0,n.render()}void 0===t&&(t=!1);var n=this;!0!==t?this._isAnimationStarting||(this._isAnimation?requestAnimationFrame(e):((5<this._isWaiteCount||this._isWaiteCount<0)&&(this._isWaiteCount=0),this._isWaiteCount<=0&&requestAnimationFrame(e),this._isWaiteCount++)):e()},M.prototype.gotoLayout=function(t){"Modle"==t&&(t="");var e=this._openFile;for(var n in this._iniParam)"srcname"==(o=(a=this._iniParam[n])[0])&&(e=a[1]);var r={},i="";for(var n in this._iniParam){var a,o;if(null==r[o=(a=this._iniParam[n])[0]]){r[o]=!0;var l=a[1];if("file"==o){if(l=e,0<t.length){var u=l.substring(l.lastIndexOf(".")+1);l=l.substring(0,l.lastIndexOf("."))+"%23"+t+"%23."+u}}else if("srcname"==o)continue;0==i.length?i=o+"="+l+"&srcname="+e:i+="&"+o+"="+l}}var c=s.MxFun.getLocationPageUrl()+"?"+i;window.location.href=c},M.prototype.addInitParam=function(t,e){var n=new Array;n.push(t),n.push(e),this._iniParam.push(n)},M.prototype.openFile=function(t,e){if(void 0===e&&(e=""),!this._isCreate)return console.log("mx: openFile Fialed mxasser(_isCreate == false)"),!1;if(this.stopAllLoading(),0==t.length)return!1;this.reInit(),this._devicePixelRatio=window.devicePixelRatio,t instanceof Array?(this._openFile=t[0],this._staticLoadingOpenFiles=t):this._openFile=t,this._openFileExtName=this._openFile.substring(this._openFile.lastIndexOf(".")+1),this._iniParam=[],this._initZoomwCoordPt1=null,this._initZoomWCoordPt2=null;var n=new Array;return n.push("file"),n.push(this._openFile),this._iniParam.push(n),this.onLoad(e),!0},M.prototype.updateCameraDisplayRange=function(t,e,n){this.mxdrawThreeJS.updateCameraDisplayRange(t,e,n)},M.prototype.newFile=function(t,e,n,r){if(!this._isCreate)return console.log("mx: openFile Fialed mxasser(_isCreate == false)"),!1;var i,a;if(a=t instanceof Object&&e instanceof Object?(i=t,e):(i=new o.Vector3(t,e,0),new o.Vector3(n,r,0)),i.x>a.x){var l=i.x;i.x=a.x,a.x=l}if(i.y>a.y){var u=i.y;i.y=a.y,a.y=u}this.reInit(),this._devicePixelRatio=window.devicePixelRatio,this._openFile="",this._openFileExtName="dwg",this._iniParam=[],this._initZoomwCoordPt1=null,this._initZoomWCoordPt2=null;var c=new o.Matrix4;c.identity(),this.intiDoc2Wold(c),this.mxdrawThreeJS.updateCameraDisplayRange(i,a,0),this.updateDisplay(!0);var h=s.MxFun.getUiObj();null!=h&&(h.SetLayoutData(this._allLayoutName),h.UpDisplayLayout())},M.prototype.calcViewsize=function(){if(null==this._userCanvas)return{viewWidth:window.innerWidth,viewHeight:window.innerHeight};var t=this._userCanvas.clientWidth,e=this._userCanvas.clientHeight;if(null!=this._event.onResize){var n=this._event.onResize();null!=n&&(t=parseInt(n.width),e=parseInt(n.height))}return{viewWidth:t,viewHeight:e}},M.prototype.create=function(t,e,n,i){if(this._is2d?i?(this.mxdrawThreeJS=new b.MxDrawMapBoxThreeJS(i,this),this._viewcolor=16777215):this.mxdrawThreeJS=new b.MxDrawObject2dThreeJS(this):this.mxdrawThreeJS=new b.MxDrawObject3dThreeJS(this),this._callCreateCanvasImageData=void 0,this._devicePixelRatio=window.devicePixelRatio,e instanceof Array?(this._openFile=e[0],this._staticLoadingOpenFiles=e):this._openFile=e,this._iniParam=s.MxFun.getUrlParams(),this._openFileExtName=this._openFile.substring(this._openFile.lastIndexOf(".")+1),""!=this._openFile&&this._runMode!=r.kMxCAD&&this._runMode!=r.kMxCADBrowseApp){var a=new Array;a.push("file"),a.push(this._openFile),this._iniParam.push(a)}""!=this._userIdentitySign&&(this.addInitParam("userIdentitySign",this._userIdentitySign),this.addInitParam("userRandomToken",this._userRandomToken)),this.addInitParam("runMode",this._runMode==r.kMxCAD||this._runMode==r.kMxCADBrowseApp?"mxcad":"browse"),this._runMode==r.kMxCAD||this._runMode==r.kMxCADBrowseApp?("empty"==this._openFile&&(this._openFile=""),this._mxCAD=new g.MxCADObject(this)):this._mxCAD=null,this._userCanvas=t;var l=window.innerWidth,u=window.innerHeight;if(null!=t&&(l=t.clientWidth,u=t.clientHeight),this._viewWidth=l,this._viewHeight=u,this.m_mxDatabase.getSelectManager().setCanvasSize(l,u),this.mxdrawThreeJS.onInitThreejs(),this.eventManager.registEvent(this),this.onCreate(),this.m_mxDatabase.init(this),this._parentDocObject=new o.Object3D,this.scene.add(this._parentDocObject),this.threejsselectObjects=new o.Object3D,this.scene.add(this.threejsselectObjects),this._objectsOsnap=new y.MxDrawObjectOsnap(this),this._select=new p.MxSelect(this,this.getCanvas()),this._select.enabled=s.MxFun.isEnableSelect(),this._select.init(),this._is2d||(this._select.enabled=!1),this._runMode!=r.kBrowse&&(this._select.enabled=!1),f.MxManager.add(this),f.MxManager.setCurrentMx(this),this.mxdrawThreeJS.addControlsChangeEvent(),this.updateDisplay(),this.mxdrawThreeJS.getType()==b.MxThreeJSType.kMapBox)this.mxdrawThreeJS.addWindowResizeEvent();else{var c=this;if(null==t){var h=function(){c._viewWidth=window.innerWidth,c._viewHeight=window.innerHeight,c.onResizeImp(),c.updateDisplay()};window.addEventListener("resize",h,!1),this._onResizeFun=h}else{var d=function(t){t&&t.viewWidth&&t.viewHeight||(t=c.calcViewsize()),c._viewWidth=t.viewWidth,c._viewHeight=t.viewHeight,c.onResizeImp(c._viewWidth,c._viewHeight),c.updateDisplay()};if(this._onResizeFun=d,null!=this._event.addResizeEvent?this._event.addResizeEvent(d,t):window.addEventListener("resize",d,!1),window.setTimeout(function(){d()},5),null!=this._event.onResize){var m=c.calcViewsize();d(m);var v=0,x=0,w=!0,_=window.setInterval(function(){x++;var t=c.calcViewsize();if(t.viewWidth==m.viewWidth&&t.viewHeight==m.viewHeight&&0<t.viewWidth&&0<t.viewHeight){if(8<++v)return clearInterval(_),void d(t);1<=v&&w&&(d(t),2<=v&&(w=!1))}else v=0;m=t,50<x&&(clearInterval(_),0<t.viewWidth&&0<t.viewHeight?d(t):console.log("mxassert(0) error view size"))},50)}}}this.onLoad(n),this._isCreate=!0},M.prototype.initResize=function(){if(null==this._userCanvas)this._viewWidth=window.innerWidth,this._viewHeight=window.innerHeight,this.onResizeImp();else{if(this._viewWidth=this._userCanvas.clientWidth,this._viewHeight=this._userCanvas.clientHeight,null!=this._event.onResize){var t=this._event.onResize();null!=t&&(this._viewWidth=t.width,this._viewHeight=t.height)}this.onResizeImp(this._viewWidth,this._viewHeight)}this.updateDisplay()},M.prototype.is2D=function(){return this._is2d},M.prototype.getOpenFile=function(){return this._openFile},M.prototype.getFileTitle=function(){var t=this._openFile;if("wgh"==this._openFile.substring(this._openFile.lastIndexOf(".")+1).toLowerCase()){var e=this._openFile.substring(0,this._openFile.indexOf(".mxb1.wgh")).split("/");"$"==(t=1==e.length?e[0]:e[e.length-1])[0]&&(t=t.substring(1))}return t},M.prototype.getIniParam=function(){return this._iniParam},M.prototype.getOpenFileExtName=function(){return this._openFileExtName},M.prototype.loadCodeToServer=function(t,e){this._net.getSend().CallLoadCodeToServer(t,e)},M.prototype.userLogin=function(t,e){this._net.getSend().UserLogin(t,e)},M.prototype.getUserCanvas=function(){return this._userCanvas},M.prototype.getCanvas=function(){return null!=this._userCanvas?this._userCanvas:this.renderer.domElement},M.prototype.getScene=function(){return this.scene},M.prototype.getCamera=function(){return this.camera},M.prototype.callCommand=function(t,e,n){void 0===e&&(e=""),this._net.getSend().DoCommand(t,e,n)},M.prototype.undoMark=function(){this._net.getSend().UndoMark()},M.prototype.loadCodeFileToServer=function(t,e,n){var r='{"path":"'+t+'","reload":'+(null!=n?"true":"false")+"}";this._net.getSend().DoCommand("Mx_LoadCodeFormServerFile",r,e)},M.prototype.deleteAll=function(){this.removeAllEntity(),this.callCommand("Mx_ClearAll"),this.updateDisplay()},M.prototype.undo=function(){this.callCommand("Mx_Undo")},M.prototype.save=function(){this.callCommand("Mx_Save")},M.prototype.initAllLayoutName=function(t){this._allLayoutName=t},M.prototype.getAllLayoutName=function(){return this._allLayoutName},M.prototype.updataClipMaterial=function(){this._blocks.updataClipMaterial(this)},M.prototype.getSketchLayers=function(){return this._sketchLayers},M.prototype.getExtRefManager=function(){return this._extRefManager},M.prototype.showLayer=function(t,e,n){"string"==typeof t&&(t=this._layers.getLayerIdForName(t)),n?this._sketchLayers.getLayer(t).show(e):this._blocks.showLayer(t,e),this.updateDisplay()},M.prototype.addLayerInfo=function(t,e,n){e=this.automaticInversionColor(16777215&e),this._layers.add(t,e,n)},M.prototype.setZeroLayerId=function(t){this._layers.setZeroLayerId(t)},M.prototype.addLayerInfoComplete=function(){this._layers.initComplete()},M.prototype.addEntity=function(t,e){var n=this._mapId2Entity.get(t);null==n&&(n=new Array,this._mapId2Entity.set(t,n)),n.push(e)},M.prototype.getEntity=function(t){return this._mapId2Entity.get(t)},M.prototype.clearThreejsScence=function(){s.MxFun.removeThreejsObject(this.threejsselectObjects,this.scene),this.threejsselectObjects=new o.Object3D,s.MxFun.removeThreejsObject(this._parentDocObject,this.scene),this._parentDocObject=new o.Object3D,this.scene.remove(),this.scene.dispose(),this.scene=new o.Scene,this.scene.add(this.threejsselectObjects),this.scene.add(this._parentDocObject),this._objectsOsnap=new y.MxDrawObjectOsnap(this),this.m_mxDatabase.init(this),this.mxdrawThreeJS.onInitScene(),s.MxFun.removeThreejsObject(this.threejsselectObjectsView,this.secenView),this.threejsselectObjectsView=null,this.secenView.remove(),this.secenView.dispose(),this.secenView=null,this.onInitViewScene()},M.prototype.reInit=function(){this.clearThreejsScence(),this._openFile="",this._openFileExtName="",this._select.removeAll(),this._is2d||(this._select.enabled=!1),this._mapId2Entity=new Map,this._setAdyDelete=new Map,this._sketchLayers=new l.MxCadSketchLayers(this),this._layers=new u.MxBrowseLayerData,this._blocks=new c.Blocks,this._extRefManager=new c.ExternalReferenceManager,this._doc2World=new o.Matrix4,this._word2doc=new o.Matrix4,this._allLayoutName=new Array,this._tzDwgStaticFile="",this._devicePixelRatio=window.devicePixelRatio,this._blocks.initRootBlockRef()},M.prototype.removeEntity=function(t){if(null==this._setAdyDelete[t]){this._setAdyDelete[t]=!0;var e=this._mapId2Entity.get(t);if(null!=e){for(var n in e)this.scene.remove(e[n]);this._sketchLayers.removeEntity(t),this._mapId2Entity.delete(t)}}},M.prototype.removeEntityFromServer=function(t){for(var e=t.getInt32(4,!0),n=0;n<e;n++){var r=t.getInt32(4*(n+20),!0);this.removeEntity(r)}},M.prototype.removeAllEntity=function(){var t=this;this._mapId2Entity.forEach(function(e,n,r){for(var i in e)t.scene.remove(e[i])}),this._mapId2Entity.clear(),this._sketchLayers.removeAllEntity()},M.prototype.mxWebAddEntity=function(t){this._setAdyDelete.clear();var e=this.mxWebAddEntity_3DChild(t);this.mxWebAddEntity_Curve(t,e),this._setAdyDelete.clear()},M.prototype.screenCoord2World=function(t,e,n){var r=this.getCanvas(),i=r.clientWidth,a=r.clientHeight;n=.5;var s=this.camera;s&&s.isOrthographicCamera&&(n=(s.near+s.far)/(s.near-s.far));var l=new o.Vector3(t/i*2-1,-e/a*2+1,n);return l.unproject(this.camera),l},M.prototype.worldCoord2Screen=function(t,e,n){var r=new o.Vector3(t,e,n).project(this.camera),i=this.getCanvas(),a=i.clientWidth/2,s=i.clientHeight/2,l=Math.round(r.x*a+a),u=Math.round(-r.y*s+s);return new o.Vector3(l,u,0)},M.prototype.worldCoordLong2Doc=function(t){var e=this.worldCoord2Doc(0,0,0),n=this.worldCoord2Doc(t,0,0);return e.distanceTo(n)},M.prototype.docCoordLong2World=function(t){var e=this.docCoord2World(0,0,0),n=this.docCoord2World(t,0,0);return e.distanceTo(n)},M.prototype.getDoc2CADMatrix=function(){return this._doc2CAD},M.prototype.docCoord2Cad=function(t,e,n){var r=new o.Vector3(t,e,n);return r.applyMatrix4(this._doc2CAD),r},M.prototype.cadCoord2Doc=function(t,e,n){var r=new o.Vector3(t,e,n);return r.applyMatrix4(this._cad2Doc),r},M.prototype.docCoord2World=function(t,e,n){var r=new o.Vector3(t,e,n);return r.applyMatrix4(this._doc2World),r},M.prototype.getDoc2World=function(){return this._doc2World},M.prototype.getWorldToDoc=function(){return this._word2doc},M.prototype.worldCoord2Doc=function(t,e,n){var r=new o.Vector3(t,e,n);return r.applyMatrix4(this._word2doc),r},M.prototype.screenCoord2Doc=function(t,e,n){var r=this.screenCoord2World(t,e,n);return this.worldCoord2Doc(r.x,r.y,0)},M.prototype.docCoord2Screen=function(t,e,n){var r=this.docCoord2World(t,e,n);return this.worldCoord2Screen(r.x,r.y,r.z)},M.prototype.screenCoordLong2Doc=function(t){var e=this.screenCoord2Doc(0,0,0),n=this.screenCoord2Doc(t,0,0);return e.distanceTo(n)},M.prototype.screenCoordLong2DocScale=function(){var t=this.screenCoord2Doc(0,0,0),e=this.screenCoord2Doc(1,0,0);return t.distanceTo(e)},M.prototype.docCoordLong2Screen=function(t){var e=this.docCoord2Screen(0,0,0),n=this.docCoord2Screen(t,0,0);return e.distanceTo(n)},M.prototype.screenCoordLong2World=function(t){var e=this.screenCoord2World(0,0,0),n=this.screenCoord2World(t,0,0);return e.distanceTo(n)},M.prototype.worldCoordLong2Screen=function(t){var e=this.worldCoord2Screen(0,0,0),n=this.worldCoord2Screen(t,0,0);return e.distanceTo(n)},M.prototype.initCAD2Doc=function(t){t instanceof Array?this._cad2Doc.fromArray(t):this._cad2Doc=t,this._doc2CAD.getInverse(this._cad2Doc)},M.prototype.intiDoc2Wold=function(t){t instanceof Array?this._doc2World.fromArray(t):this._doc2World=t,this._word2doc.getInverse(this._doc2World),this.m_mxDatabase.intiDoc2Wold(this._doc2World),this._parentDocObject.matrix=this._doc2World,this._parentDocObject.matrixAutoUpdate=!1,this.threejsselectObjects.matrix=this._doc2World,this.threejsselectObjects.matrixAutoUpdate=!1},M.prototype.getDrawContainer=function(){return this.threejsselectObjects},M.prototype.getTheTempDrawContainer=function(){return this._parentDocObject},M.prototype.enableSingleTouchPan=function(t){this.controls.enablePan=t},M.prototype.mxWebAddEntityFor2dPointMeshBuffers=function(t,e){var n=new h.MxNetData(t),r=n.getdPointMeshBuffersHead(),i=r.zeroLayerIdIndex,a=r.databaseIndex;-1!=e&&(a=e);for(var o=r.datasize,s=0;s<r.datacount;s++){var l=n.getdPointMeshBufferDataHead(o);o=l.offset;var u=l.layerId,c=u==i,d=l.blkId,p=l.pointCount;if(!(p<1)){for(var f=[],m=[],g=[],v=[],y=[],x=0;x<p;x++){var b=t.getFloat32(o,!0);o+=4;var w=t.getFloat32(o,!0);o+=4;var _=t.getFloat32(o,!0);o+=4;var M=t.getFloat32(o,!0);o+=4;var S=t.getFloat32(o,!0);o+=4;var T=t.getFloat32(o,!0);o+=4;var C=t.getInt32(o,!0);o+=4;var E=C>>24&255;2==E?(v.push(b,w),v.push(_,M),v.push(S,T)):1==E?0!=d&&c?(y.push(b,w),y.push(_,M),y.push(S,T)):(g.push(b,w),g.push(_,M),g.push(S,T)):(C=this.automaticInversionColor(16777215&C),f.push(b,w),f.push(_,M),f.push(S,T),m.push((255&C)/255,(C>>8&255)/255,(C>>16&255)/255),m.push((255&C)/255,(C>>8&255)/255,(C>>16&255)/255),m.push((255&C)/255,(C>>8&255)/255,(C>>16&255)/255))}var D=this._blocks,A=this._layers;0!=a&&(D=this._extRefManager.getBlocks(a),A=this._extRefManager.getLayers(a));var O=D.crateBlock(d);O.addGeometryMesh(f,m,u,v,g,y),D.createThreejsObj(O,this,A)}}},M.prototype.mxWebAddEntityForMemorySections=function(t,e){var n=new h.MxNetData(t),r=n.getMemorySectionsHead(),i=(r.zeroLayerIdIndex,r.databaseIndex);-1!=e&&(i=e);var a=r.nOffset,o=this._blocks,s=this._layers;0!=i&&(o=this._extRefManager.getBlocks(i),s=this._extRefManager.getLayers(i));for(var l=0;l<r.datacount;l++){var u=n.getMemorySectionHead(a);a=u.offset;var d=new c.MxNewDisplayMemorySection;d.layerId=u.layerId,d.blockId=u.blkId,d.id=u.memId,d.color=u.memColor,d.type=u.memType;var p=!1;d.type==c.MxNewDisplayMemorySectionType.kLinesType_Float?(p=!0,d.type=c.MxNewDisplayMemorySectionType.kLinesType):d.type==c.MxNewDisplayMemorySectionType.kTriangleType_Float&&(p=!0,d.type=c.MxNewDisplayMemorySectionType.kTriangleType);var f=u.pointCount;if(!(f<1)){for(var m=[],g=0;g<f;g++)if(p){var v=t.getFloat32(a,!0);a+=4;var y=t.getFloat32(a,!0);a+=4,t.getFloat32(a,!0),a+=4,m.push(v,y,0)}else v=t.getFloat64(a,!0),a+=8,y=t.getFloat64(a,!0),a+=8,t.getFloat64(a,!0),a+=8,m.push(v,y,0);d.points=m;var x=o.crateBlock(d.blockId);x.addMemorySections(d),o.createThreejsObj(x,this,s)}}},M.prototype.mxWebAddEntityFor2dPointTextureBuffers=function(t,e){var n=new h.MxNetData(t),r=n.getdPointTextureBuffersHead(),i=r.ver,a=(r.zeroLayerIdIndex,r.databaseIndex);-1!=e&&(a=e);for(var o=r.datasize,s=0;s<r.datacount;s++){var l=n.getdPointTextureBufferDataHead(o);o=l.offset;var u=l.layerId,c=l.blkId,d=l.dataCount;if(!(d<1)){var p=0,f=this._blocks,m=this._layers;0!=a&&(f=this._extRefManager.getBlocks(a),m=this._extRefManager.getLayers(a));for(var g=f.crateBlock(c);p<d;p++){var v=t.getFloat64(o,!0);o+=8;var y=t.getFloat64(o,!0);o+=8;var x=t.getFloat64(o,!0);o+=8;var b=t.getUint32(o,!0);o+=4;var w=t.getUint32(o,!0);o+=4;var _=String.fromCharCode.apply(null,new Uint8Array(t.buffer.slice(o,o+w)));o+=w;var M=[],S=[],T=[];if(!(b<1)){for(var C=0;C<b;C++){if(5<=i){var E=t.getFloat64(o,!0);o+=8;var D=t.getFloat64(o,!0);o+=8,t.getFloat64(o,!0),o+=8;var A=t.getFloat64(o,!0);o+=8;var O=t.getFloat64(o,!0);o+=8,t.getFloat64(o,!0),o+=8;var L=t.getFloat64(o,!0);o+=8;var P=t.getFloat64(o,!0);o+=8,t.getFloat64(o,!0),o+=8,M.push(E,D),M.push(A,O),M.push(L,P)}else E=t.getFloat32(o,!0),o+=4,D=t.getFloat32(o,!0),o+=4,A=t.getFloat32(o,!0),o+=4,O=t.getFloat32(o,!0),o+=4,L=t.getFloat32(o,!0),o+=4,P=t.getFloat32(o,!0),o+=4,M.push(E,D),M.push(A,O),M.push(L,P);var R=t.getInt32(o,!0);o+=4;var I=t.getFloat32(o,!0);o+=4;var k=t.getFloat32(o,!0);o+=4;var B=t.getFloat32(o,!0);o+=4;var F=t.getFloat32(o,!0);o+=4;var N=t.getFloat32(o,!0);o+=4;var j=t.getFloat32(o,!0);o+=4;var z=R>>24&255;R=2==z||1==z?16777215:this.automaticInversionColor(16777215&R),T.push(I,k),T.push(B,F),T.push(N,j),S.push((255&R)/255,(R>>8&255)/255,(R>>16&255)/255),S.push((255&R)/255,(R>>8&255)/255,(R>>16&255)/255),S.push((255&R)/255,(R>>8&255)/255,(R>>16&255)/255)}g.addGeometryTexture(M,T,S,u,_,v,y,x)}}f.createThreejsObj(g,this,m)}}},M.prototype.mxWebAddEntityFor2dPointCurveBuffers=function(t,e){var n=new h.MxNetData(t),r=n.getdPointCurveBuffersHead(),i=r.zeroLayerIdIndex,a=r.databaseIndex;-1!=e&&(a=e);for(var o=r.datasize,s=0;s<r.datacount;s++){var l=n.getdPointCurveBufferDataHead(o);o=l.offset;var u=l.layerId,c=u==i,d=l.blkId,p=l.pointCount;if(!(p<1)){for(var f=[],m=[],g=[],v=[],y=[],x=0;x<p;x++){var b=t.getFloat32(o,!0);o+=4;var w=t.getFloat32(o,!0);o+=4;var _=t.getFloat32(o,!0);o+=4;var M=t.getFloat32(o,!0);o+=4;var S=t.getInt32(o,!0);o+=4;var T=S>>24&255;2==T?(v.push(b,w),v.push(_,M)):1==T?0!=d&&c?(y.push(b,w),y.push(_,M)):(g.push(b,w),g.push(_,M)):(f.push(b,w),f.push(_,M),S=this.automaticInversionColor(16777215&S),m.push((255&S)/255,(S>>8&255)/255,(S>>16&255)/255),m.push((255&S)/255,(S>>8&255)/255,(S>>16&255)/255))}var C=this._blocks,E=this._layers;0!=a&&(C=this._extRefManager.getBlocks(a),E=this._extRefManager.getLayers(a));var D=C.crateBlock(d);D.addGeometryCurve(f,m,u,v,g,y),C.createThreejsObj(D,this,E)}}},M.prototype.mxWebAddEntityFor2dPointCurveBuffer=function(t,e){var n=new h.MxNetData(t);if(!n.getIsSketchEntity()){var r,i=n.getLayerId(),a=i==n.getZeroLayerId(),o=n.getBlockId();if(!((r=t.getInt32(20,!0)/20)<1)){for(var s=80,l=[],u=[],c=[],d=[],p=[],f=0;f<r;f++){var m=t.getFloat32(s,!0);s+=4;var g=t.getFloat32(s,!0);s+=4;var v=t.getFloat32(s,!0);s+=4;var y=t.getFloat32(s,!0);s+=4;var x=t.getInt32(s,!0);s+=4;var b=x>>24&255;2==b?(d.push(m,g),d.push(v,y)):1==b?0!=o&&a?(p.push(m,g),p.push(v,y)):(c.push(m,g),c.push(v,y)):(x=this.automaticInversionColor(16777215&x),l.push(m,g),l.push(v,y),u.push((255&x)/255,(x>>8&255)/255,(x>>16&255)/255),u.push((255&x)/255,(x>>8&255)/255,(x>>16&255)/255))}var w=n.getDatabaseIndex();-1!=e&&(w=e);var _=this._blocks,M=this._layers;0!=w&&(_=this._extRefManager.getBlocks(w),M=this._extRefManager.getLayers(w));var S=_.crateBlock(o);S.addGeometryCurve(l,u,i,d,c,p),_.createThreejsObj(S,this,M)}}},M.prototype.mxWebAddEntityFor2dPointMeshBuffer=function(t,e){var n=new h.MxNetData(t);if(!n.getIsSketchEntity()){var r,i=n.getLayerId(),a=n.getBlockId(),o=i==n.getZeroLayerId();if(!((r=t.getInt32(12,!0)/28)<1)){for(var s=80,l=[],u=[],c=[],d=[],p=[],f=0;f<r;f++){var m=t.getFloat32(s,!0);s+=4;var g=t.getFloat32(s,!0);s+=4;var v=t.getFloat32(s,!0);s+=4;var y=t.getFloat32(s,!0);s+=4;var x=t.getFloat32(s,!0);s+=4;var b=t.getFloat32(s,!0);s+=4;var w=t.getInt32(s,!0);s+=4;var _=w>>24&255;2==_?(d.push(m,g),d.push(v,y),d.push(x,b)):1==_?0!=a&&o?(p.push(m,g),p.push(v,y),p.push(x,b)):(c.push(m,g),c.push(v,y),c.push(x,b)):(l.push(m,g),l.push(v,y),l.push(x,b),w=this.automaticInversionColor(16777215&w),u.push((255&w)/255,(w>>8&255)/255,(w>>16&255)/255),u.push((255&w)/255,(w>>8&255)/255,(w>>16&255)/255),u.push((255&w)/255,(w>>8&255)/255,(w>>16&255)/255))}var M=n.getDatabaseIndex();-1!=e&&(M=e);var S=this._blocks,T=this._layers;0!=M&&(S=this._extRefManager.getBlocks(M),T=this._extRefManager.getLayers(M));var C=S.crateBlock(a);C.addGeometryMesh(l,u,i,d,c,p),S.createThreejsObj(C,this,T)}}},M.prototype.mxWebCreateAllBlocks=function(t,e){var n=new h.MxNetData(t).getDatabaseIndex();-1!=e&&(n=e);var r=this._blocks;0!=n&&(r=this._extRefManager.getBlocks(n)),r.createBlocks(t,this.scene)},M.prototype.mxWebEntitysData=function(t,e){-1==e&&this._objectsOsnap.mxWebEntitysData(t,e)},M.prototype.getObjectOsnap=function(){return this._objectsOsnap},M.prototype.saveMxEntityToJson=function(){return this.m_mxDatabase.saveJson()},M.prototype.loadMxEntityFromJson=function(t){return this.m_mxDatabase.loadJson(t)},M);function M(t){this._is2d=!0,this._runMode=r.kBrowse,this._mxCAD=null,this._userCanvas=null,this._openFile="empty",this._staticLoadingOpenFiles=[],this._openFileExtName="",this._userIdentitySign="",this._rendererParam=void 0,this._userRandomToken="",this._isCreate=!1,this.m_iniSet={},this._net=null,this._staticNet=null,this._staticLoadTzNet=null,this._staticLocalNet=null,this._isStaticLocalLoad=!1,this._staticLocalLoadPath="",this._viewWidth=1,this._viewHeight=1,this.m_sysVariable=new m.MxSystemVariable,this._color="#FFFFFF",this._viewcolor=15790320,this._isAnimation=!1,this._isAnimationStarting=!1,this._isWaiteCount=0,this._callCreateCanvasImageData=void 0,this._event={},this.scene=null,this.camera=null,this.secenView=null,this.cameraView=null,this.renderer=null,this.controls=null,this.threejsselectObjectsView=null,this._mouseRightRotate=!0,this._isMouseMiddlePan=-1,this._mapId2Entity=new Map,this._setAdyDelete=new Map,this._sketchLayers=new l.MxCadSketchLayers(this),this._layers=new u.MxBrowseLayerData,this._blocks=new c.Blocks,this._extRefManager=new c.ExternalReferenceManager,this._doc2World=new o.Matrix4,this._word2doc=new o.Matrix4,this._cad2Doc=new o.Matrix4,this._doc2CAD=new o.Matrix4,this._allLayoutName=new Array,this._devicePixelRatio=1,this._tzDwgStaticFile="",this._requestHeader="",this._objectsOsnap=null,this._initZoomwCoordPt1=null,this._initZoomWCoordPt2=null,this.m_mxDatabase=null,this._parentDocObject=null,this.threejsselectObjects=null,this._onResizeFun=null,this._sCurrentLoadURL="",this.mxdrawThreeJS=null,this.eventManager=new w.MxDrawObjectEvent,this._viewangle=0,this._is2d=t,this._blocks.initRootBlockRef(),this.m_iniSet[a.kEnableOsnapFunction]=!1,this.m_sysVariable.init(this),this.m_mxDatabase=new x.MxDbDatabase}n.MxDrawObject=_},{"./MxCAD/MxCADObject":24,"./MxCAD/MxCadSketchLayer":27,"./MxDrawObjectEvent":33,"./MxFun":34,"./MxLocalFileLoad":35,"./MxManager":36,"./MxNetData":38,"./MxSelect":39,"./MxSystemVariable":43,"./Operate/MxDrawObjectOsnap":54,"./View/MxBrowseDisplay":68,"./View/MxBrowseLayerData":69,"./View/MxDbDatabase":70,"./View/MxDrawMapBox":77,three:19}],31:[function(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0}),n.MxDrawObject2d=void 0;var a,o=t("three"),s=t("./MxFun"),l=t("./MxDrawObject"),u=t("three-orbitcontrols"),c=t("./MxNetData"),h=t("./MxMaterial"),d=t("./MxDrawData"),p=(i(f,a=l.MxDrawObject),f.prototype.set3DDraw=function(t){this.is3DDraw=t},f.prototype.getOrthographicCamera=function(){return this.camera instanceof o.OrthographicCamera?this.camera:null},f.prototype.getFullDisplayRange=function(){return{minPt:this._initMinDisplayPoint,maxPt:this._initMaxDisplayPoint}},f.prototype.zoomW=function(t,e,n){if(null!=n&&n||(t=this.docCoord2World(t.x,t.y,0),e=this.docCoord2World(e.x,e.y,0)),this._curMinDisplayPoint=t,this._curMaxDisplayPoint=e,t.x>e.x){var r=t.x;t.x=e.x,e.x=r}t.y>e.y&&(r=t.y,t.y=e.y,e.y=r);var i=this.getViewWidth(),a=this.getViewHeight(),s=Math.abs(t.x-e.x),l=Math.abs(t.y-e.y),u=this.getOrthographicCamera();if(s/l<i/a){var c=.5*l,h=i/a;u.left=-c*h,u.right=c*h,u.top=c,u.bottom=-c}else c=.5*s,h=a/i,u.left=-c,u.right=c,u.top=c*h,u.bottom=-c*h;var d=s,p=l,f=d;f<d&&(f=p),u.far<2*f&&(u.far=2*f);var m=t.x+.5*d,g=t.y+.5*p;u.zoom=1,u.position.set(m,g,.5*f),u.lookAt(new o.Vector3(m,g,0)),u.updateProjectionMatrix(),this.controls.target.x=m,this.controls.target.y=g,this.controls.target.z=0,this.controls.update()},f.prototype.zoomScale=function(t){var e=this.getOrthographicCamera();e.zoom=Math.max(this.controls.minZoom,Math.min(this.controls.maxZoom,e.zoom*t)),e.updateProjectionMatrix(),this.controls.update()},f.prototype.zoomCenter=function(t,e){var n=this.getOrthographicCamera(),r=this.docCoord2World(t,e,0);t=r.x,e=r.y,n.position.set(t,e,n.position.z),n.lookAt(new o.Vector3(t,e,0)),n.updateProjectionMatrix(),this.controls.target.x=t,this.controls.target.y=e,this.controls.target.z=0,this.controls.update()},f.prototype.calcCameraUp=function(t){var e=new o.Vector3(0,1,0),n=new o.Matrix4;return n.makeRotationZ(t),e.applyMatrix4(n),e},f.prototype.updateCameraDisplayRangeImp=function(t,e,n){null!=this._initZoomwCoordPt1&&null!=this._initZoomWCoordPt2?(this._initMinDisplayPoint=this.docCoord2World(this._initZoomwCoordPt1.x,this._initZoomwCoordPt1.y,0),this._initMaxDisplayPoint=this.docCoord2World(this._initZoomWCoordPt2.x,this._initZoomWCoordPt2.y,0)):(this._initMinDisplayPoint=t,this._initMaxDisplayPoint=e),this._viewangle=n,this.camera.up=this.calcCameraUp(n),this.cameraView.up=this.calcCameraUp(n),this.cameraView.updateProjectionMatrix(),this.zoomW(this._initMinDisplayPoint,this._initMaxDisplayPoint,!0)},f.prototype.setViewAngle=function(t){this._viewangle=t;var e=this.getOrthographicCamera();e&&(e.up=this.calcCameraUp(t),e.updateProjectionMatrix()),this.cameraView.up=this.calcCameraUp(t),this.cameraView.updateProjectionMatrix(),this.controls.update()},f.prototype.zoomInitialStates=function(){null!=this._initMinDisplayPoint&&null!=this._initMaxDisplayPoint?(this.camera.up=this.calcCameraUp(this._viewangle),this.cameraView.up=this.calcCameraUp(this._viewangle),this.cameraView.updateProjectionMatrix(),this.zoomW(this._initMinDisplayPoint,this._initMaxDisplayPoint,!0)):console.log("mx assert(0)")},f.prototype.onInitScene=function(){var t=this.getEvent(),e=0;if(null!=t.initScene&&(e=t.initScene(this.scene,this.controls,!0)),0==e){var n=new o.AmbientLight(3355443,1);this.scene.add(n);var r=new o.DirectionalLight(16777215,1);r.position.set(-2,2,3).normalize(),this.scene.add(r)}},f.prototype.updataCameraView=function(t,e){var n=t,r=e;this.cameraView.left=0,this.cameraView.right=n,this.cameraView.top=r,this.cameraView.bottom=0,this.cameraView.updateProjectionMatrix()},f.prototype.onInitViewScene=function(){if(!this.secenView){this.secenView=new o.Scene,this.secenView.background=new o.Color(this._viewcolor);var t=this.getViewWidth(),e=this.getViewHeight();t=this.xzSize(t),e=this.xzSize(e),this.cameraView=new o.OrthographicCamera(0,t,e,0,1,2e3),this.cameraView.position.set(0,0,2e3),this.cameraView.lookAt(new o.Vector3(0,0,0)),this.cameraView.updateProjectionMatrix();var n=new o.AmbientLight(3355443,1);this.secenView.add(n);var r=new o.DirectionalLight(16777215,1);r.position.set(-2,2,3).normalize(),this.secenView.add(r),this.threejsselectObjectsView=new o.Object3D,this.secenView.add(this.threejsselectObjectsView)}},f.prototype.onInitThreejs=function(){var t=this.getViewWidth(),e=this.getViewHeight(),n=(t=this.xzSize(t))/(e=this.xzSize(e))*50;this.onInitViewScene(),this.camera=new o.OrthographicCamera(n/-2,n/2,25,-25,1,1e3),this.camera.position.set(0,0,200),this.scene=new o.Scene;var r=this.getUserCanvas(),i=this._rendererParam;i=i||{},null==r?(i.antialias=!1,i.stencil=!0,this.renderer=new o.WebGLRenderer(i),this.renderer.setClearColor(0,1),this.renderer.setPixelRatio(this._devicePixelRatio),this.renderer.setSize(t,e),document.body.appendChild(this.renderer.domElement)):(i.canvas=r,i.stencil=!0,this.renderer=new o.WebGLRenderer(i),this.renderer.setClearColor(0,1),this.renderer.setPixelRatio(this._devicePixelRatio)),this.renderer.sortObjects=!0,this.renderer.info.autoReset=d.MxDrawData.m_isAutoResetRenderer,this.renderer.info.reset();var a=this.getUserCanvas();null==a&&(a=this.renderer.domElement),this.controls=new u.OrbitControls(this.camera,a),this.is3DDraw||(this.controls.enableZoom=!0),s.MxFun.isPC()?(this.controls.zoomSpeed=4,this.controls.mouseButtons.LEFT=o.MOUSE.PAN,this._mouseRightRotate?this.controls.mouseButtons.RIGHT=o.MOUSE.ROTATE:this.controls.mouseButtons.RIGHT=o.MOUSE.PAN,this.controls.screenSpacePanning=!0,-1!=this._isMouseMiddlePan&&this.setMouseMiddlePan(1==this._isMouseMiddlePan)):(this.controls.zoomSpeed=1.5,this.controls.touches.ONE=o.TOUCH.PAN,this.controls.screenSpacePanning=!0),this._is2d&&(this._runMode!=l.MxRunMode.kMxCAD&&this._runMode!=l.MxRunMode.kMxCADBrowseApp||(this.controls.mouseButtons.LEFT=-1,this.controls.mouseButtons.RIGHT=-1,this.controls.mouseButtons.MIDDLE=o.MOUSE.PAN))},f.prototype.onCreate=function(){this._is2d=!0,this.mxdrawThreeJS.onInitScene()},f.prototype.mxWebAddEntity_3DChild=function(t){var e=new c.MxNetData(t),n=e.getMesh();if(null==n.id)return n.size;var r=new o.Mesh(n.geometry,h.MxMaterial.GetBaseColorMaterial(n.nColorIndex));return this.removeEntity(n.id),this.scene.add(r),n.isSketchEntity&&(this.addEntity(n.id,r),this.getSketchLayers().addEntity(n.id,e.getLayerId())),n.size},f.prototype.mxWebAddEntity_Curve=function(t,e){var n=new c.MxNetData(t),r=n.getCurve(e);if(null!=r.id){var i=h.MxMaterial.GetCurveColorMaterial(r.colorIndex),a=new o.LineSegments(r.geometry,i);this.removeEntity(r.id),this.scene.add(a),r.isSketchEntity&&(this.addEntity(r.id,a),this.getSketchLayers().addEntity(r.id,n.getLayerId()))}},f.prototype.onResizeImp=function(t,e){var n=this.getViewWidth();null!=t&&(n=t);var r=this.getViewHeight();null!=e&&(r=e),n=this.xzSize(n),r=this.xzSize(r);var i=this.getOrthographicCamera();if(null==this._curMinDisplayPoint||null==this._curMaxDisplayPoint){var a=50,o=n/r;i.left=a*o/-2,i.right=a*o/2,i.top=a/2,i.bottom=a/-2,i.updateProjectionMatrix()}else{var s=Math.abs(this._curMinDisplayPoint.x-this._curMaxDisplayPoint.x),l=Math.abs(this._curMinDisplayPoint.y-this._curMaxDisplayPoint.y);s/l<n/r?(a=.5*l,o=n/r,i.left=-a*o,i.right=a*o,i.top=a,i.bottom=-a):(a=.5*s,o=r/n,i.left=-a,i.right=a,i.top=a*o,i.bottom=-a*o),i.updateProjectionMatrix()}this.renderer.setSize(n,r),this.updataClipMaterial(),this.updataCameraView(n,r),this.callEvent("viewsizechange",{width:n,height:r}),this.callEvent("viewchange"),this.m_mxDatabase.getSelectManager().setCanvasSize(n,r),this.m_mxDatabase.onViewChange()},f);function f(){var t=a.call(this,!0)||this;return t._initMinDisplayPoint=null,t._initMaxDisplayPoint=null,t._curMinDisplayPoint=null,t._curMaxDisplayPoint=null,t.is3DDraw=s.MxFun.is3DDwg(),t}n.MxDrawObject2d=p},{"./MxDrawData":29,"./MxDrawObject":30,"./MxFun":34,"./MxMaterial":37,"./MxNetData":38,three:19,"three-orbitcontrols":17}],32:[function(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0}),n.MxDrawObject3d=void 0;var a,o=t("three"),s=t("./MxDrawObject"),l=t("three-orbitcontrols"),u=t("./MxNetData"),c=t("./MxMaterial"),h=t("./MxTools"),d=(i(p,a=s.MxDrawObject),p.prototype.mxWebAddEntity_Curve=function(t,e){var n,r=new u.MxNetData(t),i=0==t.getInt32(32,!0),a=r.getIsSketchEntity();if(!((n=i?t.getInt32(20,!0)/4/3:t.getInt32(20,!0)/4/2)<2)){for(var s=new o.Geometry,l=e,d=0;d<n;d++){var p=t.getFloat32(l,!0);l+=4;var f=t.getFloat32(l,!0);l+=4;var m=0;i&&(m=t.getFloat32(l,!0),l+=4),s.vertices.push(h.MxTools.AsThreeJsPoint(p,f,m))}var g=t.getInt32(28,!0),v=c.MxMaterial.GetCurveColorMaterial(g),y=new o.LineSegments(s,v),x=t.getInt32(4,!0);this.removeEntity(x),this.scene.add(y),a&&this.addEntity(x,y)}},p.prototype.mxWebAddEntity_3DChild=function(t){var e=new u.MxNetData(t),n=e.getId(),r=(e.getColorIndex(),0==e.getBufferType()),i=e.getIsSketchEntity();this.removeEntity(n);var a=new o.Mesh(new o.Geometry),s=this.mxWebUpdateEntity_3DChild(a,t,r);return this.scene.add(a),i&&this.addEntity(n,a),a.geometry.computeBoundingBox(),a.geometry.computeBoundingSphere(),s},p.prototype.mxWebUpdateEntity_3DChild=function(t,e,n){var r=new u.MxNetData(e),i=r.getVertexBufferSize(),a=r.getIndexBufferSize(),s=r.getColorIndex();if(0===i||0===a)return r.getDrawDataOffset();var l=r.getMateria(),d=void 0,p=!0,f=!1,m=!1;0!=l.length&&(null!=(d=JSON.parse(l)).computeFaceNonmal&&(p=d.computeFaceNonmal),null!=d.castShadow&&(f=d.castShadow),null!=d.receiveShadow&&(m=d.receiveShadow)),t.material=c.MxMaterial.createMaterial(d),null==t.material&&(t.material=c.MxMaterial.GetColorMaterial(s)),t.castShadow=f,t.receiveShadow=m;var g,v=r.getDrawDataOffset();g=n?i/4/8:i/4/2;var y=t.geometry;y.vertices=[],y.faces=[];for(var x=0;x<g;x++){var b=e.getFloat32(v+0,!0),w=e.getFloat32(v+4,!0),_=0,M=0,S=0,T=0,C=0,E=0;n?(_=e.getFloat32(v+8,!0),M=e.getFloat32(v+12,!0),S=e.getFloat32(v+16,!0),T=e.getFloat32(v+20,!0),C=e.getFloat32(v+24,!0),E=e.getFloat32(v+28,!0),v+=32):v+=8;var D=h.MxTools.AsThreeJsPoint(b,w,_);y.vertices.push(D),y.vertices[x].normal=h.MxTools.AsThreeJsPoint(M,S,T),y.vertices[x].uv=new o.Vector2(C,E)}var A=a/4;for(x=0;x<A;x+=3){var O=e.getInt32(v,!0);v+=4;var L=e.getInt32(v,!0);v+=4;var P=e.getInt32(v,!0);v+=4;var R=new o.Face3(O,L,P);p||R.vertexNormals.push(y.vertices[O].normal,y.vertices[L].normal,y.vertices[P].normal),y.faces.push(R),y.faceVertexUvs[0].push([y.vertices[O].uv,y.vertices[L].uv,y.vertices[P].uv])}return p&&y.computeFaceNormals(),v},p.prototype.updateUVs=function(t){t.faceVertexUvs[0]=[],t.faces.forEach(function(e){var n=["x","y","z"].sort(function(t,n){return Math.abs(e.normal[t])-Math.abs(e.normal[n])}),r=t.vertices[e.a],i=t.vertices[e.b],a=t.vertices[e.c],s=new o.Vector2(r[n[0]],r[n[1]]),l=new o.Vector2(i[n[0]],i[n[1]]),u=new o.Vector2(a[n[0]],a[n[1]]);t.faceVertexUvs[0].push([s,l,u])}),t.uvsNeedUpdate=!0},p.prototype.onInitThreejs=function(){var t=this.getViewWidth(),e=this.getViewHeight(),n=(t=this.xzSize(t))/(e=this.xzSize(e))*50;this.camera=new o.OrthographicCamera(n/-2,n/2,25,-25,1,1e3),this.camera.position.set(-200,200,200),this.scene=new o.Scene,this.scene.background=new o.Color(this._viewcolor);var r=this.getUserCanvas();null==r?(this.renderer=new o.WebGLRenderer({antialias:!0,alpha:!0}),this.renderer.setPixelRatio(this._devicePixelRatio),this.renderer.setSize(t,e),document.body.appendChild(this.renderer.domElement)):(this.renderer=new o.WebGLRenderer({canvas:r,antialias:!0,alpha:!0}),this.renderer.setPixelRatio(this._devicePixelRatio));var i=this.getUserCanvas();null==i&&(i=this.renderer.domElement),this.controls=new l.OrbitControls(this.camera,i)},p.prototype.onInitViewScene=function(){},p.prototype.onInitScene=function(){var t=this.getEvent(),e=0;if(null!=t.initScene&&(e=t.initScene(this.scene,this.controls,!1)),0==e){var n=new o.AmbientLight(2236962);n.integrity=1,this.scene.add(n);var r=new o.DirectionalLight(16777215,1);r.position.set(-2,2,3).normalize(),this.scene.add(r);var i=new o.GridHelper(2e3,100);i.position.y=-199,i.material.opacity=.25,i.material.transparent=!0,this.scene.add(i);var a=new o.AxesHelper(20);this.scene.add(a)}},p.prototype.onCreate=function(){this._is2d=!1;var t=this.getEvent();null!=t.initRenderer&&t.initRenderer(this.renderer),this.mxdrawThreeJS.onInitScene()},p.prototype.getOrthographicCamera=function(){return this.camera instanceof o.OrthographicCamera?this.camera:null},p.prototype.onResizeImp=function(t,e){var n=this.getViewWidth();null!=t&&(n=t);var r=this.getViewHeight();null!=e&&(r=e),n=this.xzSize(n),r=this.xzSize(r);var i=this.getOrthographicCamera(),a=n/r;i.left=50*a/-2,i.right=50*a/2,i.top=25,i.bottom=-25,i.updateProjectionMatrix(),this.renderer.setSize(n,r)},p.prototype.zoomInitialStates=function(){},p.prototype.zoomScale=function(t){},p.prototype.zoomW=function(t,e,n){},p.prototype.zoomCenter=function(t,e){},p.prototype.setViewAngle=function(t){this._viewangle=t},p.prototype.getFullDisplayRange=function(){return{}},p);function p(){var t=a.call(this,!1)||this;return t._viewcolor=15790320,t}n.MxDrawObject3d=d},{"./MxDrawObject":30,"./MxMaterial":37,"./MxNetData":38,"./MxTools":45,three:19,"three-orbitcontrols":17}],33:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxDrawObjectEvent=n.MxDrawObjectEventDefautProc=void 0;var r=t("./MxFun"),i=t("./Operate/MxJigCmdManager"),a=t("three"),o=t("./UI/MxUiVue"),s=t("./MxDrawData"),l=(u.prototype.onMousemove=function(t){if(o.MxUiVue.isNull())return 0;var e=this.mxObj.screenCoord2Doc(t.offsetX,t.offsetY,0);return e=this.mxObj.docCoord2Cad(e.x,e.y,e.z),o.MxUiVue.setTipCoord(r.MxFun.formatString("{0},{1},0.000",e.x.toFixed(3),e.y.toFixed(3))),0},u.prototype.onTouchStart=function(t){if(s.MxDrawData.m_isEnableIntelliSelect&&!i.MxJigCmdManager.isRunning()){var e=t.touches[0].pageX,n=t.touches[0].pageY,o=this.mxObj,l=o.screenCoord2Doc(e,n,0);if(o.isMxCAD()){var u=o.getMxCAD();if(!u)return;var c=!0;if(u&&u.getGrip().onMouseLBDown(l)&&(c=!1),c)return r.MxFun.sendStringToExecute("Mx_IntelliSel",{pt1:l}),1}else if(!o.getMxDatabase().getGripManager().onMouseLBDown(l)){var h=new a.Vector3(e,n,0);return r.MxFun.sendStringToExecute("Mx_FrontEndWebpageIntelliSel",{pt:h}),1}}return 0},u.prototype.onMousdown=function(t){if(t.button==i.MxJigCmdManager.MouseButton.kRight&&i.MxJigCmdManager.isRunning())return i.MxJigCmdManager.stopCmd(),0;if(s.MxDrawData.m_isEnableIntelliSelect&&t.button==i.MxJigCmdManager.MouseButton.kLeft&&!i.MxJigCmdManager.isRunning()){var e=this.mxObj,n=e.screenCoord2Doc(t.offsetX,t.offsetY,0);if(e.isMxCAD()){var o=e.getMxCAD();if(!o)return;var l=!0;if(o&&o.getGrip().onMouseLBDown(n)&&(l=!1),l)return r.MxFun.sendStringToExecute("Mx_IntelliSel",{pt1:n}),1}else if(!e.getMxDatabase().getGripManager().onMouseLBDown(n)){var u=new a.Vector3(t.offsetX,t.offsetY,0);return r.MxFun.sendStringToExecute("Mx_FrontEndWebpageIntelliSel",{pt:u}),1}}return 0},u.prototype.init=function(t,e){this.mxObj=t;var n=this;e.addEventListener("mousemove",function(t){return n.onMousemove(t)}),e.addEventListener("mousedown",function(t){return n.onMousdown(t)}),e.addEventListener("touchstart",function(t){return n.onTouchStart(t)})},u);function u(){}n.MxDrawObjectEventDefautProc=l;var c=(h.prototype.onMousedown=function(t){this.callEvent("mousedown",t)},h.prototype.onMousemove=function(t){this.callEvent("mousemove",t)},h.prototype.onMouseup=function(t){this.callEvent("mouseup",t)},h.prototype.registEvent=function(t){var e=t.getOrbitControls();if(!e)return!1;var n=e.domElement,i=this;r.MxFun.isPC()?(n.addEventListener("mouseup",function(t){i.onMouseup(t)},!0),n.addEventListener("mousemove",function(t){i.onMousemove(t)},!0),n.addEventListener("mousedown",function(t){i.onMousedown(t)},!0)):(n.addEventListener("touchstart",function(t){i.callEvent("touchstart",t)},!0),n.addEventListener("touchend",function(t){i.callEvent("touchend",t)},!0),n.addEventListener("touchmove",function(t){i.callEvent("touchmove",t)},!0)),this.defautProc.init(t,this)},h.prototype.getEventCall=function(t){var e;return"mousemove"==t?e=this.aryMousemoveEventCall:"mouseup"==t?e=this.aryMouseupEventCall:"mousedown"==t?e=this.aryMousedownEventCall:"touchstart"==t?e=this.aryTouchstartEventCall:"touchend"==t?e=this.aryTouchendEventCall:"touchmove"==t&&(e=this.aryTouchmoveEventCall),e},h.prototype.callEvent=function(t,e){var n=this.getEventCall(t);if(n){for(var r=n.slice(),i=0,a=r.length;i<a;i++){var o=r[i](e);if(1==o)return o}return 0}},h.prototype.addEventListener=function(t,e,n){void 0===n&&(n=!1);var r=this.getEventCall(t);return!!r&&(-1<r.indexOf(e)||(n?r.unshift(e):r.push(e)),!0)},h.prototype.removeEventListener=function(t,e){var n=this.getEventCall(t);if(!n)return!1;var r=n.indexOf(e);return-1<r&&(n.splice(r,1),!0)},h);function h(){this.aryMousedownEventCall=[],this.aryMouseupEventCall=[],this.aryMousemoveEventCall=[],this.aryTouchstartEventCall=[],this.aryTouchendEventCall=[],this.aryTouchmoveEventCall=[],this.defautProc=new l}n.MxDrawObjectEvent=c},{"./MxDrawData":29,"./MxFun":34,"./Operate/MxJigCmdManager":58,"./UI/MxUiVue":67,three:19}],34:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxFun=void 0;var r,i,a,o,s,l,u,c,h,d,p,f,m,g,v=t("three"),y=t("./MxManager"),x=t("./MxDrawObject2d"),b=t("./MxDrawObject3d"),w=t("./UI/MxUiObjectMobile"),_=t("./UI/MxUiObjectPC"),M=t("./Operate/MxJigCmdManager"),S=t("./Operate/MxJigGetLine"),T=t("./Operate/MxCmdRunManager"),C=t("./UI/MxUiVue"),E=t("./MxThreeJS"),D=t("./MxWindowsEvent"),A=t("./MxTools"),O=t("./MxDrawCommands"),L=t("./MxDrawData"),P=t("./MxCAD/MxCADEditDisplay"),R=t("./MxLocalFileLoad"),I=t("./TempTest/MxTestJig"),k=t("./MxVersion"),B=t("./MrxDbgUtils");function F(t){t.cmd&&U(t.cmd)}function N(t){var e=new RegExp("(^|&)"+t+"=([^&]*)(&|$)"),n=window.location.search.substr(1).match(e);return null!=n?decodeURIComponent(n[2]):""}function j(){return y.MxManager.currentMx()}function z(){return y.MxManager.currentMx()}function V(t,e){var n={};if(null!=t)if(t instanceof Array)n.is2d=!0;else{0==t.length&&(t="empty");var r=t.substring(t.lastIndexOf(".")+1).toLowerCase();if("dwg"!=r&&"dxf"!=r&&"dwf"!=r&&"mwg"!=r&&"wgh"!=r||(n.is2d=!0),1!=e&&null!=e&&"wgh"!=r){var i=void 0,a=t.split("/");"$"==(i=1==a.length?a[0]:a[a.length-1])[0]&&(i=i.substring(1));for(var o=void 0,s=0;s<a.length-1;s++)o=0==s?a[s]:o+"/"+a[s];t=o?o+"/$"+i+".mxb1.wgh":"$"+i+".mxb1.wgh"}}else t="empty";return n.sFileName=t,n}function G(t){if("string"==typeof t){var e=t.substring(t.lastIndexOf(".")+1).toLowerCase();if("dwg"!=e&&"wgh"!=e){var n=t.lastIndexOf("?");if(-1!=n){var r=t.substring(n,t.length);return{sFileName:t=t.substring(0,n),sUrlParam:r}}}}return null}function U(t,e){var n=z();return T.MxCmdRunManager.runCmd(n,t,e)}function H(t){null!=t&&(t.init(),C.MxUiVue.init(t)),p||(console.log("MxDraw Version:"+k.MxBulid.getVersion()),p=!0,g=new R.MxLocalNodeJs,M.MxJigCmdManager.init(),D.MxWindowsEvent.registEvent(),y.MxManager.init(),O.MxDrawCommands.registerCommand(),window.mxConfig_isLoadTest&&I.MxTest.registerCommand(),m.sendStringToExecute=F)}r=n.MxFun||(n.MxFun={}),i=".",u=s=o=-1,d=null,p=!(h="ws://localhost:5090"),m={},g=f=c=l=a=void 0,r.getUiObj=function(){return d},r.getNodeJs=function(){return g},r.setMxServer=function(t){h=t},r.getMxServer=function(){return h},r.isPC=function(){return!/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)},r.getClientPlatform=function(){return navigator.platform},r.getClientInfo=function(){return{width:document.body.clientWidth,height:document.body.clientHeight}},r.curPath=function(){return i},r.setCurPath=function(t){i=t},r.getQueryString=N,r.getLocationPageUrl=function(){var t=window.location.href,e=t.lastIndexOf("?");return-1==e?t:t.substring(0,e)},r.getUrlParams=function(){var t=window.location.search,e=t.substr(1,t.length).split("&"),n=new Array;if(null!=e)for(var r=0;r<e.length;r++){var i=e[r].replace(/[=|^==]/,"&").split("&");if(1<i.length){var a=new Array;a.push(decodeURIComponent(i[0])),a.push(decodeURIComponent(i[1])),n.push(a)}}return n},r.call=function(t,e,n){null==e?e="{}":"string"==typeof e?0==e.length?e="{}":"["==e[0]&&"]"==e[e.length-1]||"{"==e[0]&&"}"==e[e.length-1]||(e='"'+(e=e.replace(/"/g,"'"))+'"'):e="object"==typeof e?JSON.stringify(e):"{}",y.MxManager.currentMx().call(t,e,n)},r.loadCodeToServer=function(t,e){y.MxManager.currentMx().loadCodeToServer(t,e)},r.getCurrentMx=j,r.getCurrentMxCAD=function(){var t=j();return t?t.getMxCAD():null},r.loadCodeFileToServer=function(t,e,n){y.MxManager.currentMx().loadCodeFileToServer(t,e,n)},r.isEnableSelect=function(){if(-1!=o)return 1==o;var t=N("select");return o=0,null!=t&&"y"==t.toLowerCase()&&(o=1),1==o},r.is3DDwg=function(){if(-1!=u)return 1==u;var t=N("3ddwg");return u=0,null!=t&&"y"==t.toLowerCase()&&(u=1),1==u},r.isStaticLoad=function(){if(-1!=s)return 1==s;var t=N("static");return s=0,null!=t&&"y"==t.toLowerCase()&&(s=1),1==s},r.enableSelect=function(t){o=t?1:0},r.enablStaticLoad=function(t){s=null==t||t?1:0},r.dwgDir=function(){return null!=l||null==(l=N("dwgdir"))&&(l=""),l},r.setDwgDir=function(t){l=t},r.getStaticServer=function(){return null!=c||null==(c=N("staticServer"))&&(c=""),c},r.setStaticServer=function(t){c=t},r.is2dParam=function(){if(null!=a)return a;var t=N("file");if(a=!1,null!=t){var e=t.substring(t.lastIndexOf(".")+1);"dwg"!=e.toLowerCase()&&"dxf"!=e.toLowerCase()&&"dwf"!=e.toLowerCase()&&"mwg"!=e.toLowerCase()||(a=!0)}return a},r.set2dParam=function(t){a=t},r.showLayer=function(t,e,n){var r=y.MxManager.currentMx().getMxCAD();if(!r)return y.MxManager.currentMx().showLayer(t,e,n);"number"==typeof t&&P.MxCADDisplayFun.showLayer(r.getDatabase(),t,e)},r.upDisplayForLayerData=function(t){var e=y.MxManager.currentMx().getMxCAD();return!!e&&e.getDatabase().getLayerTable().upDisplayForLayerData(e.getDatabase(),t)},r.screenCoord2World=function(t,e,n){return t instanceof Object?y.MxManager.currentMx().screenCoord2World(t.x,t.y,t.z):y.MxManager.currentMx().screenCoord2World(t,e,n)},r.worldCoord2Screen=function(t,e,n){return t instanceof Object?y.MxManager.currentMx().worldCoord2Screen(t.x,t.y,t.z):y.MxManager.currentMx().worldCoord2Screen(t,e,n)},r.docCoord2Cad=function(t,e,n){return t instanceof Object?y.MxManager.currentMx().docCoord2Cad(t.x,t.y,t.z):y.MxManager.currentMx().docCoord2Cad(t,e,n)},r.cadCoord2Doc=function(t,e,n){return t instanceof Object?y.MxManager.currentMx().cadCoord2Doc(t.x,t.y,t.z):y.MxManager.currentMx().cadCoord2Doc(t,e,n)},r.docCoord2World=function(t,e,n){return t instanceof Object?y.MxManager.currentMx().docCoord2World(t.x,t.y,t.z):y.MxManager.currentMx().docCoord2World(t,e,n)},r.worldCoord2Doc=function(t,e,n){return t instanceof Object?y.MxManager.currentMx().worldCoord2Doc(t.x,t.y,t.z):y.MxManager.currentMx().worldCoord2Doc(t,e,n)},r.screenCoord2Doc=function(t,e,n){return t instanceof Object?y.MxManager.currentMx().screenCoord2Doc(t.x,t.y,t.z):y.MxManager.currentMx().screenCoord2Doc(t,e,n)},r.docCoord2Screen=function(t,e,n){return t instanceof Object?y.MxManager.currentMx().docCoord2Screen(t.x,t.y,t.z):y.MxManager.currentMx().docCoord2Screen(t,e,n)},r.zoomCenter=function(t,e){y.MxManager.currentMx().is2D()&&(y.MxManager.currentMx().zoomCenter(t,e),y.MxManager.currentMx().updateDisplay())},r.zoomW=function(t,e,n,r,i){y.MxManager.currentMx().is2D()&&(y.MxManager.currentMx().zoomW(new v.Vector3(t,e,0),new v.Vector3(n,r,0),i),y.MxManager.currentMx().updateDisplay())},r.zoomScale=function(t){y.MxManager.currentMx().is2D()&&(y.MxManager.currentMx().zoomScale(t),y.MxManager.currentMx().updateDisplay())},r.zoomAll=function(){y.MxManager.currentMx().is2D()&&(y.MxManager.currentMx().zoomAll(),y.MxManager.currentMx().updateDisplay())},r.deleteAll=function(){return y.MxManager.currentMx().deleteAll()},r.callCommand=function(t,e,n){y.MxManager.currentMx().callCommand(t,e,n)},r.getCurrentColor=function(){return y.MxManager.currentMx().getCurrentColor()},r.setCurrentColor=function(t){y.MxManager.currentMx().setCurrentColor(t)},r.undo=function(){y.MxManager.currentMx().undo()},r.save=function(){y.MxManager.currentMx().save()},r.showLoading=function(){null!=d&&d.ShowLoading()},r.hideLoading=function(){null!=d&&d.HideLoading()},r.showProp=function(t){null!=d&&d.ShowObjectProperty(t)},r.hideProp=function(){null!=d&&d.HideObjectProp()},r.getUiObject=function(){return d},r.getViewCenterDocCoord=function(){return y.MxManager.currentMx().is2D()?y.MxManager.currentMx().getViewCenterDocCoord():new v.Vector3(0,0,0)},r.screenCoordLong2Doc=function(t){return y.MxManager.currentMx().is2D()?y.MxManager.currentMx().screenCoordLong2Doc(t):t},r.docCoordLong2Screen=function(t){return y.MxManager.currentMx().is2D()?y.MxManager.currentMx().docCoordLong2Screen(t):t},r.worldCoordLong2Doc=function(t){return y.MxManager.currentMx().is2D()?y.MxManager.currentMx().worldCoordLong2Doc(t):t},r.docCoordLong2World=function(t){return y.MxManager.currentMx().is2D()?y.MxManager.currentMx().docCoordLong2World(t):t},r.screenCoordLong2World=function(t){return y.MxManager.currentMx().is2D()?y.MxManager.currentMx().screenCoordLong2World(t):t},r.worldCoordLong2Screen=function(t){return y.MxManager.currentMx().is2D()?y.MxManager.currentMx().worldCoordLong2Screen(t):t},r.addSelectEvent=function(t){y.MxManager.addSelectEvent(t)},r.clearSelectEvent=function(){y.MxManager.clearSelectEvent()},r.removeThreejsObject=function(t,e,n){t&&(t.traverse(function(t){(t instanceof v.Mesh||t instanceof v.Line||t instanceof v.LineLoop)&&(t.geometry.dispose(),n&&(t.material instanceof Array?t.material.forEach(function(t){t.dispose()}):t.material.dispose()))}),e.remove(t))},r.setOutServerDebugCall=function(t){y.MxManager.setOutDebugCall(t)},r.updateDisplay=function(){y.MxManager.updateDisplay()},r.getCurrentDraw=z,r.formatString=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r++)t=t.replace("{".concat(r,"}"),e[r]);return t},r.createMxUiObject=function(t){var e;return e=this.isPC()?new _.MxUiObjectPC:new w.MxUiObjectMobile,t(d=e),e.create(),e},r.openFile=function(t,e){var n="";if("string"==typeof t){var r=G(t);r&&(n=r.sUrlParam,t=r.sFileName)}null==e&&(e=!1);var i=V(t,e);return i.is2d&&(a=i.is2d),t=i.sFileName,y.MxManager.currentMx().openFile(t,n)},r.createMxObject=function(t,e,n,i,a,o,s){p||H(),"string"==typeof t&&(t=0==t.length?void 0:document.getElementById(t));var l="";if(null==e)e=r.getQueryString("file");else{var u=G(e);u&&(l=u.sUrlParam,e=u.sFileName)}var c=null!=i&&i,h=V(e,o);h.is2d&&(c=h.is2d),e=h.sFileName,1==a&&(e="");var d=null;return c?(d=new x.MxDrawObject2d).setViewColor(0):(d=new b.MxDrawObject3d).setViewColor(15790320),null!=n&&n(d),d.create(t,e,l,s),d},r.getMxObjectFormElement=function(t){return y.MxManager.getMxObject(t)},r.isRunningCommand=function(){return M.MxJigCmdManager.isRunning()},r.stopRunCommand=function(){return M.MxJigCmdManager.stopCmd()},r.runCommand=function(t){return M.MxJigCmdManager.runCmd(t)},r.getTHREE=function(){return v},r.getLine=function(t){var e=new S.MxJigGetLine;e.setRetCall(t),M.MxJigCmdManager.runCmd(e)},r.addCommand=function(t,e,n){T.MxCmdRunManager.addCommand(t,e,n)},r.sendStringToExecute=U,r.getMxEntity=function(t){var e=z();return e?e.getMxEntityUserObject(t):null},r.initUiDataObject=function(t){C.MxUiVue.isNull()&&(t.init(r),C.MxUiVue.init(t))},r.init=H,r.addWindowsEvent=function(t){D.MxWindowsEvent.addEvent(t)},r.getCurrentMousePostion=function(){return D.MxWindowsEvent.getCurrentMousePostion()},r.getMxThreeJS=function(){return E.MxThreeJS},r.getMxTools=function(){return A.MxTools},r.getMxCmdRunManager=function(){return T.MxCmdRunManager},r.getMxJigCmdManager=function(){return M.MxJigCmdManager},r.initQuickCommand=function(t){T.MxCmdRunManager.InitQuickCommand(t)},r.Assert=function(t){t||console.log("MxAssert error")},r.setIniset=function(t){L.MxDrawData.setIniset(t)},r.setPostMessageToParentFrameFunction=function(t){f=t},r.postMessageToParentFrame=function(t){return null!=f&&(f(t),!0)},r.onParentFrameMessage=function(t){null!=t&&null!=t.type&&m[t.type]&&m[t.type](t)},r.acutPrintf=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(!C.MxUiVue.isNull()){for(var r=arguments,i=r[0],a=0;a<r.length-1;a++){var o=new RegExp("\\{"+a+"\\}","gm");i=i.replace(o,r[a+1])}C.MxUiVue.AcutPrintfNoFormat(i,!0)}},r.loadImageMaterial=function(t,e){y.MxManager.getMxDbTextureManager().loadImage(t,e)},r.loadSVG=function(t,e,n,r){y.MxManager.getMxDbSvgManager().loadSVG(t,e,n,r)},r.initMxDbEntityType=function(t){y.MxManager.getMxDbEntityClassHierarchy().init(t)},r.initDynamicCreate=function(t){y.MxManager.getMxDbEntityClassHierarchy().initDynamic(t)},r.ceneratecursor=function(t,e,n){void 0===t&&(t=128),void 0===e&&(e=10),void 0===n&&(n=!0);var r=document.createElement("canvas");r.width=r.height=t,r.style.background="transparent";var i=r.getContext("2d"),a=t%2==0?-.5:0,o=e%2==0?-.5:0;i.strokeStyle="#fff",n&&(i.beginPath(),i.moveTo(r.width/2+a,a),i.lineTo(r.width/2+a,r.height+a),i.stroke(),i.beginPath(),i.moveTo(a,r.height/2+a),i.lineTo(r.width+a,r.height/2+a),i.stroke()),i.beginPath(),i.strokeRect(t/2-e/2+o,t/2-e/2+o,e,e),i.stroke();var s=new Image;return s.src=r.toDataURL("image/png"),s.src},r.getMrxDbgUtilsClass=function(){return B.MrxDbgUtils}},{"./MrxDbgUtils":20,"./MxCAD/MxCADEditDisplay":21,"./MxDrawCommands":28,"./MxDrawData":29,"./MxDrawObject2d":31,"./MxDrawObject3d":32,"./MxLocalFileLoad":35,"./MxManager":36,"./MxThreeJS":44,"./MxTools":45,"./MxVersion":47,"./MxWindowsEvent":48,"./Operate/MxCmdRunManager":53,"./Operate/MxJigCmdManager":58,"./Operate/MxJigGetLine":59,"./TempTest/MxTestJig":63,"./UI/MxUiObjectMobile":65,"./UI/MxUiObjectPC":66,"./UI/MxUiVue":67,three:19}],35:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxLocalDwgFileLoad=n.MxLocalFileLoad=n.MxLocalNodeJs=void 0;var r=t("./MxFun"),i=(a.prototype.init=function(t){this.loadFileCall=t.loadFileFun},a.prototype.loadFile=function(t,e,n,r,i){null!=this.loadFileCall?this.loadFileCall(t,e,n,r,i):i(void 0)},a);function a(){this.loadFileCall=null}n.MxLocalNodeJs=i;var o=(s.prototype.setPath=function(t){this.path=t},s.prototype.setBinary=function(t){this.isBinary=t},s.prototype.load=function(t,e,n,i){r.MxFun.getNodeJs().loadFile(this.path+t,this.isBinary,e,n,i)},s);function s(){this.path="",this.isBinary=!1}n.MxLocalFileLoad=o;var l=(u.prototype.setShowloading=function(t){this._isShowLoading=t},u.prototype.load=function(t,e){var n="$"+e+".mxb1.wgh";this._path=t,this._filename=e;var r=this;this.getFile(this._path,n,!1,function(t){"string"==typeof t?r.net.onStaticHeadMessage(t):console.log("mx error h1")},function(){console.log("mx get "+n+" faild")})},u.prototype.getDatas=function(){if(this._iGet>=this._dataNum)this._isShowLoading&&r.MxFun.hideLoading();else{var t=this._dataType[this._iGet];this._iGet++;var e=this,n=this._iGet+1,i="$"+this._filename+".mxb"+n+".wgh",a=0!=t;this.getFile(this._path,i,a,function(t){e.net.onStaticMessage(t),e.getDatas()},function(){e._dataNum=0,e._iGet=0,e._isShowLoading&&r.MxFun.hideLoading(),console.log("mx get "+i+" faild")})}},u.prototype.onRenderHead=function(t){var e=JSON.parse(t);this._dataType=e.type,this._dataNum=e.count,this._iGet=0,this._isShowLoading&&r.MxFun.showLoading(),this.getDatas()},u.prototype.getFile=function(t,e,n,r,i){var a=new o;a.setPath(t),a.setBinary(n),a.load(e,r,function(){},i)},u);function u(t){this.net=null,this._dataNum=0,this._iGet=0,this._dataType=[],this._path="",this._filename="",this._isShowLoading=!0,this.net=t}n.MxLocalDwgFileLoad=l},{"./MxFun":34}],36:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxManager=n.MxData=void 0;var r,i,a,o,s,l,u,c,h,d=t("./View/MxDbEntity"),p=t("./View/MxDbTextureManager"),f=t("./SVGLoader/MxSVGLoader");(r=n.MxData||(n.MxData={})).iSelectRenderOrder=5,r.iCADMeshRenderOrder=10,r.iCADCurveRenderOrder=20,r.iMxEntityRenderOrder=30,r.iGripRenderOrder=110,r.iDynJigRenderOrder=120,i=n.MxManager||(n.MxManager={}),a=[],o=null,s=[],l=void 0,u=new p.MxDbTextureManager,c=new f.MxSvgManager,h=new d.MxDbEntityClassHierarchy,i.add=function(t){a.push(t)},i.getMxDbEntityClassHierarchy=function(){return h},i.getMxDbTextureManager=function(){return u},i.getMxDbSvgManager=function(){return c},i.outDebugString=function(t){null==l?console.log(t):l(t)},i.setOutDebugCall=function(t){l=t},i.onLoad=function(){for(var t in a)a[t].onLoad("")},i.updateDisplay=function(){for(var t in a)a[t].updateDisplay()},i.currentMx=function(){return o},i.setCurrentMx=function(t){o=t},i.initResize=function(){for(var t in a)a[t].initResize()},i.addSelectEvent=function(t){s.push(t)},i.clearSelectEvent=function(){s=[]},i.callSelectObject=function(t){for(var e in s)if(1==s[e](t))break},i.init=function(){},i.getMxObject=function(t){for(var e in a)if(a[e].getCanvas()===t)return a[e];return null}},{"./SVGLoader/MxSVGLoader":61,"./View/MxDbEntity":71,"./View/MxDbTextureManager":76}],37:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxMaterial=void 0;var r=t("three");!function(t){t.shaderUniforms={crAmbient:{value:new r.Vector3(1,0,0)},crDiffuse:{value:new r.Vector3(1,0,0)},crSpecular:{value:new r.Vector3(1,0,0)}},t.m_arrSystemColors=new Array(0,16711680,16776960,65280,65535,255,16711935,16777215,8421504,12632256,16711680,16744319,13369344,13395558,10027008,10046540,8323072,8339263,4980736,4990502,16727808,16752511,13382400,13401958,10036736,10051404,8331008,8343359,4985600,4992806,16744192,16760703,13395456,13408614,10046464,10056268,8339200,8347455,4990464,4995366,16760576,16768895,13408512,13415014,10056192,10061132,8347392,8351551,4995328,4997670,16776960,16777087,13421568,13421670,10066176,10066252,8355584,8355647,5000192,5000230,12582656,14679935,10079232,11717734,7510272,8755532,6258432,7307071,3755008,4344870,8388352,12582783,6736896,10079334,5019904,7510348,4161280,6258495,2509824,3755046,4194048,10485631,3394560,8375398,2529536,6265164,2064128,5209919,1264640,3099686,65280,8388479,52224,6736998,39168,5019980,32512,4161343,19456,2509862,65343,8388511,52275,6737023,39206,5019999,32543,4161359,19475,2509871,65407,8388543,52326,6737049,39244,5020018,32575,4161375,19494,2509881,65471,8388575,52377,6737074,39282,5020037,32607,4161391,19513,2509890,65535,8388607,52428,6737100,39321,5020057,32639,4161407,19532,2509900,49151,8380415,39372,6730444,29337,5014937,24447,4157311,14668,2507340,32767,8372223,26316,6724044,19609,5010073,16255,4153215,9804,2505036,16383,8364031,13260,6717388,9881,5005209,8063,4149119,4940,2502476,255,8355839,204,6710988,153,5000345,127,4145023,76,2500172,4129023,10452991,3342540,8349388,2490521,6245529,2031743,5193599,1245260,3089996,8323327,12550143,6684876,10053324,4980889,7490713,4128895,6242175,2490444,3745356,12517631,14647295,10027212,11691724,7471257,8735897,6226047,7290751,3735628,4335180,16711935,16744447,13369548,13395660,10027161,10046617,8323199,8339327,4980812,4990540,16711871,16744415,13369497,13395634,10027122,10046597,8323167,8339311,4980793,4990530,16711807,16744383,13369446,13395609,10027084,10046578,8323135,8339295,4980774,4990521,16711743,16744351,13369395,13395583,10027046,10046559,8323103,8339279,4980755,4990511,3355443,5987163,8684676,11382189,14079702,16777215),t.m_arrDefUseMaterials=new Array(null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null),t.m_arrDefUseCurveMaterials=new Array(null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null),t.m_arrDefUseBasicMaterials=new Array(null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null),t.m_selectMaterial=new r.MeshPhongMaterial({color:255,opacity:.2,transparent:!0,side:r.DoubleSide}),t.m_mouseMoveMaterial=new r.MeshPhongMaterial({color:16776960,side:r.DoubleSide}),t.m_lockedMaterial=new r.MeshPhongMaterial({color:197379,side:r.DoubleSide}),t.m_samplePoints=new r.PointsMaterial({color:255,depthTest:!1,size:8}),t.m_samplePointsMouseMove=new r.PointsMaterial({color:16711680,depthTest:!1,size:12});var e=new r.MeshBasicMaterial({color:16777215,transparent:!0,depthTest:!1,side:r.DoubleSide,opacity:1,stencilWrite:!1,colorWrite:!1});t.getStencilMaterial=function(){return e},t.GetColorByIndex=function(e){return t.m_arrSystemColors[e]},t.GetColorMaterial=function(e){var n=t.m_arrDefUseMaterials[e];return null===n&&(n=new r.MeshLambertMaterial({color:t.m_arrSystemColors[e],side:r.DoubleSide}),t.m_arrDefUseMaterials[e]=n),n},t.GetBaseColorMaterial=function(e){var n=t.m_arrDefUseBasicMaterials[e];return null===n&&(n=new r.MeshBasicMaterial({color:t.m_arrSystemColors[e],side:r.DoubleSide}),t.m_arrDefUseMaterials[e]=n),n},t.GetCurveColorMaterial=function(e){var n=t.m_arrDefUseCurveMaterials[e];return null===n&&(n=new r.LineBasicMaterial({color:t.m_arrSystemColors[e],linewidth:1}),t.m_arrDefUseCurveMaterials[e]=n),n},t.GetSelectMaterial=function(){return t.m_selectMaterial},t.GetMouseMoveMaterial=function(){return t.m_mouseMoveMaterial},t.GetLockedMaterial=function(){return t.m_lockedMaterial},t.GetSamplePointsMaterial=function(){return t.m_samplePoints},t.GetSamplePointsMouseMoveMaterial=function(){return t.m_samplePointsMouseMove},t.createMaterial=function(t){var e=void 0;if(null==t)return e;function n(t,e){if(null!=e.map){var n=e.map,i=(new r.TextureLoader).load(n);i.wrapS=i.wrapT=r.RepeatWrapping,t.map=i,t.side=r.DoubleSide}}return 0!=t.transparent?t.transparent=!0:t.transparent=!1,"MeshPhongMaterial"==t.name?n(e=new r.MeshPhongMaterial(t),t):"MeshBasicMaterial"==t.name?n(e=new r.MeshBasicMaterial(t),t):"MeshDepthMaterial"==t.name?n(e=new r.MeshDepthMaterial(t),t):"MeshNormalMaterial"==t.name?n(e=new r.MeshNormalMaterial(t),t):"MeshLambertMaterial"==t.name?n(e=new r.MeshLambertMaterial(t),t):"MeshStandardMaterial"==t.name&&n(e=new r.MeshStandardMaterial(t),t),e}}(n.MxMaterial||(n.MxMaterial={}))},{three:19}],38:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxHFileLoad=n.MxNet=n.MxNetBinMessageType=n.MxNetSend=n.MxNetMessage=n.MxNetMessageType=n.MxNetData=void 0;var r,i,a=t("three"),o=t("./MxFun"),s=t("pako"),l=t("./MxManager"),u=t("./MxDrawData"),c=(h.prototype.getId=function(){return this._dataView.getInt32(4,!0)},h.prototype.getVersion_MwBlobHead=function(){return this._dataView.getInt32(60,!0)},h.prototype.getVersion_MwBlobHeadDynLen=function(){return this._dataView.getInt32(4,!0)},h.prototype.getdPointCurveBuffersHead=function(){var t={};return t.ver=this._dataView.getInt32(4,!0),t.databaseIndex=this._dataView.getInt32(8,!0),t.zeroLayerIdIndex=this._dataView.getInt32(16,!0),t.datacount=this._dataView.getInt32(20,!0),t.datasize=this._dataView.getInt32(24,!0),t},h.prototype.getdPointMeshBuffersHead=function(){var t={};return t.ver=this._dataView.getInt32(4,!0),t.databaseIndex=this._dataView.getInt32(8,!0),t.id=this._dataView.getInt32(12,!0),t.zeroLayerIdIndex=this._dataView.getInt32(16,!0),t.datacount=this._dataView.getInt32(20,!0),t.datasize=this._dataView.getInt32(24,!0),t},h.prototype.getdPointTextureBuffersHead=function(){var t={};return t.ver=this._dataView.getInt32(4,!0),t.databaseIndex=this._dataView.getInt32(8,!0),t.zeroLayerIdIndex=this._dataView.getInt32(16,!0),t.datacount=this._dataView.getInt32(20,!0),t.datasize=this._dataView.getInt32(24,!0),t},h.prototype.getBlobHeadForMemorySectionsHead=function(t){var e={};return e.type=this._dataView.getInt32(t,!0),t+=4,e.ver=this._dataView.getInt32(t,!0),t+=4,e.databaseIndex=this._dataView.getInt32(t,!0),t+=4,e.nOffset=t,e},h.prototype.getMemorySectionsHead=function(){var t=this.getBlobHeadForMemorySectionsHead(0);return t.zeroLayerIdIndex=this._dataView.getInt32(t.nOffset,!0),t.nOffset+=4,t.datacount=this._dataView.getInt32(t.nOffset,!0),t.nOffset+=4,t.datasize=this._dataView.getInt32(t.nOffset,!0),t.nOffset+=4,t.datasize!=t.nOffset&&console.log("mx: sectionshead size assert(0)"),t},h.prototype.getMemorySectionHead=function(t){var e=this.getBlobHeadForMemorySectionsHead(t);return t=e.nOffset,e.pointCount=this._dataView.getInt32(t,!0),t+=4,e.layerId=this._dataView.getInt32(t,!0),t+=4,e.blkId=this._dataView.getInt32(t,!0),t+=4,e.memColor=this._dataView.getInt32(t,!0),t+=4,e.memId=this._dataView.getInt32(t,!0),t+=4,e.memType=this._dataView.getInt32(t,!0),t+=4,e.offset=t,e},h.prototype.getdPointTextureBufferDataHead=function(t){t+=4,t+=4,t+=4;var e={};return e.dataCount=this._dataView.getInt32(t,!0),t+=4,e.layerId=this._dataView.getInt32(t,!0),t+=4,e.blkId=this._dataView.getInt32(t,!0),t+=4,e.offset=t,e},h.prototype.getdPointCurveBufferDataHead=function(t){t+=4,t+=4,t+=4;var e={};return e.pointCount=this._dataView.getInt32(t,!0),t+=4,e.layerId=this._dataView.getInt32(t,!0),t+=4,e.blkId=this._dataView.getInt32(t,!0),t+=4,e.offset=t,e},h.prototype.getdPointMeshBufferDataHead=function(t){t+=4,t+=4,t+=4;var e={};return e.pointCount=this._dataView.getInt32(t,!0),t+=4,e.layerId=this._dataView.getInt32(t,!0),t+=4,e.blkId=this._dataView.getInt32(t,!0),t+=4,e.offset=t,e},h.prototype.getDatabaseIndex=function(){return this._dataView.getInt32(8,!0)},h.prototype.getColorIndex=function(){return this._dataView.getInt32(24,!0)},h.prototype.getBufferType=function(){return this._dataView.getInt32(32,!0)},h.prototype.getIsSketchEntity=function(){return this._dataView.getInt32(40,!0)},h.prototype.getLayerId=function(){return this._dataView.getInt32(44,!0)},h.prototype.getBlockId=function(){return this._dataView.getInt32(48,!0)},h.prototype.getVertexBufferSize=function(){return this._dataView.getInt32(12,!0)},h.prototype.getIndexBufferSize=function(){return this._dataView.getInt32(16,!0)},h.prototype.getZeroLayerId=function(){return this._dataView.getInt32(52,!0)},h.prototype.getSelectMark=function(){return this._dataView.getInt32(56,!0)},h.prototype.getMateria=function(){var t=this._dataView.getInt32(36,!0);if(0==t)return"";for(var e=[],n=0;n<t;n++){var r=String.fromCharCode(this._dataView.getUint8(80+n));e.push(r)}return e.join("")},h.prototype.getDrawDataOffset=function(){return this._dataView.getInt32(36,!0)+80},h.prototype.getMesh=function(){var t=this._dataView.getInt32(4,!0),e=0==this._dataView.getInt32(32,!0),n={},r=this._dataView.getInt32(12,!0),i=this._dataView.getInt32(16,!0);if(0===r||0===i)return n.size=80,n;var o,s=new a.Geometry,l=80;o=e?r/4/8:r/4/2;for(var u=0;u<o;u++){var c=this._dataView.getFloat32(l+0,!0),h=this._dataView.getFloat32(l+4,!0),d=0;e?(d=this._dataView.getFloat32(l+8,!0),this._dataView.getFloat32(l+12,!0),this._dataView.getFloat32(l+16,!0),this._dataView.getFloat32(l+20,!0),this._dataView.getFloat32(l+24,!0),this._dataView.getFloat32(l+28,!0),l+=32):l+=8;var p=new a.Vector3(c,h,d);s.vertices.push(p)}var f=i/4;for(u=0;u<f;u+=3){var m=this._dataView.getInt32(l,!0);l+=4;var g=this._dataView.getInt32(l,!0);l+=4;var v=this._dataView.getInt32(l,!0);l+=4;var y=new a.Face3(m,g,v);s.faces.push(y)}var x=this.getIsSketchEntity();return n.size=l,n.geometry=s,n.id=t,n.isSketchEntity=x,n.nColorIndex=this._dataView.getInt32(24,!0),n},h.prototype.getCurve=function(t){var e,n=this._dataView.getInt32(32,!0),r=this.getIsSketchEntity(),i=0==n,o={};if((e=i?this._dataView.getInt32(20,!0)/4/3:this._dataView.getInt32(20,!0)/4/2)<2)return o;for(var s=new a.Geometry,l=t,u=0;u<e;u++){var c=this._dataView.getFloat32(l,!0);l+=4;var h=this._dataView.getFloat32(l,!0);l+=4;var d=0;i&&(d=this._dataView.getFloat32(l,!0),l+=4),s.vertices.push(new a.Vector3(c,h,d))}var p=this._dataView.getInt32(4,!0);return o.size=l,o.geometry=s,o.id=p,o.isSketchEntity=r,o.colorIndex=this._dataView.getInt32(28,!0),o},h);function h(t){this._dataView=t}n.MxNetData=c,(i=r=n.MxNetMessageType||(n.MxNetMessageType={})).kAddLayer="00000007",i.kClearLayer="00000008",i.kHideLayer="00000009",i.kShowLayer="00000010",i.kUpdateDisplayRange="00000011",i.kCallJsReturn="00000012",i.kLayerData="00000013",i.kSendDebugString="00000014",i.kShowLoading="00000015",i.kHideLoading="00000016",i.kSelectObject="00000017",i.kGlRenderHead="00000018",i.kUserLoginResult="00000019",i.kOpenFileResult="00000020",i.kServerReturn="00000021",i.kMxCADLayerData="00000056",i.kMxCADSystemVariable="00000057";var d=(p.prototype.setJsRetCall=function(t,e,n){this.serverJsRetCall.set(e+n,t)},p.prototype.onSocketErrort=function(){this.serverJsRetCall.forEach(function(t){t(void 0)}),this.serverJsRetCall=new Map},p.prototype.Do=function(t){var e=this.net.getCurrentDatabaseId();if(-1==e){var n=t.substring(0,4);e=parseInt(n)}var r=t.substring(4,12),i=t.substring(12);return null!=this.messageCall[r]&&(this.messageCall[r](i,e),!0)},p);function p(t,e){this.messageCall=new Map,this.serverJsRetCall=new Map,this.net=null,this.net=e;var n=this;this.messageCall[r.kUpdateDisplayRange]=function(e){if(!n.net.isTzDwgStaticFile()){e=e.replace(/\\/g,"\\\\");try{var r=JSON.parse(e);if(null!=r&&t.is2D()){t.initCAD2Doc(new a.Matrix4),r.newbrownermode?r.DToSMat?u.MxDrawData.m_isCorrectLargeCoordinates?(t.intiDoc2Wold(new a.Matrix4),t.initCAD2Doc(r.DToSMat)):t.intiDoc2Wold(r.DToSMat):t.intiDoc2Wold(new a.Matrix4):t.intiDoc2Wold(r.DToWMat),t.updateCameraDisplayRange(new a.Vector3(+r.pt1[0],+r.pt1[1],+r.pt1[2]),new a.Vector3(+r.pt2[0],+r.pt2[1],+r.pt2[2]),+r.viewangle),t.initAllLayoutName(r.layout),t.updateDisplay(!0);var i=o.MxFun.getUiObj();null!=i&&(i.SetLayoutData(r.layout),i.UpDisplayLayout())}}catch(e){console.log("UpdateDisplayRange exception")}}},this.messageCall[r.kCallJsReturn]=function(t){if(0!=t.length){var e=JSON.parse(t);0==e.cmd.length&&(e.cmd="__mx_loadcode");var r=e.cmd+e.count,i=n.serverJsRetCall.get(r);i&&(n.serverJsRetCall.delete(r),"string"==typeof e.ret&&(e.ret=e.ret.replace(/\'/g,'"')),i(e.ret))}else console.log("assert(0),kCallJsReturn return empty")},this.messageCall[r.kSendDebugString]=function(t){l.MxManager.outDebugString(t)},this.messageCall[r.kUserLoginResult]=function(e){t.userLoginResult(e)},this.messageCall[r.kOpenFileResult]=function(e){t.openFileResult(e)},this.messageCall[r.kServerReturn]=function(e){t.serverReturn(e)},this.messageCall[r.kShowLoading]=function(t){n.net.isTzDwgStaticFile()||o.MxFun.showLoading()},this.messageCall[r.kHideLoading]=function(e){n.net.isTzDwgStaticFile()||(o.MxFun.hideLoading(),t.callInitCompleteEvent())},this.messageCall[r.kSelectObject]=function(t){var e=JSON.parse(t);l.MxManager.callSelectObject(parseInt(e.id))},this.messageCall[r.kGlRenderHead]=function(e){t.isStaticLocalLoad()?t.getStaticLocalNet().onRenderHead(e):(n.net.isTzDwgStaticFile()?t.getStaticLoadTzNet():t.getStaticNet()).onRenderHead(e)},this.messageCall[r.kMxCADLayerData]=function(e,n){t.getMxCAD().getOpenDisplay().OnMessageLayerData(e)},this.messageCall[r.kMxCADSystemVariable]=function(e,n){t.sysVariable().OnMessageMxCADSystemVariable(e)},this.messageCall[r.kLayerData]=function(e,n){if(0==n){if(t.addLayerInfoComplete(),null!=(s=JSON.parse(e))){if(!s.isSketch){var r=s.list;for(var i in r)t.addLayerInfo(r[i].id,r[i].colorvalue,r[i].name),1==r[i].zerolayer&&t.setZeroLayerId(r[i].id)}s.isSketch||t.callEvent("uiSetLayerData",s.list);var a=o.MxFun.getUiObj();null!=a&&(s.isSketch?a.SetSketchLayerData(s.list):a.SetLayerData(s.list),a.UpDisplayLayer())}}else{var s,l=t.getExtRefManager().getLayers(n);if(l.initComplete(),null!=(s=JSON.parse(e)))for(var i in r=s.list)l.add(r[i].id,r[i].colorvalue,r[i].name),1==r[i].zerolayer&&l.setZeroLayerId(r[i].id)}}}n.MxNetMessage=d;var f,m,g=(v.prototype.setWebSocket=function(t){this._webSocket=t},v.prototype.UndoMark=function(){null!=this._webSocket&&this._webSocket.send(this.SendType.kUndoMark+"")},v.prototype.DoCommand=function(t,e,n){null!=this._webSocket&&(null!=n?(this._callCount++,200<this._callCount&&(this._callCount=1),this._msg.setJsRetCall(n,t,this._callCount),null==e&&(e=""),this._webSocket.send(this.SendType.kCmdEx+","+t+","+this._callCount+","+e)):null==e?this._webSocket.send(this.SendType.kCmd+","+t):this._webSocket.send(this.SendType.kCmd+","+t+","+e))},v.prototype.OpenFile=function(t){null!=this._webSocket&&this._webSocket.send(this.SendType.kOpenFile+","+t)},v.prototype.UserLogin=function(t,e,n){if(null!=this._webSocket){var r={};r.IdentitySign=t,r.RandomToken=null==e?"":e,r.Init=null==n?"":n,this._webSocket.send(this.SendType.kUserLogin+","+JSON.stringify(r))}},v.prototype.Init=function(t){null!=this._webSocket&&this._webSocket.send(this.SendType.kInit+","+t)},v.prototype.CallServerJS=function(t,e,n){null!=this._webSocket&&(null==n?null==e||null==e||0==e.length?this._webSocket.send(this.SendType.kCallJS+',{"command":"'+t+'","param":"{}"}'):this._webSocket.send(this.SendType.kCallJS+',{"command":"'+t+'","param":'+e+"}"):(this._callCount++,200<this._callCount&&(this._callCount=1),this._msg.setJsRetCall(n,t,this._callCount),null==e||null==e||0==e.length?this._webSocket.send(this.SendType.kCallJS+',{"command":"'+t+'","param":"{}","count":"'+this._callCount+'"}'):this._webSocket.send(this.SendType.kCallJS+',{"command":"'+t+'","param":'+e+',"count":"'+this._callCount+'"}')))},v.prototype.CallLoadCodeToServer=function(t,e){null!=this._webSocket&&(this._msg.setJsRetCall(e,"__mx_loadcode",0),null!=t&&null!=t&&0!=t.length&&this._webSocket.send(this.SendType.kCallJS+","+t))},v.prototype.DeleteObject=function(t){null!=this._webSocket&&this._webSocket.send(this.SendType.kDelete+","+t)},v.prototype.SelectObject=function(t){null!=this._webSocket&&this._webSocket.send(this.SendType.kSelect+","+t)},v.prototype.QuitSelectObject=function(t){null!=this._webSocket&&this._webSocket.send(this.SendType.kQuitSelect+","+t)},v.prototype.SendDragDrawEntity=function(t){null!=this._webSocket&&this._webSocket.send(this.SendType.kAddDragDraw+","+t)},v.prototype.SendDragDrawRequest=function(){null!=this._webSocket&&(this.SendMousePickRay(),this._webSocket.send(this.SendType.kRequestDragDraw))},v.prototype.SendDragDrawDetermine=function(){null!=this._webSocket&&(this.SendMousePickRay(),this._webSocket.send(this.SendType.kDetermineDragDraw))},v.prototype.SendDragDrawCancel=function(){null!=this._webSocket&&this._webSocket.send(this.SendType.kCancelDragDraw)},v.prototype.SendMousePickRay=function(){this._webSocket},v);function v(t,e){this.SendType={},this._callCount=1,this._webSocket=t,this._msg=e,this.SendType.kCmd=0,this.SendType.kDelete=1,this.SendType.kSelect=2,this.SendType.kOpenFile=3,this.SendType.kGetDemoList=4,this.SendType.kCallJS=5,this.SendType.kAddDragDraw=6,this.SendType.kRequestDragDraw=7,this.SendType.kMousePickRay=8,this.SendType.kDetermineDragDraw=9,this.SendType.kCancelDragDraw=10,this.SendType.kQuitSelect=11,this.SendType.kInit=12,this.SendType.kCmdEx=13,this.SendType.kUserLogin=14,this.SendType.kUndoMark=15}n.MxNetSend=g,(m=f=n.MxNetBinMessageType||(n.MxNetBinMessageType={})).eBlockRef=10,m.eEntitysData=14,m.eAddEntityFor2dPointTextureBuffers=15,m.eMxNewMemorySections=16,m.kMxCADBlockRef=56,m.kMxCADMemorySections=57,m.kMxCADMemorySectionsFromChange=59,m.kMxCADNotUseMemorySectionsForChage=61,m.kMxCADEntityDisplayDatas=62;var y=(x.prototype.setCurrentDatabaseId=function(t){this._iCurrentDatabaseId=t},x.prototype.getMxDrawObject=function(){return this._mx},x.prototype.getCurrentDatabaseId=function(){return this._iCurrentDatabaseId},x.prototype.isTzDwgStaticFile=function(){return-1!=this._iCurrentDatabaseId},x.prototype.onBinMessage=function(t){var e=this._mx,n=s.inflate(t),r=new DataView(n.buffer),i=r.getInt32(0,!0);this._binMessageCall.has(i)?this._binMessageCall.get(i)(r,this._iCurrentDatabaseId):(-1==this._iCurrentDatabaseId&&(0==i?e.mxWebAddEntity(r):2==i?e.getSelect().mxWebAddEntity(r):6==i?e.removeEntityFromServer(r):11==i&&e.getExtRefManager().createExternalReferences(r)),12==i?e.mxWebAddEntityFor2dPointCurveBuffers(r,this._iCurrentDatabaseId):13==i?e.mxWebAddEntityFor2dPointMeshBuffers(r,this._iCurrentDatabaseId):8==i?e.mxWebAddEntityFor2dPointCurveBuffer(r,this._iCurrentDatabaseId):9==i?e.mxWebAddEntityFor2dPointMeshBuffer(r,this._iCurrentDatabaseId):i==f.eBlockRef&&e.mxWebCreateAllBlocks(r,this._iCurrentDatabaseId))},x.prototype.socket_onErrort=function(){this._msg.onSocketErrort()},x.prototype.socket_onMessageImp=function(t,e){if(void 0===e&&(e=!1),"string"==typeof t)this._msg.Do(t);else if(e)this.onBinMessage(t);else{var n=new FileReader;n.readAsArrayBuffer(t);var r=this;n.onload=function(t){r._mx.updateDisplay(),r.onBinMessage(n.result)}}this._mx.updateDisplay()},x.prototype.initBinMessage=function(){var t=this._mx;this._binMessageCall.set(f.kMxCADBlockRef,function(e,n){t.getMxCAD().getOpenDisplay().OnMessageDisplayBlockRef(e)}),this._binMessageCall.set(f.kMxCADMemorySections,function(e,n){t.getMxCAD().getOpenDisplay().OnMessageDisplayMemorySections(e)}),this._binMessageCall.set(f.kMxCADMemorySectionsFromChange,function(e,n){t.getMxCAD().getSyncDisplay().OnMessageDisplayMemorySectionsFromChange(e)}),this._binMessageCall.set(f.kMxCADNotUseMemorySectionsForChage,function(e,n){t.getMxCAD().getSyncDisplay().OnMessageDisplayNotUseMemorySectionsForChage(e)}),this._binMessageCall.set(f.kMxCADEntityDisplayDatas,function(e,n){t.getMxCAD().getSelect().OnMessageEntityDisplayDatas(e)}),this._binMessageCall.set(f.eEntitysData,function(e,n){t.mxWebEntitysData(e,n)}),this._binMessageCall.set(f.eAddEntityFor2dPointTextureBuffers,function(e,n){t.mxWebAddEntityFor2dPointTextureBuffers(e,n)}),this._binMessageCall.set(f.eMxNewMemorySections,function(e,n){t.mxWebAddEntityForMemorySections(e,n)})},x.prototype.init=function(t,e){var n=this;this._mx=t,this._msg=new d(t,this),this.initBinMessage(),e&&(this._webSocket=new WebSocket(o.MxFun.getMxServer()),this._webSocket.onopen=function(){var t=n._mx.getIniParam();if(0!=t.length){for(var e="{",r=t.length,i=0;i<r;i++)e=0==i?e+'"'+t[i][0]+'":"'+t[i][1]+'"':e+',"'+t[i][0]+'":"'+t[i][1]+'"';e+="}",n._send.Init(e)}},this._webSocket.onmessage=function(t){n.socket_onMessageImp(t.data)},this._webSocket.onerror=function(){console.log("mx: socket error"),n.socket_onErrort()}),this._send=new g(this._webSocket,this._msg)},x.prototype.closeWebSocket=function(){this._webSocket&&(this._send.setWebSocket(null),this._webSocket.close(),this._webSocket=null)},x.prototype.getOnMessage=function(){return this._msg},x.prototype.getSend=function(){return this._send},x.prototype.onStaticMessage=function(t){try{return this.socket_onMessageImp(t,!0),!0}catch(t){return console.log("mx file data error!"),console.log(t),!1}},x.prototype.onStaticHeadMessage=function(t){return"string"==typeof t&&this._msg.Do(t)},x);function x(){this._webSocket=null,this._send=null,this._msg=null,this._mx=null,this._binMessageCall=new Map,this._iCurrentDatabaseId=-1}n.MxNet=y;var b=(w.prototype.stopAllLoading=function(){this._isStopLoading||(this._isStopLoading=!0,this._isShowLoading&&o.MxFun.hideLoading())},w.prototype.setShowloading=function(t){this._isShowLoading=t},w.prototype.showLoading=function(){this._isShowLoading&&o.MxFun.showLoading()},w.prototype.hideLoading=function(t){this._isStopLoading||(this._isShowLoading&&o.MxFun.hideLoading(),this.net.getMxDrawObject().callInitCompleteEvent(),this.net.getMxDrawObject().callOpenFileComplete(t))},w.prototype.setRequestHeader=function(t){this._requestHeader=t},w.prototype.setUrlParam=function(t){this._urlParam=t},w.prototype.load=function(t,e){var n=o.MxFun.curPath(),r=o.MxFun.dwgDir(),i=o.MxFun.getStaticServer(),a="/buf/";if("wgh"==t.substring(t.lastIndexOf(".")+1).toLowerCase()){a="/";var s=t.substring(0,t.indexOf(".mxb1.wgh")).split("/");"$"==(t=1==s.length?s[0]:(i=t.substring(0,t.lastIndexOf("/")),s[s.length-1]))[0]&&(t=t.substring(1))}var l="$"+(t=encodeURIComponent(t))+".mxb1.wgh";0!=i.length?n=i+a:0!=r.length?n=n+"/"+r+a:n+=a,this._path=n,this._filename=t,1<(this._staticLoadingOpenFiles=e).length&&(l=e[0],this._path=void 0);var u=this;this.getFile(this._path,l,function(t){if(!u._isStopLoading)return"string"!=typeof t?(console.log("mx error h1"),void u.hideLoading(4)):u.net.onStaticHeadMessage(t)?void 0:(console.log("mx error h1:"+t),void u.hideLoading(2))},function(){u.hideLoading(3),console.log("mx get "+l+" faild")})},w.prototype.getData=function(){if(this._isStopLoading)this.hideLoading(5);else if(this._iGet>=this._dataNum)this.hideLoading(0);else{var t=this._dataType[this._iGet];this._iGet++;var e=this,n=this._iGet+1,r="$"+this._filename+".mxb"+n+".wgh";if(1<this._staticLoadingOpenFiles.length){if(this._iGet>=this._staticLoadingOpenFiles.length)return console.log("Mx staticLoadingOpenFiles error!"),void this.hideLoading(7);r=this._staticLoadingOpenFiles[this._iGet]}var i=r;this._path&&(i=this._path+r);var a=i.substring(0,i.lastIndexOf("/")+1);if(this.net.getMxDrawObject().setCurrentLoadUrl(a),0==t)this.getFile(this._path,r,function(t){e._isStopLoading||(e.net.onStaticMessage(t)||(console.log(this._path),console.log(r)),e.getData())},function(){e._dataNum=0,e._iGet=0,e.hideLoading(8),console.log("mx get "+r+" faild")});else{var o=new XMLHttpRequest,s=r;this._path&&(s=this._path+r),0!=this._urlParam.length?o.open("GET",s+this._urlParam):o.open("GET",s),0!=this._requestHeader.length&&o.setRequestHeader("usertoken",this._requestHeader),o.responseType="arraybuffer",o.onload=function(){e._isStopLoading||(e.net.onStaticMessage(o.response)||console.log(s),e.getData())},o.addEventListener("error",function(t){e._dataNum=0,e._iGet=0,e.hideLoading(9),console.log("mx get "+r+" faild")},!1),o.send()}}},w.prototype.onRenderHead=function(t){if(!this._isStopLoading){var e=JSON.parse(t);this._dataType=e.type,this._dataNum=e.count,this._iGet=0,this.showLoading(),this.getData()}},w.prototype.getFile=function(t,e,n,r){var i=new a.FileLoader(this.manager);i.setPath(t);var o=e;0!=this._urlParam.length&&(o=e+this._urlParam),0!=this._requestHeader.length&&(i.requestHeader={usertoken:this._requestHeader}),i.load(o,n,function(){},r)},w);function w(t,e){this.net=null,this.manager=null,this._dataNum=0,this._iGet=0,this._dataType=[],this._path="",this._filename="",this._staticLoadingOpenFiles=[],this._isShowLoading=!0,this._requestHeader="",this._isStopLoading=!1,this._urlParam="",this.net=t,this.manager=void 0!==e?e:a.DefaultLoadingManager}n.MxHFileLoad=b},{"./MxDrawData":29,"./MxFun":34,"./MxManager":36,pako:1,three:19}],39:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxSelect=void 0;var r=t("three"),i=t("three.meshline"),a=t("./MxFun"),o=t("./MxNetData"),s=t("./MxMaterial"),l=(u.prototype.removeAll=function(){this._mapSelectMark2Entity=new Map},u.prototype.addEntity=function(t,e){var n=this._mapSelectMark2Entity.get(t);null==n&&(n=new Array,this._mapSelectMark2Entity.set(t,n)),n.push(e)},u.prototype.removeEntity=function(t){var e=new Map,n=function(t,e){var n=this.mx.getScene(),r=e;return function(e,i,o){if(null==t||i!=t)for(var s in e)a.MxFun.removeThreejsObject(e[s],n);else{var l=e.concat();r.set(t,l)}}}.call(this,t,e);this._mapSelectMark2Entity.forEach(n),this._mapSelectMark2Entity=e},u.prototype.init=function(){var t=this;t.domElement.addEventListener("mousedown",function(e){if(!1!==t.enabled&&!t.tmpDisable&&e.button==r.MOUSE.LEFT){var n=t.mx.screenCoord2Doc(e.clientX,e.clientY,0),i=t.mx.screenCoordLong2Doc(10),o=a.MxFun.formatString("[{0},{1},{2},{3}]",n.x.toString(),n.y.toString(),"0",i.toString());t.mx.callCommand("Mx_Select",o)}},!1)},u.prototype.mxWebAddEntity=function(t){var e=new o.MxNetData(t),n=e.getSelectMark();this.removeEntity(n);var r=this.mxWebAddEntity_3DChild(e);this.mxWebAddEntity_Curve(e,r)},u.prototype.mxWebAddEntity_3DChild=function(t){var e=t.getMesh();if(null==e.id)return e.size;var n=new r.Mesh(e.geometry,s.MxMaterial.GetBaseColorMaterial(1));this.mx.getScene().add(n);var i=t.getSelectMark();return this.addEntity(i,n),e.size},u.prototype.mxWebAddEntity_Curve=function(t,e){var n=t.getCurve(e);if(null!=n.id){var a=this.mx.getViewWidth(),o=this.mx.getViewHeight();this._material.resolution=new r.Vector2(a,o);for(var s=t.getSelectMark(),l=n.geometry,u=this.mx.getScene(),c=0;c+1<l.vertices.length;c+=2){var h=l.vertices[c],d=l.vertices[c+1],p=new Float32Array(6);p[0]=h.x,p[1]=h.y,p[2]=h.z,p[3]=d.x,p[4]=d.y,p[5]=d.z;var f=new i.MeshLine;f.setGeometry(p);var m=new r.Mesh(f.geometry,this._material);u.add(m),this.addEntity(s,m)}}},u);function u(t,e){this.enabled=!0,this.tmpDisable=!1,this.mx=void 0,this.domElement=void 0,this._mapSelectMark2Entity=new Map,this._material=new i.MeshLineMaterial({useMap:!1,color:new r.Color(16711680),opacity:.5,resolution:new r.Vector2(500,500),sizeAttenuation:!1,lineWidth:10,transparent:!0}),this.mx=t,this.domElement=void 0!==e?e:document}n.MxSelect=l},{"./MxFun":34,"./MxMaterial":37,"./MxNetData":38,three:19,"three.meshline":18}],40:[function(t,e,n){var r;Object.defineProperty(n,"__esModule",{value:!0}),n.MxShader=void 0,(r=n.MxShader||(n.MxShader={})).VSHADER_COLOR_POINT=" precision highp float; \nuniform mat4 modelViewMatrix; \nuniform mat4 projectionMatrix; \nattribute vec2 position; \nattribute vec3 color; \nattribute vec4 tran1; \nattribute vec4 tran2; \nattribute vec4 tran3; \nattribute vec4 tran4; \nattribute float ishide; \nvarying vec4 vColor; \nvoid main(){ \n mat4 tran; \ntran[0][0] = tran1.x;tran[0][1] = tran1.y;tran[0][2] = tran1.z;tran[0][3] = tran1.w; \ntran[1][0] = tran2.x;tran[1][1] = tran2.y;tran[1][2] = tran2.z;tran[1][3] = tran2.w; \ntran[2][0] = tran3.x;tran[2][1] = tran3.y;tran[2][2] = tran3.z;tran[2][3] = tran3.w; \ntran[3][0] = tran4.x;tran[3][1] = tran4.y;tran[3][2] = tran4.z;tran[3][3] = tran4.w; \nif(ishide > 0.1) \n vColor = vec4(color,0.0); \nelse \n vColor = vec4(color,1.0); \ngl_Position = projectionMatrix * modelViewMatrix * tran * vec4( position.x,position.y,0.0, 1.0 ); \n} \n",r.VSHADER_COLOR_POINT_BYLAYER=" precision highp float; \nuniform mat4 modelViewMatrix; \nuniform mat4 projectionMatrix; \nuniform vec3 color; \nattribute vec2 position; \nattribute vec4 tran1; \nattribute vec4 tran2; \nattribute vec4 tran3; \nattribute vec4 tran4; \nattribute float ishide; \nvarying vec4 vColor; \nvoid main(){ \n mat4 tran; \ntran[0][0] = tran1.x;tran[0][1] = tran1.y;tran[0][2] = tran1.z;tran[0][3] = tran1.w; \ntran[1][0] = tran2.x;tran[1][1] = tran2.y;tran[1][2] = tran2.z;tran[1][3] = tran2.w; \ntran[2][0] = tran3.x;tran[2][1] = tran3.y;tran[2][2] = tran3.z;tran[2][3] = tran3.w; \ntran[3][0] = tran4.x;tran[3][1] = tran4.y;tran[3][2] = tran4.z;tran[3][3] = tran4.w; \nif(ishide > 0.1) \n vColor = vec4(color,0.0); \nelse \n vColor = vec4(color,1.0); \ngl_Position = projectionMatrix * modelViewMatrix * tran * vec4( position.x,position.y,0.0, 1.0 ); \n} \n",r.FSHADER_COLOR_POINT=" precision highp float; \nvarying vec4 vColor; \nvoid main() { \ngl_FragColor = vColor; \n} \n",r.VSHADER_COLOR_POINT_TEXTURE=" precision highp float; \nuniform mat4 modelViewMatrix; \nuniform mat4 projectionMatrix; \nattribute vec2 position; \nattribute vec2 uv; \nattribute vec4 tran1; \nattribute vec4 tran2; \nattribute vec4 tran3; \nattribute vec4 tran4; \nvarying vec2 vUv; \nvoid main(){ \nvUv = uv; \nmat4 tran; \ntran[0][0] = tran1.x;tran[0][1] = tran1.y;tran[0][2] = tran1.z;tran[0][3] = tran1.w; \ntran[1][0] = tran2.x;tran[1][1] = tran2.y;tran[1][2] = tran2.z;tran[1][3] = tran2.w; \ntran[2][0] = tran3.x;tran[2][1] = tran3.y;tran[2][2] = tran3.z;tran[2][3] = tran3.w; \ntran[3][0] = tran4.x;tran[3][1] = tran4.y;tran[3][2] = tran4.z;tran[3][3] = tran4.w; \ngl_Position = projectionMatrix * modelViewMatrix * tran * vec4( position.x,position.y,0.0, 1.0 ); \n} \n",r.FSHADER_COLOR_POINT_TEXTURE=" precision highp float; \nvarying vec2 vUv; \nuniform sampler2D texture; \nvoid main() { \ngl_FragColor = texture2D( texture, vUv ); \n} \n",r.VSHADER_COLOR_POINT_CLIP=" precision highp float; \nuniform mat4 modelViewMatrix; \nuniform mat4 projectionMatrix; \nuniform vec2 clippt1; \nuniform vec2 clippt2; \nuniform float vieww; \nuniform float viewh; \nattribute vec2 position; \nattribute vec3 color; \nattribute vec4 tran1; \nattribute vec4 tran2; \nattribute vec4 tran3; \nattribute vec4 tran4; \nattribute float ishide; \nvarying vec4 vColor; \nvarying vec2 vCp1; \nvarying vec2 vCp2; \nvoid main(){ \n mat4 tran; \ntran[0][0] = tran1.x;tran[0][1] = tran1.y;tran[0][2] = tran1.z;tran[0][3] = tran1.w; \ntran[1][0] = tran2.x;tran[1][1] = tran2.y;tran[1][2] = tran2.z;tran[1][3] = tran2.w; \ntran[2][0] = tran3.x;tran[2][1] = tran3.y;tran[2][2] = tran3.z;tran[2][3] = tran3.w; \ntran[3][0] = tran4.x;tran[3][1] = tran4.y;tran[3][2] = tran4.z;tran[3][3] = tran4.w; \nvec4 pt1 = projectionMatrix * modelViewMatrix * vec4( clippt1.x,clippt1.y,0.0, 1.0 ); \nvec4 pt2 = projectionMatrix * modelViewMatrix * vec4( clippt2.x,clippt2.y,0.0, 1.0 ); \nvCp1 = vec2(pt1.x * vieww + vieww,pt1.y * viewh + viewh); \nvCp2 = vec2(pt2.x * vieww + vieww,pt2.y * viewh + viewh); \nif(ishide > 0.1) \n vColor = vec4(color,0.0); \nelse \n vColor = vec4(color,1.0); \ngl_Position = projectionMatrix * modelViewMatrix * tran * vec4( position.x,position.y,0.0, 1.0 ); \n} \n",r.VSHADER_COLOR_POINT_BYLAYER_CLIP=" precision highp float; \nuniform mat4 modelViewMatrix; \nuniform mat4 projectionMatrix; \nuniform vec3 color; \nuniform vec2 clippt1; \nuniform vec2 clippt2; \nuniform float vieww; \nuniform float viewh; \nattribute vec2 position; \nattribute vec4 tran1; \nattribute vec4 tran2; \nattribute vec4 tran3; \nattribute vec4 tran4; \nattribute float ishide; \nvarying vec4 vColor; \nvarying vec2 vCp1; \nvarying vec2 vCp2; \nvoid main(){ \n mat4 tran; \ntran[0][0] = tran1.x;tran[0][1] = tran1.y;tran[0][2] = tran1.z;tran[0][3] = tran1.w; \ntran[1][0] = tran2.x;tran[1][1] = tran2.y;tran[1][2] = tran2.z;tran[1][3] = tran2.w; \ntran[2][0] = tran3.x;tran[2][1] = tran3.y;tran[2][2] = tran3.z;tran[2][3] = tran3.w; \ntran[3][0] = tran4.x;tran[3][1] = tran4.y;tran[3][2] = tran4.z;tran[3][3] = tran4.w; \nvec4 pt1 = projectionMatrix * modelViewMatrix * vec4( clippt1.x,clippt1.y,0.0, 1.0 ); \nvec4 pt2 = projectionMatrix * modelViewMatrix * vec4( clippt2.x,clippt2.y,0.0, 1.0 ); \nvCp1 = vec2(pt1.x * vieww + vieww,pt1.y * viewh + viewh); \nvCp2 = vec2(pt2.x * vieww + vieww,pt2.y * viewh + viewh); \nif(ishide > 0.1) \n vColor = vec4(color,0.0); \nelse \n vColor = vec4(color,1.0); \ngl_Position = projectionMatrix * modelViewMatrix * tran * vec4( position.x,position.y,0.0, 1.0 ); \n} \n",r.FSHADER_COLOR_POINT_CLIP="precision highp float; \nvarying vec4 vColor; \nvarying vec2 vCp1; \nvarying vec2 vCp2; \nvoid main() { \nif(gl_FragCoord.x > vCp1.x && gl_FragCoord.x < vCp2.x && gl_FragCoord.y > vCp1.y && gl_FragCoord.y < vCp2.y) \ngl_FragColor = vColor; \nelse \ndiscard; \n} \n",r.VSHADER_COLOR_POINT_FORMXCAD=" precision highp float; \nuniform mat4 modelViewMatrix; \nuniform mat4 projectionMatrix; \nuniform vec3 color; \nattribute vec2 position; \nattribute vec4 tran1; \nattribute vec4 tran2; \nattribute vec4 tran3; \nattribute vec4 tran4; \nattribute float ishide; \nvarying vec4 vColor; \nvoid main(){ \n mat4 tran; \ntran[0][0] = tran1.x;tran[0][1] = tran1.y;tran[0][2] = tran1.z;tran[0][3] = tran1.w; \ntran[1][0] = tran2.x;tran[1][1] = tran2.y;tran[1][2] = tran2.z;tran[1][3] = tran2.w; \ntran[2][0] = tran3.x;tran[2][1] = tran3.y;tran[2][2] = tran3.z;tran[2][3] = tran3.w; \ntran[3][0] = tran4.x;tran[3][1] = tran4.y;tran[3][2] = tran4.z;tran[3][3] = tran4.w; \nif(ishide > 0.1) \n vColor = vec4(color,0.0); \nelse \n vColor = vec4(color,1.0); \ngl_Position = projectionMatrix * modelViewMatrix * tran * vec4( position.x,position.y,0.0, 1.0 ); \n} \n",r.FSHADER_COLOR_POINT_FORMXCAD=" precision highp float; \nvarying vec4 vColor; \nvoid main() { \ngl_FragColor = vColor; \n} \n",r.VSHADER_COLOR_POINT_CLIP_FORMXCAD=" precision highp float; \nuniform mat4 modelViewMatrix; \nuniform mat4 projectionMatrix; \nuniform vec3 color; \nuniform vec2 clippt1; \nuniform vec2 clippt2; \nuniform float vieww; \nuniform float viewh; \nattribute vec2 position; \nattribute vec4 tran1; \nattribute vec4 tran2; \nattribute vec4 tran3; \nattribute vec4 tran4; \nattribute float ishide; \nvarying vec4 vColor; \nvarying vec2 vCp1; \nvarying vec2 vCp2; \nvoid main(){ \n mat4 tran; \ntran[0][0] = tran1.x;tran[0][1] = tran1.y;tran[0][2] = tran1.z;tran[0][3] = tran1.w; \ntran[1][0] = tran2.x;tran[1][1] = tran2.y;tran[1][2] = tran2.z;tran[1][3] = tran2.w; \ntran[2][0] = tran3.x;tran[2][1] = tran3.y;tran[2][2] = tran3.z;tran[2][3] = tran3.w; \ntran[3][0] = tran4.x;tran[3][1] = tran4.y;tran[3][2] = tran4.z;tran[3][3] = tran4.w; \nvec4 pt1 = projectionMatrix * modelViewMatrix * vec4( clippt1.x,clippt1.y,0.0, 1.0 ); \nvec4 pt2 = projectionMatrix * modelViewMatrix * vec4( clippt2.x,clippt2.y,0.0, 1.0 ); \nvCp1 = vec2(pt1.x * vieww + vieww,pt1.y * viewh + viewh); \nvCp2 = vec2(pt2.x * vieww + vieww,pt2.y * viewh + viewh); \nif(ishide > 0.1) \n vColor = vec4(color,0.0); \nelse \n vColor = vec4(color,1.0); \ngl_Position = projectionMatrix * modelViewMatrix * tran * vec4( position.x,position.y,0.0, 1.0 ); \n} \n",r.FSHADER_COLOR_POINT_CLIP_FORMXCAD="precision highp float; \nvarying vec4 vColor; \nvarying vec2 vCp1; \nvarying vec2 vCp2; \nvoid main() { \nif(gl_FragCoord.x > vCp1.x && gl_FragCoord.x < vCp2.x && gl_FragCoord.y > vCp1.y && gl_FragCoord.y < vCp2.y) \ngl_FragColor = vColor; \nelse \ndiscard; \n} \n"},{}],41:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxStencilObject=void 0;var r=t("three"),i=t("./MxMaterial"),a=(o.prototype.object_onAfterRender=function(t){var e=this.aryMeshStencil;if(e&&0<e.length){t.getContext();var n=t.state.buffers;n.stencil.setLocked(!1),n.depth.setTest(!0),n.stencil.setTest(!1)}},o.prototype.object_onBeforeRender=function(t,e,n){var r=this.aryMeshStencil;if(r&&0<r.length){var i=t.getContext(),a=t.state.buffers;a.color.setMask(!1),a.color.setLocked(!0),a.depth.setTest(!1),a.stencil.setTest(!0),a.stencil.setMask(255),a.stencil.setClear(0),t.clearStencil(),a.stencil.setLocked(!0);var o=1,s=!0;r.forEach(function(r){s?(s=!1,a.stencil.setFunc(i.ALWAYS,o,255),a.stencil.setOp(i.KEEP,i.KEEP,i.REPLACE)):(a.stencil.setFunc(i.EQUAL,o,255),a.stencil.setOp(i.KEEP,i.KEEP,i.INCR),o++),t.mxRenderObject(r,e,n,r.material,null)}),a.color.setLocked(!1),a.color.setMask(!0),a.stencil.setMask(0),a.stencil.setFunc(i.EQUAL,o,255)}},o.prototype.associateObject=function(t,e){var n=this;e.forEach(function(t){if(3<=t.length){var e=new r.Shape(t),a=new r.ShapeGeometry(e),o=new r.Mesh(a,i.MxMaterial.getStencilMaterial());n.aryMeshStencil.push(o)}});var a=this;t.onBeforeRender=function(t,e,n){a.object_onBeforeRender(t,e,n)},t.onAfterRender=function(t){a.object_onAfterRender(t)}},o);function o(){this.aryMeshStencil=[]}n.MxStencilObject=a},{"./MxMaterial":37,three:19}],42:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxString=void 0;var r=(i.prototype.Find=function(t){return this.m_val.indexOf(t)},i.prototype.Left=function(t){return this.m_val.substring(0,t)},i.prototype.Right=function(t){return this.m_val.substring(t+1,this.m_val.length)},i.prototype.TrimLeft=function(t){for(;0<this.m_val.length&&this.m_val[0]==t;)this.m_val=this.m_val.slice(1)},i.prototype.TrimRight=function(t){for(;0<this.m_val.length&&this.m_val[this.m_val.length-1]==t;)this.m_val=this.m_val.slice(0,-1)},i.prototype.AnalyzeString=function(t){return this.m_val.split(t)},i.prototype.IsEmpty=function(){return 0==this.m_val.length},i.prototype.MakeUpper=function(){this.m_val=this.m_val.toUpperCase()},i.prototype.MakeLower=function(){this.m_val=this.m_val.toLowerCase()},i.prototype.GetLength=function(){return this.m_val.length},i);function i(t){this.m_val="",null!=t&&(this.m_val=t)}n.MxString=r},{}],43:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxSystemVariable=void 0;var r=t("three"),i=t("./Operate/McEdJigOsnap"),a=(o.prototype.init=function(t){this.m_mxObj=t},o.prototype.getAllLinetypeName=function(){return this.m_vecLinetype},o.prototype.getSysVarBool=function(t){return null!=this.m_data[t]&&this.m_data[t]},o.prototype.setSysVarBool=function(t,e){this.m_data[t]=e},o.prototype.setSysVarPoint=function(t,e){this.m_data[t]=e},o.prototype.OnMessageMxCADSystemVariable=function(t){this.m_vecLinetype=[];var e=JSON.parse(t);if(null!=e){var n=e.vecLinetypeName;for(var r in n)this.m_vecLinetype.push(n[r]);this.m_data.CELTYPE=e.curLinetypeName,this.m_data.CLAYER=e.clayer,this.m_data.CECOLOR=e.cecolor,this.m_data.CECOLORINDEX=e.cecolorindex}this.m_mxObj.callEvent("loadSystmeVariableComplete")},o.prototype.getSysVarPoint=function(t){return null==this.m_data[t]?new r.Vector3(0,0,0):this.m_data[t]},o.prototype.setSysVarNumber=function(t,e){this.m_data[t]=e},o.prototype.getSysVarNumber=function(t){return null==this.m_data[t]?0:this.m_data[t]},o);function o(){this.m_data={},this.m_mxObj=null,this.m_vecLinetype=[],this.m_data.DYNINPUT=!0,this.m_data.GETPOINTSTATUS=0,this.m_data.CELTYPE="Continuous",this.m_data.CLAYER="0",this.m_data.CECOLOR=67108863,this.m_data.CECOLORINDEX=7,this.m_data.OSMODE=i.MxOsnapDefine.OsModeAll}n.MxSystemVariable=a},{"./Operate/McEdJigOsnap":49,three:19}],44:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxThreeJS=void 0;var r,i=t("three"),a=t("./MxFun");function o(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}(r=n.MxThreeJS||(n.MxThreeJS={})).createLine=function(t,e,n,r){var a,o=new i.Geometry;return a=r&&1!=r||0==r?new i.LineBasicMaterial({color:n,transparent:!0,depthTest:!1,opacity:r}):new i.LineBasicMaterial({color:n,transparent:!0,depthTest:!1}),o.vertices.push(t,e),new i.Line(o,a)},r.createCircle=function(t,e,n){var r=new i.CircleGeometry(e,64,3,2*Math.PI),a=new i.LineBasicMaterial({color:n,transparent:!0,depthTest:!1});r.vertices.shift();var o=new i.LineLoop(r,a);return o.position.x=t.x,o.position.y=t.y,o.position.z=t.z,o},r.clacTextSize=function(t,e){var n=document.createElement("canvas").getContext("2d");if(null==n)return e;var r=a.MxFun.formatString("normal {0}px Arial","256");return n.font=r,n.measureText(t).width*e/256},r.clacTextSpriteSize=function(t,e,n){e<=1e-8&&(e=1);var r=document.createElement("canvas"),i=r.getContext("2d"),s=a.MxFun.formatString("normal {0}px Arial","256");i.font=s;var l=e/256,u=0,c=[],h=!0,d=0;if(n){u=n;for(var p=0,f=0,m=0;f<t.length;f++)(g=i.measureText(t.substring(p,f+1))).width*l>u&&(d+=(g.fontBoundingBoxAscent+g.fontBoundingBoxDescent)*l,c.push(t.substring(p,f)),p=f,m++);if(p<f){var g=i.measureText(t.substring(p,f));c.push(t.substring(p,f)),d+=(g.fontBoundingBoxAscent+g.fontBoundingBoxDescent)*l,m++}h=m<=1}else d=e,u=(g=i.measureText(t)).width*l,c.push(t),h=!1;var v=d/u*(r.width=1024);return r.height=o(v),r.height<v&&(r.height*=2),0==r.height&&(r.height=512),{spritewidth:u,spriteheight:u*r.height/r.width,textwidth:u,allTextHeight:d,singleline:h}},r.creatTextSprite=function(t,e,n,r,s,l){n<=1e-8&&(n=1);var u=document.createElement("canvas"),c=u.getContext("2d"),h=a.MxFun.formatString("normal {0}px Arial","256");c.font=h;var d=n/256,p=0,f=[],m=[],g=0;if(l){p=l;for(var v=0,y=0;y<t.length;y++)(b=c.measureText(t.substring(v,y+1))).width*d>p&&(g+=x=(b.fontBoundingBoxAscent+b.fontBoundingBoxDescent)*d,f.push(t.substring(v,y)),m.push(x),v=y);if(v<y){var x,b=c.measureText(t.substring(v,y));f.push(t.substring(v,y)),g+=x=(b.fontBoundingBoxAscent+b.fontBoundingBoxDescent)*d,m.push(x)}}else g=n,p=(b=c.measureText(t)).width*d,f.push(t),m.push(g);var w=g/p*(u.width=1024);u.height=o(w),u.height<w&&(u.height*=2),0==u.height&&(u.height=512);var _=1024/p,M=_*n;c.font=a.MxFun.formatString("normal {0}px Arial",""+M);var S=a.MxFun.formatString("rgba({0}, {1}, {2}, 1.0)",(s>>16&255)+"",(s>>8&255)+"",(255&s)+"");c.fillStyle=S,c.textAlign="left",c.textBaseline="bottom";for(var T=0,C=0;T<f.length;T++)C+=_*m[T];for(T=0,C=.5*(u.height-C);T<f.length;T++)C+=_*m[T],c.fillText(f[T],0,C);var E=new i.Texture(u);E.needsUpdate=!0;var D=new i.SpriteMaterial({transparent:!0,depthTest:!1,map:E});D.rotation=r;var A=new i.Sprite(D);return A.scale.set(p,p/u.width*u.height,1),A.position.set(e.x,e.y,e.z),A},r.createTriangle=function(t,e,n){if(!(t.length<3)){for(var r=t.length,a=new i.Geometry,o=0;o+2<r;o+=3){a.vertices.push(t[o]),a.vertices.push(t[o+1]),a.vertices.push(t[o+2]);var s=new i.Face3(o,o+1,o+2);a.faces.push(s)}a.computeFaceNormals(),a.computeVertexNormals(),null==n&&(n=1);var l=new i.MeshBasicMaterial({color:e,transparent:!0,depthTest:!1,side:i.DoubleSide,opacity:n});return new i.Mesh(a,l)}},r.createLines=function(t,e,n){var r,a=new i.Geometry;return a.vertices=t,r=n&&1!=n||0==n?new i.LineBasicMaterial({color:e,transparent:!0,depthTest:!1,opacity:n}):new i.LineBasicMaterial({color:e,transparent:!0,depthTest:!1}),new i.Line(a,r)},r.createDashedLines=function(t,e,n,r){var a=new i.Geometry;a.vertices=t;var o=new i.Line(a,new i.LineDashedMaterial({color:e,dashSize:n,gapSize:r,transparent:!0,depthTest:!1}));return o.computeLineDistances(),o}},{"./MxFun":34,three:19}],45:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxPair=n.MxTools=void 0;var r,i=t("three");(r=n.MxTools||(n.MxTools={})).AsMxWebPoint=function(t,e,n){return new i.Vector3(-t,n,e)},r.AsMxWebPoint_pt=function(t){return new i.Vector3(-t.x,t.z,t.y)},r.AsThreeJsPoint=function(t,e,n){return new i.Vector3(-t,n,e)},r.stringTrimLeftSpace=function(t){return t.replace(/^\s*/g,"")},r.stringDeleteAllSpace=function(t){return t.replace(/\s*/g,"")},r.stringTrimLeftRightSpace=function(t){return t.replace(/^\s*|\s*$/g,"")},r.stringTrimRightSpace=function(t){return t.replace(/(\s*$)/g,"")},r.IsNumerical=function(t){if("string"==typeof t){var e=/^(-(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*)))$/;return!(!/^\d+(\.\d+)?$/.test(t)&&!e.test(t))}var n=t.m_val;return e=/^(-(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*)))$/,!(!/^\d+(\.\d+)?$/.test(n)&&!e.test(n))},r.formatString=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r++)t=t.replace("{".concat(r,"}"),e[r]);return t},r._tstof=function(t){return parseFloat(t)},r._tstoi=function(t){return parseInt(t)},r.IsZero=function(t){return-1e-7<t&&t<1e-7},r.MillimeterToPixels=function(t){return 10*t},r.getXYPlanDistance=function(t,e){var n=new i.Vector2(t.x,t.y),r=new i.Vector2(e.x,e.y);return n.distanceTo(r)},r.MxASSERT=function(t,e){t||console.log("MxASSERT(0):"+e)},r.generateUUID=function(){return i.MathUtils.generateUUID()},n.MxPair=function(t,e){this.first=t,this.second=e}},{three:19}],46:[function(t,e,n){var r,i,a;Object.defineProperty(n,"__esModule",{value:!0}),n.MxType=void 0,(i=(r=n.MxType||(n.MxType={})).CommandFlags||(r.CommandFlags={}))[i.MCRX_CMD_MODAL=0]="MCRX_CMD_MODAL",i[i.MCRX_CMD_TRANSPARENT=1]="MCRX_CMD_TRANSPARENT",i[i.MCRX_CMD_NO_UNDO_MARKER=2]="MCRX_CMD_NO_UNDO_MARKER",i[i.MCRX_CMD_NOPRV=4]="MCRX_CMD_NOPRV",(a=r.MxCloneType||(r.MxCloneType={}))[a.kClone=1]="kClone",a[a.kDragClone=2]="kDragClone",a[a.kMxFileClone=3]="kMxFileClone"},{}],47:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxBulid=void 0,window.MxDrawVersion="1.0(2022-10-18 17:41)",(n.MxBulid||(n.MxBulid={})).getVersion=function(){return window.MxDrawVersion?window.MxDrawVersion:"inalid version"}},{}],48:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxWindowsEvent=void 0;var r,i,a,o,s=t("./MxFun"),l=t("./Operate/MxJigCmdManager"),u=t("three"),c=t("./MxDrawData");function h(t,e){for(var n=0,r=o.length;n<r;n++){var i=o[n](t,e);if(0!=i)return i}}function d(t){a.x=t.offsetX,a.y=t.offsetY,h("mousemove",t)}function p(t){h("mouseup",t)}function f(t){h("dblclick",t)}function m(t){a.x=t.offsetX,a.y=t.offsetY,h("mousedown",t)}function g(t){var e=t||window.event||arguments.callee.caller.arguments[0];if(e&&27==e.keyCode)if(c.MxDrawData.m_isEnableIntelliSelect&&!l.MxJigCmdManager.isRunning()){var n=!1,r=s.MxFun.getCurrentMx(),i=r.getMxCAD();if(i){var a=i.getSelect().clearAllSelect(),o=i.getGrip().clearAll();(a||o)&&(n=!0)}r.getMxDatabase().getGripManager().removeAllGrips()&&(n=!0),r.getMxDatabase().getSelectManager().removeAllEntity()&&(n=!0),n&&r.updateDisplay()}else l.MxJigCmdManager.isRunning()&&l.MxJigCmdManager.stopCmd()}r=n.MxWindowsEvent||(n.MxWindowsEvent={}),i=!1,a=new u.Vector2(0,0),o=new Array,r.addEvent=function(t){o.push(t)},r.getCurrentMousePostion=function(){return a},r.registEvent=function(){i||(i=!0,s.MxFun.isPC()&&(document.addEventListener("mousemove",d,!1),document.addEventListener("mouseup",p,!1),document.addEventListener("mousedown",m,!1),document.addEventListener("dblclick",f,!1),document.onkeydown=g))}},{"./MxDrawData":29,"./MxFun":34,"./Operate/MxJigCmdManager":58,three:19}],49:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.McEdJigOsnap=n.McEdImpJigGlobalData=n.MxOsnapDefine=void 0;var r,i,a,o,s,l,u,c,h,d,p,f=t("three"),m=t("../MxDrawObject"),g=t("../MxFun"),v=t("./MxJigCmdManager"),y=t("../MxTools"),x=t("../MxDrawData"),b=t("../MxWindowsEvent");(i=r=n.MxOsnapDefine||(n.MxOsnapDefine={}))[i.OsModeInvalid=0]="OsModeInvalid",i[i.OsModeEnd=1]="OsModeEnd",i[i.OsModeMid=2]="OsModeMid",i[i.OsModeCen=4]="OsModeCen",i[i.OsModeNode=8]="OsModeNode",i[i.OsModeQuad=16]="OsModeQuad",i[i.OsModeInt=32]="OsModeInt",i[i.OsModeIns=64]="OsModeIns",i[i.OsModePerp=128]="OsModePerp",i[i.OsModeTan=256]="OsModeTan",i[i.OsModeNear=512]="OsModeNear",i[i.OsModeApp=2048]="OsModeApp",i[i.OsModeExt=4096]="OsModeExt",i[i.OsModePar=8192]="OsModePar",i[i.OsModeOff=16384]="OsModeOff",i[i.OsModeAll=16383]="OsModeAll",o=a=n.McEdImpJigGlobalData||(n.McEdImpJigGlobalData={}),s=!1,l=new f.Vector3,u=new f.Vector3,c=0,d=h=!1,p=new Array,o.setPrvPoint=function(t){l=t,d=!0},o.isOsnapZValue=function(){return!1},o.setIsValidPrvpoint=function(t){d=t},o.isValidPrvpoint=function(){return d},o.getPrvPoint=function(){return l},o.setIsValidBasepoint=function(t){s=t},o.isValidBasepoint=function(){return s},o.setBasepoint=function(t){s=!0,u=t},o.getBasepoint=function(){return u},o.initStartCommand=function(){h=s=!1},o.setIsTmpDisableOsmode=function(t){h=t},o.isTmpDisableOsmode=function(){return h},o.intiStartDrag=function(t){c=t.sysVariable().getSysVarNumber("OSMODE")},o.isEnableOsmode=function(){return!(0==c||c&r.OsModeOff||h)},o.getOSmode=function(){return c},o.addDynDrawObject=function(t){p.push(t)},o.clearDisplay=function(t){for(var e=p.length,n=0;n<e;n++)g.MxFun.removeThreejsObject(p[n],t);p=[]};var w=(_.prototype.drawLine=function(t,e,n){var r=new f.Geometry,i=new f.LineBasicMaterial({color:this.m_iColor});r.vertices.push(new f.Vector3(t.x,t.y,t.z),new f.Vector3(e.x,e.y,e.z));var o=new f.Line(r,i);n.add(o),a.addDynDrawObject(o)},_.prototype.drawPolyline=function(t,e){for(var n=new f.Geometry,r=new f.LineBasicMaterial({color:this.m_iColor}),i=t.length,o=0;o<i;o++)n.vertices.push(new f.Vector3(t[o].x,t[o].y,t[o].z));var s=new f.Line(n,r);e.add(s),a.addDynDrawObject(s)},_.prototype.setWidth=function(t){this.m_dOsmodeWdith=t},_.prototype.GetDrawRect=function(){var t=.5*this.m_dOsmodeWdith,e={};return e.left=this.m_pt.x-t,e.right=this.m_pt.x+t,e.top=this.m_pt.y-t,e.bottom=this.m_pt.y+t,e},_.prototype.DrawNear=function(t){var e=this.GetDrawRect(),n=[new f.Vector3,new f.Vector3];n[0].x=e.left,n[0].y=e.top,n[1].x=e.right,n[1].y=e.top,this.drawLine(n[0],n[1],t),n[0].x=e.left,n[0].y=e.bottom,n[1].x=e.right,n[1].y=e.bottom,this.drawLine(n[0],n[1],t),n[0].x=e.right,n[0].y=e.top,n[1].x=e.left,n[1].y=e.bottom,this.drawLine(n[0],n[1],t),n[0].x=e.right,n[0].y=e.bottom,n[1].x=e.left,n[1].y=e.top,this.drawLine(n[0],n[1],t)},_.prototype.DrawEnd=function(t){var e=this.GetDrawRect(),n=[new f.Vector3,new f.Vector3,new f.Vector3,new f.Vector3];n[0].x=e.left,n[0].y=e.top,n[1].x=e.right,n[1].y=e.top,n[2].x=e.right,n[2].y=e.bottom,n[3].x=e.left,n[3].y=e.bottom,this.drawLine(n[0],n[1],t),this.drawLine(n[1],n[2],t),this.drawLine(n[2],n[3],t),this.drawLine(n[3],n[0],t)},_.prototype.DrawMid=function(t){var e=this.GetDrawRect(),n=1.2*(e.right-e.left),r=n/2/Math.sin(60*3.14159265/180),i=r*Math.sin(.5235987750000001),a=new f.Vector3(this.m_pt.x,this.m_pt.y,this.m_pt.z);a.y-=r;var o=new f.Vector3;o.x=this.m_pt.x+n/2,o.y=this.m_pt.y+i;var s=new f.Vector3;s.x=this.m_pt.x-n/2,s.y=this.m_pt.y+i;var l=[new f.Vector3,new f.Vector3,new f.Vector3,new f.Vector3];l[0].x=a.x,l[0].y=a.y,l[1].x=o.x,l[1].y=o.y,l[2].x=s.x,l[2].y=s.y,l[3].x=a.x,l[3].y=a.y,this.drawLine(l[0],l[1],t),this.drawLine(l[1],l[2],t),this.drawLine(l[2],l[3],t)},_.prototype.DrawPerp=function(t){var e=this.GetDrawRect(),n=[new f.Vector3,new f.Vector3,new f.Vector3];n[0].x=e.left,n[0].y=e.top,n[1].x=e.left,n[1].y=e.bottom,n[2].x=e.right,n[2].y=e.bottom,this.drawPolyline(n,t),n[0].x=e.left,n[0].y=this.m_pt.y,n[1].x=this.m_pt.x,n[1].y=this.m_pt.y,n[2].x=this.m_pt.x,n[2].y=e.bottom,this.drawPolyline(n,t)},_.prototype.DrawCircle=function(t,e,n){null==n&&(n=.5*this.m_dOsmodeWdith);for(var r=[],i=0,a=3.14159265/180;i<=360;i+=15){var o=n*Math.cos(i*a)+t.x,s=n*Math.sin(i*a)+t.y;r.push(new f.Vector3(o,s))}this.drawPolyline(r,e)},_.prototype.DrawInt=function(t){var e=this.GetDrawRect(),n=[new f.Vector3,new f.Vector3];n[0].x=e.right,n[0].y=e.top,n[1].x=e.left,n[1].y=e.bottom,this.drawLine(n[0],n[1],t),n[0].x=e.right,n[0].y=e.bottom,n[1].x=e.left,n[1].y=e.top,this.drawLine(n[0],n[1],t)},_.prototype.DrawCen=function(t){this.DrawInt(t),this.DrawCircle(this.m_pt,t)},_.prototype.DrawTan=function(t){this.DrawEnd(t)},_.prototype.DrawIns=function(t){var e=this.GetDrawRect(),n={},r=(e.right-e.left)/1.5;n.left=this.m_pt.x-r,n.right=this.m_pt.x+r,n.top=this.m_pt.y-r,n.bottom=this.m_pt.y+r;var i=this.m_pt.x,a=this.m_pt.y,o=[new f.Vector3,new f.Vector3,new f.Vector3,new f.Vector3,new f.Vector3,new f.Vector3,new f.Vector3,new f.Vector3,new f.Vector3];o[0].x=n.left,o[0].y=n.top,o[1].x=n.left,o[1].y=a+2,o[2].x=i,o[2].y=a+2,o[3].x=i,o[3].y=n.bottom,o[4].x=n.right,o[4].y=n.bottom,o[5].x=n.right,o[5].y=a-2,o[6].x=i,o[6].y=a-2,o[7].x=i,o[7].y=n.top,o[8].x=n.left,o[8].y=n.top,this.drawPolyline(o,t)},_.prototype.DrawNode=function(t){var e=this.GetDrawRect(),n={},r=(e.right-e.left)/1.5;n.left=this.m_pt.x-r,n.right=this.m_pt.x+r,n.top=this.m_pt.y-r,n.bottom=this.m_pt.y+r;var i=this.m_dOsmodeWdith/1.3;this.m_pt.x,this.m_pt.x,this.m_pt.y,this.m_pt.y;var a=[new f.Vector3,new f.Vector3,new f.Vector3,new f.Vector3];a[0].x=n.left,a[0].y=n.top,a[1].x=n.right,a[1].y=n.bottom,a[2].x=n.left,a[2].y=n.bottom,a[3].x=n.right,a[3].y=n.top,this.drawLine(a[0],a[1],t),this.drawLine(a[2],a[3],t),this.DrawCircle(this.m_pt,t,i)},_.prototype.upDisplay=function(t,e,n){this.m_pt=t,this.m_osmode=e,this.clearDisplay(n);var r=n.getMxObject().getTheTempDrawContainer(),i=.5*this.m_dOsmodeWdith;if(this.m_osmode!=v.MxJigCmdManager.OsnapMode.kOsModekValid)if(this.m_osmode==v.MxJigCmdManager.OsnapMode.kOsModeNear)this.DrawNear(r);else if(this.m_osmode==v.MxJigCmdManager.OsnapMode.kOsModeEnd)this.DrawEnd(r);else if(this.m_osmode==v.MxJigCmdManager.OsnapMode.kOsModeMid)this.DrawMid(r);else if(this.m_osmode==v.MxJigCmdManager.OsnapMode.kOsModePerp)this.DrawPerp(r);else if(this.m_osmode==v.MxJigCmdManager.OsnapMode.kOsModeInt)this.DrawInt(r);else if(this.m_osmode==v.MxJigCmdManager.OsnapMode.kOsModeCen)this.DrawCen(r);else if(this.m_osmode==v.MxJigCmdManager.OsnapMode.kOsModeTan)this.DrawTan(r);else if(this.m_osmode==v.MxJigCmdManager.OsnapMode.kOsModeIns)this.DrawIns(r);else if(this.m_osmode==v.MxJigCmdManager.OsnapMode.kOsModeNode)this.DrawNode(r);else{var a=new f.Vector3(t.x-i,t.y-i,0),o=new f.Vector3(t.x+i,t.y+i,0);this.drawLine(a,o,r);var s=new f.Vector3(t.x-i,t.y+i,0),l=new f.Vector3(t.x+i,t.y-i,0);this.drawLine(s,l,r)}},_.prototype.clearDisplay=function(t){var e=t.getMxObject().getTheTempDrawContainer();a.clearDisplay(e)},_);function _(){this.m_iColor=16711935,this.m_pt=new f.Vector3,this.m_osmode=v.MxJigCmdManager.OsnapMode.kOsModekValid,this.m_dOsmodeWdith=10}var M=(S.prototype.resetData=function(){this.m_osmode=v.MxJigCmdManager.OsnapMode.kOsModekValid,this.m_isValidPrvInputPoint=!1,this.m_lOSmode=0,this.m_vecOffset.set(0,0,0),this.m_isValid=!1,this.m_iLongprogressStatus=-1},S.prototype.notifyOsnapToServer=function(){var t=this;if(this.m_isRuning){var e={ptx:this.m_pt.x,pty:this.m_pt.y,osmode:this.m_lOSmode,isValidPrvInputPoint:this.m_isValidPrvInputPoint};this.m_isValidPrvInputPoint&&(e.prvPtx=this.m_prvInputPoint.x,e.prvPty=this.m_prvInputPoint.y);var n=this.m_mxJig.getMxObject();if(n.getRunMode()==m.MxRunMode.kBrowse){var r=this,i=b.MxWindowsEvent.getCurrentMousePostion();n.getObjectOsnap().getOsnapData(i,function(t,e){t=n.worldCoord2Doc(t.x,t.y,t.z),r.m_ptSnapPoint.x=t.x,r.m_ptSnapPoint.y=t.y,r.m_ptSnapPoint.z=0,r.m_ptSnapSrcPoint.x=r.m_pt.x,r.m_ptSnapSrcPoint.y=r.m_pt.y,r.m_ptSnapSrcPoint.z=0,r.m_osmode=e,r.m_draw.setWidth(n.screenCoordLong2Doc(x.MxDrawData.getCursorWidthPixels())),r.m_draw.upDisplay(new f.Vector3(t.x,t.y,0),e,r.m_mxJig)})}else{e.SearchRnge=n.screenCoordLong2Doc(x.MxDrawData.getCursorWidthPixels());var a=this;n.callCommand("MxCAD_NotifyOsnap",JSON.stringify(e),function(e){if(!("string"!=typeof e||e.length<1)&&a.m_isRuning){var r=JSON.parse(e);t.m_ptSnapPoint.x=r.ptsx,t.m_ptSnapPoint.y=r.ptsy,t.m_ptSnapPoint.z=r.ptsz,t.m_ptSnapSrcPoint.x=r.ptx,t.m_ptSnapSrcPoint.y=r.pty,t.m_ptSnapSrcPoint.z=0,t.m_osmode=r.osmode,a.m_draw.setWidth(n.screenCoordLong2Doc(x.MxDrawData.getCursorWidthPixels())),a.m_draw.upDisplay(new f.Vector3(r.ptsx,r.ptsy,r.ptsz),r.osmode,a.m_mxJig)}})}}},S.prototype.startDrag=function(t,e){this.m_mxJig=e;var n,r,i=this.m_mxJig.getMxObject();function a(){n.notifyOsnapToServer()}return e.isDisableOsnap()?this.m_isEnable=!1:this.m_isEnable=!0===i.getInisetValue(m.IniSetName.kEnableOsnapFunction),this.m_isOffsetInputPostion=t,this.m_isRuning=!0,this.m_draw.setWidth(i.screenCoordLong2Doc(x.MxDrawData.getCursorWidthPixels())),this.resetData(),this.m_notifyOsnap_delayCall=(n=this,r=null,function(){clearTimeout(r),r=setTimeout(a,100)}),!0},S.prototype.endDrag=function(){return this.m_isRuning=!1,this.m_draw.clearDisplay(this.m_mxJig),!0},S.prototype.reCompteCurrentPoint=function(t){return t},S.prototype.isEnable=function(){return this.m_isEnable&&a.isEnableOsmode()},S.prototype.notifyOsnap=function(t,e){this.m_lOSmode=t,null==e?this.m_isValidPrvInputPoint=!1:(this.m_isValidPrvInputPoint=!0,this.m_prvInputPoint=e),this.m_osmode==v.MxJigCmdManager.OsnapMode.kOsModekValid&&this.m_draw.clearDisplay(this.m_mxJig),this.m_notifyOsnap_delayCall()},S.prototype.setPoint=function(t,e){if(this.isEnable()){null==t?(this.m_isValid=!1,this.m_osmode=v.MxJigCmdManager.OsnapMode.kOsModekValid):(-1==this.m_iLongprogressStatus||this.m_iLongprogressStatus,this.m_pt=t,this.m_inPoint=t,this.m_isValid=!0,(null==e||this.m_osmode!=v.MxJigCmdManager.OsnapMode.kOsModekValid&&y.MxTools.getXYPlanDistance(this.m_ptSnapSrcPoint,t)>e)&&(this.m_osmode=v.MxJigCmdManager.OsnapMode.kOsModekValid));var n=a.getOSmode(),r=a.getPrvPoint();this.notifyOsnap(n,a.isValidPrvpoint()?r:void 0)}},S.prototype.seInValidPoint=function(){this.setPoint(void 0)},S.prototype.getCurrentOSnapPoint=function(t){var e={};return this.isEnable()?(e.pt=t,e.osmode=this.m_osmode,this.m_osmode!=v.MxJigCmdManager.OsnapMode.kOsModekValid?(e.pt.x=this.m_ptSnapPoint.x,e.pt.y=this.m_ptSnapPoint.y,e.pt.z=this.m_ptSnapPoint.z,a.isOsnapZValue()||(t.z=0)):e.pt=t):(e.pt=t,e.osmode=v.MxJigCmdManager.OsnapMode.kOsModekValid),e},S.prototype.setLongprogressStatus=function(t){this.m_iLongprogressStatus=t},S.prototype.reComputeOffset=function(){},S);function S(t){this.m_inPoint=new f.Vector3,this.m_vecOffset=new f.Vector3,this.m_pt=new f.Vector3,this.m_isValid=!1,this.m_ptSnapPoint=new f.Vector3,this.m_ptSnapSrcPoint=new f.Vector3,this.m_osmode=v.MxJigCmdManager.OsnapMode.kOsModekValid,this.m_prvInputPoint=new f.Vector3,this.m_isValidPrvInputPoint=!1,this.m_lOSmode=0,this.m_iLongprogressStatus=-1,this.m_isOffsetInputPostion=!1,this.m_mxJig=null,this.m_notifyOsnap_delayCall=void 0,this.m_isRuning=!1,this.m_isEnable=!1,this.m_mxJig=t,this.m_draw=new w}n.McEdJigOsnap=M},{"../MxDrawData":29,"../MxDrawObject":30,"../MxFun":34,"../MxTools":45,"../MxWindowsEvent":48,"./MxJigCmdManager":58,three:19}],50:[function(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0}),n.McGiWorldDrawSelect=n.McGiWorldDraw=n.McGiWorldDrawType=void 0;var a,o,s=t("three"),l=t("../MxThreeJS"),u=t("../MxManager"),c=t("three.meshline");(o=a=n.McGiWorldDrawType||(n.McGiWorldDrawType={}))[o.kWorldDraw=1]="kWorldDraw",o[o.kDynDragDraw=2]="kDynDragDraw",o[o.kSelectDraw=3]="kSelectDraw";var h=(d.prototype.getType=function(){return this.worldDrawType},d.prototype.setMatrix=function(t){this.matrix=t},d.prototype.getMatrix=function(){return this.matrix},d.prototype.setOpacity=function(t){this.opacity=t},d.prototype.getOpacity=function(){return this.opacity},d.prototype.setColor=function(t){this.iColor!=t&&(this.widthMaterial=null),this.iColor=t},d.prototype.setDash=function(t,e){this.dDashArray=t,this.dDashRatio=e},d.prototype.getDash=function(){return{dDashArray:this.dDashArray,dDashRatio:this.dDashRatio}},d.prototype.setDashLineDisplay=function(t){t?(this.dDashArray=.03,this.dDashRatio=.1,0==this.dLineWidth&&(this.dLineWidth=6,this.lineWidthByPixels=!0)):(this.dDashArray=0,this.dDashRatio=0)},d.prototype.isDashLineDisplay=function(){return 0<this.dDashArray&&0<this.dDashRatio},d.prototype.getColor=function(){return this.iColor},d.prototype.setRenderOrder=function(t){this.iRenderOrder=t},d.prototype.getRenderOrder=function(){return this.iRenderOrder},d.prototype.setLineWidthByPixels=function(t){this.lineWidthByPixels!=t&&(this.widthMaterial=null),this.lineWidthByPixels=t},d.prototype.getLineWidthByPixels=function(){return this.lineWidthByPixels},d.prototype.setLineWidth=function(t){this.dLineWidth!=t&&(this.widthMaterial=null),this.dLineWidth=t},d.prototype.getLineWidth=function(){return this.dLineWidth},d.prototype.drawEntity=function(t){var e=this.iRenderOrder;"Group"==t.type?t.traverse(function(t){"Group"!=t.type&&(t.renderOrder=e)}):t.renderOrder=e,null!=this.matrix&&t.applyMatrix4(this.matrix),this.aryEntity.push(t)},d.prototype.getEntitys=function(){return this.aryEntity},d.prototype.getMxObject=function(){return this.mxObj},d.prototype.createWidthMaterial=function(){null==this.widthMaterial&&(0<this.dDashArray&&0<this.dDashRatio?this.widthMaterial=new c.MeshLineMaterial({useMap:!1,color:this.iColor,opacity:1,resolution:new s.Vector2(this.mxObj.getViewWidth(),this.mxObj.getViewHeight()),sizeAttenuation:!this.lineWidthByPixels,lineWidth:this.dLineWidth,transparent:!0,depthTest:!1,dashArray:this.dDashArray,dashRatio:this.dDashRatio}):this.widthMaterial=new c.MeshLineMaterial({useMap:!1,color:this.iColor,opacity:1,resolution:new s.Vector2(this.mxObj.getViewWidth(),this.mxObj.getViewHeight()),sizeAttenuation:!this.lineWidthByPixels,lineWidth:this.dLineWidth,transparent:!0,depthTest:!1}))},d.prototype.drawSolid=function(t){if(!(t.length<3)){var e=new s.Shape(t.map(function(t){var e=t.x,n=t.y;return new s.Vector2(e,n)})),n=new s.ShapeGeometry(e),r=new s.Mesh(n,new s.MeshPhongMaterial({color:this.getColor(),side:s.DoubleSide,transparent:!0,opacity:this.getOpacity()}));this.drawEntity(r)}},d.prototype.drawLines=function(t){if(!(t.length<2))if(0!=this.dLineWidth){this.createWidthMaterial();var e=new s.Geometry;e.vertices=t;var n=new c.MeshLine;n.setGeometry(e);var r=new s.Mesh(n.geometry,this.widthMaterial);this.drawEntity(r),this.drawEntity(l.MxThreeJS.createLines(t.slice(0),this.iColor,0))}else this.drawEntity(l.MxThreeJS.createLines(t.slice(0),this.iColor,this.opacity))},d.prototype.drawGeometryLines=function(t){if(!(t.vertices.length<2))if(0!=this.dLineWidth){this.createWidthMaterial();var e=new c.MeshLine;if(!(t instanceof s.Geometry)){var n=new s.Geometry;n.vertices=t.vertices,t=n}e.setGeometry(t);var r=new s.Mesh(e.geometry,this.widthMaterial);this.drawEntity(r);var i=new s.LineBasicMaterial({color:this.iColor,transparent:!0,depthTest:!1,opacity:0}),a=new s.Line(t,i);this.drawEntity(a)}else i=void 0,i=this.opacity&&1!=this.opacity||0==this.opacity?new s.LineBasicMaterial({color:this.iColor,transparent:!0,depthTest:!1,opacity:this.opacity}):new s.LineBasicMaterial({color:this.iColor,transparent:!0,depthTest:!1}),a=new s.Line(t,i),this.drawEntity(a)},d.prototype.drawSelectLine=function(t,e,n,r){t instanceof Object&&e instanceof Object?this.drawEntity(l.MxThreeJS.createLine(t,e,this.iColor,0)):"number"==typeof t&&"number"==typeof e&&this.drawEntity(l.MxThreeJS.createLine(new s.Vector3(t,e,0),new s.Vector3(n,r,0),this.iColor,0))},d.prototype.drawLine=function(t,e,n,r){var i,a;if(t instanceof Object&&e instanceof Object?(i=t,a=e):"number"==typeof t&&"number"==typeof e&&(i=new s.Vector3(t,e,0),a=new s.Vector3(n,r,0)),0!=this.dLineWidth){this.createWidthMaterial();var o=new Float32Array(6);o[0]=i.x,o[1]=i.y,o[2]=0,o[3]=a.x,o[4]=a.y,o[5]=0;var u=new c.MeshLine;u.setGeometry(o);var h=new s.Mesh(u.geometry,this.widthMaterial);h.renderOrder=this.iRenderOrder,this.drawEntity(h),this.drawSelectLine(i,a)}else this.drawEntity(l.MxThreeJS.createLine(i,a,this.iColor,this.opacity))},d.prototype.drawCircle=function(t,e){this.drawEntity(l.MxThreeJS.createCircle(t,e,this.iColor))},d.prototype.drawText=function(t,e,n,r,i){var a=l.MxThreeJS.creatTextSprite(t,r,e,n,this.iColor,i);return this.drawEntity(a),a},d.prototype.setupForEntity=function(t){this.iColor=t.getColor(),this.iRenderOrder=t.getRenderOrder(),this.opacity=t.opacity,this.dLineWidth=t.getLineWidth(),this.lineWidthByPixels=t.getLineWidthByPixels(),this.dDashArray=t.getDash().dDashArray,this.dDashRatio=t.getDash().dDashRatio},d);function d(t,e){this.aryEntity=[],this.iColor=16777215,this.dLineWidth=0,this.lineWidthByPixels=!0,this.iRenderOrder=u.MxData.iMxEntityRenderOrder,this.worldDrawType=1,this.widthMaterial=null,this.dDashArray=0,this.dDashRatio=0,this.matrix=null,this.opacity=1,this.mxObj=t,this.worldDrawType=e}n.McGiWorldDraw=h;var p,f=(i(m,p=h),m.prototype.setCurEntityId=function(t){this.curEntityId=t},m.prototype.drawEntity=function(t){},m.prototype.drawText=function(t,e,n,r){return null},m.prototype.drawSelectLine=function(t,e,n,r){},m.prototype.isValid=function(){return 0!=this.curEntityId||(console.log("this.curEntityId == 0"),!1)},m.prototype.drawLine=function(t,e,n,r){var i,a;this.isValid()&&(t instanceof Object&&e instanceof Object?(i=t,a=e):"number"==typeof t&&"number"==typeof e&&(i=new s.Vector3(t,e,0),a=new s.Vector3(n,r,0)),this.selectManager.addLineDisplay(this.curEntityId,i,a))},m.prototype.drawCircle=function(t,e){this.isValid()&&this.selectManager.addCircleDisplay(this.curEntityId,t,e)},m.prototype.drawLines=function(t){if(!(t.length<2))for(var e=t.length,n=0;n<e-1;n++)this.selectManager.addLineDisplay(this.curEntityId,t[n],t[n+1])},m);function m(t,e){var n=p.call(this,t,a.kSelectDraw)||this;return n.selectManager=e,n.curEntityId=0,n}n.McGiWorldDrawSelect=f},{"../MxManager":36,"../MxThreeJS":44,three:19,"three.meshline":18}],51:[function(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0}),n.MrxDbgUiPrBase=n.MrxDbgUiPrBase_Return=n.McEdGetPointWorldDrawObject=n.McEdGetPointWorldDraw=void 0;var a=t("./MxJig"),o=t("./MxJigCmdManager"),s=t("../MxThreeJS"),l=t("../UI/MxUiVue"),u=t("../MxString"),c=t("./McGiWorldDraw"),h=(d.prototype.setMcEdJig=function(t){this.m_pJig=t},d.prototype.setColor=function(t){this.m_iColor=t},d.prototype.getColor=function(){return this.m_iColor},d.prototype.drawLine=function(t,e){this.m_pJig.drawEntity(s.MxThreeJS.createLine(t,e,this.m_iColor))},d.prototype.drawCircle=function(t,e){this.m_pJig.drawEntity(s.MxThreeJS.createCircle(t,e,this.m_iColor))},d.prototype.drawEntity=function(t,e){this.m_pJig.drawEntity(t,e)},d.prototype.drawText=function(t,e,n,r){var i=s.MxThreeJS.creatTextSprite(t,r,e,n,this.m_iColor);this.drawEntity(i)},d.prototype.drawCustomEntity=function(t,e){var n=new c.McGiWorldDraw(this.m_pJig.getMxObject(),c.McGiWorldDrawType.kDynDragDraw);n.setupForEntity(t),t.worldDraw(n);for(var r=n.getEntitys(),i=r.length,a=0;a<i;a++)this.drawEntity(r[a],e)},d);function d(){this.m_pJig=null,this.m_iColor=16777215}n.McEdGetPointWorldDraw=h;var p,f,m,g=(i(v,p=h),v.prototype.setDraw=function(t){this.m_callDraw=t},v.prototype.worldDraw=function(t){null!=this.m_callDraw&&this.m_callDraw(t,this)},v);function v(){var t=null!==p&&p.apply(this,arguments)||this;return t.m_callDraw=void 0,t}n.McEdGetPointWorldDrawObject=g,(m=f=n.MrxDbgUiPrBase_Return||(n.MrxDbgUiPrBase_Return={}))[m.kCancel=-2]="kCancel",m[m.kNone=-1]="kNone",m[m.kOk=0]="kOk",m[m.kKeyWord=1]="kKeyWord";var y,x=(i(b,y=a.McEdJigCommand),b.prototype.procInKeyword=function(t){t.status>=o.MxJigCmdManager.DragStatus.kKW1&&0<t.sKeyValue.length?this.m_keyWordPicked=t.sKeyValue.toUpperCase():this.m_keyWordPicked=""},b.prototype.getReturnStatus=function(t){switch(t){case o.MxJigCmdManager.DragStatus.kNoChange:return f.kNone;case o.MxJigCmdManager.DragStatus.kCancel:return f.kCancel;case o.MxJigCmdManager.DragStatus.kNull:return f.kNone;case o.MxJigCmdManager.DragStatus.kNormal:return f.kOk}return 1<=t?f.kKeyWord:f.kCancel},b.prototype.setInputToucheType=function(t){this.m_toucheType=t},b.prototype.getInputToucheType=function(){return this.m_toucheType},b.prototype.keyWords=function(){return this.m_keyWords},b.prototype.setKeyWords=function(t){this.m_keyWords=t},b.prototype.message=function(){return this.m_message},b.prototype.setMessage=function(t){this.m_message=t},b.prototype.keyWordPicked=function(){return this.m_keyWordPicked},b.prototype.isKeyWordPicked=function(t){return t=t.toUpperCase(),this.m_keyWordPicked==t},b.prototype.setUserDraw=function(t){t.setMcEdJig(this),this.m_pWorldDraw=t},b.prototype.printMessage=function(){var t=new u.MxString(this.m_message);t.TrimRight(":"),1<this.m_keyWords.length&&"["==this.m_keyWords[0]&&"]"==this.m_keyWords[this.m_keyWords.length-1]?l.MxUiVue.acutPrintf(t.m_val+" 或"+this.m_keyWords+":"):l.MxUiVue.acutPrintf(t.m_val+":")},b);function b(){var t=null!==y&&y.apply(this,arguments)||this;return t.m_keyWords="",t.m_message="",t.m_keyWordPicked="",t.m_pWorldDraw=null,t.m_toucheType=o.MxJigCmdManager.InType.kGetBegan,t}n.MrxDbgUiPrBase=x},{"../MxString":42,"../MxThreeJS":44,"../UI/MxUiVue":67,"./McGiWorldDraw":50,"./MxJig":57,"./MxJigCmdManager":58}],52:[function(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0}),n.MrxDbgUiPrPoint=void 0;var a,o=t("three"),s=t("./MxJigCmdManager"),l=t("../MxFun"),u=t("./MrxDbgUiPrBase"),c=t("../UI/MxUiVue"),h=t("../MxThreeJS"),d=(i(p,a=u.MrxDbgUiPrBase),p.prototype.value=function(){return new o.Vector3(this.m_value.x,this.m_value.y,0)},p.prototype.basePt=function(){return new o.Vector3(this.m_basePt.x,this.m_basePt.y,0)},p.prototype.setBasePt=function(t){null==this.m_basePt?this.m_basePt=new o.Vector3(t.x,t.y,0):(this.m_basePt.x=t.x,this.m_basePt.y=t.y)},p.prototype.setUseBasePt=function(t){this.m_useBasePt=t},p.prototype.initGo=function(){this.m_keyWordPicked="",this.m_retcall=null,this.m_retWhileCall=null,this.m_exitCall=null},p.prototype.go=function(t){this.initGo(),this.m_retcall=t,s.MxJigCmdManager.runCmd(this)},p.prototype.goWhile=function(t,e){this.initGo(),this.m_retWhileCall=t,e&&(this.m_exitCall=e),s.MxJigCmdManager.runCmd(this)},p.prototype.onExitCommand=function(){var t=this;c.MxUiVue.setCursorType(c.MxUiVue.CursorType.kNormal);var e=!1;null!=this.m_retcall&&(s.MxJigCmdManager.setRunCmdEvent(function(){a.prototype.onExitCommand.call(t,!1),e=!0}),this.m_retcall(this.getReturnStatus(this.m_resultDragStatus)),s.MxJigCmdManager.setRunCmdEvent(void 0)),!e&&s.MxJigCmdManager.isWaitCmdNull()&&c.MxUiVue.restoreCmdStatus(),e||a.prototype.onExitCommand.call(this,!0)},p.prototype.onStartCommand=function(){c.MxUiVue.setCursorType(c.MxUiVue.CursorType.kCross),this.printMessage(),s.MxJigCmdManager.setKeywordList(this.keyWords()),a.prototype.onStartCommand.call(this)},p.prototype.sampler=function(){var t=this.acquirePoint(this.m_toucheType);return this.procInKeyword(t),t.status==s.MxJigCmdManager.DragStatus.kNormal&&(null==this.m_value?this.m_value=new o.Vector3(t.pt.x,t.pt.y,0):(this.m_value.x=t.pt.x,this.m_value.y=t.pt.y)),t.status},p.prototype.done=function(t){if(null!=this.m_retcall)return this.m_resultDragStatus=t,this.m_exitCall&&this.m_exitCall(this.getReturnStatus(this.m_resultDragStatus)),s.MxJigCmdManager.DoneStatius.kExitCommand;if(null!=this.m_retWhileCall){if((this.m_resultDragStatus=t)==s.MxJigCmdManager.DragStatus.kCancel)return this.m_exitCall&&this.m_exitCall(this.getReturnStatus(this.m_resultDragStatus)),s.MxJigCmdManager.DoneStatius.kExitCommand;var e=!1;t==s.MxJigCmdManager.DragStatus.kNull&&(e=!0);var n=this.m_retWhileCall(this.getReturnStatus(this.m_resultDragStatus));return null!=n&&null!=n.exit&&(e=n.exit),e?(this.m_exitCall&&this.m_exitCall(this.getReturnStatus(this.m_resultDragStatus)),s.MxJigCmdManager.DoneStatius.kExitCommand):(s.MxJigCmdManager.setKeywordList(this.keyWords()),this.printMessage(),s.MxJigCmdManager.DoneStatius.kContinueCommand)}l.MxFun.Assert(0)},p.prototype.upDisplay=function(){this.m_value&&(this.m_pWorldDraw&&this.m_pWorldDraw.worldDraw(this.m_value),this.m_useBasePt&&this.m_basePt&&this.drawEntity(h.MxThreeJS.createLine(this.m_value,this.m_basePt,16777215)))},p);function p(){var t=null!==a&&a.apply(this,arguments)||this;return t.m_useBasePt=!1,t.m_basePt=null,t.m_value=null,t.m_retcall=null,t.m_retWhileCall=null,t.m_exitCall=null,t.m_resultDragStatus=s.MxJigCmdManager.DragStatus.kCancel,t}n.MrxDbgUiPrPoint=d},{"../MxFun":34,"../MxThreeJS":44,"../UI/MxUiVue":67,"./MrxDbgUiPrBase":51,"./MxJigCmdManager":58,three:19}],53:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxCmdRunManager=void 0;var r,i,a,o,s,l,u,c=t("../MxFun"),h=t("../MxType"),d=t("./MxJigCmdManager"),p=t("../UI/MxUiVue"),f=t("../MxDrawData");r=n.MxCmdRunManager||(n.MxCmdRunManager={}),i={},a=new Array,o=0,s=!1,l="",u={},r.InitQuickCommand=function(t){for(var e=t.length,n=0;n<e;n++){var r=t[n];if(!(r.length<2)){var i=r[0];if(0!=i.length)for(var a=r.length,o=1;o<a;o++)0!=r[o].length&&(u[r[o].toUpperCase()]=i)}}},r.MoveUpKey=function(){return s?++o>=a.length&&(o=0):s=!0,!0},r.MoveDownKey=function(){return!!s&&(--o<0&&(o=a.length-1),!0)},r.GetListCommad=function(){return o<0||o>=a.length?"":a[o]},r.ClearPrvCmd=function(){l=""},r.GetPrvCmd=function(){return l},r.SetPrvCmd=function(t){l=t},r.runCmd=function(t,e,n){var r=e.toUpperCase(),m=i[r];if(t&&null==m){var g=u[r];if(null!=g&&(m=i[g.toUpperCase()]),null==m)return p.MxUiVue.isNull()?console.log(c.MxFun.formatString('未知命令"{0}"',e)):p.MxUiVue.acutPrintf('未知命令"{0}"。\n命令:',e),!1}if(!m)return!1;var v=a.indexOf(m.cmd);-1<v&&a.splice(v,1),s=!(o=0),a.push(m.cmd),l=m.cmd;var y=m.fun;if(t&&0==(m.flag&h.MxType.CommandFlags.MCRX_CMD_TRANSPARENT)&&p.MxUiVue.acutPrintf("{0}\n",m.cmd),d.MxJigCmdManager.stopCmd(),t&&t.undoMark(),t&&"Mx_GripEdit"!=e&&"Mx_IntelliSel"!=e&&"Mx_FrontEndWebpageIntelliSel"!=e&&"Mx_FrontEndWebpageGripEdit"!=e){var x=!1,b=t.getMxCAD();if(b){t.callCommand("MxCAD_StartCommandEvent");var w=b.getSelect().clearAllSelect(!1),_=b.getGrip().clearAll();(w||_)&&(x=!0)}else{var M=t.getMxAllSelect();t.getMxDatabase().getGripManager().removeAllGrips()&&(x=!0),t.getMxDatabase().getSelectManager().removeAllEntity()&&(x=!0),t.getMxDatabase().getSelectManager().setPrvCommandSelect(M)}x&&t.updateDisplay()}return y(n),t&&(d.MxJigCmdManager.isRunning()||p.MxUiVue.restoreCmdStatus(),t.updateDisplay(),f.MxDrawData.m_isAutoResetRenderer||t.resetRenderer()),!0},r.addCommand=function(t,e,n){null==n&&(n=h.MxType.CommandFlags.MCRX_CMD_MODAL);var r=t.toUpperCase();i[r]={fun:e,cmd:t,flag:n}}},{"../MxDrawData":29,"../MxFun":34,"../MxType":46,"../UI/MxUiVue":67,"./MxJigCmdManager":58}],54:[function(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0}),n.MxDrawObjectOsnap=n.McDbLine=n.McDbCurve=n.McDbEntity=n.McDbType=void 0;var a,o,s=t("three"),l=t("../MxThreeJS"),u=t("../MxDrawData"),c=t("./MxJigCmdManager");(o=a=n.McDbType||(n.McDbType={}))[o.kInValid=0]="kInValid",o[o.kLine=1]="kLine";var h=(d.prototype.getType=function(){return this.m_type},d);function d(){this.m_type=a.kInValid}n.McDbEntity=h;var p,f=(i(m,p=h),m);function m(){return null!==p&&p.apply(this,arguments)||this}n.McDbCurve=f;var g,v=(i(y,g=f),y);function y(){var t=g.call(this)||this;return t.m_type=a.kLine,t}n.McDbLine=v;var x=(b.prototype.getBlobHead=function(t,e){var n={};return n.type=t.getInt32(e,!0),e+=4,n.ver=t.getInt32(e,!0),e+=4,n.databaseIndex=t.getInt32(e,!0),e+=4,n.nOffset=e,n},b.prototype.clearData=function(){this.threejsObjects=new s.Object3D},b.prototype.calculateDistance=function(t,e,n){var r=(new s.Vector3).subVectors(e,t),i=(new s.Vector3).subVectors(n,t),a=r.clone().normalize(),o=i.clone().normalize(),l=a.dot(o),u=(new s.Vector3).subVectors(n,e),c=(new s.Vector3).subVectors(t,e),h=u.clone().normalize(),d=c.clone().normalize();if(0<h.dot(d)&&0<l){var p=Math.sqrt(1-l*l),f=t.distanceTo(n),m=f*p,g=f*l,v=r.clone().normalize().multiplyScalar(g),y=t.clone().add(v),x=r.clone().normalize().multiplyScalar(200+g);return{pt1:t,pt2:e,pt:n,distance:m,targetPt:y,warningPt:t.clone().add(x)}}return null},b.prototype.getOsnapData=function(t,e){if(this.threejsObjects){var n=new s.Raycaster,r=u.MxDrawData.getCursorWidthPixels();n.linePrecision=this.mxObj.screenCoordLong2World(r);var i=this.mxObj.getCanvas(),o=i.clientWidth,l=i.clientHeight,h=this.mxObj.screenCoord2World(t.x,t.y);h.z=0,t=new s.Vector2(t.x/o*2-1,-t.y/l*2+1),n.setFromCamera(t,this.mxObj.getCamera());var d=n.intersectObjects(this.threejsObjects.children,!0),p=new Map;if(d.length)for(var f=0;f<d.length;f++){var m=d[f];if(m.object.userData&&m.object.userData.obj.getType()==a.kLine){var g=m.object.userData.obj,v=h.distanceTo(g.pt1);g.pt1.type=c.MxJigCmdManager.OsnapMode.kOsModeEnd,p.set(v,g.pt1);var y=h.distanceTo(g.pt2);if(g.pt2.type=c.MxJigCmdManager.OsnapMode.kOsModeEnd,p.set(y,g.pt2),!g.bulge||0==g.bulge){var x=this.calculateDistance(g.pt1,g.pt2,h);x&&(x.targetPt.type=c.MxJigCmdManager.OsnapMode.kOsModeNear,p.set(x.distance,x.targetPt))}}}if(p.size){var b=this.mxObj.screenCoordLong2World(r),w=Array.from(p);w.sort(function(t,e){return t[0]-e[0]}),w[0][0]<b&&e(w[0][1],w[0][1].type)}}},b.prototype.mxWebEntitysData=function(t,e){var n=this.getBlobHead(t,0);t.getInt32(n.nOffset,!0),n.nOffset+=4;var r=t.getInt32(n.nOffset,!0);n.nOffset+=4;var i=t.getInt32(n.nOffset,!0);if(n.nOffset+=4,1<i)console.log("mx:error mxfun.js version is old!");else{var a=t.getInt32(n.nOffset,!0);if(n.nOffset+=4,a==n.nOffset){this.threejsObjects=new s.Object3D;for(var o=0;o<r;o++){var u=t.getInt8(n.nOffset);n.nOffset+=1;var c=t.getInt32(n.nOffset,!0);if(n.nOffset+=4,1==u){var h=t.getFloat32(n.nOffset,!0);n.nOffset+=4;var d=t.getFloat32(n.nOffset,!0);n.nOffset+=4;var p=t.getFloat32(n.nOffset,!0);n.nOffset+=4;var f=t.getFloat32(n.nOffset,!0);n.nOffset+=4,(M=new v).pt1=new s.Vector3(h,d,0),M.pt2=new s.Vector3(p,f,0),(S=l.MxThreeJS.createLine(M.pt1,M.pt2,16777215)).userData.obj=M,this.threejsObjects.add(S)}else if(2==u){var m=t.getInt8(n.nOffset);n.nOffset+=1;var g=t.getInt32(n.nOffset,!0);n.nOffset+=4;for(var y=new s.Vector3,x=0,b=null,w=0;w<g;w++){var _=new s.Vector3;_.x=t.getFloat32(n.nOffset,!0),n.nOffset+=4,_.y=t.getFloat32(n.nOffset,!0),n.nOffset+=4;var M,S,T=t.getFloat32(n.nOffset,!0);n.nOffset+=4,0<w&&((M=new v).pt1=y.clone(),M.pt2=_.clone(),M.bulge=T,(S=l.MxThreeJS.createLine(M.pt1,M.pt2,16777215)).userData.obj=M,this.threejsObjects.add(S)),y=_,x=T,0==w&&(b=_)}m&&2<g&&((M=new v).pt1=b.clone(),M.pt2=y.clone(),M.bulge=x,(S=l.MxThreeJS.createLine(M.pt1,M.pt2,16777215)).userData.obj=M,this.threejsObjects.add(S))}else console.log("mx:error mxWebEntitysData type"),n.nOffset=n.nOffset-5+c}}else console.log("mx: mxWebEntitysData size assert(0)")}},b);function b(t){this.threejsObjects=null,this.mxObj=null,this.mxObj=t}n.MxDrawObjectOsnap=x},{"../MxDrawData":29,"../MxThreeJS":44,"./MxJigCmdManager":58,three:19}],55:[function(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0}),n.MxEntSelJig=void 0;var a,o=t("./MxJig"),s=t("./MxJigCmdManager"),l=t("../UI/MxUiVue"),u=t("../MrxDbgUtils"),c=(i(h,a=o.McEdJigCommand),h.prototype.sampler=function(){var t=s.MxJigCmdManager.InType.kGetBegan,e=this.acquirePoint(t);return e.status==s.MxJigCmdManager.DragStatus.kNormal&&(this.point=e.pt),e.status},h.prototype.done=function(t){if(t==s.MxJigCmdManager.DragStatus.kNormal){var e=this;u.MrxDbgUtils.findEntAtPoint(this.getMxObject(),this.point,this.filter).then(function(t){e.callRet(t)})}else this.callRet([]);return s.MxJigCmdManager.DoneStatius.kExitCommand},h.prototype.onStartCommand=function(){l.MxUiVue.setCursorType(l.MxUiVue.CursorType.kRect),a.prototype.onStartCommand.call(this)},h.prototype.onExitCommand=function(){l.MxUiVue.setCursorType(l.MxUiVue.CursorType.kNormal),s.MxJigCmdManager.isWaitCmdNull()&&l.MxUiVue.restoreCmdStatus(),a.prototype.onExitCommand.call(this,!0)},h.prototype.upDisplay=function(){},h);function h(){return null!==a&&a.apply(this,arguments)||this}n.MxEntSelJig=c},{"../MrxDbgUtils":20,"../UI/MxUiVue":67,"./MxJig":57,"./MxJigCmdManager":58}],56:[function(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0}),n.MxIntelliSelectJig=void 0;var a,o=t("three"),s=t("./MxJig"),l=t("./MxJigCmdManager"),u=t("../MxThreeJS"),c=(i(h,a=s.McEdJigCommand),h.prototype.sampler=function(){var t=l.MxJigCmdManager.InType.kGetBegan,e=this.acquirePoint(t);return e.status==l.MxJigCmdManager.DragStatus.kNormal&&(this.m_pt2=e.pt),e.status},h.prototype.getTypeName=function(){return"MxIntelliSelect"},h.prototype.done=function(t){if(t==l.MxJigCmdManager.DragStatus.kNormal){var e=this.getMxObject();if(this.m_isFrontEndWebpage)e.getMxDatabase().getGripManager().doWindowsSelect(this.m_pt1,this.m_pt2);else{var n={x1:this.m_pt1.x,y1:this.m_pt1.y,x2:this.m_pt2.x,y2:this.m_pt2.y};e.callCommand("MxCAD_IntelliSelect",JSON.stringify(n),function(t){e.getMxCAD().getGrip().onIntelliSelect(t)})}}return l.MxJigCmdManager.DoneStatius.kExitCommand},h.prototype.doPointSelect=function(t,e,n){var r=t.screenCoordLong2Doc(16),i={x:e.x,y:e.y,tol:r};t.callCommand("MxCAD_IntelliSelect_Point",JSON.stringify(i),function(t){n(t)})},h.prototype.upDisplay=function(){var t=new o.Vector3(this.m_pt1.x,this.m_pt2.y,this.m_pt2.z),e=new o.Vector3(this.m_pt2.x,this.m_pt1.y,this.m_pt2.z),n=[];n.push(this.m_pt1),n.push(t),n.push(this.m_pt2),n.push(e),n.push(this.m_pt1);var r=null,i=65280;if(this.m_pt2.x>this.m_pt1.x)r=u.MxThreeJS.createLines(n,16777215),i=255;else{var a=this.getMxObject().screenCoordLong2Doc(3);r=u.MxThreeJS.createDashedLines(n,16777215,2*a,a)}var s=[];s.push(this.m_pt1),s.push(t),s.push(this.m_pt2),s.push(this.m_pt1),s.push(this.m_pt2),s.push(e);var l=u.MxThreeJS.createTriangle(s,i,.27);this.drawEntity(l,30),this.drawEntity(r,31)},h);function h(t,e){var n=a.call(this)||this;return n.m_pt1=t,n.m_pt2=t,n.m_isFrontEndWebpage=e,n}n.MxIntelliSelectJig=c},{"../MxThreeJS":44,"./MxJig":57,"./MxJigCmdManager":58,three:19}],57:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.McEdJigCommand=n.MxDynamicInput=void 0;var r=t("three"),i=t("../MxFun"),a=t("./MxJigCmdManager"),o=t("../MxManager"),s=t("../MxTools"),l=t("../UI/MxUiVue"),u=t("./McEdJigOsnap"),c=t("../MxWindowsEvent"),h=(d.prototype.onKeyDonw=function(t){if(27==t)return this.m_isInputStatus?(this.m_isInputStatus=!1,l.MxUiVue.OnMxEvent({name:"dynInputReSet"}),1):0;if(32!=t&&13!=t)return this.m_isInputStatus=!0,0;if(this.m_isInputStatus&&l.MxUiVue.DynamicInput_isShow()&&l.MxUiVue.DynamicInput_getType()==a.MxJigCmdManager.DynamicInputType.kXYCoordInput){var e,n=l.MxUiVue.DynamicInput_getValue1(),r=l.MxUiVue.DynamicInput_getValue2(),o=l.MxUiVue.DynamicInput_getFocusValue();e=s.MxTools.IsNumerical(n)&&s.MxTools.IsNumerical(r)?i.MxFun.formatString("{0},{1}",n,r):o,l.MxUiVue.setCmdText(e)}return this.m_isInputStatus=!1,0},d.prototype.isInputStatus=function(){return this.m_isInputStatus},d.prototype.initDynInput=function(t){this.m_jig=t;var e=this.m_jig.getMxObject();l.MxUiVue.DynamicInput_setType(this.m_dynType),this.m_dynType==a.MxJigCmdManager.DynamicInputType.kAutoInput&&(null!=this._dynamicInputBasePoint||e.sysVariable().getSysVarNumber("GETPOINTSTATUS")&a.MxJigCmdManager.GETPOINTSTATUS.OsModeSValidLastPoint?l.MxUiVue.DynamicInput_setType(a.MxJigCmdManager.DynamicInputType.kDistanceInput):l.MxUiVue.DynamicInput_setType(a.MxJigCmdManager.DynamicInputType.kXYCoordInput))},d.prototype.setFocus=function(t){l.MxUiVue.OnMxEvent({name:"dynInputSetFocus",param:{isFocus:t}})},d.prototype.exitDynInput=function(){this._dynamicInputBasePoint=void 0,l.MxUiVue.DynamicInput_setShow(!1),l.MxUiVue.DynamicInput_upDisplay()},d.prototype.isShow=function(){return l.MxUiVue.DynamicInput_isShow()},d.prototype.upDynInput=function(){var t,e=this.m_jig.getMxObject();if(t=!this.m_jig.isDisableDynInput()&&e.sysVariable().getSysVarBool("DYNINPUT"),l.MxUiVue.DynamicInput_setShow(t),t){if(l.MxUiVue.DynamicInput_setTip(l.MxUiVue.getCmdTip()),a.MxJigCmdManager.getAcquireStatus()==a.MxJigCmdManager.AcquireStatus.kMove){var n=a.MxJigCmdManager.getAcquirePoint();if(l.MxUiVue.DynamicInput_setPos(i.MxFun.docCoord2Screen(n.x,n.y,n.z)),l.MxUiVue.DynamicInput_getType()==a.MxJigCmdManager.DynamicInputType.kXYCoordInput){var r=n;l.MxUiVue.DynamicInput_setValue1(r.x.toFixed(3)),l.MxUiVue.DynamicInput_setValue2(r.y.toFixed(3))}else l.MxUiVue.DynamicInput_getType(),a.MxJigCmdManager.DynamicInputType.kDistanceInput}l.MxUiVue.DynamicInput_upDisplay()}},d.prototype.setDynamicInputBasePoint=function(t){this._dynamicInputBasePoint=t},d.prototype.setDynamicInputType=function(t){this.m_dynType=t},d.prototype.getDynamicInputType=function(){return this.m_dynType},d);function d(t){this.m_dynType=a.MxJigCmdManager.DynamicInputType.kAutoInput,this._dynamicInputBasePoint=void 0,this.m_isInputStatus=!1,this.m_jig=t}n.MxDynamicInput=h;var p=(f.prototype.getTypeName=function(){return""},f.prototype.getSence=function(){return this._mxObject.getTheTempDrawContainer()},f.prototype.onExitCommand=function(t){t&&this.m_dynInput.exitDynInput(),this.m_osnap.endDrag()},f.prototype.getOsnap=function(){return this.m_osnap},f.prototype.isDisableDynInput=function(){return this.m_isDisableDynInput},f.prototype.setDisableDynInput=function(t){this.m_isDisableDynInput=t},f.prototype.setDisableOsnap=function(t){this.m_isDisableOsnap=t},f.prototype.isDisableOsnap=function(){return this.m_isDisableOsnap},f.prototype.onStartCommand=function(){this._isCancle=!1,this._isExit=!1,this.m_dynInput.initDynInput(this),u.McEdImpJigGlobalData.intiStartDrag(this._mxObject),this.m_osnap.startDrag(this.m_isOffsetInputPostion,this);var t=c.MxWindowsEvent.getCurrentMousePostion(),e=this._mxObject.screenCoord2Doc(t.x,t.y,0);this.m_osnap.setPoint(e),a.MxJigCmdManager.doMouseMoveImp(),this.m_dynInput.setFocus(!0)},f.prototype.getDynImput=function(){return this.m_dynInput},f.prototype.setMxObject=function(t){this._mxObject=t},f.prototype.getMxObject=function(){return this._mxObject},f.prototype.setColor=function(t){this._iColor=t},f.prototype.getColor=function(){return this._iColor},f.prototype.setDynamicInputType=function(t){this.m_dynInput.setDynamicInputType(t)},f.prototype.getDynamicInputType=function(){return this.m_dynInput.getDynamicInputType()},f.prototype.createTriangle=function(t,e,n){var i=new r.MeshBasicMaterial({color:this._iColor,side:r.DoubleSide}),a=new r.Geometry;a.vertices.push(t),a.vertices.push(e),a.vertices.push(n);var o=new r.Vector3(1,1,1),s=new r.Color(this._iColor),l=new r.Face3(0,1,2,o,s,0);return a.faces.push(l),a.computeFaceNormals(),a.computeVertexNormals(),new r.Mesh(a,i)},f.prototype.createPoint=function(t){var e=new r.Geometry;e.vertices.push(t);var n=new r.PointsMaterial({color:this._iColor,size:3});return new r.Points(e,n)},f.prototype.createLine=function(t,e){var n=new r.Geometry,i=new r.LineBasicMaterial({color:this._iColor});return n.vertices.push(t,e),new r.Line(n,i)},f.prototype.drawReserve=function(t){this.m_isReserveDrawStatus=!0,this.m_callReserveDrawAddEntity=t,this.upDisplay(),this.m_isReserveDrawStatus=!1,this.m_callReserveDrawAddEntity=null},f.prototype.drawEntity=function(t,e){if(null!=t)if(this.m_isReserveDrawStatus)t.renderOrder=null!=e?e:o.MxData.iDynJigRenderOrder,this._mxObject.addObject(t),this.m_callReserveDrawAddEntity&&this.m_callReserveDrawAddEntity(t);else{var n="MxDynDraw_"+this._DynNameId.toString();t.name=n,t.renderOrder=null!=e?e:o.MxData.iDynJigRenderOrder,null==this._aryDynDrawObjectNamesId&&(this._aryDynDrawObjectNamesId=new Array),this._aryDynDrawObjectNamesId.push(this._DynNameId),this._DynNameId++,this.getSence().add(t)}},f.prototype.floorPowerOfTwo=function(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))},f.prototype.makeTextSprite=function(t,e,n,a,o){var s,l=document.createElement("canvas"),u=l.getContext("2d"),c=i.MxFun.formatString("normal {0}px Arial","256");u.font=c;var h=u.measureText(t);s=2*this.floorPowerOfTwo(h.width),l.width=s,l.height=256,u.font=c,u.textAlign="center",u.textBaseline="middle";var d=i.MxFun.formatString("#{0}",o.toString(16));u.fillStyle=d,u.fillText(t,s/2,128);var p=new r.Texture(l);p.needsUpdate=!0;var f=new r.SpriteMaterial({map:p});f.transparent=!1,f.rotation=a;var m=new r.Sprite(f);return m.scale.set(s/256*n,n,1),m.position.set(e.x,e.y,0),m},f.prototype.drawText=function(t,e,n,r){var i=this.makeTextSprite(t,r,e,n,this._iColor);this.drawEntity(i)},f.prototype.drawPoints=function(t){for(var e=0;e<t.length;e++){var n=new r.Geometry;n.vertices.push(t[e]);var i=new r.PointsMaterial({color:this._iColor,size:3}),a=new r.Points(n,i);this.drawEntity(a)}},f.prototype.drawPoint=function(t){var e=new r.Geometry;e.vertices.push(t);var n=new r.PointsMaterial({color:this._iColor,size:3}),i=new r.Points(e,n);this.drawEntity(i)},f.prototype.drawPolyline=function(t){for(var e=new r.Geometry,n=0;n<t.length;n++)e.vertices.push(t[n]);var i=new r.LineBasicMaterial({color:this._iColor}),a=new r.Line(e,i);this.drawEntity(a)},f.prototype.drawSpline=function(t){},f.prototype.drawCircle=function(t,e){var n=new r.CircleGeometry(e,64,3,2*Math.PI),i=new r.LineBasicMaterial({color:this._iColor});n.vertices.shift();var a=new r.LineLoop(n,i);a.position.x=t.x,a.position.y=t.y,a.position.z=t.z,this.drawEntity(a)},f.prototype.drawArc=function(t,e,n,i){var a=new r.CircleGeometry(e,64,n,i),o=new r.LineBasicMaterial({color:this._iColor});a.vertices.shift();var s=new r.Line(a,o);s.position.x=t.x,s.position.y=t.y,s.position.z=t.z,this.drawEntity(s)},f.prototype.drawLine=function(t,e){var n=new r.Geometry,i=new r.LineBasicMaterial({color:this._iColor});n.vertices.push(t,e);var a=new r.Line(n,i);this.drawEntity(a)},f.prototype.removeDynDrawObject=function(){if(null!=this._aryDynDrawObjectNamesId){for(var t=0;t<this._aryDynDrawObjectNamesId.length;t++){var e="MxDynDraw_"+this._aryDynDrawObjectNamesId[t].toString(),n=this.getSence().getObjectByName(e);i.MxFun.removeThreejsObject(n,this.getSence())}this._aryDynDrawObjectNamesId=[]}},f.prototype.acquirePoint=function(t){var e=a.MxJigCmdManager.acquirePoint(t);return this._isExit=e.exit,e},f.prototype.notifyCancleExit=function(){this._isCancle=!0,this.removeDynDrawObject(),this.done(a.MxJigCmdManager.DragStatus.kCancel),this.onExitCommand(!0),a.MxJigCmdManager.commandRunComplete(this)},f.prototype.notifySampler=function(){var t=this.sampler();if(this.m_dynInput.upDynInput(),t==a.MxJigCmdManager.DragStatus.kNormal&&(this.removeDynDrawObject(),this.upDisplay()),this._isExit){var e=this.done(t);this._isCancle||(e==a.MxJigCmdManager.DoneStatius.kContinueCommand?(this._isExit=!1,a.MxJigCmdManager.doMouseMoveImp(),l.MxUiVue.OnMxEvent({name:"dynInputReSet"})):(this.removeDynDrawObject(),a.MxJigCmdManager.commandRunComplete(this),this.onExitCommand(!0)))}this._mxObject.updateDisplay()},f.prototype.getCurrentMouseButton=function(){return a.MxJigCmdManager.getCurrentMouseButton()},f.prototype.userInputControls=function(){return this._userInputContros},f.prototype.setUserInputControls=function(t){this._userInputContros=t},f);function f(){this._isExit=!1,this._aryDynDrawObjectNamesId=void 0,this._DynNameId=1,this._iColor=16777215,this._isCancle=!1,this.m_isDisableDynInput=!1,this.m_isDisableOsnap=!1,this.m_dynInput=new h(this),this.m_osnap=new u.McEdJigOsnap(this),this._userInputContros=a.MxJigCmdManager.UserInputControls.kNullResponseAccepted,this.m_isOffsetInputPostion=!1,this.m_isReserveDrawStatus=!1,this.m_callReserveDrawAddEntity=null,this._mxObject=null}n.McEdJigCommand=p},{"../MxFun":34,"../MxManager":36,"../MxTools":45,"../MxWindowsEvent":48,"../UI/MxUiVue":67,"./McEdJigOsnap":49,"./MxJigCmdManager":58,three:19}],58:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxJigCmdManager=n.AcquireReturn=void 0;var r,i=t("three"),a=t("../MxFun"),o=t("./MxJig"),s=t("../MxManager"),l=t("./MrxDbgUiPrPoint"),u=t("./MrxDbgUiPrBase"),c=t("../UI/MxUiVue"),h=t("../MxTools"),d=t("../MxString"),p=t("../MxWindowsEvent"),f=t("../MxDrawObject"),m=t("./McEdJigOsnap"),g=t("../MxDrawData"),v=function(){this.status=r.DragStatus.kNoChange,this.exit=!0,this.sKeyValue=""};n.AcquireReturn=v,function(t){var e,n,r,y,x,b,w,_,M,S,T,C,E,D,A,O,L,P;(n=e=t.UserInputControls||(t.UserInputControls={}))[n.kGovernedByOrthoMode=1]="kGovernedByOrthoMode",n[n.kNullResponseAccepted=2]="kNullResponseAccepted",n[n.kDontEchoCancelForCtrlC=4]="kDontEchoCancelForCtrlC",n[n.kDontUpdateLastPoint=8]="kDontUpdateLastPoint",n[n.kNoDwgLimitsChecking=16]="kNoDwgLimitsChecking",n[n.kNoZeroResponseAccepted=32]="kNoZeroResponseAccepted",n[n.kNoNegativeResponseAccepted=64]="kNoNegativeResponseAccepted",n[n.kAccept3dCoordinates=128]="kAccept3dCoordinates",n[n.kAcceptMouseUpAsPoint=256]="kAcceptMouseUpAsPoint",n[n.kAnyBlankTerminatesInput=512]="kAnyBlankTerminatesInput",n[n.kInitialBlankTerminatesInput=1024]="kInitialBlankTerminatesInput",n[n.kAcceptOtherInputString=2048]="kAcceptOtherInputString",n[n.kGovernedByUCSDetect=4096]="kGovernedByUCSDetect",n[n.kNoZDirectionOrtho=8192]="kNoZDirectionOrtho",n[n.kSpacesInAccepted=16384]="kSpacesInAccepted",(y=r=t.AcquireStatus||(t.AcquireStatus={}))[y.kNoChange=0]="kNoChange",y[y.kMove=1]="kMove",y[y.kBegan=2]="kBegan",y[y.kEnd=3]="kEnd",y[y.kMouseUp=4]="kMouseUp",y[y.kMouseDown=5]="kMouseDown",y[y.kCancle=6]="kCancle",(b=x=t.DragStatus||(t.DragStatus={}))[b.kNoChange=-6]="kNoChange",b[b.kCancel=-4]="kCancel",b[b.kOther=-3]="kOther",b[b.kNull=-1]="kNull",b[b.kNormal=0]="kNormal",b[b.kKW1=1]="kKW1",(w=t.DoneStatius||(t.DoneStatius={}))[w.kContinueCommand=0]="kContinueCommand",w[w.kExitCommand=1]="kExitCommand",(M=_=t.InType||(t.InType={}))[M.kGetBegan=1]="kGetBegan",M[M.kGetEnd=2]="kGetEnd",(T=S=t.MouseButton||(t.MouseButton={}))[T.kInvalid=-1]="kInvalid",T[T.kLeft=0]="kLeft",T[T.kMid=1]="kMid",T[T.kRight=2]="kRight",(E=C=t.COMMAND_IN||(t.COMMAND_IN={}))[E.COMMAND_IN_NO_ENTITY=0]="COMMAND_IN_NO_ENTITY",E[E.COMMAND_IN_EMTPY=1]="COMMAND_IN_EMTPY",E[E.COMMAND_IN_KEY=2]="COMMAND_IN_KEY",E[E.COMMAND_IN_STRING=3]="COMMAND_IN_STRING",E[E.COMMAND_IN_COORD=5]="COMMAND_IN_COORD",E[E.COMMAND_IN_DIST=6]="COMMAND_IN_DIST",E[E.COMMAND_IN_INVALID=7]="COMMAND_IN_INVALID",E[E.COMMAND_IN_INVALID_ZERO=8]="COMMAND_IN_INVALID_ZERO",E[E.COMMAND_IN_INVALID_NEG=9]="COMMAND_IN_INVALID_NEG",E[E.COMMAND_IN_INT=10]="COMMAND_IN_INT",(A=D=t.COMMAND_GET||(t.COMMAND_GET={}))[A.COMMAND_GET_STRING=1]="COMMAND_GET_STRING",A[A.COMMAND_GET_KEY=2]="COMMAND_GET_KEY",A[A.COMMAND_GET_DIST=4]="COMMAND_GET_DIST",A[A.COMMAND_GET_COORD=8]="COMMAND_GET_COORD",A[A.COMMAND_GET_INT=16]="COMMAND_GET_INT",(O=t.DynamicInputType||(t.DynamicInputType={}))[O.kNoInput=0]="kNoInput",O[O.kXYCoordInput=1]="kXYCoordInput",O[O.kDistanceInput=2]="kDistanceInput",O[O.kDynTip=3]="kDynTip",O[O.kAutoInput=4]="kAutoInput",O[O.kAngleInput=5]="kAngleInput",(L=t.GETPOINTSTATUS||(t.GETPOINTSTATUS={}))[L.OsModeSValidLastPoint=1]="OsModeSValidLastPoint",L[L.OsModeSTempDisable=2]="OsModeSTempDisable",L[L.OsModeOrthoTempDisable=4]="OsModeOrthoTempDisable",L[L.OsModeSInvalidLastMovePoint=8]="OsModeSInvalidLastMovePoint",L[L.OsModePoloarTempDisable=16]="OsModePoloarTempDisable",L[L.OsModeDynTraceTempDisable=32]="OsModeDynTraceTempDisable",L[L.OsModeGridSnapTempDisable=64]="OsModeGridSnapTempDisable",(P=t.OsnapMode||(t.OsnapMode={}))[P.kOsModekValid=0]="kOsModekValid",P[P.kOsModeEnd=1]="kOsModeEnd",P[P.kOsModeMid=2]="kOsModeMid",P[P.kOsModeCen=3]="kOsModeCen",P[P.kOsModeNode=4]="kOsModeNode",P[P.kOsModeQuad=5]="kOsModeQuad",P[P.kOsModeIns=7]="kOsModeIns",P[P.kOsModePerp=8]="kOsModePerp",P[P.kOsModeTan=9]="kOsModeTan",P[P.kOsModeNear=10]="kOsModeNear",P[P.kOsModeInt=11]="kOsModeInt";var R,I=void 0,k=void 0,B=r.kNoChange,F=S.kInvalid,N=-9999999,j=new i.Vector2(N,N),z=!1,V=void 0,G=!1,U=new Map,H=new Array,W=new d.MxString,J=void 0;function q(){null!=I&&I.notifySampler()}function X(t){var e=t.srcElement;if(e&&"CANVAS"==e.tagName){if(null==I)return;if(I.getDynImput().isInputStatus())return;j.x=t.offsetX,j.y=t.offsetY,tt(j),t.stopPropagation()}}function Y(t){if(t.button!=S.kLeft)return 0;var e=t.srcElement;return!e||"CANVAS"!=e.tagName||null==I||I.getDynImput().isInputStatus()?0:(j.x=t.offsetX,j.y=t.offsetY,R=I.getMxObject().screenCoord2Doc(t.offsetX,t.offsetY,0),B=r.kMouseUp,F=t.button,q(),t.stopPropagation(),1)}function Z(t){if(t.button!=S.kLeft)return 0;null!=I&&I.getDynImput().isShow()&&I.getDynImput().setFocus(!0);var e=t.srcElement;if(e&&"CANVAS"==e.tagName){if(null==I)return 0;if(I.getDynImput().isInputStatus())return 0;j.x=t.offsetX,j.y=t.offsetY;var n=I.getMxObject().screenCoord2Doc(t.offsetX,t.offsetY,0),i=I.getOsnap(),a=i.getCurrentOSnapPoint(n);return n=a.pt,a.osmode,m.McEdImpJigGlobalData.setPrvPoint(n),i.seInValidPoint(),R=n,B=r.kMouseDown,F=t.button,q(),t.stopPropagation(),1}return 0}function $(t){if(0!=t.touches.length){null!=I&&I.getDynImput().isShow()&&I.getDynImput().setFocus(!0);var e=t.srcElement;if(e&&"CANVAS"==e.tagName){if(null==I)return;if(I.getDynImput().isInputStatus())return;j.x=t.touches[0].pageX,j.y=t.touches[0].pageY;var n=I.getMxObject().screenCoord2Doc(t.touches[0].pageX,t.touches[0].pageY,0),i=I.getOsnap(),a=i.getCurrentOSnapPoint(n);return n=a.pt,a.osmode,m.McEdImpJigGlobalData.setPrvPoint(n),i.seInValidPoint(),R=n,B=r.kBegan,F=S.kInvalid,q(),t.stopPropagation(),1}}}function K(t){var e=t.srcElement;if(e&&"CANVAS"==e.tagName){if(null==I)return;if(I.getDynImput().isInputStatus())return;if(j.x==N||j.y==N)return;return R=I.getMxObject().screenCoord2Doc(j.x,j.y,0),B=r.kEnd,F=S.kInvalid,q(),t.stopPropagation(),1}}function Q(t){var e=t.srcElement;if(e&&"CANVAS"==e.tagName){if(null==I)return;if(I.getDynImput().isInputStatus())return;j.x=t.touches[0].pageX,j.y=t.touches[0].pageY,tt(j)}}function tt(e){if(G=!1,null==e){if(j.x==N||j.y==N)return;e=j}var n=I.getMxObject().screenCoord2Doc(e.x,e.y,0),i=I.getOsnap(),a=I.getMxObject().screenCoordLong2Doc(.5*g.MxDrawData.getCursorWidthPixels());i.setPoint(n,a),t.OsnapMode.kOsModekValid,R=n,B=r.kMove,q.call(this)}function et(){I&&(J=I.getMxObject().getEventManager(),a.MxFun.isPC()?(J.addEventListener("mouseup",Y,!0),J.addEventListener("mousemove",X,!0),J.addEventListener("mousedown",Z,!0)):(J.addEventListener("touchstart",$,!0),J.addEventListener("touchend",K,!0),J.addEventListener("touchmove",Q,!0)))}function nt(){J&&(a.MxFun.isPC()?(J.removeEventListener("mouseup",Y,!0),J.removeEventListener("mousemove",X,!0),J.removeEventListener("mousedown",Z,!0)):(J.removeEventListener("touchstart",$,!0),J.removeEventListener("touchend",K,!0),J.removeEventListener("touchmove",Q,!0)),J=void 0)}function rt(t){var e=t.getOrbitControls();a.MxFun.isPC()||(e.enabled=!1),e.resetStatusValue(),t.getRunMode()==f.MxRunMode.kBrowse&&t.enableSingleTouchPan(!1),t.tempDisableSelect(!0),t.updateDisplay()}function it(t){var e=new i.Vector3,n=!1,r=new d.MxString(t),a=r.AnalyzeString(",");if(a.length<2)for(;!r.IsEmpty()&&h.MxTools.IsNumerical(r);){var o=h.MxTools._tstof(r.m_val);if(h.MxTools.IsZero(o))break;break}else{var s=new d.MxString(a[0]),l=new d.MxString(a[1]),u=new d.MxString("0");2<a.length&&(u.m_val=a[2]),s.IsEmpty()||"@"!=s.Left(1)?h.MxTools.IsNumerical(s)&&h.MxTools.IsNumerical(l)&&h.MxTools.IsNumerical(u)?(n=!0,e.x=h.MxTools._tstof(s.m_val),e.y=h.MxTools._tstof(l.m_val),e.z=h.MxTools._tstof(u.m_val)):n=!1:(s.m_val=s.Right(s.GetLength()-1),h.MxTools.IsNumerical(s)&&h.MxTools.IsNumerical(l)&&h.MxTools.IsNumerical(u)||(n=!1))}return n?e:null}function at(t,e){void 0===e&&(e=!1),c.MxUiVue.AcutPrintfNoFormat(t,e)}function ot(t,n){if(t==C.COMMAND_IN_INVALID){var r=c.MxUiVue.getCmdTip();return at(n),at(r),x.kNoChange}return t==C.COMMAND_IN_INVALID_ZERO?(r=c.MxUiVue.getCmdTip(),I.userInputControls()&e.kNoNegativeResponseAccepted?at("\n 值必须为正 且非零。 \n"):at("\n 值必不能为零。 \n"),at(r),x.kOther):t!=C.COMMAND_IN_INVALID_NEG?x.kNoChange:(r=c.MxUiVue.getCmdTip(),I.userInputControls()&e.kNoZeroResponseAccepted?at("\n 值必须为正 且非零。 \n"):at("\n 值必不能为负。 \n"),at(r),x.kOther)}function st(t){var n={iRet:C.COMMAND_IN_NO_ENTITY,sValue:"",iKey:x.kNull,dDist:0,iVal:0,pt:null};if(!G)return n;var r=I.userInputControls(),i=c.MxUiVue.getCmdText();if(0==i.length)return r&e.kNullResponseAccepted?n.iRet=C.COMMAND_IN_EMTPY:n.iRet=C.COMMAND_IN_INVALID,n;if(t&D.COMMAND_GET_KEY&&0<U.size){var a=new d.MxString(i);a.MakeUpper(),a.TrimLeft(" "),a.TrimRight(" ");var o=U.get(a.m_val);if(null!=o)return n.iRet=C.COMMAND_IN_KEY,n.iKey=o,n.sValue=a.m_val,n}if(t&D.COMMAND_GET_DIST&&h.MxTools.IsNumerical(i))return n.dDist=h.MxTools._tstof(i),r&e.kNoZeroResponseAccepted&&h.MxTools.IsZero(n.dDist)?n.iRet=C.COMMAND_IN_INVALID_ZERO:r&e.kNoNegativeResponseAccepted&&n.dDist<0?n.iRet=C.COMMAND_IN_INVALID_NEG:(n.sValue=i,n.iRet=C.COMMAND_IN_DIST),n;if(t&D.COMMAND_GET_INT&&h.MxTools.IsNumerical(i))return n.iVal=h.MxTools._tstoi(i),r&e.kNoZeroResponseAccepted&&0==n.iiVal?n.iRet=C.COMMAND_IN_INVALID_ZERO:r&e.kNoNegativeResponseAccepted&&n.iiVal<0?n.iRet=C.COMMAND_IN_INVALID_NEG:(n.sValue=i,n.iRet=C.COMMAND_IN_INT),n;if(t&D.COMMAND_GET_COORD){var s=it(i);if(null!=s)return n.sValue=i,n.iRet=C.COMMAND_IN_COORD,n.pt=s,n}return t&D.COMMAND_GET_STRING?(n.sValue=i,n.iRet=C.COMMAND_IN_STRING):n.iRet=C.COMMAND_IN_INVALID,n}t.getInputKeyword=function(t){if(t<1)return"";for(var e,n=U.entries();!(e=n.next()).done;)if(e.value==t)return e.key;return""},t.GetKeyWordToString=function(){return H},t.keywordList=function(){return W.m_val},t.setKeywordList=function(t){if(W.m_val=t,U.clear(),H.length=0,!W.IsEmpty())if(W.TrimLeft(" "),W.TrimRight(" "),"["==W.m_val[0]&&"]"==W.m_val[W.m_val.length-1]){W.TrimLeft("["),W.TrimRight("]");for(var e=W.AnalyzeString("/"),n=1,r=0;r<e.length;r++){var i=(s=new d.MxString(e[r])).Find("(");if(-1!=i){var a=new d.MxString(s.Left(i)),o=new d.MxString(s.Right(s.GetLength()-i-1));o.TrimRight(")"),a.IsEmpty()||o.IsEmpty()||(o.MakeUpper(),U.set(o.m_val,n),n++,H.push(new h.MxPair(o.m_val,a.m_val)))}}}else for(e=W.AnalyzeString(" "),n=1,r=0;r<e.length;r++){var s;(s=new d.MxString(e[r])).IsEmpty()||(s.MakeUpper(),U.set(s.m_val,n),n++)}},t.getAcquirePoint=function(){return R},t.getAcquireStatus=function(){return B},t.doMouseMoveImp=tt,t.OnThreeControlsChage=function(){null==I||j.x!=N&&j.y!=N&&tt(j)},t.OnEnter=function(t){G=!0,B=r.kNoChange,q(),G=!1},t.Test=function(){G=!0},t.registEvent=et,t.unRegistEvent=nt,t.getCurrentMouseButton=function(){return F},t.isRunning=function(){return null!=I},t.getCurCmd=function(){return I},t.commandRunComplete=function(t){I!=t&&console.log("aseert:_curCmd == cmd");var e,n=s.MxManager.currentMx();null!=I&&(n=I.getMxObject()),null!=k?(I=k,k=void 0,F=S.kInvalid,et(),I.onStartCommand(),rt(n)):(nt(),I=void 0,e=n,a.MxFun.isPC()||(e.getOrbitControls().enabled=!0),e.getRunMode()==f.MxRunMode.kBrowse&&e.enableSingleTouchPan(!0),e.tempDisableSelect(!1),e.updateDisplay(),g.MxDrawData.m_isAutoResetRenderer||e.resetRenderer())},t.isWaitCmdNull=function(){return null==k},t.stopCmd=function(){null!=I&&(z=!0,I.notifyCancleExit(),z=!1)},t.setRunCmdEvent=function(t){V=t},t.runCmd=function(t){if(!z){var e=s.MxManager.currentMx();t.setMxObject(e),a.MxFun.isPC()?j=p.MxWindowsEvent.getCurrentMousePostion():(j.x=N,j.y=N),V&&V(),null==I?(I=t,F=S.kInvalid,et(),I.onStartCommand(),rt(e)):(k=t,z=!0,I.notifyCancleExit(),z=!1)}},t.GetAcqurePointFromStringTo=it,t.ProcCommandRetResult=ot,t.GetCommandLineContent=st,t.acquirePoint=function(t){var e=new v;if(null==I)return e.status=x.kCancel,e;var n=st(D.COMMAND_GET_COORD|D.COMMAND_GET_KEY);return n.iRet==C.COMMAND_IN_EMTPY?(e.status=x.kNull,e.exit=!0):n.iRet==C.COMMAND_IN_KEY?(e.status=n.iKey,e.exit=!0,e.sKeyValue=n.sValue):n.iRet==C.COMMAND_IN_COORD?(e.status=x.kNormal,e.pt=new i.Vector3(n.pt.x,n.pt.y,n.pt.z),e.exit=!0):(ot(n.iRet,"\n 需要点或选项关键字。 \n"),B==r.kMove?(e.status=x.kNormal,e.pt=R,e.exit=!1):B==r.kEnd?t&_.kGetEnd?(e.status=x.kNormal,e.pt=R,e.exit=!0):(e.status=x.kNormal,e.pt=R,e.exit=!1):B==r.kCancle?(e.status=x.kCancel,e.pt=R,e.exit=!0):B==r.kBegan?t&_.kGetBegan?(e.status=x.kNormal,e.pt=R,e.exit=!0):(e.status=x.kNormal,e.pt=R,e.exit=!1):B==r.kMouseDown?(e.status=x.kNormal,e.pt=R,e.exit=!0):(e.status=x.kNoChange,e.pt=void 0,e.exit=!1)),e},t.getMcEdJigCommandClass=function(){return o.McEdJigCommand},t.getMrxDbgUiPrPointClass=function(){return l.MrxDbgUiPrPoint},t.getMcEdGetPointWorldDrawClass=function(){return u.McEdGetPointWorldDraw},t.McEdGetPointWorldDrawObjectClass=function(){return u.McEdGetPointWorldDrawObject},t.init=function(){this._curCmd=void 0}}(r=n.MxJigCmdManager||(n.MxJigCmdManager={}))},{"../MxDrawData":29,"../MxDrawObject":30,"../MxFun":34,"../MxManager":36,"../MxString":42,"../MxTools":45,"../MxWindowsEvent":48,"../UI/MxUiVue":67,"./McEdJigOsnap":49,"./MrxDbgUiPrBase":51,"./MrxDbgUiPrPoint":52,"./MxJig":57,three:19}],59:[function(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0}),n.MxJigGetLine=void 0;var a,o=t("./MxJig"),s=t("./MxJigCmdManager"),l=t("../MxFun"),u=(i(c,a=o.McEdJigCommand),c.prototype.sampler=function(){var t=s.MxJigCmdManager.InType.kGetBegan;this._isGetPt1||(t=s.MxJigCmdManager.InType.kGetEnd);var e=this.acquirePoint(t);return e.status==s.MxJigCmdManager.DragStatus.kNormal&&(this._isGetPt1?this._pt1=e.pt:this._pt2=e.pt),e.status},c.prototype.setRetCall=function(t){this._retCall=t},c.prototype.done=function(t){if(this._isGetPt1)return this._isGetPt1=!1,s.MxJigCmdManager.DoneStatius.kContinueCommand;var e={};return e.pt1=l.MxFun.worldCoord2Doc(this._pt1.x,this._pt1.y,this._pt1.z),e.pt2=l.MxFun.worldCoord2Doc(this._pt2.x,this._pt2.y,this._pt2.z),this._retCall(e),s.MxJigCmdManager.DoneStatius.kExitCommand},c.prototype.upDisplay=function(){this._isGetPt1||null==this._pt1||null==this._pt2||this.drawLine(this._pt1,this._pt2)},c);function c(){var t=null!==a&&a.apply(this,arguments)||this;return t._isGetPt1=!0,t}n.MxJigGetLine=u},{"../MxFun":34,"./MxJig":57,"./MxJigCmdManager":58}],60:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0});var r=t("./MxFun");function i(){}(i.CreateMx=function(){r.MxFun.init(),"undefined"!=typeof MxMain&&0==MxMain(t)||r.MxFun.createMxObject();var e=r.MxFun.getUiObject();null!=e&&(e.sTitle=r.MxFun.getCurrentDraw().getFileTitle(),setTimeout(function(){e.init()},400))},i.Main=function(){if("undefined"!=typeof MxUiMain){MxUiMain(t);var e=r.MxFun.getUiObject();null!=e&&e.writeUICSS()}"undefined"==typeof MxDocumentReady?$(document).ready(function(){i.CreateMx()}):MxDocumentReady(t,i.CreateMx)},i).Main()},{"./MxFun":34}],61:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxSvgManager=void 0;var r=t("three"),i=t("three"),a=t("./SVGLoader"),o=function(){this.svg=new r.Group,this.aryMeterial=[],this.boxSize=new i.Vector3(1,1,1)},s=(l.prototype.loadSVGImp=function(t,e,n,i){(new a.SVGLoader).load(t,function(o){if(o.paths.length){var s=[],l=o.paths,u=new r.Group,c=!0,h=!0,d=!1,p=!1;i&&(i.drawStrokes&&(c=i.drawStrokes),i.drawFillShapes&&(h=i.drawFillShapes),i.fillShapesWireframe&&(d=i.fillShapesWireframe),i.strokesWireframe&&(p=i.strokesWireframe));for(var f=0;f<l.length;f++){var m=l[f],g=m.userData.style.fill;if(h&&void 0!==g&&"none"!==g){for(var v=new r.MeshBasicMaterial({color:e||(new r.Color).setStyle(g),opacity:m.userData.style.fillOpacity,transparent:m.userData.style.fillOpacity<1,side:r.DoubleSide,depthWrite:!1,wireframe:d}),y=a.SVGLoader.createShapes(m),x=0;x<y.length;x++){var b=y[x],w=new r.ShapeBufferGeometry(b),_=new r.Mesh(w,v);u.add(_)}s.push(v)}var M=m.userData.style.stroke;if(c&&void 0!==M&&"none"!==M){v=new r.MeshBasicMaterial({color:e||(new r.Color).setStyle(M),opacity:m.userData.style.strokeOpacity,transparent:m.userData.style.strokeOpacity<1,side:r.DoubleSide,depthWrite:!1,wireframe:p}),x=0;for(var S=m.subPaths.length;x<S;x++){var T=m.subPaths[x];(w=a.SVGLoader.pointsToStroke(T.getPoints(),m.userData.style,12,.001))&&(_=new r.Mesh(w,v),u.add(_))}s.push(v)}}n&&n(u,s)}else console.log("mx svg:"+t+" data.paths.length == 0"),n&&n(null,null)},void 0,function(){n&&n(null,null)})},l.prototype.loadSVG=function(t,e,n,r){var a=this,s=this.mapSvgUrlToData.get(t),l=!r||!r.useBuffer||r.useBuffer;if(s&&l){if(n)if(null==s)n(null,null);else{var u=s.svg.clone();u.boxSize=s.boxSize,n(u,s.aryMeterial)}}else this.loadSVGImp(t,e,function(e,r){if(e&&r){var s=new o;s.svg=e,s.aryMeterial=r;var l=(new i.Box3).setFromObject(e);s.boxSize.x=l.max.x-l.min.x,s.boxSize.y=l.max.y-l.min.y,s.boxSize.x!==-1/0&&s.boxSize.y!==-1/0||console.log("mx svg:"+t+" boxSize invalid"),a.mapSvgUrlToData.set(t,s);var u=s.svg.clone();u.boxSize=s.boxSize,n&&n(u,s.aryMeterial)}else a.mapSvgUrlToData.set(t,null),n&&n(null,null)},r)},l);function l(){this.mapSvgUrlToData=new Map}var u=(c.prototype.loadSVG=function(t,e,n,r){n&&this.mxThreeJsBuffer.loadSVG(t,e,n,r)},c);function c(){this.mxThreeJsBuffer=new s}n.MxSvgManager=u},{"./SVGLoader":62,three:19}],62:[function(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0}),n.SVGLoader=void 0;var a,o=t("three"),s=(i(l,a=o.Loader),l.prototype.load=function(t,e,n,r){var i=this,a=new o.FileLoader(i.manager);a.setPath(i.path),a.setRequestHeader(i.requestHeader),a.setWithCredentials(i.withCredentials),a.load(t,function(n){try{e(i.parse(n))}catch(n){r?r(n):console.error(n),i.manager.itemError(t)}},n,r)},l.prototype.parse=function(t){var e=this;function n(t,e,n,i,a,o,s,l){if(0!=e&&0!=n){i=i*Math.PI/180,e=Math.abs(e),n=Math.abs(n);var u=(s.x-l.x)/2,c=(s.y-l.y)/2,h=Math.cos(i)*u+Math.sin(i)*c,d=-Math.sin(i)*u+Math.cos(i)*c,p=e*e,f=n*n,m=h*h,g=d*d,v=m/p+g/f;if(1<v){var y=Math.sqrt(v);p=(e*=y)*e,f=(n*=y)*n}var x=p*g+f*m,b=(p*f-x)/x,w=Math.sqrt(Math.max(0,b));a===o&&(w=-w);var _=w*e*d/n,M=-w*n*h/e,S=Math.cos(i)*_-Math.sin(i)*M+(s.x+l.x)/2,T=Math.sin(i)*_+Math.cos(i)*M+(s.y+l.y)/2,C=r(1,0,(h-_)/e,(d-M)/n),E=r((h-_)/e,(d-M)/n,(-h-_)/e,(-d-M)/n)%(2*Math.PI);t.currentPath.absellipse(S,T,e,n,C,C+E,0===o,i)}else t.lineTo(l.x,l.y)}function r(t,e,n,r){var i=t*n+e*r,a=Math.sqrt(t*t+e*e)*Math.sqrt(n*n+r*r),o=Math.acos(Math.max(-1,Math.min(1,i/a)));return t*r-e*n<0&&(o=-o),o}function i(t,e){e=Object.assign({},e);var n={};if(t.hasAttribute("class"))for(var r=t.getAttribute("class").split(/\s/).filter(Boolean).map(function(t){return t.trim()}),i=0;i<r.length;i++)n=Object.assign(n,d["."+r[i]]);function a(r,i,a){void 0===a&&(a=function(t){return t.startsWith("url")&&console.warn("SVGLoader: url access in attributes is not implemented."),t}),t.hasAttribute(r)&&(e[i]=a(t.getAttribute(r))),n[r]&&(e[i]=a(n[r])),t.style&&""!==t.style[r]&&(e[i]=a(t.style[r]))}function o(t){return Math.max(0,Math.min(1,c(t)))}function s(t){return Math.max(0,c(t))}return t.hasAttribute("id")&&(n=Object.assign(n,d["#"+t.getAttribute("id")])),a("fill","fill"),a("fill-opacity","fillOpacity",o),a("fill-rule","fillRule"),a("opacity","opacity",o),a("stroke","stroke"),a("stroke-opacity","strokeOpacity",o),a("stroke-width","strokeWidth",s),a("stroke-linejoin","strokeLineJoin"),a("stroke-linecap","strokeLineCap"),a("stroke-miterlimit","strokeMiterLimit",s),a("visibility","visibility"),e}function a(t,e){return t-(e-t)}function s(t,e,n){if("string"!=typeof t)throw new TypeError("Invalid input: "+typeof t);var r,i={SEPARATOR:/[ \t\r\n\,.\-+]/,WHITESPACE:/[ \t\r\n]/,DIGIT:/[\d]/,SIGN:/[-+]/,POINT:/\./,COMMA:/,/,EXP:/e/i,FLAGS:/[01]/},a=0,o=!0,s="",l="",u=[];function c(t,e,n){var r=new SyntaxError('Unexpected character "'+t+'" at index '+e+".");throw r.partial=n,r}function h(){""!==s&&(""===l?u.push(Number(s)):u.push(Number(s)*Math.pow(10,Number(l)))),l=s=""}for(var d=t.length,p=0;p<d;p++)if(r=t[p],Array.isArray(e)&&e.includes(u.length%n)&&i.FLAGS.test(r))a=1,s=r,h();else{if(0===a){if(i.WHITESPACE.test(r))continue;if(i.DIGIT.test(r)||i.SIGN.test(r)){a=1,s=r;continue}if(i.POINT.test(r)){a=2,s=r;continue}i.COMMA.test(r)&&(o&&c(r,p,u),o=!0)}if(1===a){if(i.DIGIT.test(r)){s+=r;continue}if(i.POINT.test(r)){s+=r,a=2;continue}if(i.EXP.test(r)){a=3;continue}i.SIGN.test(r)&&1===s.length&&i.SIGN.test(s[0])&&c(r,p,u)}if(2===a){if(i.DIGIT.test(r)){s+=r;continue}if(i.EXP.test(r)){a=3;continue}i.POINT.test(r)&&"."===s[s.length-1]&&c(r,p,u)}if(3===a){if(i.DIGIT.test(r)){l+=r;continue}if(i.SIGN.test(r)){if(""===l){l+=r;continue}1===l.length&&i.SIGN.test(l)&&c(r,p,u)}}i.WHITESPACE.test(r)?(h(),a=0,o=!1):i.COMMA.test(r)?(h(),o=!(a=0)):i.SIGN.test(r)?(h(),a=1,s=r):i.POINT.test(r)?(h(),a=2,s=r):c(r,p,u)}return h(),u}var l=["mm","cm","in","pt","pc","px"],u={mm:{mm:1,cm:.1,in:1/25.4,pt:72/25.4,pc:6/25.4,px:-1},cm:{mm:10,cm:1,in:1/2.54,pt:72/2.54,pc:6/2.54,px:-1},in:{mm:25.4,cm:2.54,in:1,pt:72,pc:6,px:-1},pt:{mm:25.4/72,cm:2.54/72,in:1/72,pt:1,pc:6/72,px:-1},pc:{mm:25.4/6,cm:2.54/6,in:1/6,pt:12,pc:1,px:-1},px:{px:1}};function c(t){var n="px";if("string"==typeof t||t instanceof String)for(var r=0,i=l.length;r<i;r++){var a=l[r];if(t.endsWith(a)){n=a,t=t.substring(0,t.length-a.length);break}}var o=void 0;return"px"===n&&"px"!==e.defaultUnit?o=u.in[e.defaultUnit]/e.defaultDPI:(o=u[n][e.defaultUnit])<0&&(o=u[n].in*e.defaultDPI),o*parseFloat(t)}var h=[],d={},p=[],f=new o.Matrix3,m=new o.Matrix3,g=new o.Matrix3,v=new o.Matrix3,y=new o.Vector2,x=new o.Vector3,b=new o.Matrix3,w=(new DOMParser).parseFromString(t,"image/svg+xml");return function t(e,r){if(1===e.nodeType){var l,u,w,_,M,S,T,C,E,D,A,O,L=function(t){if(!(t.hasAttribute("transform")||"use"===t.nodeName&&(t.hasAttribute("x")||t.hasAttribute("y"))))return null;var e=function(t){var e=new o.Matrix3,n=f;if("use"===t.nodeName&&(t.hasAttribute("x")||t.hasAttribute("y"))){var r=c(t.getAttribute("x")),i=c(t.getAttribute("y"));e.translate(r,i)}if(t.hasAttribute("transform"))for(var a=t.getAttribute("transform").split(")"),l=a.length-1;0<=l;l--){var u=a[l].trim();if(""!==u){var h=u.indexOf("("),d=u.length;if(0<h&&h<d){var p=u.substr(0,h),y=s(u.substr(h+1,d-h-1));switch(n.identity(),p){case"translate":1<=y.length&&(i=r=y[0],2<=y.length&&(i=y[1]),n.translate(r,i));break;case"rotate":if(1<=y.length){var x,b=0,w=0;x=-y[0]*Math.PI/180,3<=y.length&&(b=y[1],w=y[2]),m.identity().translate(-b,-w),g.identity().rotate(x),v.multiplyMatrices(g,m),m.identity().translate(b,w),n.multiplyMatrices(m,v)}break;case"scale":if(1<=y.length){var _=y[0],M=_;2<=y.length&&(M=y[1]),n.scale(_,M)}break;case"skewX":1===y.length&&n.set(1,Math.tan(y[0]*Math.PI/180),0,0,1,0,0,0,1);break;case"skewY":1===y.length&&n.set(1,0,0,Math.tan(y[0]*Math.PI/180),1,0,0,0,1);break;case"matrix":6===y.length&&n.set(y[0],y[2],y[4],y[1],y[3],y[5],0,0,1)}}e.premultiply(n)}}return e}(t);return 0<p.length&&e.premultiply(p[p.length-1]),b.copy(e),p.push(e),e}(e),P=!0,R=null;switch(e.nodeName){case"svg":break;case"style":!function(t){if(t.sheet&&t.sheet.cssRules&&t.sheet.cssRules.length)for(var e=0;e<t.sheet.cssRules.length;e++){var n=t.sheet.cssRules[e];if(1===n.type)for(var r=n.selectorText.split(/,/gm).filter(Boolean).map(function(t){return t.trim()}),i=0;i<r.length;i++)d[r[i]]=Object.assign(d[r[i]]||{},n.style)}}(e);break;case"g":r=i(e,r);break;case"path":r=i(e,r),e.hasAttribute("d")&&(R=function(t){for(var e=new o.ShapePath,r=new o.Vector2,i=new o.Vector2,l=new o.Vector2,u=!0,c=!1,h=t.getAttribute("d").match(/[a-df-z][^a-df-z]*/gi),d=0,p=h.length;d<p;d++){var f=h[d],m=f.charAt(0),g=f.substr(1).trim();!0===u&&(u=!(c=!0));var v=void 0;switch(m){case"M":for(var y=0,x=(v=s(g)).length;y<x;y+=2)r.x=v[y+0],r.y=v[y+1],i.x=r.x,i.y=r.y,0===y?e.moveTo(r.x,r.y):e.lineTo(r.x,r.y),0===y&&l.copy(r);break;case"H":for(y=0,x=(v=s(g)).length;y<x;y++)r.x=v[y],i.x=r.x,i.y=r.y,e.lineTo(r.x,r.y),0===y&&!0===c&&l.copy(r);break;case"V":for(y=0,x=(v=s(g)).length;y<x;y++)r.y=v[y],i.x=r.x,i.y=r.y,e.lineTo(r.x,r.y),0===y&&!0===c&&l.copy(r);break;case"L":for(y=0,x=(v=s(g)).length;y<x;y+=2)r.x=v[y+0],r.y=v[y+1],i.x=r.x,i.y=r.y,e.lineTo(r.x,r.y),0===y&&!0===c&&l.copy(r);break;case"C":for(y=0,x=(v=s(g)).length;y<x;y+=6)e.bezierCurveTo(v[y+0],v[y+1],v[y+2],v[y+3],v[y+4],v[y+5]),i.x=v[y+2],i.y=v[y+3],r.x=v[y+4],r.y=v[y+5],0===y&&!0===c&&l.copy(r);break;case"S":for(y=0,x=(v=s(g)).length;y<x;y+=4)e.bezierCurveTo(a(r.x,i.x),a(r.y,i.y),v[y+0],v[y+1],v[y+2],v[y+3]),i.x=v[y+0],i.y=v[y+1],r.x=v[y+2],r.y=v[y+3],0===y&&!0===c&&l.copy(r);break;case"Q":for(y=0,x=(v=s(g)).length;y<x;y+=4)e.quadraticCurveTo(v[y+0],v[y+1],v[y+2],v[y+3]),i.x=v[y+0],i.y=v[y+1],r.x=v[y+2],r.y=v[y+3],0===y&&!0===c&&l.copy(r);break;case"T":for(y=0,x=(v=s(g)).length;y<x;y+=2){var b=a(r.x,i.x),w=a(r.y,i.y);e.quadraticCurveTo(b,w,v[y+0],v[y+1]),i.x=b,i.y=w,r.x=v[y+0],r.y=v[y+1],0===y&&!0===c&&l.copy(r)}break;case"A":for(y=0,x=(v=s(g,[3,4],7)).length;y<x;y+=7)if(v[y+5]!=r.x||v[y+6]!=r.y){var _=r.clone();r.x=v[y+5],r.y=v[y+6],i.x=r.x,i.y=r.y,n(e,v[y],v[y+1],v[y+2],v[y+3],v[y+4],_,r),0===y&&!0===c&&l.copy(r)}break;case"m":for(y=0,x=(v=s(g)).length;y<x;y+=2)r.x+=v[y+0],r.y+=v[y+1],i.x=r.x,i.y=r.y,0===y?e.moveTo(r.x,r.y):e.lineTo(r.x,r.y),0===y&&l.copy(r);break;case"h":for(y=0,x=(v=s(g)).length;y<x;y++)r.x+=v[y],i.x=r.x,i.y=r.y,e.lineTo(r.x,r.y),0===y&&!0===c&&l.copy(r);break;case"v":for(y=0,x=(v=s(g)).length;y<x;y++)r.y+=v[y],i.x=r.x,i.y=r.y,e.lineTo(r.x,r.y),0===y&&!0===c&&l.copy(r);break;case"l":for(y=0,x=(v=s(g)).length;y<x;y+=2)r.x+=v[y+0],r.y+=v[y+1],i.x=r.x,i.y=r.y,e.lineTo(r.x,r.y),0===y&&!0===c&&l.copy(r);break;case"c":for(y=0,x=(v=s(g)).length;y<x;y+=6)e.bezierCurveTo(r.x+v[y+0],r.y+v[y+1],r.x+v[y+2],r.y+v[y+3],r.x+v[y+4],r.y+v[y+5]),i.x=r.x+v[y+2],i.y=r.y+v[y+3],r.x+=v[y+4],r.y+=v[y+5],0===y&&!0===c&&l.copy(r);break;case"s":for(y=0,x=(v=s(g)).length;y<x;y+=4)e.bezierCurveTo(a(r.x,i.x),a(r.y,i.y),r.x+v[y+0],r.y+v[y+1],r.x+v[y+2],r.y+v[y+3]),i.x=r.x+v[y+0],i.y=r.y+v[y+1],r.x+=v[y+2],r.y+=v[y+3],0===y&&!0===c&&l.copy(r);break;case"q":for(y=0,x=(v=s(g)).length;y<x;y+=4)e.quadraticCurveTo(r.x+v[y+0],r.y+v[y+1],r.x+v[y+2],r.y+v[y+3]),i.x=r.x+v[y+0],i.y=r.y+v[y+1],r.x+=v[y+2],r.y+=v[y+3],0===y&&!0===c&&l.copy(r);break;case"t":for(y=0,x=(v=s(g)).length;y<x;y+=2)b=a(r.x,i.x),w=a(r.y,i.y),e.quadraticCurveTo(b,w,r.x+v[y+0],r.y+v[y+1]),i.x=b,i.y=w,r.x=r.x+v[y+0],r.y=r.y+v[y+1],0===y&&!0===c&&l.copy(r);break;case"a":for(y=0,x=(v=s(g,[3,4],7)).length;y<x;y+=7)0==v[y+5]&&0==v[y+6]||(_=r.clone(),r.x+=v[y+5],r.y+=v[y+6],i.x=r.x,i.y=r.y,n(e,v[y],v[y+1],v[y+2],v[y+3],v[y+4],_,r),0===y&&!0===c&&l.copy(r));break;case"Z":case"z":e.currentPath.autoClose=!0,0<e.currentPath.curves.length&&(r.copy(l),e.currentPath.currentPoint.copy(r),u=!0);break;default:console.warn(f)}c=!1}return e}(e));break;case"rect":r=i(e,r),R=function(t){var e=c(t.getAttribute("x")||0),n=c(t.getAttribute("y")||0),r=c(t.getAttribute("rx")||t.getAttribute("ry")||0),i=c(t.getAttribute("ry")||t.getAttribute("rx")||0),a=c(t.getAttribute("width")),s=c(t.getAttribute("height")),l=.448084975506,u=new o.ShapePath;return u.moveTo(e+r,n),u.lineTo(e+a-r,n),0===r&&0===i||u.bezierCurveTo(e+a-r*l,n,e+a,n+i*l,e+a,n+i),u.lineTo(e+a,n+s-i),0===r&&0===i||u.bezierCurveTo(e+a,n+s-i*l,e+a-r*l,n+s,e+a-r,n+s),u.lineTo(e+r,n+s),0===r&&0===i||u.bezierCurveTo(e+r*l,n+s,e,n+s-i*l,e,n+s-i),u.lineTo(e,n+i),0===r&&0===i||u.bezierCurveTo(e,n+i*l,e+r*l,n,e+r,n),u}(e);break;case"polygon":r=i(e,r),D=e,A=new o.ShapePath,O=0,D.getAttribute("points").replace(/(-?[\d\.?]+)[,|\s](-?[\d\.?]+)/g,function(t,e,n){var r=c(e),i=c(n);0===O?A.moveTo(r,i):A.lineTo(r,i),O++}),A.currentPath.autoClose=!0,R=A;break;case"polyline":r=i(e,r),T=e,C=new o.ShapePath,E=0,T.getAttribute("points").replace(/(-?[\d\.?]+)[,|\s](-?[\d\.?]+)/g,function(t,e,n){var r=c(e),i=c(n);0===E?C.moveTo(r,i):C.lineTo(r,i),E++}),C.currentPath.autoClose=!1,R=C;break;case"circle":r=i(e,r),R=function(t){var e=c(t.getAttribute("cx")||0),n=c(t.getAttribute("cy")||0),r=c(t.getAttribute("r")||0),i=new o.Path;i.absarc(e,n,r,0,2*Math.PI,!1);var a=new o.ShapePath;return a.subPaths.push(i),a}(e);break;case"ellipse":r=i(e,r),R=function(t){var e=c(t.getAttribute("cx")||0),n=c(t.getAttribute("cy")||0),r=c(t.getAttribute("rx")||0),i=c(t.getAttribute("ry")||0),a=new o.Path;a.absellipse(e,n,r,i,0,2*Math.PI,void 0,void 0);var s=new o.ShapePath;return s.subPaths.push(a),s}(e);break;case"line":r=i(e,r),u=c((l=e).getAttribute("x1")||0),w=c(l.getAttribute("y1")||0),_=c(l.getAttribute("x2")||0),M=c(l.getAttribute("y2")||0),(S=new o.ShapePath).moveTo(u,w),S.lineTo(_,M),S.currentPath.autoClose=!1,R=S;break;case"defs":P=!1;break;case"use":r=i(e,r);var I=e.href.baseVal.substring(1),k=e.viewportElement.getElementById(I);k?t(k,r):console.warn("SVGLoader: 'use node' references non-existent node id: "+I)}if(R&&(void 0!==r.fill&&"none"!==r.fill&&R.color.setStyle(r.fill),function(t,e){function n(t){x.set(t.x,t.y,1).applyMatrix3(e),t.set(x.x,x.y)}for(var r=function(t){return 0!==t.elements[1]||0!==t.elements[3]}(e),i=t.subPaths,a=0,o=i.length;a<o;a++)for(var s=i[a].curves,l=0;l<s.length;l++){var u=s[l];u.isLineCurve?(n(u.v1),n(u.v2)):u.isCubicBezierCurve?(n(u.v0),n(u.v1),n(u.v2),n(u.v3)):u.isQuadraticBezierCurve?(n(u.v0),n(u.v1),n(u.v2)):u.isEllipseCurve&&(r&&console.warn("SVGLoader: Elliptic arc or ellipse rotation or skewing is not implemented."),y.set(u.aX,u.aY),n(y),u.aX=y.x,u.aY=y.y,u.xRadius*=(h=e.elements,Math.sqrt(h[0]*h[0]+h[1]*h[1])),u.yRadius*=(c=e.elements,Math.sqrt(c[3]*c[3]+c[4]*c[4])))}var c,h}(R,b),h.push(R),R.userData={node:e,style:r}),P)for(var B=e.childNodes,F=0;F<B.length;F++)t(B[F],r);L&&(p.pop(),0<p.length?b.copy(p[p.length-1]):b.identity())}}(w.documentElement,{fill:"#000",fillOpacity:1,strokeOpacity:1,strokeWidth:1,strokeLineJoin:"miter",strokeLineCap:"butt",strokeMiterLimit:4}),{paths:h,xml:w.documentElement}},l.createShapes=function(t){var e=999999999,n=0,r=1,i=2,a=3,s=4,l=5,u=6,c={loc:n,t:0};function h(t,e,r,a){var o=t.x,s=e.x,l=r.x,u=a.x,h=t.y,p=e.y,f=r.y,m=a.y,g=(u-l)*(h-f)-(m-f)*(o-l),v=(m-f)*(s-o)-(u-l)*(p-h),y=g/v,x=((s-o)*(h-f)-(p-h)*(o-l))/v;if(0==v&&0!=g||y<=0||1<=y||x<0||1<x)return null;if(0==g&&0==v){for(var b=0;b<2;b++){if(d(0===b?r:a,t,e),c.loc==n)return{x:(w=0===b?r:a).x,y:w.y,t:c.t};if(c.loc==i)return{x:+(o+c.t*(s-o)).toPrecision(10),y:+(h+c.t*(p-h)).toPrecision(10),t:c.t}}return null}for(b=0;b<2;b++){var w;if(d(0===b?r:a,t,e),c.loc==n)return{x:(w=0===b?r:a).x,y:w.y,t:c.t}}return{x:+(o+y*(s-o)).toPrecision(10),y:+(h+y*(p-h)).toPrecision(10),t:y}}function d(t,e,o){var h,d=o.x-e.x,p=o.y-e.y,f=t.x-e.x,m=t.y-e.y,g=d*m-f*p;return t.x===e.x&&t.y===e.y?(c.loc=n,c.t=0):t.x===o.x&&t.y===o.y?(c.loc=r,c.t=1,0):void(g<-Number.EPSILON?c.loc=a:g>Number.EPSILON?c.loc=s:d*f<0||p*m<0?c.loc=l:Math.sqrt(d*d+p*p)<Math.sqrt(f*f+m*m)?c.loc=u:(h=0!=d?f/d:m/p,c.loc=i,c.t=h))}function p(t,e,n){var r=new o.Vector2;e.getCenter(r);var i=[];return n.forEach(function(e){e.boundingBox.containsPoint(r)&&function(t,e){for(var n=[],r=[],i=1;i<t.length;i++)for(var a=t[i-1],s=t[i],l=function(t){var i=e[t-1],l=e[t],u=h(a,s,i,l);null!==u&&void 0===n.find(function(t){return t.t<=u.t+Number.EPSILON&&t.t>=u.t-Number.EPSILON})&&(n.push(u),r.push(new o.Vector2(u.x,u.y)))},u=1;u<e.length;u++)l(u);return r}(t,e.points).forEach(function(t){i.push({identifier:e.identifier,isCW:e.isCW,point:t})})}),i.sort(function(t,e){return t.point.x-e.point.x}),i}var f=0,m=e,g=-e,v=t.subPaths.map(function(t){for(var n=t.getPoints(),r=-e,i=e,a=-e,s=e,l=0;l<n.length;l++){var u=n[l];u.y>r&&(r=u.y),u.y<i&&(i=u.y),u.x>a&&(a=u.x),u.x<s&&(s=u.x)}return g<=a&&(g=a+1),s<=m&&(m=s-1),{curves:t.curves,points:n,isCW:o.ShapeUtils.isClockWise(n),identifier:f++,boundingBox:new o.Box2(new o.Vector2(s,i),new o.Vector2(a,r))}});v=v.filter(function(t){return 1<t.points.length}),f=0;var y=(v=v.map(function(t){return t.identifier=f,f++,t})).map(function(e){return function(t,e,n,r,i){null!=i&&""!==i||(i="nonzero");var a=new o.Vector2;t.boundingBox.getCenter(a);var s=p([new o.Vector2(n,a.y),new o.Vector2(r,a.y)],t.boundingBox,e);s.sort(function(t,e){return t.point.x-e.point.x});var l=[],u=[];s.forEach(function(e){e.identifier===t.identifier?l.push(e):u.push(e)});for(var c=l[0].point.x,h=[],d=0;d<u.length&&u[d].point.x<c;)0<h.length&&h[h.length-1]===u[d].identifier?h.pop():h.push(u[d].identifier),d++;if(h.push(t.identifier),"evenodd"===i){var f=h.length%2==0,m=h[h.length-2];return{identifier:t.identifier,isHole:f,for:m}}if("nonzero"===i){f=!0;for(var g=m=null,v=0;v<h.length;v++){var y=h[v];f?(g=e[y].isCW,f=!1,m=y):g!==e[y].isCW&&(g=e[y].isCW,f=!0)}return{identifier:t.identifier,isHole:f,for:m}}console.warn('fill-rule: "'+i+'" is currently not implemented.')}(e,v,m,g,t.userData.style.fillRule)}),x=[];return v.forEach(function(t){if(!y[t.identifier].isHole){var e=new o.Shape;e.curves=t.curves,y.filter(function(e){return e.isHole&&e.for===t.identifier}).forEach(function(t){var n=v[t.identifier],r=new o.Path;r.curves=n.curves,e.holes.push(r)}),x.push(e)}}),x},l.getStrokeStyle=function(t,e,n,r,i){return{strokeColor:e=void 0!==e?e:"#000",strokeWidth:t=void 0!==t?t:1,strokeLineJoin:n=void 0!==n?n:"miter",strokeLineCap:r=void 0!==r?r:"butt",strokeMiterLimit:i=void 0!==i?i:4}},l.pointsToStroke=function(t,e,n,r){var i=[],a=[],s=[];if(0===l.pointsToStrokeWithBuffers(t,e,n,r,i,a,s))return null;var u=new o.BufferGeometry;return u.setAttribute("position",new o.Float32BufferAttribute(i,3)),u.setAttribute("normal",new o.Float32BufferAttribute(a,3)),u.setAttribute("uv",new o.Float32BufferAttribute(s,2)),u},l.pointsToStrokeWithBuffers=function(t,e,n,r,i,a,s,l){var u=new o.Vector2,c=new o.Vector2,h=new o.Vector2,d=new o.Vector2,p=new o.Vector2,f=new o.Vector2,m=new o.Vector2,g=new o.Vector2,v=new o.Vector2,y=new o.Vector2,x=new o.Vector2,b=new o.Vector2,w=new o.Vector2,_=new o.Vector2,M=new o.Vector2,S=new o.Vector2,T=new o.Vector2;n=void 0!==n?n:12,r=void 0!==r?r:.001,l=void 0!==l?l:0;var C=(t=function(t){for(var e=!1,n=1,i=t.length-1;n<i;n++)if(t[n].distanceTo(t[n+1])<r){e=!0;break}if(!e)return t;var a=[];for(a.push(t[0]),n=1,i=t.length-1;n<i;n++)t[n].distanceTo(t[n+1])>=r&&a.push(t[n]);return a.push(t[t.length-1]),a}(t)).length;if(C<2)return 0;var E,D,A,O,L,P,R=t[0].equals(t[C-1]),I=t[0],k=e.strokeWidth/2,B=1/(C-1),F=0,N=!1,j=0,z=3*l,V=2*l;K(t[0],t[1],u).multiplyScalar(k),g.copy(t[0]).sub(u),v.copy(t[0]).add(u),y.copy(g),x.copy(v);for(var G=1;G<C;G++){E=t[G],D=G===C-1?R?t[1]:void 0:t[G+1];var U=u;if(K(I,E,U),h.copy(U).multiplyScalar(k),b.copy(E).sub(h),w.copy(E).add(h),A=F+B,O=!1,void 0!==D){K(E,D,c),h.copy(c).multiplyScalar(k),_.copy(E).sub(h),M.copy(E).add(h),L=!0,h.subVectors(D,I),U.dot(h)<0&&(L=!1),1===G&&(N=L),h.subVectors(D,E),h.normalize();var H=Math.abs(U.dot(h));if(0!==H){var W=k/H;h.multiplyScalar(-W),d.subVectors(E,I),p.copy(d).setLength(W).add(h),S.copy(p).negate();var J=p.length(),q=d.length();d.divideScalar(q),f.subVectors(D,E);var X=f.length();switch(f.divideScalar(X),d.dot(S)<q&&f.dot(S)<X&&(O=!0),T.copy(p).add(E),S.add(E),P=!1,O?L?(M.copy(S),w.copy(S)):(_.copy(S),b.copy(S)):et(),e.strokeLineJoin){case"bevel":nt(L,O,A);break;case"round":rt(L,O),L?tt(E,b,_,A,0):tt(E,M,w,A,1);break;default:var Y=k*e.strokeMiterLimit/J;if(Y<1){if("miter-clip"!==e.strokeLineJoin){nt(L,O,A);break}rt(L,O),L?(f.subVectors(T,b).multiplyScalar(Y).add(b),m.subVectors(T,_).multiplyScalar(Y).add(_),Q(b,A,0),Q(f,A,0),Q(E,A,.5),Q(E,A,.5),Q(f,A,0),Q(m,A,0),Q(E,A,.5),Q(m,A,0),Q(_,A,0)):(f.subVectors(T,w).multiplyScalar(Y).add(w),m.subVectors(T,M).multiplyScalar(Y).add(M),Q(w,A,1),Q(f,A,1),Q(E,A,.5),Q(E,A,.5),Q(f,A,1),Q(m,A,1),Q(E,A,.5),Q(m,A,1),Q(M,A,1))}else O?(L?(Q(v,F,1),Q(g,F,0),Q(T,A,0),Q(v,F,1),Q(T,A,0),Q(S,A,1)):(Q(v,F,1),Q(g,F,0),Q(T,A,1),Q(g,F,0),Q(S,A,0),Q(T,A,1)),L?_.copy(T):M.copy(T)):L?(Q(b,A,0),Q(T,A,0),Q(E,A,.5),Q(E,A,.5),Q(T,A,0),Q(_,A,0)):(Q(w,A,1),Q(T,A,1),Q(E,A,.5),Q(E,A,.5),Q(T,A,1),Q(M,A,1)),P=!0}}else et()}else et();R||G!==C-1||it(t[0],y,x,L,!0,F),F=A,I=E,g.copy(_),v.copy(M)}if(R){if(O&&i){var Z=T,$=S;N!==L&&(Z=S,$=T),L?(P||N)&&($.toArray(i,0),$.toArray(i,9),P&&Z.toArray(i,3)):!P&&N||($.toArray(i,3),$.toArray(i,9),P&&Z.toArray(i,0))}}else it(E,b,w,L,!1,A);return j;function K(t,e,n){return n.subVectors(e,t),n.set(-n.y,n.x).normalize()}function Q(t,e,n){i&&(i[z]=t.x,i[z+1]=t.y,i[z+2]=0,a&&(a[z]=0,a[z+1]=0,a[z+2]=1),z+=3,s&&(s[V]=e,s[V+1]=n,V+=2)),j+=3}function tt(t,e,r,i,a){u.copy(e).sub(t).normalize(),c.copy(r).sub(t).normalize();var o=Math.PI,s=u.dot(c);Math.abs(s)<1&&(o=Math.abs(Math.acos(s))),o/=n,h.copy(e);for(var l=0,p=n-1;l<p;l++)d.copy(h).rotateAround(t,o),Q(h,i,a),Q(d,i,a),Q(t,i,.5),h.copy(d);Q(d,i,a),Q(r,i,a),Q(t,i,.5)}function et(){Q(v,F,1),Q(g,F,0),Q(b,A,0),Q(v,F,1),Q(b,A,1),Q(w,A,0)}function nt(t,e,n){e?(t?(Q(v,F,1),Q(g,F,0),Q(b,A,0),Q(v,F,1),Q(b,A,0),Q(S,A,1),Q(b,n,0),Q(_,n,0)):(Q(v,F,1),Q(g,F,0),Q(w,A,1),Q(g,F,0),Q(S,A,0),Q(w,A,1),Q(w,n,1),Q(M,n,0)),Q(S,n,.5)):(t?(Q(b,n,0),Q(_,n,0)):(Q(w,n,1),Q(M,n,0)),Q(E,n,.5))}function rt(t,e){e&&(t?(Q(v,F,1),Q(g,F,0),Q(b,A,0),Q(v,F,1),Q(b,A,0),Q(S,A,1),Q(b,F,0),Q(E,A,.5),Q(S,A,1),Q(E,A,.5),Q(_,F,0),Q(S,A,1)):(Q(v,F,1),Q(g,F,0),Q(w,A,1),Q(g,F,0),Q(S,A,0),Q(w,A,1),Q(w,F,1),Q(S,A,0),Q(E,A,.5),Q(E,A,.5),Q(S,A,0),Q(M,F,1)))}function it(t,n,r,a,o,s){switch(e.strokeLineCap){case"round":o?tt(t,r,n,s,.5):tt(t,n,r,s,.5);break;case"square":if(o)u.subVectors(n,t),c.set(u.y,-u.x),h.addVectors(u,c).add(t),d.subVectors(c,u).add(t),a?(h.toArray(i,3),d.toArray(i,0),d.toArray(i,9)):(h.toArray(i,3),h.toArray(i,9),d.toArray(i,0));else{u.subVectors(r,t),c.set(u.y,-u.x),h.addVectors(u,c).add(t),d.subVectors(c,u).add(t);var l=i.length;a?(h.toArray(i,l-3),d.toArray(i,l-6)):(h.toArray(i,l-6),d.toArray(i,l-3)),d.toArray(i,l-12)}}}},l);function l(t){var e=a.call(this,t)||this;return e.defaultDPI=90,e.defaultUnit="px",e}n.SVGLoader=s},{three:19}],63:[function(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0}),n.MxTest=void 0;var a,o,s=t("../Operate/MrxDbgUiPrBase"),l=t("../Operate/MrxDbgUiPrPoint"),u=t("../MxThreeJS"),c=t("three"),h=t("../MxFun"),d=t("../View/MxDbEntity"),p=t("../MrxDbgUtils"),f=(i(m,a=d.MxDbEntityUserObject),m.prototype.worldDraw=function(t){var e=new c.Vector3(this.pt.x-this.r,this.pt.y-this.r,0),n=new c.Vector3(this.pt.x+this.r,this.pt.y+this.r,0);new c.Vector3(e.x,n.y);var r=new c.Vector3(n.x,e.y);t.setDashLineDisplay(!0),t.setDash(.1,.2),t.drawLine(r,e)},m.prototype.setPoint=function(t){this.pt=t},m.prototype.setR=function(t){this.r=t},m.prototype.getTypeName=function(){return"MxDbTest"},m.prototype.getGripPoints=function(){var t=[];return t.push(this.pt),t},m.prototype.moveGripPointsAt=function(t,e){return 0==t&&this.pt.add(e),!0},m.prototype.dwgIn=function(t){return a.prototype.dwgIn.call(this,t),this.pt.copy(t.pt),this.r=t.r,!0},m.prototype.dwgOut=function(t){return a.prototype.dwgOut.call(this,t),t.pt=this.pt,t.r=this.r,t},m.prototype.create=function(){return new m},m);function m(){var t=null!==a&&a.apply(this,arguments)||this;return t.pt=new c.Vector3,t.r=100,t}function g(t){var e=new l.MrxDbgUiPrPoint;e.setMessage("\n指定第一点:"),e.go(function(t){if(0==t){var n=e.value(),r=new c.Vector3;r.x=n.x,r.y=n.y;var i=new s.McEdGetPointWorldDrawObject;i.setDraw(function(t,e){e.setColor(255),e.drawLine(t,r)}),e.setUserDraw(i),e.setMessage("\n指定下一点:"),e.go(function(t){if(0==t){var r=e.value(),i=h.MxFun.getCurrentDraw(),a=u.MxThreeJS.createLine(n,r,16777215);i.addObject(a)}})}})}function v(){var t=new l.MrxDbgUiPrPoint;t.setMessage("\n指定第一点:"),t.go(function(e){if(0==e){var n=h.MxFun.getCurrentDraw(),r=new f;r.setColor(16711680),r.setPoint(t.value()),r.setR(n.screenCoordLong2Doc(100)),n.addMxEntity(r),n.addMxCurrentSelect(r.objectId())}})}function y(){p.MrxDbgUtils.selectEnt("Test").then(function(t){console.log(t)})}function x(){var t=h.MxFun.getCurrentDraw();o?(t.eraseAllMxEntity(),t.loadMxEntityFromJson(o)):(o=t.saveMxEntityToJson(),console.log(o))}function b(){h.MxFun.openFile("demo/buf/hhhh.dwg?token=123456")}(n.MxTest||(n.MxTest={})).registerCommand=function(){console.log("regist mx test"),(new f).init(),h.MxFun.addCommand("MxTest_GetPoint",g),h.MxFun.addCommand("MxTest_DrawCustomEntity",v),h.MxFun.addCommand("MxTest_EntSel",y),h.MxFun.addCommand("MxTest_SaveMxDbEntityToJson",x),h.MxFun.addCommand("MxTest_OpenFile",b),h.MxFun.addWindowsEvent(function(t,e){if("mouseup"==t){if(h.MxFun.isRunningCommand())return 0;if(0!=e.button)return 0;var n=e.srcElement;if(n&&"CANVAS"==n.tagName){var r=h.MxFun.getCurrentDraw(),i=new c.Vector3(e.offsetX,e.offsetY,0);r.findMxEntityAtPoint(i,!1).length&&e.preventDefault()}return 0}})}},{"../MrxDbgUtils":20,"../MxFun":34,"../MxThreeJS":44,"../Operate/MrxDbgUiPrBase":51,"../Operate/MrxDbgUiPrPoint":52,"../View/MxDbEntity":71,three:19}],64:[function(require,module,exports){Object.defineProperty(exports,"__esModule",{value:!0}),exports.MxUiObject=exports.MxToolBarItem=exports.MxMenuItem=void 0;var MxFun_1=require("../MxFun"),MxMenuItem=function(){this.id=-1,this.text="",this.evalString="",this.parentId=-1};exports.MxMenuItem=MxMenuItem;var MxToolBarItem=function(){this.isMxCommand=!1,this.itemid=""};exports.MxToolBarItem=MxToolBarItem;var MxUiObject=function(){function MxUiObject(){this.vecMenuItem=new Array,this.vecToolBarItem=new Array,this.uiPath="./ui",this.idMenuItemCount=100,this.isShowTitle=!1,this.isShowStructTree=!1,this.isEnableLoading=!0,this.isShowLayer=!1,this.isShowTakeColor=!1,this.isShowLayout=!1,this.isEnableObjectProperty=!1,this.isShowToolbar=!1,this.isShowMainMenu=!1,this.sTitle="",this.sLanguageTable={layout:"布局",layer:"图层",visible:"可见",color:"颜色",name:"名字",status:"状态",openComplete:"提示:打开图纸完成"}}return MxUiObject.prototype.SetLayoutData=function(t){this.vecLayoutData=t},MxUiObject.prototype.CallMxCommand=function(t){MxFun_1.MxFun.callCommand(t,"")},MxUiObject.prototype.EvalJs=function(value){eval(value)},MxUiObject.prototype.SetLayerData=function(t){this.vecLayerData=t},MxUiObject.prototype.SetSketchLayerData=function(t){this.vecSketchLayerData=t},MxUiObject.prototype.init=function(){this.onInit()},MxUiObject.prototype.addMenuItem=function(t,e,n,r){void 0===e&&(e=""),void 0===n&&(n=-1),void 0===r&&(r=-1);var i=new MxMenuItem;i.text=t,i.evalString=e,-1==r&&(r=this.idMenuItemCount,this.idMenuItemCount++),i.id=r,i.parentId=n,this.vecMenuItem.push(i)},MxUiObject.prototype.addToolBarItem=function(t,e,n,r,i){void 0===e&&(e=""),void 0===n&&(n=""),void 0===r&&(r=!1),void 0===i&&(i="");var a=new MxToolBarItem;a.image=t,a.evalString=n,a.text=e,a.isMxCommand=r,a.itemid=i,this.vecToolBarItem.push(a)},MxUiObject.prototype.setPath=function(t){this.uiPath=t},MxUiObject.prototype.getPath=function(){return this.uiPath},MxUiObject.prototype.create=function(){this.onCreate()},MxUiObject.prototype.writeUICSS=function(){var t=this.uiPath;MxFun_1.MxFun.isPC()?(document.write("<link rel='stylesheet' href='"+t+"/css/mxbimpcm.css'>"),this.isShowMainMenu&&(document.write("<link rel='stylesheet' href='"+t+"/css/rightfacefonts2.css'>"),document.write("<link rel='stylesheet' href='"+t+"/css/rightmnu.css'>"),document.write("<script type='text/javascript' src='"+t+"/hc-mobile-nav.js'><\/script>"))):(document.write("<link rel='stylesheet' href='"+t+"/css/mxmobile.css'>"),this.isShowMainMenu&&(document.write("<link href='"+t+"/css/font-awesome.min.css' rel='stylesheet'>"),document.write("<link rel='stylesheet' href='"+t+"/css/rightfacefonts1.css'>"),document.write("<link rel='stylesheet' href='"+t+"/css/rightfacefonts2.css'>"),document.write("<link rel='stylesheet' href='"+t+"/css/rightmnu.css'>"),document.write("<script type='text/javascript' src='"+t+"/hc-mobile-nav.js'><\/script>")))},MxUiObject}();exports.MxUiObject=MxUiObject},{"../MxFun":34}],65:[function(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0}),n.MxUiObjectMobile=void 0;var a,o=t("./MxUiObject"),s=t("../MxFun"),l=(i(u,a=o.MxUiObject),u.prototype.onCreate=function(){this.isShowTitle&&this.WriteTitle(),this.WriteStructTree(),this.isEnableLoading&&this.WriteLoading(),this.WriteLayer(),this.WriteTakeColor(),this.WriteLayout(),this.isEnableObjectProperty&&this.WriteObjectProperty(),this.isShowToolbar&&this.WriteToolbar()},u.prototype.onInit=function(){this.InitEvent()},u.prototype.ShowLoading=function(){this.isEnableLoading&&($(".Prompt").css("background","rgba(0, 0, 0, 0)"),$(".Prompt").fadeIn(100),$(".Prompt span").css("display","none"))},u.prototype.HideLoading=function(){this.isEnableLoading&&($(".Prompt").css("background","rgba(0, 0, 0, 0.8)"),$(".Prompt div").fadeOut(100),$(".Prompt span").fadeIn(200),setTimeout(function(){$(".Prompt").fadeOut(1e3)},1e3))},u.prototype.ShowObjectProperty=function(t){if(0!=t.length){var e;e="string"==typeof t?JSON.parse(t):t;var n="";for(var r in e){var i=e[r];for(var a in n+='<tbody class="bf-group undefined bf-collapse">',n+='<tr class="bf-group-title">',n+='<td colspan="2"><i class="bf-icon" style=" padding: 12px;"></i>'+i.name+"</td>",n+="</tr>",i.datas){var o=i.datas[a];n+="<tr class='bf-group-content'>",n+="<td class='bf-key'>"+o.name+"</td>",n+="<td class='bf-value'>"+o.value+"</td>",n+="</tr>"}n+="</tbody>"}document.getElementById("ComponentContent").innerHTML=n,$(".bf-group").click(function(){$(this).hasClass("bf-collapse")?$(this).removeClass("bf-collapse"):$(this).addClass("bf-collapse")})}},u.prototype.HideObjectProp=function(){},u.prototype.SwitchShowLayer=function(){var t=document.getElementById("LayerInterface");"none"==t.style.display?(t.style.display="block",t.style.left="80px",t.style.top="50px"):t.style.display="none"},u.prototype.SwitchShowStructTree=function(){},u.prototype.Chosecolor=function(){document.getElementById("color-picker").click()},u.prototype.ColorChange=function(t){document.getElementById("colorbox").style.backgroundColor=t,s.MxFun.setCurrentColor(t)},u.prototype.SwitchShowLayout=function(){var t=document.getElementById("LayerOutInterface");"none"==t.style.display?t.style.display="block":t.style.display="none"},u.prototype.WriteTitle=function(){var t=this.uiPath;document.write("<div class='bar1'>"),document.write("<img src='"+t+"/image/mxcad.png' style='height: 50%;position: absolute;top: 12px;left: 10px;'>"),document.write("<span class='barspan' style='position: absolute;left: 45px;'>"),document.write("</span>"),document.write("<div id='container'>"),this.isShowMainMenu&&(document.write("<header>"),document.write("<div class='wrapper cf'style='z-index: 999'>"),document.write("<nav id='main-nav' >"),document.write("</nav>"),document.write("<a class='toggle'>"),document.write("<span></span>"),document.write("</a>"),document.write("</div>"),document.write("</header>")),document.write("</div>"),document.write("</div>")},u.prototype.WriteToolbar=function(){document.write("<div id='MainMenuContent' class='bf-toolbar bf-toolbar-bottom'>"),document.write("</div>")},u.prototype.WriteLoading=function(){var t=this.uiPath;document.write("<div class='Prompt' style='width: 100px;height:30px;position:"),document.write("absolute;top: 60px;left: 50%;margin-left: -50px;color: #fff;text-align: center;'>"),document.write("<div style='text-align: center;'>"),document.write("<img src='"+t+"/image/loading.gif' alt='' style='width:30px;height:30px;float: left'>"),document.write("<p style='color:black;vertical-align: middle;float: left; margin-top: 5px;margin-left: 5px;'>加载中.....</p>"),document.write("</div>"),document.write("<span style='vertical-align: middle;display: none'>图纸加载完毕</span>"),document.write("</div>")},u.prototype.WriteLayer=function(){var t=this.uiPath;this.isShowLayer&&(document.write("<div class='bf-toolbar bf-toolbar bf-tree-toolbar' title='ModelTree' style='position: absolute; top:111px;left: 0px;' onclick='uiObj.SwitchShowLayer()'>"),document.write("<div class='bf-button mxbim-bf-tree' title='图层'>"),document.write("<img src='"+t+"/image/layer.png.gif' alt='' style='width: 24px;'>"),document.write("</div>"),document.write("</div>")),document.write("<div class='bf-panel bf-has-title bf-sizable' id='LayerInterface' title='图层'"),document.write("style='left: 0px;"),document.write("top: 0px;"),document.write("width: 100%;"),document.write("height: 100%;"),document.write("display: none;'>"),document.write("<div class='bf-close' onclick='uiObj.SwitchShowLayer()' style='text-align: center;'><i class='fa fa-times' aria-hidden='true'></i></div>"),document.write("<div class='bf-title' style='cursor: move; user-select: none;'>图层</div>"),document.write("<div>"),document.write("<div class='layer-title' style='width: 12.5%;'>可见</div>"),document.write("<div class='layer-title' style='width: 12.5%;'>颜色</div>"),document.write("<div class='layer-title' style='width: 62.5%'>名字</div>"),document.write("<div class='layer-title' style='width: 12.5%'>状态</div>"),document.write("</div>"),document.write("<div id='Layer-Info' style='margin-top: 26px;height: 79%;width: 100%; position: absolute;overflow-y: auto;'>"),document.write("</div>"),document.write("</div>")},u.prototype.WriteStructTree=function(){this.isShowStructTree&&(document.write("<div class='bf-toolbar bf-toolbar bf-tree-toolbar' id='Fmj' title='ModelTree'"),document.write("style='position: absolute; top:60px;left: 0px;' onclick='uiObj.SwitchShowStructTree()'>"),document.write("<div class='bf-button mxbim-bf-tree' title='构件树'><i class='fa fa-sitemap' aria-hidden='true' style='font-size: 24px;'></i></div>"),document.write("</div>")),document.write("<div class='bf-panel bf-has-title bf-sizable tree-panel' id='dv' title='目录树' style='left: 0px; top: 0px; width: 100%; height: 100%; display: none;'>"),document.write("<div class='bf-close' onclick='uiObj.SwitchShowStructTree()'><i class='fa fa-times fa-2x' aria-hidden='true'></i></div>"),document.write("<div class='bf-title' style='cursor: move; user-select: none;'>目录树</div>"),document.write("<div class='bf-panel-body' style='padding-top: 57px;overflow-y: scroll;'>"),document.write("<div class='bf-panel-header'>"),document.write("<div class='bf-panel-header'>"),document.write("<div class='bf-tree-header' style='margin-top: -57px;'>"),document.write("<div class='bf-tabs bf-tabs-tree'>"),document.write("<ul class='bf-tabs-list'>"),document.write("<li class='bf-tabs-option my-option undefined active' id='component'>构件</li>"),document.write("<li class='bf-tabs-option my-option undefined' id='area'>空间</li>"),document.write("<li class='bf-tabs-option my-option undefined' id='drawing'>图纸</li>"),document.write("</ul>"),document.write("</div>"),document.write("</div>"),document.write("</div>"),document.write("</div>"),document.write("<div class='' style='margin-bottom: 100px;' id='DirectoryContent'>"),document.write("</div>"),document.write("</div>"),document.write("</div>")},u.prototype.WriteTakeColor=function(){var t=this.uiPath;this.isShowTakeColor&&(document.write("<div class='bf-toolbar bf-toolbar bf-tree-toolbar' id='TakeColor'"),document.write("style='position: absolute;left: 0px; top: 162px;width: 45px; '>"),document.write("<div class='bf-button' onclick='uiObj.Chosecolor()' style='opacity: 1;width: 45px;'>"),document.write("<div style='position: relative;margin-left: 10px;margin-top: -5px;'>"),document.write("<img src='"+t+"/image/color.png' alt='' style='width: 40px;margin-left: -21px;'>"),document.write("</div>"),document.write("<div id='colorbox' style='width: 30px;height: 5px;background-color: #cccccc;margin-left: -3px;margin-top: -5px;'>"),document.write("</div>"),document.write("<div style='width: 18px;height: 40px;float: right;margin-top: -38px;margin-left: 14px;position: absolute;'>"),document.write("<img src='"+t+"/image/daojiao.png' alt='' style='width: 15px;margin-top: 10px;z-index: 999;position: relative'>"),document.write("<input id='color-picker' type='color' value='#c0c0c0' style='display: none' onchange='colorChange(value)'>"),document.write("</div>"),document.write("</div>"),document.write("</div>"))},u.prototype.WriteLayout=function(){var t=this.uiPath;this.isShowLayout&&(document.write("<div class='bf-toolbar bf-toolbar bf-tree-toolbar' id='LayerOut'"),document.write("style='position: absolute;left: 0px; top: 213px; ' onclick='uiObj.SwitchShowLayout()'>"),document.write("<div class='bf-button'>"),document.write("<img src='"+t+"/image/layout.png' alt='' style='width: 24px;'>"),document.write("</div>"),document.write("</div>")),document.write("<div class='bf-panel bf-has-title bf-sizable' id='LayerOutInterface'"),document.write("style='left: 0; top: 0; width: 100%;display:none'>"),document.write("<div class='bf-close' onclick='uiObj.SwitchShowLayout()'><i class='fa fa-times' aria-hidden='true'></i></div>"),document.write("<div class='bf-title' id='buju' style='cursor: move; user-select: none;'>布局</div>"),document.write("<div>"),document.write("</div>"),document.write("<div id=''>"),document.write("<div>"),document.write("<table class='bf-table'>"),document.write("<tbody class='bf-group'>"),document.write("<tr class='bf-group-title bf_layerout' style='height: 30px;cursor: pointer;'>"),document.write("<td class='bf_layerout_td' style='width: 60px' >"),document.write("<div class='bf_layer_div layer_on'></div>"),document.write("</td>"),document.write("<td style='width: 238px' >"),document.write("<span style='color: white;cursor: pointer;'>LayerOut</span>"),document.write("</td>"),document.write("</tr>"),document.write("<tr class='bf-group-title bf_layerout' style='height: 30px;cursor: pointer;'>"),document.write("<td class='bf_layerout_td' style='width: 60px' >"),document.write("<div class='bf_layer_div' ></div>"),document.write("</td>"),document.write("<td style='width: 238px' >"),document.write("<span style='color: white;cursor: pointer;'>LayerOut</span>"),document.write("</td>"),document.write("</tr>"),document.write("<tr class='bf-group-title bf_layerout' style='height: 30px;cursor: pointer;'>"),document.write("<td class='bf_layerout_td' style='width: 60px' >"),document.write("<div class='bf_layer_div' ></div>"),document.write("</td>"),document.write("<td style='width: 238px' >"),document.write("<span style='color: white;cursor: pointer;'>LayerOut</span>"),document.write("</td>"),document.write("</tr>"),document.write("<tr class='bf-group-title bf_layerout' style='height: 30px;cursor: pointer;'>"),document.write("<td class='bf_layerout_td' style='width: 60px' >"),document.write("<div class='bf_layer_div'></div>"),document.write("</td>"),document.write("<td style='width: 238px' >"),document.write("<span style='color: white;cursor: pointer;'>LayerOut</span>"),document.write("</td>"),document.write("</tr>"),document.write("</tbody>"),document.write("</table>"),document.write("</div>"),document.write("</div>"),document.write("</div>")},u.prototype.WriteObjectProperty=function(){document.write("<div class='bf-panel bf-has-title bf-sizable property-panel' id='fmj2' title='构件详情' style='left: 0px; top: 0px; width: 100%; height: 100%;display: none;'>"),document.write("<div class='bf-close' id='close2' style='top:4.0em;'><i class='fa fa-times fa-2x' aria-hidden='true'></i></div>"),document.write("<div class='bf-title' style='cursor: move; user-select: none;'>构件详情</div>"),document.write("<div class='bf-panel-body' style='padding-top: 41px;'>"),document.write("<div class='bf-panel-container bf-scroll-bar' style='top:0;width: 100%;height: 100%;overflow-y: auto;position: relative;'>"),document.write("<table class='bf-table' id='ComponentContent'>"),document.write("</table>"),document.write("</div>"),document.write("</div>"),document.write("</div>")},u.prototype.UpDisplayLayout=function(){},u.prototype.UpDisplayLayer=function(){var t=this.uiPath,e=this.vecLayerData,n=this.vecSketchLayerData,r="";if(null!=n){var i=n;for(var a in i){r+="<div>";var o="hide.png";0==i[a].off&&(o="show.png");var s="unlock.png";r+="<table class='bf-table'>",r+="<tbody class='bf-group'>",r+="<tr class='bf-group-title'>",r+='<td><img class="layer-enable" sketch=1 id='+i[a].id+' src="'+t+"/image/"+o+'"/></td>',r+='<td><span class="layer-color" style="background-color:'+i[a].color+'"></span></td>',r+='<td><span class="layer-text">草图_'+i[a].name+"</span></td>",r+='<td><img class="layer-state" src="'+t+"/image/"+s+'"/></td>',r+="</tr>",r+="</tbody>",r+="</table>",r+="</div>"}}if(null!=e)for(var a in i=e)r+="<div>",o="hide.png",0==i[a].off&&(o="show.png"),s="lock.png",r+="<table class='bf-table'>",r+="<tbody class='bf-group'>",r+="<tr class='bf-group-title'>",r+='<td><img class="layer-enable" sketch=0 id='+i[a].id+' src="'+t+"/image/"+o+'"/></td>',r+='<td><span class="layer-color" style="background-color:'+i[a].color+'"></span></td>',r+='<td><span class="layer-text">'+i[a].name+"</span></td>",r+='<td><img class="layer-state" src="'+t+"/image/"+s+'"/></td>',r+="</tr>",r+="</tbody>",r+="</table>",r+="</div>";var l=document.getElementById("Layer-Info");null!=l&&(l.innerHTML=r)},u.prototype.WriteFooter=function(){document.write("<div class='footer' style='background: rgba(0, 0, 0, 0.7);min-width: auto;position: fixed;left: 0;bottom: 0;width: 100%;'>"),document.write("<div style='line-height: 40px;font-size: 12px;color: #999;padding: 0 10px;'>"),document.write("<p style='float: right;line-height: 15px;font-size: 12px;color: #999;display: block;'>"),document.write("<a style='color: #4a90e2;text-decoration: none;outline: none;' href='http://www.mxdraw.com/' target='_blank'>梦想CAD</a>旗下产品"),document.write("</p>"),document.write("<a style='color: #4a90e2;text-decoration: none;outline: none;' href='http://www.mxdraw.com' target='_blank'>MX3D</a> 蜀ICP备15011727号"),document.write("</div>"),document.write("</div>")},u.prototype.CreateToolBar=function(t){if(this.isShowToolbar){var e="";for(var n in t){var r=t[n],i="uiObj.CallMxCommand";r.isMxCommand||(i="uiObj.EvalJs"),0<r.itemid.length?e+='<div class="bf-button" onclick="'+i+"('"+t[n].evalString+'\')"><img class="mainimage-bf-butto" id="'+r.itemid+'" src="'+this.uiPath+"\\image\\"+r.image+'" title="'+t[n].text+'"></div>':e+='<div class="bf-button" onclick="'+i+"('"+t[n].evalString+'\')"><img class="mainimage-bf-butto" src="'+this.uiPath+"\\image\\"+r.image+'" title="'+t[n].text+'"></div>'}document.getElementById("MainMenuContent").innerHTML=e}},u.prototype.InitEvent=function(){var t=document.getElementById("LayerInterface");this.CreateToolBar(this.vecToolBarItem),t.style.display="none";var e=this.vecMenuItem;this.isShowMainMenu&&function(t){var n="";!function t(e,r){var i=function(t,e){var n=new Array;for(var r in e)e[r].parentId==t&&n.push(e[r]);return n}(e,r);if(0<i.length){for(var a in n+="<ul>",i)0!=i[a].evalString.length?(n+='<li><p class="li_option" ',n+="onclick=\"uiObj.EvalJs('"+i[a].evalString+"')\"",n+=">"+i[a].text+"</p>"):(n+="<li><a ",n+=">"+i[a].text+"</a>"),t(i[a].id,r),n+="</li>";n+="</br>",n+="</br>",n+="</br>",n+="</ul>"}}(-1,e),t("#main-nav").append(n);var r=t("#main-nav"),i=t(".toggle"),a={maxWidth:!1,customToggle:i,levelTitles:!0},o=null,s={};o&&o.remove(),i.off("click"),o=r.clone(),t.extend(s,{side:"right"}),o.hcMobileNav(t.extend({},a,s))}(jQuery);var n=window.location.href,r=n.length,i=n.indexOf("?"),a=n.substr(i,r).split("=")[1];$(".barspan").html(decodeURIComponent(a)),$("#close2").click(function(){$(this).parent("div").fadeOut(200)}),$(".bf-select-current").click(function(){$(this).hasClass("bf-open")?$(this).removeClass("bf-open"):$(this).addClass("bf-open")}),$(".my-option").click(function(){var t=$(this);$(".my-option").each(function(){$(this).removeClass("active")}),t.addClass("active")}),$(".bf-select-option").click(function(){$(this).parent("ul").prev("span").html($(this).text()),$(this).parent("ul").prev("span").removeClass("bf-open")}),$(document).on("click",".layer-enable",function(){var t=s.MxFun.getUiObj().getPath(),e=parseInt($(this).attr("id")),n=parseInt($(this).attr("sketch")),r=!0;$(this).attr("src")==t+"/image/show.png"?($(this).attr("src",t+"/image/hide.png"),r=!1):$(this).attr("src",t+"/image/show.png"),s.MxFun.showLayer(e,r,1==n)})},u.prototype.Fullscreen=function(){var t=document.documentElement;t.requestFullscreen?t.requestFullscreen():t.mozRequestFullScreen?t.mozRequestFullScreen():t.webkitRequestFullScreen&&t.webkitRequestFullScreen(),document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitCancelFullScreen?document.webkitCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen(),this.IsFullStatus()?($("img[title='取消全屏']").attr("src",this.uiPath+"/image\\fullscreen1.gif"),$("img[title='取消全屏']").attr("title","全屏")):($("img[title='全屏']").attr("src",this.uiPath+"/image\\escscreen1.gif"),$("img[title='全屏']").attr("title","取消全屏"))},u.prototype.IsFullStatus=function(){return null!=(document.fullscreenEnabled||document.mozFullscreenElement||document.webkitFullscreenElement)},u);function u(){return null!==a&&a.apply(this,arguments)||this}n.MxUiObjectMobile=l},{"../MxFun":34,"./MxUiObject":64}],66:[function(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0}),n.MxUiObjectPC=void 0;var a,o=t("./MxUiObject"),s=t("../MxFun"),l=(i(u,a=o.MxUiObject),u.prototype.onCreate=function(){this.isShowTitle&&this.WriteTitle(),this.WriteStructTree(),this.isEnableLoading&&this.WriteLoading(),this.WriteLayer(),this.WriteTakeColor(),this.WriteLayout(),this.isEnableObjectProperty&&this.WriteObjectProperty(),this.isShowToolbar&&this.WriteToolbar()},u.prototype.onInit=function(){this.InitEvent()},u.prototype.WriteTitle=function(){var t=this.uiPath;document.write("<div id='all'>"),document.write(" <div class='bar1'>"),document.write(" <img src="+t+"/image/mxcad.png style='height: 50%;position: absolute;top: 12px;left: 10px;'>"),document.write(" <span class='barspan' style='position: absolute;left: 45px;'>"),document.write(" </span>"),document.write(" <div id='container'>"),this.isShowMainMenu&&(document.write(" <header>"),document.write(" <div class='wrapper cf'style='z-index: 999'>"),document.write(" <nav id='main-nav' >"),document.write(" </nav>"),document.write(" <a class='toggle'>"),document.write(" <span></span>"),document.write(" </a>"),document.write(" </div>"),document.write(" </header>")),document.write(" </div>"),document.write(" </div>")},u.prototype.WriteStructTree=function(){this.isShowStructTree&&(document.write("<div class='bf-toolbar bf-toolbar bf-tree-toolbar' id='ModelTreeThumbnail' title='目录树'"),document.write("style='position: absolute;left: 10px; top: 97px; ' onclick='uiObj.SwitchShowStructTree()'>"),document.write("<div class='bf-button mxbim-bf-tree' title='目录树'><i class='fa fa-sitemap' aria-hidden='true'></i></div>"),document.write("</div>")),document.write("<div class='bf-panel bf-has-title bf-sizable' id='ModelTreeInterface' title='目录树'"),document.write("style='left:0px; top: 0px; width: 300px; height: 416px;display: none'>"),document.write(" <div class='bf-close' onclick='uiObj.SwitchShowStructTree()'><i class='fa fa-times' aria-hidden='true'></i></div>"),document.write("<div class='bf-title' style='cursor: move; user-select: none;' id='mulushu'>目录树</div>"),document.write("<div class='bf-panel-body' style='padding-top: 36px;'>"),document.write("<div class='bf-panel-header'>"),document.write("<div class='bf-tree-header' style='margin-top: -36px;'>"),document.write("<div class='bf-select bf-select-tree'>"),document.write("<span class='bf-select-current'>构件</span>"),document.write("<ul class='bf-select-list'>"),document.write("<li class='bf-select-option' id='type'>构件</li>"),document.write("<li class='bf-select-option' id='file'>文件</li>"),document.write("<li class='bf-select-option' id='area'>空间</li>"),document.write("<li class='bf-select-option' id='drawing'>图纸</li>"),document.write("</ul>"),document.write("</div>"),document.write("</div>"),document.write("</div>"),document.write("<div id='DirectoryContent' class='bf-panel-container TreeInfo'>"),document.write("</div>"),document.write("</div>"),document.write("</div>")},u.prototype.WriteLoading=function(){var t=this.uiPath;document.write("<div class='Prompt'>"),document.write("<div style='text-align: center;'>"),document.write("<img src='"+t+"/image/loading.gif' alt='' style='width:30px;height:30px;float: left'>"),document.write("<p style='color:black;vertical-align: middle;float: left; margin-top: 5px;margin-left: 5px;'>加载中.....</p>"),document.write("</div>"),document.write("<span style='display: none'>"+this.sLanguageTable.openComplete+"</span>"),document.write("</div>")},u.prototype.WriteLayer=function(){var t=this.uiPath;this.isShowLayer&&(document.write("<div class='bf-toolbar bf-toolbar bf-tree-toolbar' id='LayerThumbnail' title='"+this.sLanguageTable.layer+"'"),document.write("style='position: absolute;left: 10px; top: 45px; ' onclick='uiObj.SwitchShowLayer()'>"),document.write("<div class='bf-button'>"),document.write("<img src='"+t+"/image/layer.png.gif' alt='' style='width: 32px;'>"),document.write("</div>"),document.write("</div>")),document.write("<div class='bf-panel bf-has-title bf-sizable' id='LayerInterface'"),document.write("style='left: 10px; top: 50px; width: 300px; height: 416px;display: none'>"),document.write("<div class='bf-close' onclick='uiObj.SwitchShowLayer(false)'><i class='fa fa-times' aria-hidden='true'></i></div>"),document.write("<div class='bf-title' id='tuceng' style='cursor: move; user-select: none;'>"+this.sLanguageTable.layer+"</div>"),document.write("<div>"),document.write("<div class='layer-title' style='width: 50px;font-size: 14px'>"+this.sLanguageTable.visible+"</div>"),document.write("<div class='layer-title' style='width: 50px;font-size: 14px'>"+this.sLanguageTable.color+"</div>"),document.write("<div class='layer-title' style='width: 148px;font-size: 14px'>"+this.sLanguageTable.name+"</div>"),document.write("<div class='layer-title' style='width: 50px;font-size: 14px'>"+this.sLanguageTable.status+"</div>"),document.write("</div>"),document.write("<div id='Layer-Info' style='margin-top: 25px;height: 349px;position: absolute;overflow-y: auto;'>"),document.write("</div>"),document.write("</div>")},u.prototype.WriteTakeColor=function(){var t=this.uiPath;this.isShowTakeColor&&(document.write("<div class='bf-toolbar bf-toolbar bf-tree-toolbar' id='TakeColor' title='选择颜色'"),document.write("style='position: absolute;left: 10px; top: 149px; '>"),document.write("<div class='bf-button' onclick='uiObj.Chosecolor()' style='opacity: 1;'>"),document.write("<img src='"+t+"/image/color.png' alt='' style='width: 40px;margin-left: -10px;'>"),document.write("<div id='colorbox' style='width: 35px;height: 5px;background-color: #cccccc;margin-left: -3px'>"),document.write("</div>"),document.write("<div style='width: 18px;height: 40px;float: right;margin-top: -42px;margin-left: 14px;'>"),document.write("<img src='"+t+"/image/daojiao.png' alt='' style='width: 15px;margin-top: 10px;z-index: 999;position: relative'>"),document.write("<input id='color-picker' type='color' value='#c0c0c0' style='display: none' onchange='uiObj.ColorChange(value)'>"),document.write("</div>"),document.write("</div>"),document.write("</div>"))},u.prototype.WriteLayout=function(){var t=this.uiPath;this.isShowLayout&&(document.write("<div class='bf-toolbar bf-toolbar bf-tree-toolbar' id='LayerOut' title='"+this.sLanguageTable.layout+"'"),document.write("style='position: absolute;left: 10px; top: 97px; ' onclick='uiObj.SwitchShowLayout()'>"),document.write("<div class='bf-button'>"),document.write("<img src='"+t+"/image/layout.png' alt='' style='width: 32px;'>"),document.write("</div>"),document.write("</div>")),document.write("<div class='bf-panel bf-has-title bf-sizable' id='LayerOutInterface'"),document.write("style='left: 10px; top: 50px; width: 300px;display:none'>"),document.write("<div class='bf-close' onclick='uiObj.SwitchShowLayout()'><i class='fa fa-times' aria-hidden='true'></i></div>"),document.write("<div class='bf-title' id='buju' style='cursor: move; user-select: none;'>"+this.sLanguageTable.layout+"</div>"),document.write("<div>"),document.write("</div>"),document.write("<div id='layout-Info'>"),document.write("</div>"),document.write("</div>")},u.prototype.WriteObjectProperty=function(){document.write("<div class='bf-panel bf-has-title bf-sizable' id='StrcutInfoBase' title='属性'"),document.write("style='right: 10px; top: 45px; width: 300px; height: 416px;display: none'>"),document.write("<div class='bf-close' id='close2'><i class='fa fa-times' aria-hidden='true'></i></div>"),document.write("<div class='bf-title' style='cursor: move; user-select: none;'>属性</div>"),document.write("<div id='ComponentContent' class='bf-panel-body StructInfo'></div>"),document.write("<div class='bf-resize'></div>"),document.write("</div>")},u.prototype.WriteToolbar=function(){document.write("<div id='MainMenuContent' class='bf-toolbar bf-toolbar-bottom' style='position: fixed'></div>")},u.prototype.CreateToolBar=function(t){if(this.isShowToolbar){var e="";for(var n in t){var r=t[n],i="uiObj.CallMxCommand";r.isMxCommand||(i="uiObj.EvalJs"),0<r.itemid.length?e+='<div class="bf-button" onclick="'+i+"('"+t[n].evalString+'\')"><img class="mainimage-bf-butto" id="'+r.itemid+'" src="'+this.uiPath+"\\image\\"+r.image+'" title="'+t[n].text+'"></div>':e+='<div class="bf-button" onclick="'+i+"('"+t[n].evalString+'\')"><img class="mainimage-bf-butto" src="'+this.uiPath+"\\image\\"+r.image+'" title="'+t[n].text+'"></div>'}document.getElementById("MainMenuContent").innerHTML=e}},u.prototype.UpDisplayLayer=function(){var t=this.uiPath,e=this.vecLayerData,n=this.vecSketchLayerData,r="";if(null!=n){var i=n;for(var a in i){r+="<div>";var o="hide.png";0==i[a].off&&(o="show.png");var s="unlock.png";r+="<table class='bf-table'>",r+="<tbody class='bf-group'>",r+="<tr class='bf-group-title'>",r+='<td><img class="layer-enable" sketch=1 id='+i[a].id+' src="'+t+"/image/"+o+'"/></td>',r+='<td><span class="layer-color" style="background-color:'+i[a].color+'"></span></td>',r+='<td><span class="layer-text">草图_'+i[a].name+"</span></td>",r+='<td><img class="layer-state" src="'+t+"/image/"+s+'"/></td>',r+="</tr>",r+="</tbody>",r+="</table>",r+="</div>"}}if(null!=e)for(var a in i=e)r+="<div>",o="hide.png",0==i[a].off&&(o="show.png"),s="lock.png",r+="<table class='bf-table'>",r+="<tbody class='bf-group'>",r+="<tr class='bf-group-title'>",r+='<td><img class="layer-enable" sketch=0 id='+i[a].id+' src="'+t+"/image/"+o+'"/></td>',r+='<td><span class="layer-color" style="background-color:'+i[a].color+'"></span></td>',r+='<td><span class="layer-text">'+i[a].name+"</span></td>",r+='<td><img class="layer-state" src="'+t+"/image/"+s+'"/></td>',r+="</tr>",r+="</tbody>",r+="</table>",r+="</div>";var l=document.getElementById("Layer-Info");null!=l&&(l.innerHTML=r)},u.prototype.UpDisplayLayout=function(){var t=this.vecLayoutData,e="";if(e+="<div>",e+="<table class='bf-table'>",e+="<tbody class='bf-group'>",e+="<tr class='bf-group-title bf_layerout' style='height: 30px;cursor: pointer;'>",e+="<td class='bf_layerout_td' style='width: 60px' >",e+="<div class='bf_layer_div layer_on'></div>",e+="</td>",e+="<td style='width: 238px' >",e+="<span class='layout-name' name='Model' style='color: white;cursor: pointer;'>Model</span>",e+="</td>",e+="</tr>",null!=t){var n=t;for(var r in n)e+="<tr class='bf-group-title bf_layerout' style='height: 30px;cursor: pointer;'>",e+="<td class='bf_layerout_td' style='width: 60px' >",e+="<div class='bf_layer_div layer_on'></div>",e+="</td>",e+="<td style='width: 238px' >",e+="<span class='layout-name' name='"+n[r]+"' style='color: white;cursor: pointer;'>"+n[r]+"</span>",e+="</td>",e+="</tr>"}e+="</tbody>",e+="</table>",e+="</div>";var i=document.getElementById("layout-Info");null!=i&&(i.innerHTML=e)},u.prototype.InitEvent=function(){var t=document.getElementById("ModelTreeInterface"),e=document.getElementById("LayerInterface"),n=document.getElementById("LayerOutInterface"),r=document.getElementById("tuceng"),i=document.getElementById("mulushu"),a=document.getElementById("buju"),o=0,l=0,u=0,c=0,h=!1;i.onmousedown=function(e){o=e.clientX,l=e.clientY,u=t.offsetLeft,c=t.offsetTop,h=!0,t.style.cursor="move"},r.onmousedown=function(t){o=t.clientX,l=t.clientY,u=e.offsetLeft,c=e.offsetTop,h=!0,e.style.cursor="move"},a.onmousedown=function(t){o=t.clientX,l=t.clientY,u=n.offsetLeft,c=n.offsetTop,h=!0,n.style.cursor="move"},window.onmousemove=function(r){if(0!=h){var i=r.clientX,a=r.clientY,s=i-(o-u),d=a-(l-c);t.style.left=s+"px",t.style.top=d+"px",e.style.left=s+"px",e.style.top=d+"px",n.style.left=s+"px",n.style.top=d+"px"}},i.onmouseup=function(){h=!1,t.style.cursor="default"},r.onmouseup=function(){h=!1,e.style.cursor="default"},a.onmouseup=function(){h=!1,n.style.cursor="default"},$("#close2").click(function(){$(this).parent("div").fadeOut(200)}),$("#menu4").click(function(){$("#StrcutInfoBase").hasClass("hide")?($("#StrcutInfoBase").fadeIn(200),$("#StrcutInfoBase").removeClass("hide")):($("#StrcutInfoBase").fadeOut(200),$("#StrcutInfoBase").addClass("hide"))}),$(".bf-select-current").click(function(){$(this).hasClass("bf-open")?$(this).removeClass("bf-open"):$(this).addClass("bf-open")}),$(".bf-select-option").click(function(){$(this).parent("ul").prev("span").html($(this).text()),$(this).parent("ul").prev("span").removeClass("bf-open")});var d=$("#StrcutInfoBase");d.bind("mousedown",function(t){var e=$(this)[0].offsetLeft,n=$(this)[0].offsetTop,r=t.pageX,i=t.pageY;$(document).bind("mousemove",function(t){var a=t.pageX-r,o=t.pageY-i,s=e+a+"px",l=n+o+"px";d.css({top:l,left:s})})}),$(document).bind("mouseup",function(){$(this).unbind("mousemove")}),this.CreateToolBar(this.vecToolBarItem);var p=this.vecMenuItem;if(this.isShowMainMenu&&function(t){var e="";!function t(n,r){var i=function(t,e){var n=new Array;for(var r in e)e[r].parentId==t&&n.push(e[r]);return n}(n,r);if(0<i.length){for(var a in e+="<ul>",i)0!=i[a].evalString.length?(e+='<li><p class="li_option" ',e+="onclick=\"uiObj.EvalJs('"+i[a].evalString+"')\"",e+=">"+i[a].text+"</p>"):(e+="<li><a ",e+=">"+i[a].text+"</a>"),t(i[a].id,r),e+="</li>";e+="</br>",e+="</br>",e+="</br>",e+="</ul>"}}(-1,p),t("#main-nav").append(e);var n=t("#main-nav"),r=t(".toggle"),i={maxWidth:!1,customToggle:r,levelTitles:!0},a=null,o={};a&&a.remove(),r.off("click"),a=n.clone(),t.extend(o,{side:"right"}),a.hcMobileNav(t.extend({},i,o))}(jQuery),$(".li_option").click(function(){var t=$(this);$(".li_option").each(function(){$(this).removeClass("active")}),t.addClass("active")}),""==this.sTitle){var f=window.location.href,m=f.length,g=f.indexOf("?"),v=f.substr(g,m).split("=")[1];null!=v&&(this.sTitle=v)}$(".barspan").html(decodeURIComponent(this.sTitle)),$(document).on("click",".layer-enable",function(){var t=s.MxFun.getUiObj().getPath(),e=parseInt($(this).attr("id")),n=parseInt($(this).attr("sketch")),r=!0;$(this).attr("src")==t+"/image/show.png"?($(this).attr("src",t+"/image/hide.png"),r=!1):$(this).attr("src",t+"/image/show.png"),s.MxFun.showLayer(e,r,1==n)}),$(document).on("click",".layout-name",function(){var t=$(this).attr("name");"Model"==t&&(t=""),s.MxFun.getCurrentDraw().gotoLayout(t)})},u.prototype.WriteFooter=function(){document.write("<div class='footer' style='background: rgba(0, 0, 0, 0.7);position: fixed;left: 0;bottom: 0;width: 100%;'>"),document.write(" <div style='line-height: 40px;font-size: 12px;color: #999;padding: 0 10px;'>"),document.write(" <p style='float: right;line-height: 15px;font-size: 12px;color: #999;display: block;'>"),document.write(" <a style='color: #4a90e2;text-decoration: none;outline: none;' href='http://www.mxdraw.com/' target='_blank'>MxDraw </a>旗下产品"),document.write(" </p>"),document.write(" <a style='color: #4a90e2;text-decoration: none;outline: none;' href='http://www.mxdraw.com' target='_blank'>MX3D </a> 蜀ICP备15011727号"),document.write(" </div>"),document.write(" </div>")},u.prototype.ShowLoading=function(){this.isEnableLoading&&($(".Prompt").css("background","rgba(0, 0, 0, 0)"),$(".Prompt").fadeIn(100),$(".Prompt span").css("display","none"))},u.prototype.HideLoading=function(){this.isEnableLoading&&($(".Prompt").css("background","rgba(0, 0, 0, 0.8)"),$(".Prompt div").fadeOut(100),$(".Prompt span").fadeIn(200),setTimeout(function(){$(".Prompt").fadeOut(1e3)},1e3))},u.prototype.ShowObjectProperty=function(t){if(0!=t.length){var e;e="string"==typeof t?JSON.parse(t):t;var n="";for(var r in e){var i=e[r];for(var a in n+="<table class='bf-table'>",n+="<tbody class='bf-group'>",n+="<tr class='bf-group-title'>",n+="<td colspan='2'><i class='bf-icon'></i>"+i.name+"</td>",n+="</tr>",i.datas){var o=i.datas[a];n+="<tr class='bf-group-content'>",n+="<td class='bf-key'>"+o.name+"</td>",n+="<td class='bf-value'>"+o.value+"</td>",n+="</tr>"}n+="</tbody>",n+="</table>"}document.getElementById("ComponentContent").innerHTML=n,$(".bf-group").click(function(){$(this).hasClass("bf-collapse")?$(this).removeClass("bf-collapse"):$(this).addClass("bf-collapse")}),$("#StrcutInfoBase").fadeIn(200),$("#StrcutInfoBase").removeClass("hide")}},u.prototype.HideObjectProp=function(){$("#StrcutInfoBase").hasClass("hide")||($("#StrcutInfoBase").fadeOut(200),$("#StrcutInfoBase").addClass("hide"))},u.prototype.SwitchShowLayer=function(){var t=document.getElementById("ModelTreeInterface"),e=document.getElementById("ModelTreeThumbnail"),n=document.getElementById("LayerThumbnail"),r=document.getElementById("LayerInterface"),i=document.getElementById("LayerOut"),a=document.getElementById("LayerOutInterface");t.style.display="none",(a.style.display="none")==r.style.display?(n.style.display="block",r.style.display="block",r.style.left="80px",r.style.top="50px",null!=e&&(e.style.display="block"),null!=i&&(i.style.display="block"),t.style.display="none",a.style.display="none"):(r.style.display="none",null!=e&&(e.style.display="block"),n.style.display="block",null!=i&&(i.style.display="block"))},u.prototype.SwitchShowStructTree=function(){var t=document.getElementById("ModelTreeInterface"),e=document.getElementById("ModelTreeThumbnail"),n=document.getElementById("LayerThumbnail"),r=document.getElementById("LayerInterface"),i=document.getElementById("LayerOut"),a=document.getElementById("LayerOutInterface");r.style.display="none",(a.style.display="none")==t.style.display?(null!=e&&(e.style.display="block"),t.style.display="block",t.style.left="80px",t.style.top="50px",n.style.display="block",null!=i&&(i.style.display="block"),r.style.display="none",a.style.display="none"):(t.style.display="none",null!=e&&(e.style.display="block"),n.style.display="block",null!=i&&(i.style.display="block"))},u.prototype.Chosecolor=function(){document.getElementById("color-picker").click()},u.prototype.ColorChange=function(t){document.getElementById("colorbox").style.backgroundColor=t,s.MxFun.setCurrentColor(t)},u.prototype.SwitchShowLayout=function(){var t=document.getElementById("ModelTreeInterface"),e=document.getElementById("ModelTreeThumbnail"),n=document.getElementById("LayerThumbnail"),r=document.getElementById("LayerInterface"),i=document.getElementById("LayerOut"),a=document.getElementById("LayerOutInterface");t.style.display="none",r.style.display="none",a&&"none"==a.style.display?(i&&(i.style.display="block"),a.style.display="block",a.style.left="80px",a.style.top="120px",null!=e&&(e.style.display="block"),n&&(n.style.display="block"),t.style.display="none",r.style.display="none"):(a&&(a.style.display="none"),null!=e&&(e.style.display="block"),n&&(n.style.display="block"),i&&(i.style.display="block"))},u.prototype.Fullscreen=function(){var t=document.documentElement;t.requestFullscreen?t.requestFullscreen():t.mozRequestFullScreen?t.mozRequestFullScreen():t.webkitRequestFullScreen&&t.webkitRequestFullScreen(),document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitCancelFullScreen?document.webkitCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen(),this.IsFullStatus()?($("img[title='取消全屏']").attr("src",this.uiPath+"/image\\fullscreen1.gif"),$("img[title='取消全屏']").attr("title","全屏")):($("img[title='全屏']").attr("src",this.uiPath+"/image\\escscreen1.gif"),$("img[title='全屏']").attr("title","取消全屏"))},u.prototype.IsFullStatus=function(){return null!=(document.fullscreenEnabled||document.mozFullscreenElement||document.webkitFullscreenElement)},u);function u(){return null!==a&&a.apply(this,arguments)||this}n.MxUiObjectPC=l},{"../MxFun":34,"./MxUiObject":64}],67:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxUiVue=void 0;var r,i,a,o=t("../MxFun"),s=t("../Operate/MxJigCmdManager"),l=t("../MxTools"),u=t("../Operate/MxCmdRunManager");function c(t){if(32==t||13==t)if(s.MxJigCmdManager.isRunning())s.MxJigCmdManager.OnEnter(t);else{var e=f(),n="";n=0==e.length?u.MxCmdRunManager.GetPrvCmd():e,m(""),n=l.MxTools.stringTrimLeftSpace(n),o.MxFun.sendStringToExecute(n)}else if(27==t)s.MxJigCmdManager.isRunning()?s.MxJigCmdManager.stopCmd():d(" *取消*\n命令:");else if(38==t)s.MxJigCmdManager.isRunning()||(u.MxCmdRunManager.MoveUpKey(),0!=(r=u.MxCmdRunManager.GetListCommad()).length&&(m(r),p()));else if(40==t){var r;s.MxJigCmdManager.isRunning()||(u.MxCmdRunManager.MoveDownKey(),0!=(r=u.MxCmdRunManager.GetListCommad()).length&&(m(r),p()))}}function h(t,e){void 0===e&&(e=!0);var n=t.length;if(!(n<1)){for(var r=a.getCmdLine(),i=r.getCmdTip(),o=r.getCmdText(),s=t.indexOf("\n"),l=0,u=!0;-1!=s&&(u?(r.addCmdDisplay("\n"+i+o+t.substring(l,s-l)),o=i="",u=!1):r.addCmdDisplay("\n"+t.substring(l,s-l)),(l=s+1)<n);)s=t.indexOf("\n",l);if(u){var c=t.substring(l,n-l),h=c.indexOf("\r"),d=c.length;i=-1==h?i+o+c:h+1<d?c.substring(h+1,d-h-1):""}else l<n&&(i=t.substring(l,n));o="",e&&(i+=" "),r.setCmdTip(i),r.setCmdText(o),r.upDisplay()}}function d(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(null!=a){for(var r=arguments,i=r[0],o=0;o<r.length-1;o++){var s=new RegExp("\\{"+o+"\\}","gm");i=i.replace(s,r[o+1])}h(i,!0)}}function p(){null!=a&&a.getCmdLine().upDisplay()}function f(){if(null==a)return"";var t=a.getCmdLine();return l.MxTools.stringTrimLeftRightSpace(t.getCmdText())}function m(t){if(null!=a)return a.getCmdLine().setCmdText(t)}function g(t){var e=s.MxJigCmdManager.getCurCmd();null!=e&&(e.getDynImput().onKeyDonw(t)||c(t))}r=n.MxUiVue||(n.MxUiVue={}),a=void 0,(i=r.CursorType||(r.CursorType={}))[i.kNormal=0]="kNormal",i[i.kRect=1]="kRect",i[i.kCross=2]="kCross",r.isNull=function(){return null==a},r.init=function(t){(a=t).mountKeydownEvent(c),a.getDynamicInput().mountKeydownEvent(g)},r.setTipCoord=function(t){null!=a&&a.setTipCoord(t)},r.setCursorType=function(t){null!=a&&a.setCursorType(t)},r.AcutPrintfNoFormat=h,r.acutPrintf=d,r.cmdLineUpDisplay=p,r.getCmdText=f,r.setCmdText=m,r.getCmdDisplay=function(){return null==a?"":a.getCmdLine().getCmdDisplay()},r.setCmdDisplay=function(t){if(null!=a)return a.getCmdLine().setCmdDisplay(t)},r.getCmdTip=function(){return null==a?"":a.getCmdLine().getCmdTip()},r.setCmdTip=function(t){if(null!=a)return a.getCmdLine().setCmdTip(t)},r.restoreCmdStatus=function(){if(null!=a){var t=a.getCmdLine();" "==t.getCmdTip()&&0==t.getCmdText().length?(t.setCmdTip(""),d("{0}:","命令")):d("\n{0}:","命令")}},r.DynamicInput_upDisplay=function(){null!=a&&r.OnMxEvent({name:"dynInputUpDisplay"})},r.DynamicInput_setType=function(t){null!=a&&a.getDynamicInput().setType(t)},r.DynamicInput_getType=function(){return null==a?s.MxJigCmdManager.DynamicInputType.kNoInput:a.getDynamicInput().getType()},r.DynamicInput_setPos=function(t){null!=a&&a.getDynamicInput().setPos([t.x,t.y])},r.DynamicInput_setTip=function(t){null!=a&&a.getDynamicInput().setTip(t)},r.DynamicInput_setValue1=function(t){null!=a&&a.getDynamicInput().setValue1(t)},r.DynamicInput_getValue1=function(){return null==a?"":a.getDynamicInput().getValue1()},r.DynamicInput_setValue1Pos=function(t){null!=a&&a.getDynamicInput().setValue1Pos([t.x,t.y])},r.DynamicInput_setValue2=function(t){null!=a&&a.getDynamicInput().setValue2(t)},r.DynamicInput_getValue2=function(){return null==a?"":a.getDynamicInput().getValue2()},r.DynamicInput_getFocusValue=function(){return null==a?"":a.getDynamicInput().getFocusValue()},r.DynamicInput_setValue2Pos=function(t){null!=a&&a.getDynamicInput().setValue2Pos([t.x,t.y])},r.DynamicInput_setShow=function(t){null!=a&&a.getDynamicInput().setShow(t)},r.DynamicInput_isShow=function(){return null!=a&&a.getDynamicInput().isShow()},r.OnMxEvent=function(t){if(null==a)return!1;a.OnMxEvent(t)}},{"../MxFun":34,"../MxTools":45,"../Operate/MxCmdRunManager":53,"../Operate/MxJigCmdManager":58}],68:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.ExternalReferenceManager=n.ExternalReferenceDatabase=n.Blocks=n.Block=n.Layer=n.MxNewDisplayMemorySection=n.MxNewDisplayMemorySectionType=n.TextureData=n.BlockInstance=n.BlockRef=n.ClipPlans=n.ClipPlan=void 0;var r=t("three"),i=t("../MxShader"),a=t("./MxBrowseLayerData"),o=t("../MxManager"),s=t("../MxNetData"),l=t("../MxStencilObject"),u=t("../MxFun"),c=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0};n.ClipPlan=c;var h=function(){this.ver=4,this.id=1,this.clipPlanArray=new Array,this.clipPoints=[],this.instansClipePoints=[]};n.ClipPlans=h;var d=function(){this.ver=4,this.mat=new r.Matrix4,this.blkRecId=-1,this.blkOwnerId=0,this.layerId=-1,this.color=16777215,this.clipPlans=new h};n.BlockRef=d;var p=function(){this.mat=new r.Matrix4,this.color=new Array,this.topLayerColor=new Array,this.clipPlans=new h,this.clipMat=new r.Matrix4};n.BlockInstance=p;var f,m,g=function(){};n.TextureData=g,(m=f=n.MxNewDisplayMemorySectionType||(n.MxNewDisplayMemorySectionType={}))[m.kLinesType=1]="kLinesType",m[m.kTriangleType=2]="kTriangleType",m[m.kLinesType_Float=3]="kLinesType_Float",m[m.kTriangleType_Float=4]="kTriangleType_Float",n.MxNewDisplayMemorySection=function(){this.id=0,this.type=f.kLinesType,this.blockId=0,this.layerId=0,this.color=0,this.points=[]};var v=(y.prototype.Show=function(t){for(var e=0,n=this._entitys.length;e<n;e++)this._entitys[e].visible=t},y.prototype.updataClipMaterial=function(t){for(var e=this._material_clip.length,n=.5*t.width,r=.5*t.height,i=0;i<e;i++)this._material_clip[i].uniforms.vieww.value=n,this._material_clip[i].uniforms.viewh.value=r},y.prototype.createThreejsObjForMesh_Clip=function(t,e,n){0!=t.size&&t.forEach(function(t){var a=t;if(0!=a.length){var s=[],u=[],c=a[0].clipPlans;c.ver<=3&&(s.push(c.clipPlanArray[0].x1,c.clipPlanArray[0].y1),u.push(c.clipPlanArray[0].x2,c.clipPlanArray[0].y2));for(var h=[],d=[],p=[],f=[],m=[],g=[],v=[],y=0;y<a.length;y++){var x=a[y];h=h.concat(x.mat.elements.slice(0,4)),d=d.concat(x.mat.elements.slice(4,8)),p=p.concat(x.mat.elements.slice(8,12)),f=f.concat(x.mat.elements.slice(12,16)),m.push(0),g=g.concat(a[y].color)}if(0<this._geometryMeshPositionsByBlock.length)for(y=0;y<a.length;y++)g=g.concat(a[y].color);if(0<this._geometryMeshPositionsByBlock_ZeroLayer.length)for(y=0;y<a.length;y++)v=v.concat(a[y].topLayerColor);var b,w=.5*n.width,_=.5*n.height;c.ver<=3?(b=new r.RawShaderMaterial({uniforms:{clippt1:{value:s},clippt2:{value:u},vieww:{value:w},viewh:{value:_}},vertexShader:i.MxShader.VSHADER_COLOR_POINT_CLIP,fragmentShader:i.MxShader.FSHADER_COLOR_POINT_CLIP,linewidth:1,transparent:!0,side:r.DoubleSide}),this._material_clip.push(b)):b=new r.RawShaderMaterial({vertexShader:i.MxShader.VSHADER_COLOR_POINT,fragmentShader:i.MxShader.FSHADER_COLOR_POINT,linewidth:1,transparent:!0,side:r.DoubleSide});for(var M=0;M<this._geometryMeshPostion.length;M++)(T=new r.InstancedBufferGeometry).maxInstancedCount=a.length,T.setAttribute("position",new r.Float32BufferAttribute(this._geometryMeshPostion[M],2)),T.setAttribute("color",new r.Float32BufferAttribute(this._geometryMeshColor[M],3)),T.setAttribute("tran1",new r.InstancedBufferAttribute(new Float32Array(h),4)),T.setAttribute("tran2",new r.InstancedBufferAttribute(new Float32Array(d),4)),T.setAttribute("tran3",new r.InstancedBufferAttribute(new Float32Array(p),4)),T.setAttribute("tran4",new r.InstancedBufferAttribute(new Float32Array(f),4)),T.setAttribute("ishide",new r.InstancedBufferAttribute(new Float32Array(m),1)),(C=new r.Mesh(T,b)).frustumCulled=!1,C.renderOrder=o.MxData.iCADMeshRenderOrder,e.add(C),this._entitys.push(C),4<=c.ver&&0<c.instansClipePoints.length&&(new l.MxStencilObject).associateObject(C,c.instansClipePoints);for(M=0;M<this._geometryMeshPositionsByBlock.length;M++)(T=new r.InstancedBufferGeometry).maxInstancedCount=a.length,T.setAttribute("position",new r.Float32BufferAttribute(this._geometryMeshPositionsByBlock[M],2)),T.setAttribute("color",new r.InstancedBufferAttribute(new Float32Array(g),3)),T.setAttribute("tran1",new r.InstancedBufferAttribute(new Float32Array(h),4)),T.setAttribute("tran2",new r.InstancedBufferAttribute(new Float32Array(d),4)),T.setAttribute("tran3",new r.InstancedBufferAttribute(new Float32Array(p),4)),T.setAttribute("tran4",new r.InstancedBufferAttribute(new Float32Array(f),4)),T.setAttribute("ishide",new r.InstancedBufferAttribute(new Float32Array(m),1)),(C=new r.Mesh(T,b)).frustumCulled=!1,C.renderOrder=o.MxData.iCADMeshRenderOrder,e.add(C),this._entitys.push(C),4<=c.ver&&0<c.instansClipePoints.length&&(new l.MxStencilObject).associateObject(C,c.instansClipePoints);for(M=0;M<this._geometryMeshPositionsByBlock_ZeroLayer.length;M++)(T=new r.InstancedBufferGeometry).maxInstancedCount=a.length,T.setAttribute("position",new r.Float32BufferAttribute(this._geometryMeshPositionsByBlock_ZeroLayer[M],2)),T.setAttribute("color",new r.InstancedBufferAttribute(new Float32Array(v),3)),T.setAttribute("tran1",new r.InstancedBufferAttribute(new Float32Array(h),4)),T.setAttribute("tran2",new r.InstancedBufferAttribute(new Float32Array(d),4)),T.setAttribute("tran3",new r.InstancedBufferAttribute(new Float32Array(p),4)),T.setAttribute("tran4",new r.InstancedBufferAttribute(new Float32Array(f),4)),T.setAttribute("ishide",new r.InstancedBufferAttribute(new Float32Array(m),1)),(C=new r.Mesh(T,b)).frustumCulled=!1,C.renderOrder=o.MxData.iCADMeshRenderOrder,e.add(C),this._entitys.push(C),4<=c.ver&&0<c.instansClipePoints.length&&(new l.MxStencilObject).associateObject(C,c.instansClipePoints);var S=new r.RawShaderMaterial({uniforms:{color:{value:this._color},clippt1:{value:s},clippt2:{value:u},vieww:{value:w},viewh:{value:_}},vertexShader:i.MxShader.VSHADER_COLOR_POINT_BYLAYER_CLIP,fragmentShader:i.MxShader.FSHADER_COLOR_POINT_CLIP,linewidth:1,transparent:!0,side:r.DoubleSide});for(this._material_clip.push(S),M=0;M<this._geometryMeshPositionsByLayer.length;M++){var T,C;(T=new r.InstancedBufferGeometry).maxInstancedCount=a.length,T.setAttribute("position",new r.Float32BufferAttribute(this._geometryMeshPositionsByLayer[M],2)),T.setAttribute("tran1",new r.InstancedBufferAttribute(new Float32Array(h),4)),T.setAttribute("tran2",new r.InstancedBufferAttribute(new Float32Array(d),4)),T.setAttribute("tran3",new r.InstancedBufferAttribute(new Float32Array(p),4)),T.setAttribute("tran4",new r.InstancedBufferAttribute(new Float32Array(f),4)),T.setAttribute("ishide",new r.InstancedBufferAttribute(new Float32Array(m),1)),(C=new r.Mesh(T,S)).frustumCulled=!1,C.renderOrder=o.MxData.iCADMeshRenderOrder,e.add(C),this._entitys.push(C),4<=c.ver&&0<c.instansClipePoints.length&&(new l.MxStencilObject).associateObject(C,c.instansClipePoints)}}},this)},y.prototype.createThreejsObjForCurve_Clip=function(t,e,n){0!=t.size&&t.forEach(function(t,a,s){var u=t;if(0!=u.length){var c=[],h=[],d=u[0].clipPlans;d.ver<=3&&(c.push(d.clipPlanArray[0].x1,d.clipPlanArray[0].y1),h.push(d.clipPlanArray[0].x2,d.clipPlanArray[0].y2));for(var p=[],f=[],m=[],g=[],v=[],y=[],x=[],b=0;b<u.length;b++){var w=u[b];p=p.concat(w.mat.elements.slice(0,4)),f=f.concat(w.mat.elements.slice(4,8)),m=m.concat(w.mat.elements.slice(8,12)),g=g.concat(w.mat.elements.slice(12,16)),v.push(0)}if(0<this._geometryCurvePositionsByBlock.length)for(b=0;b<u.length;b++)y=y.concat(u[b].color);if(0<this._geometryCurvePositionsByBlock_ZeroLayer.length)for(b=0;b<u.length;b++)x=x.concat(u[b].topLayerColor);var _,M=.5*n.width,S=.5*n.height;d.ver<=3?(_=new r.RawShaderMaterial({uniforms:{clippt1:{value:c},clippt2:{value:h},vieww:{value:M},viewh:{value:S}},vertexShader:i.MxShader.VSHADER_COLOR_POINT_CLIP,fragmentShader:i.MxShader.FSHADER_COLOR_POINT_CLIP,linewidth:1,transparent:!0,side:r.DoubleSide}),this._material_clip.push(_)):_=new r.RawShaderMaterial({vertexShader:i.MxShader.VSHADER_COLOR_POINT,fragmentShader:i.MxShader.FSHADER_COLOR_POINT,linewidth:1,transparent:!0,side:r.DoubleSide});for(var T=0;T<this._geometryCurvePostion.length;T++)(E=new r.InstancedBufferGeometry).maxInstancedCount=u.length,E.setAttribute("position",new r.Float32BufferAttribute(this._geometryCurvePostion[T],2)),E.setAttribute("color",new r.Float32BufferAttribute(this._geometryCurveColor[T],3)),E.setAttribute("tran1",new r.InstancedBufferAttribute(new Float32Array(p),4)),E.setAttribute("tran2",new r.InstancedBufferAttribute(new Float32Array(f),4)),E.setAttribute("tran3",new r.InstancedBufferAttribute(new Float32Array(m),4)),E.setAttribute("tran4",new r.InstancedBufferAttribute(new Float32Array(g),4)),E.setAttribute("ishide",new r.InstancedBufferAttribute(new Float32Array(v),1)),(D=new r.LineSegments(E,_)).frustumCulled=!1,D.renderOrder=o.MxData.iCADCurveRenderOrder,e.add(D),this._entitys.push(D),4<=d.ver&&0<d.instansClipePoints.length&&(new l.MxStencilObject).associateObject(D,d.instansClipePoints);for(T=0;T<this._geometryCurvePositionsByBlock.length;T++)(E=new r.InstancedBufferGeometry).maxInstancedCount=u.length,E.setAttribute("position",new r.Float32BufferAttribute(this._geometryCurvePositionsByBlock[T],2)),E.setAttribute("color",new r.InstancedBufferAttribute(new Float32Array(y),3)),E.setAttribute("tran1",new r.InstancedBufferAttribute(new Float32Array(p),4)),E.setAttribute("tran2",new r.InstancedBufferAttribute(new Float32Array(f),4)),E.setAttribute("tran3",new r.InstancedBufferAttribute(new Float32Array(m),4)),E.setAttribute("tran4",new r.InstancedBufferAttribute(new Float32Array(g),4)),E.setAttribute("ishide",new r.InstancedBufferAttribute(new Float32Array(v),1)),(D=new r.LineSegments(E,_)).frustumCulled=!1,D.renderOrder=o.MxData.iCADCurveRenderOrder,e.add(D),this._entitys.push(D),4<=d.ver&&0<d.instansClipePoints.length&&(new l.MxStencilObject).associateObject(D,d.instansClipePoints);for(T=0;T<this._geometryCurvePositionsByBlock_ZeroLayer.length;T++)(E=new r.InstancedBufferGeometry).maxInstancedCount=u.length,E.setAttribute("position",new r.Float32BufferAttribute(this._geometryCurvePositionsByBlock_ZeroLayer[T],2)),E.setAttribute("color",new r.InstancedBufferAttribute(new Float32Array(x),3)),E.setAttribute("tran1",new r.InstancedBufferAttribute(new Float32Array(p),4)),E.setAttribute("tran2",new r.InstancedBufferAttribute(new Float32Array(f),4)),E.setAttribute("tran3",new r.InstancedBufferAttribute(new Float32Array(m),4)),E.setAttribute("tran4",new r.InstancedBufferAttribute(new Float32Array(g),4)),E.setAttribute("ishide",new r.InstancedBufferAttribute(new Float32Array(v),1)),(D=new r.LineSegments(E,_)).frustumCulled=!1,D.renderOrder=o.MxData.iCADCurveRenderOrder,e.add(D),this._entitys.push(D),4<=d.ver&&0<d.instansClipePoints.length&&(new l.MxStencilObject).associateObject(D,d.instansClipePoints);var C=new r.RawShaderMaterial({uniforms:{color:{value:this._color},clippt1:{value:c},clippt2:{value:h},vieww:{value:M},viewh:{value:S}},vertexShader:i.MxShader.VSHADER_COLOR_POINT_BYLAYER_CLIP,fragmentShader:i.MxShader.FSHADER_COLOR_POINT_CLIP,linewidth:1,transparent:!0,side:r.DoubleSide});for(this._material_clip.push(C),T=0;T<this._geometryCurvePositionsByLayer.length;T++){var E,D;(E=new r.InstancedBufferGeometry).maxInstancedCount=u.length,E.setAttribute("position",new r.Float32BufferAttribute(this._geometryCurvePositionsByLayer[T],2)),E.setAttribute("tran1",new r.InstancedBufferAttribute(new Float32Array(p),4)),E.setAttribute("tran2",new r.InstancedBufferAttribute(new Float32Array(f),4)),E.setAttribute("tran3",new r.InstancedBufferAttribute(new Float32Array(m),4)),E.setAttribute("tran4",new r.InstancedBufferAttribute(new Float32Array(g),4)),E.setAttribute("ishide",new r.InstancedBufferAttribute(new Float32Array(v),1)),(D=new r.LineSegments(E,C)).frustumCulled=!1,D.renderOrder=o.MxData.iCADCurveRenderOrder,e.add(D),this._entitys.push(D),4<=d.ver&&0<d.instansClipePoints.length&&(new l.MxStencilObject).associateObject(D,d.instansClipePoints)}}},this)},y.prototype.createThreejsObjForCurve=function(t,e){if(0!=t.length){for(var n=[],a=[],s=[],l=[],u=[],c=[],h=[],d=0;d<t.length;d++){var p=t[d];n=n.concat(p.mat.elements.slice(0,4)),a=a.concat(p.mat.elements.slice(4,8)),s=s.concat(p.mat.elements.slice(8,12)),l=l.concat(p.mat.elements.slice(12,16)),u.push(0)}if(0<this._geometryCurvePositionsByBlock.length)for(d=0;d<t.length;d++)c=c.concat(t[d].color);if(0<this._geometryCurvePositionsByBlock_ZeroLayer.length)for(d=0;d<t.length;d++)h=h.concat(t[d].topLayerColor);for(var f=new r.RawShaderMaterial({vertexShader:i.MxShader.VSHADER_COLOR_POINT,fragmentShader:i.MxShader.FSHADER_COLOR_POINT,linewidth:1,transparent:!0,side:r.DoubleSide}),m=0;m<this._geometryCurvePostion.length;m++)(v=new r.InstancedBufferGeometry).maxInstancedCount=t.length,v.setAttribute("position",new r.Float32BufferAttribute(this._geometryCurvePostion[m],2)),v.setAttribute("color",new r.Float32BufferAttribute(this._geometryCurveColor[m],3)),v.setAttribute("tran1",new r.InstancedBufferAttribute(new Float32Array(n),4)),v.setAttribute("tran2",new r.InstancedBufferAttribute(new Float32Array(a),4)),v.setAttribute("tran3",new r.InstancedBufferAttribute(new Float32Array(s),4)),v.setAttribute("tran4",new r.InstancedBufferAttribute(new Float32Array(l),4)),v.setAttribute("ishide",new r.InstancedBufferAttribute(new Float32Array(u),1)),(y=new r.LineSegments(v,f)).frustumCulled=!1,y.renderOrder=o.MxData.iCADCurveRenderOrder,e.add(y),this._entitys.push(y);for(m=0;m<this._geometryCurvePositionsByBlock.length;m++)(v=new r.InstancedBufferGeometry).maxInstancedCount=t.length,v.setAttribute("position",new r.Float32BufferAttribute(this._geometryCurvePositionsByBlock[m],2)),v.setAttribute("color",new r.InstancedBufferAttribute(new Float32Array(c),3)),v.setAttribute("tran1",new r.InstancedBufferAttribute(new Float32Array(n),4)),v.setAttribute("tran2",new r.InstancedBufferAttribute(new Float32Array(a),4)),v.setAttribute("tran3",new r.InstancedBufferAttribute(new Float32Array(s),4)),v.setAttribute("tran4",new r.InstancedBufferAttribute(new Float32Array(l),4)),v.setAttribute("ishide",new r.InstancedBufferAttribute(new Float32Array(u),1)),(y=new r.LineSegments(v,f)).frustumCulled=!1,y.renderOrder=o.MxData.iCADCurveRenderOrder,e.add(y),this._entitys.push(y);for(m=0;m<this._geometryCurvePositionsByBlock_ZeroLayer.length;m++)(v=new r.InstancedBufferGeometry).maxInstancedCount=t.length,v.setAttribute("position",new r.Float32BufferAttribute(this._geometryCurvePositionsByBlock_ZeroLayer[m],2)),v.setAttribute("color",new r.InstancedBufferAttribute(new Float32Array(h),3)),v.setAttribute("tran1",new r.InstancedBufferAttribute(new Float32Array(n),4)),v.setAttribute("tran2",new r.InstancedBufferAttribute(new Float32Array(a),4)),v.setAttribute("tran3",new r.InstancedBufferAttribute(new Float32Array(s),4)),v.setAttribute("tran4",new r.InstancedBufferAttribute(new Float32Array(l),4)),v.setAttribute("ishide",new r.InstancedBufferAttribute(new Float32Array(u),1)),(y=new r.LineSegments(v,f)).frustumCulled=!1,y.renderOrder=o.MxData.iCADCurveRenderOrder,e.add(y),this._entitys.push(y);var g=new r.RawShaderMaterial({uniforms:{color:{value:this._color}},vertexShader:i.MxShader.VSHADER_COLOR_POINT_BYLAYER,fragmentShader:i.MxShader.FSHADER_COLOR_POINT,linewidth:1,transparent:!0,side:r.DoubleSide});for(m=0;m<this._geometryCurvePositionsByLayer.length;m++){var v,y;(v=new r.InstancedBufferGeometry).maxInstancedCount=t.length,v.setAttribute("position",new r.Float32BufferAttribute(this._geometryCurvePositionsByLayer[m],2)),v.setAttribute("tran1",new r.InstancedBufferAttribute(new Float32Array(n),4)),v.setAttribute("tran2",new r.InstancedBufferAttribute(new Float32Array(a),4)),v.setAttribute("tran3",new r.InstancedBufferAttribute(new Float32Array(s),4)),v.setAttribute("tran4",new r.InstancedBufferAttribute(new Float32Array(l),4)),v.setAttribute("ishide",new r.InstancedBufferAttribute(new Float32Array(u),1)),(y=new r.LineSegments(v,g)).frustumCulled=!1,y.renderOrder=o.MxData.iCADCurveRenderOrder,e.add(y),this._entitys.push(y)}}},y.prototype.createThreejsObjForMemorySections_clip=function(t,e,n){0!=t.size&&t.forEach(function(t){var n=t;if(0!=n.length){for(var a=n[0].clipPlans,s=[],u=[],c=[],h=[],d=[],p=0;p<n.length;p++){var m=n[p];s=s.concat(m.mat.elements.slice(0,4)),u=u.concat(m.mat.elements.slice(4,8)),c=c.concat(m.mat.elements.slice(8,12)),h=h.concat(m.mat.elements.slice(12,16)),d.push(0)}for(var g=this._MemorySections.length,v=0;v<g;v++){var y=this._MemorySections[v],x=y.color,b=[];if(16777216==(4278190080&x)?b=this._color:b.push((255&x)/255,(x>>8&255)/255,(x>>16&255)/255),y.type==f.kLinesType){var w=new r.RawShaderMaterial({uniforms:{color:{value:b}},vertexShader:i.MxShader.VSHADER_COLOR_POINT_FORMXCAD,fragmentShader:i.MxShader.FSHADER_COLOR_POINT_FORMXCAD,linewidth:1,transparent:!0,side:r.DoubleSide});(M=new r.InstancedBufferGeometry).maxInstancedCount=n.length,M.setAttribute("position",new r.Float32BufferAttribute(y.points,3)),M.setAttribute("tran1",new r.InstancedBufferAttribute(new Float32Array(s),4)),M.setAttribute("tran2",new r.InstancedBufferAttribute(new Float32Array(u),4)),M.setAttribute("tran3",new r.InstancedBufferAttribute(new Float32Array(c),4)),M.setAttribute("tran4",new r.InstancedBufferAttribute(new Float32Array(h),4)),M.setAttribute("ishide",new r.InstancedBufferAttribute(new Float32Array(d),1));var _=new r.LineSegments(M,w);_.frustumCulled=!1,_.renderOrder=o.MxData.iCADCurveRenderOrder,4<=a.ver&&0<a.instansClipePoints.length&&(new l.MxStencilObject).associateObject(_,a.instansClipePoints),e.add(_),this._entitys.push(_)}else if(y.type==f.kTriangleType){var M;w=new r.RawShaderMaterial({uniforms:{color:{value:b}},vertexShader:i.MxShader.VSHADER_COLOR_POINT_FORMXCAD,fragmentShader:i.MxShader.FSHADER_COLOR_POINT_FORMXCAD,transparent:!0,side:r.DoubleSide}),(M=new r.InstancedBufferGeometry).maxInstancedCount=n.length,M.setAttribute("position",new r.Float32BufferAttribute(y.points,3)),M.setAttribute("tran1",new r.InstancedBufferAttribute(new Float32Array(s),4)),M.setAttribute("tran2",new r.InstancedBufferAttribute(new Float32Array(u),4)),M.setAttribute("tran3",new r.InstancedBufferAttribute(new Float32Array(c),4)),M.setAttribute("tran4",new r.InstancedBufferAttribute(new Float32Array(h),4)),M.setAttribute("ishide",new r.InstancedBufferAttribute(new Float32Array(d),1));var S=new r.Mesh(M,w);S.frustumCulled=!1,S.renderOrder=o.MxData.iCADMeshRenderOrder,4<=a.ver&&0<a.instansClipePoints.length&&(new l.MxStencilObject).associateObject(S,a.instansClipePoints),e.add(S),this._entitys.push(S)}}}},this)},y.prototype.createThreejsObjForMemorySections=function(t,e,n){if(0!=t.length){for(var a=[],s=[],l=[],u=[],c=[],h=0;h<t.length;h++){var d=t[h];a=a.concat(d.mat.elements.slice(0,4)),s=s.concat(d.mat.elements.slice(4,8)),l=l.concat(d.mat.elements.slice(8,12)),u=u.concat(d.mat.elements.slice(12,16)),c.push(0)}for(var p=this._MemorySections.length,m=0;m<p;m++){var g=this._MemorySections[m],v=g.color,y=[];if(16777216==(4278190080&v)?y=this._color:y.push((255&v)/255,(v>>8&255)/255,(v>>16&255)/255),g.type==f.kLinesType){var x=new r.RawShaderMaterial({uniforms:{color:{value:y}},vertexShader:i.MxShader.VSHADER_COLOR_POINT_FORMXCAD,fragmentShader:i.MxShader.FSHADER_COLOR_POINT_FORMXCAD,linewidth:1,transparent:!0,side:r.DoubleSide});(w=new r.InstancedBufferGeometry).maxInstancedCount=t.length,w.setAttribute("position",new r.Float32BufferAttribute(g.points,3)),w.setAttribute("tran1",new r.InstancedBufferAttribute(new Float32Array(a),4)),w.setAttribute("tran2",new r.InstancedBufferAttribute(new Float32Array(s),4)),w.setAttribute("tran3",new r.InstancedBufferAttribute(new Float32Array(l),4)),w.setAttribute("tran4",new r.InstancedBufferAttribute(new Float32Array(u),4)),w.setAttribute("ishide",new r.InstancedBufferAttribute(new Float32Array(c),1));var b=new r.LineSegments(w,x);b.frustumCulled=!1,b.renderOrder=o.MxData.iCADCurveRenderOrder,e.add(b),this._entitys.push(b)}else if(g.type==f.kTriangleType){var w;x=new r.RawShaderMaterial({uniforms:{color:{value:y}},vertexShader:i.MxShader.VSHADER_COLOR_POINT_FORMXCAD,fragmentShader:i.MxShader.FSHADER_COLOR_POINT_FORMXCAD,transparent:!0,side:r.DoubleSide}),(w=new r.InstancedBufferGeometry).maxInstancedCount=t.length,w.setAttribute("position",new r.Float32BufferAttribute(g.points,3)),w.setAttribute("tran1",new r.InstancedBufferAttribute(new Float32Array(a),4)),w.setAttribute("tran2",new r.InstancedBufferAttribute(new Float32Array(s),4)),w.setAttribute("tran3",new r.InstancedBufferAttribute(new Float32Array(l),4)),w.setAttribute("tran4",new r.InstancedBufferAttribute(new Float32Array(u),4)),w.setAttribute("ishide",new r.InstancedBufferAttribute(new Float32Array(c),1));var _=new r.Mesh(w,x);_.frustumCulled=!1,_.renderOrder=o.MxData.iCADMeshRenderOrder,e.add(_),this._entitys.push(_)}}}},y.prototype.createThreejsObjForTexture=function(t,e,n){if(0!=t.length){var a=[],s=[],l=[],c=[],h=[],d=n.getCurrentLoadUrl(),p=u.MxFun.dwgDir();0!=p.length&&"/buf/"!=d.substring(d.lastIndexOf("/buf/")).toLowerCase()&&(d=d+p+"/buf/");for(var f=0;f<t.length;f++){var m=t[f];a=a.concat(m.mat.elements.slice(0,4)),s=s.concat(m.mat.elements.slice(4,8)),l=l.concat(m.mat.elements.slice(8,12)),c=c.concat(m.mat.elements.slice(12,16)),h.push(0)}for(var g=0;g<this._TextureData.length;g++){var v=this._TextureData[g],y=new r.InstancedBufferGeometry;y.maxInstancedCount=t.length,y.setAttribute("position",new r.Float32BufferAttribute(v.pos,2)),y.setAttribute("uv",new r.Float32BufferAttribute(v.textureCoord,2)),y.setAttribute("color",new r.Float32BufferAttribute(v.color,3)),y.setAttribute("tran1",new r.InstancedBufferAttribute(new Float32Array(a),4)),y.setAttribute("tran2",new r.InstancedBufferAttribute(new Float32Array(s),4)),y.setAttribute("tran3",new r.InstancedBufferAttribute(new Float32Array(l),4)),y.setAttribute("tran4",new r.InstancedBufferAttribute(new Float32Array(c),4)),y.setAttribute("ishide",new r.InstancedBufferAttribute(new Float32Array(h),1));var x=d+v.sFileName,b={texture:{value:(new r.TextureLoader).load(x,function(t){t&&n.updateDisplay()})}};b.texture.value.wrapS=b.texture.value.wrapT=r.RepeatWrapping;var w=new r.RawShaderMaterial({uniforms:b,vertexShader:i.MxShader.VSHADER_COLOR_POINT_TEXTURE,fragmentShader:i.MxShader.FSHADER_COLOR_POINT_TEXTURE,transparent:!0,side:r.DoubleSide}),_=new r.Mesh(y,w);_.renderOrder=o.MxData.iCADMeshRenderOrder,_.frustumCulled=!1,e.add(_),this._entitys.push(_)}}},y.prototype.createThreejsObjForTexture_Clip=function(t,e,n){if(0!=t.size){var a=n.getCurrentLoadUrl(),s=u.MxFun.dwgDir();0!=s.length&&"/buf/"!=a.substring(a.lastIndexOf("/buf/")).toLowerCase()&&(a=a+s+"/buf/"),t.forEach(function(t){var s=t;if(0!=s.length){for(var u=s[0].clipPlans,c=[],h=[],d=[],p=[],f=[],m=0;m<s.length;m++){var g=s[m];c=c.concat(g.mat.elements.slice(0,4)),h=h.concat(g.mat.elements.slice(4,8)),d=d.concat(g.mat.elements.slice(8,12)),p=p.concat(g.mat.elements.slice(12,16)),f.push(0)}for(var v=0;v<this._TextureData.length;v++){var y=this._TextureData[v],x=new r.InstancedBufferGeometry;x.maxInstancedCount=s.length,x.setAttribute("position",new r.Float32BufferAttribute(y.pos,2)),x.setAttribute("uv",new r.Float32BufferAttribute(y.textureCoord,2)),x.setAttribute("color",new r.Float32BufferAttribute(y.color,3)),x.setAttribute("tran1",new r.InstancedBufferAttribute(new Float32Array(c),4)),x.setAttribute("tran2",new r.InstancedBufferAttribute(new Float32Array(h),4)),x.setAttribute("tran3",new r.InstancedBufferAttribute(new Float32Array(d),4)),x.setAttribute("tran4",new r.InstancedBufferAttribute(new Float32Array(p),4)),x.setAttribute("ishide",new r.InstancedBufferAttribute(new Float32Array(f),1));var b=a+y.sFileName,w={texture:{value:(new r.TextureLoader).load(b,function(t){t&&n.updateDisplay()})}};w.texture.value.wrapS=w.texture.value.wrapT=r.RepeatWrapping;var _=new r.RawShaderMaterial({uniforms:w,vertexShader:i.MxShader.VSHADER_COLOR_POINT_TEXTURE,fragmentShader:i.MxShader.FSHADER_COLOR_POINT_TEXTURE,transparent:!0,side:r.DoubleSide}),M=new r.Mesh(x,_);M.renderOrder=o.MxData.iCADMeshRenderOrder,M.frustumCulled=!1,4<=u.ver&&0<u.instansClipePoints.length&&(new l.MxStencilObject).associateObject(M,u.instansClipePoints),e.add(M),this._entitys.push(M)}}},this)}},y.prototype.createThreejsObjForMesh=function(t,e){if(0!=t.length){for(var n=[],a=[],s=[],l=[],u=[],c=[],h=[],d=0;d<t.length;d++){var p=t[d];n=n.concat(p.mat.elements.slice(0,4)),a=a.concat(p.mat.elements.slice(4,8)),s=s.concat(p.mat.elements.slice(8,12)),l=l.concat(p.mat.elements.slice(12,16)),u.push(0),c=c.concat(t[d].color)}if(0<this._geometryMeshPositionsByBlock.length)for(d=0;d<t.length;d++)c=c.concat(t[d].color);if(0<this._geometryMeshPositionsByBlock_ZeroLayer.length)for(d=0;d<t.length;d++)h=h.concat(t[d].topLayerColor);for(var f=new r.RawShaderMaterial({vertexShader:i.MxShader.VSHADER_COLOR_POINT,fragmentShader:i.MxShader.FSHADER_COLOR_POINT,transparent:!0,side:r.DoubleSide}),m=0;m<this._geometryMeshPostion.length;m++)(v=new r.InstancedBufferGeometry).maxInstancedCount=t.length,v.setAttribute("position",new r.Float32BufferAttribute(this._geometryMeshPostion[m],2)),v.setAttribute("color",new r.Float32BufferAttribute(this._geometryMeshColor[m],3)),v.setAttribute("tran1",new r.InstancedBufferAttribute(new Float32Array(n),4)),v.setAttribute("tran2",new r.InstancedBufferAttribute(new Float32Array(a),4)),v.setAttribute("tran3",new r.InstancedBufferAttribute(new Float32Array(s),4)),v.setAttribute("tran4",new r.InstancedBufferAttribute(new Float32Array(l),4)),v.setAttribute("ishide",new r.InstancedBufferAttribute(new Float32Array(u),1)),(y=new r.Mesh(v,f)).frustumCulled=!1,y.renderOrder=o.MxData.iCADMeshRenderOrder,e.add(y),this._entitys.push(y);for(m=0;m<this._geometryMeshPositionsByBlock.length;m++)(v=new r.InstancedBufferGeometry).maxInstancedCount=t.length,v.setAttribute("position",new r.Float32BufferAttribute(this._geometryMeshPositionsByBlock[m],2)),v.setAttribute("color",new r.InstancedBufferAttribute(new Float32Array(c),3)),v.setAttribute("tran1",new r.InstancedBufferAttribute(new Float32Array(n),4)),v.setAttribute("tran2",new r.InstancedBufferAttribute(new Float32Array(a),4)),v.setAttribute("tran3",new r.InstancedBufferAttribute(new Float32Array(s),4)),v.setAttribute("tran4",new r.InstancedBufferAttribute(new Float32Array(l),4)),v.setAttribute("ishide",new r.InstancedBufferAttribute(new Float32Array(u),1)),(y=new r.Mesh(v,f)).frustumCulled=!1,y.renderOrder=o.MxData.iCADMeshRenderOrder,e.add(y),this._entitys.push(y);for(m=0;m<this._geometryMeshPositionsByBlock_ZeroLayer.length;m++)(v=new r.InstancedBufferGeometry).maxInstancedCount=t.length,v.setAttribute("position",new r.Float32BufferAttribute(this._geometryMeshPositionsByBlock_ZeroLayer[m],2)),v.setAttribute("color",new r.InstancedBufferAttribute(new Float32Array(h),3)),v.setAttribute("tran1",new r.InstancedBufferAttribute(new Float32Array(n),4)),v.setAttribute("tran2",new r.InstancedBufferAttribute(new Float32Array(a),4)),v.setAttribute("tran3",new r.InstancedBufferAttribute(new Float32Array(s),4)),v.setAttribute("tran4",new r.InstancedBufferAttribute(new Float32Array(l),4)),v.setAttribute("ishide",new r.InstancedBufferAttribute(new Float32Array(u),1)),(y=new r.Mesh(v,f)).frustumCulled=!1,y.renderOrder=o.MxData.iCADMeshRenderOrder,e.add(y),this._entitys.push(y);var g=new r.RawShaderMaterial({uniforms:{color:{value:this._color}},vertexShader:i.MxShader.VSHADER_COLOR_POINT,fragmentShader:i.MxShader.FSHADER_COLOR_POINT,transparent:!0,side:r.DoubleSide});for(m=0;m<this._geometryMeshPositionsByLayer.length;m++){var v,y;(v=new r.InstancedBufferGeometry).maxInstancedCount=t.length,v.setAttribute("position",new r.Float32BufferAttribute(this._geometryMeshPositionsByLayer[m],2)),v.setAttribute("tran1",new r.InstancedBufferAttribute(new Float32Array(n),4)),v.setAttribute("tran2",new r.InstancedBufferAttribute(new Float32Array(a),4)),v.setAttribute("tran3",new r.InstancedBufferAttribute(new Float32Array(s),4)),v.setAttribute("tran4",new r.InstancedBufferAttribute(new Float32Array(l),4)),v.setAttribute("ishide",new r.InstancedBufferAttribute(new Float32Array(u),1)),(y=new r.Mesh(v,g)).frustumCulled=!1,y.renderOrder=o.MxData.iCADMeshRenderOrder,e.add(y),this._entitys.push(y)}}},y.prototype.addGeometryCurve=function(t,e,n,r,i){0<t.length&&(this._geometryCurvePostion.push(t),this._geometryCurveColor.push(e)),0<n.length&&this._geometryCurvePositionsByBlock.push(n),0<r.length&&this._geometryCurvePositionsByLayer.push(r),0<i.length&&this._geometryCurvePositionsByBlock_ZeroLayer.push(i)},y.prototype.addGeometryMesh=function(t,e,n,r,i){0<t.length&&(this._geometryMeshPostion.push(t),this._geometryMeshColor.push(e)),0<n.length&&this._geometryMeshPositionsByBlock.push(n),0<r.length&&this._geometryMeshPositionsByLayer.push(r),0<i.length&&this._geometryMeshPositionsByBlock_ZeroLayer.push(i)},y.prototype.addGeometryTexture=function(t,e,n,r,i,a,o){var s=new g;s.pos=t,s.textureCoord=e,s.color=n,s.sFileName=r,s.dAngel=i,s.ptRotationPostionX=a,s.ptRotationPostionY=o,this._TextureData.push(s)},y.prototype.addMemorySections=function(t){this._MemorySections.push(t)},y.prototype.createThreejsObj=function(t,e,n,r,i){var a=n.getScene(),o=n.getCanvas();if(0!=t.length){if(null==this._color){var s=r.getColor(i);this._color=[],this._color.push((255&s)/255,(s>>8&255)/255,(s>>16&255)/255)}0==this._geometryCurvePostion.length&&0==this._geometryCurvePositionsByBlock.length&&0==this._geometryCurvePositionsByLayer.length&&0==this._geometryCurvePositionsByBlock_ZeroLayer.length||this.createThreejsObjForCurve(t,a),0==this._geometryMeshPostion.length&&0==this._geometryMeshPositionsByBlock.length&&0==this._geometryMeshPositionsByLayer.length&&0==this._geometryMeshPositionsByBlock_ZeroLayer.length||this.createThreejsObjForMesh(t,a),0!=this._TextureData.length&&this.createThreejsObjForTexture(t,a,n),0!=this._MemorySections.length&&this.createThreejsObjForMemorySections(t,a,n)}0!=e.size&&(null==this._color&&(s=r.getColor(i),this._color=[],this._color.push((255&s)/255,(s>>8&255)/255,(s>>16&255)/255)),0==this._geometryCurvePostion.length&&0==this._geometryCurvePositionsByBlock.length&&0==this._geometryCurvePositionsByLayer.length&&0==this._geometryCurvePositionsByBlock_ZeroLayer.length||this.createThreejsObjForCurve_Clip(e,a,o),0==this._geometryMeshPostion.length&&0==this._geometryMeshPositionsByBlock.length&&0==this._geometryMeshPositionsByLayer.length&&0==this._geometryMeshPositionsByBlock_ZeroLayer.length||this.createThreejsObjForMesh_Clip(e,a,o),0!=this._TextureData.length&&this.createThreejsObjForTexture_Clip(e,a,n),0!=this._MemorySections.length&&this.createThreejsObjForMemorySections_clip(e,a,n)),this._geometryCurvePostion=[],this._geometryCurvePositionsByBlock=[],this._geometryCurvePositionsByLayer=[],this._geometryCurvePositionsByBlock_ZeroLayer=[],this._geometryCurveColor=[],this._geometryMeshPostion=[],this._geometryMeshPositionsByBlock=[],this._geometryMeshPositionsByLayer=[],this._geometryMeshPositionsByBlock_ZeroLayer=[],this._geometryMeshColor=[],this._TextureData=[],this._MemorySections=[]},y);function y(t){this._blockRecId=0,this._TextureData=[],this._MemorySections=[],this._geometryCurvePostion=new Array,this._geometryCurveColor=new Array,this._geometryMeshPostion=new Array,this._geometryMeshColor=new Array,this._geometryCurvePositionsByBlock=new Array,this._geometryMeshPositionsByBlock=new Array,this._geometryCurvePositionsByLayer=new Array,this._geometryMeshPositionsByLayer=new Array,this._geometryCurvePositionsByBlock_ZeroLayer=new Array,this._geometryMeshPositionsByBlock_ZeroLayer=new Array,this._entitys=new Array,this._color=void 0,this._material_clip=[],this._blockRecId=t}n.Layer=v;var x=(b.prototype.showLayer=function(t,e){var n=this._layerTogeometry.get(t);null!=n&&n.Show(e)},b.prototype.updataClipMaterial=function(t){var e=t.getCanvas();this._layerTogeometry.forEach(function(t,n,r){t.updataClipMaterial(e)})},b.prototype.getId=function(){return this._id},b.prototype.getBlkRef=function(){return this._blkRef},b.prototype.createThreejsObj=function(t,e){var n=this;this._layerTogeometry.forEach(function(r,i,a){r.createThreejsObj(n._instance,n._instance_clip,t,e,i)})},b.prototype.addGeometryCurve=function(t,e,n,r,i,a){var o=this._layerTogeometry.get(n);null==o&&(o=new v(this._id),this._layerTogeometry.set(n,o)),o.addGeometryCurve(t,e,r,i,a)},b.prototype.addMemorySections=function(t){var e=this._layerTogeometry.get(t.layerId);null==e&&(e=new v(this._id),this._layerTogeometry.set(t.layerId,e)),e.addMemorySections(t)},b.prototype.addGeometryTexture=function(t,e,n,r,i,a,o,s){var l=this._layerTogeometry.get(r);null==l&&(l=new v(this._id),this._layerTogeometry.set(r,l)),l.addGeometryTexture(t,e,n,i,a,o,s)},b.prototype.addGeometryMesh=function(t,e,n,r,i,a){var o=this._layerTogeometry.get(n);null==o&&(o=new v(this._id),this._layerTogeometry.set(n,o)),o.addGeometryMesh(t,e,r,i,a)},b.prototype.addInstance=function(t){var e;t.clipPlans.ver<=3?0==t.clipPlans.clipPlanArray.length?this._instance.push(t):(null==(e=this._instance_clip.get(t.clipPlans.id))&&(e=[],this._instance_clip.set(t.clipPlans.id,e)),e.push(t)):0==t.clipPlans.instansClipePoints.length||100<this._instance_clip.size?this._instance.push(t):(null==(e=this._instance_clip.get(t.clipPlans.id))&&(e=[],this._instance_clip.set(t.clipPlans.id,e)),e.push(t))},b.prototype.addBlkRef=function(t){this._blkRef.push(t)},b);function b(t){this._id=0,this._layerTogeometry=new Map,this._blkRef=[],this._instance=[],this._instance_clip=new Map,this._id=t}n.Block=x;var w=(_.prototype.crateBlock=function(t){var e=this._mapBlock.get(t);return null==e&&(e=new x(t),this._mapBlock.set(t,e)),e},_.prototype.getBlock=function(t){return this._mapBlock.get(t)},_.prototype.addBlockRef=function(t){this.crateBlock(t.blkOwnerId).addBlkRef(t)},_.prototype.showLayer=function(t,e){this._mapBlock.forEach(function(t,e){var n=t,r=e;return function(t,e,i){t.showLayer(n,r)}}.call(this,t,e))},_.prototype.createBlocks_30=function(t,e){if(!this._isCreate){this.crateBlock(0);for(var n=1,i=t.getInt32(12,!0),a=80,o=0;o<i;o++){var s=t.getInt32(a,!0);a+=4;var l=t.getInt32(a,!0);a+=4;var u=t.getInt32(a,!0);a+=4;var p=t.getInt32(a,!0);a+=4;for(var f=new Array,m=0;m<16;m++){var g=t.getFloat32(a,!0);a+=4,f.push(g)}var v=t.getInt32(a,!0);a+=4;var y=new h;y.id=n,y.ver=3,n++,y.clipPlanArray=[];for(var x=0;x<v;x++){var b=t.getFloat32(a,!0);a+=4;var w=t.getFloat32(a,!0);a+=4;var _=t.getFloat32(a,!0);a+=4;var M=t.getFloat32(a,!0);a+=4;var S=new c;S.x1=b,S.y1=w,S.x2=_,S.y2=M,y.clipPlanArray.push(S)}var T=new d;T.ver=3,T.mat=new r.Matrix4,T.mat.fromArray(f),T.blkRecId=u,T.blkOwnerId=s,T.layerId=l,T.color=p,T.clipPlans=y,this.crateBlock(u),this.addBlockRef(T)}this._isGetAllBlocks=!0,this._isCreate=!0}},_.prototype.createBlocks_40=function(t,e){if(!this._isCreate){this.crateBlock(0);for(var n=1,i=t.getInt32(12,!0),a=80,o=0;o<i;o++){var s=t.getInt32(a,!0);a+=4;var l=t.getInt32(a,!0);a+=4;var u=t.getInt32(a,!0);a+=4;var c=t.getInt32(a,!0);a+=4;for(var p=new Array,f=0;f<16;f++){var m=t.getFloat32(a,!0);a+=4,p.push(m)}var g=t.getInt32(a,!0);a+=4;var v=new h;v.id=n,v.ver=4,n++,v.clipPoints=[];for(var y=0;y<g;y++){var x=new r.Vector2;x.x=t.getFloat32(a,!0),a+=4,x.y=t.getFloat32(a,!0),a+=4,v.clipPoints.push(x)}var b=new d;b.ver=4,b.mat=new r.Matrix4,b.mat.fromArray(p),b.blkRecId=u,b.blkOwnerId=s,b.layerId=l,b.color=c,b.clipPlans=v,this.crateBlock(u),this.addBlockRef(b)}this._isGetAllBlocks=!0,this._isCreate=!0}},_.prototype.createBlocks=function(t,e){this._isCreate||(new s.MxNetData(t).getVersion_MwBlobHead()<=3?this.createBlocks_30(t,e):this.createBlocks_40(t,e))},_.prototype.updataClipMaterial=function(t){this._mapBlock.forEach(function(e,n,r){e.updataClipMaterial(t)})},_.prototype.createAllInstance=function(t){var e=this.getBlock(0);if(null==e)return!1;if(null==this._rootBlockRef)return!1;var n=new r.Matrix4,i=new Map,a=new h;return this._iClipIdCount=1,a.id=this._iClipIdCount,this._iClipIdCount++,this.createAllInstanceCall(e,this._rootBlockRef,n,i,16777215,t,void 0,a),!0},_.prototype.createThreejsObj=function(t,e,n){null==this._mapNeedCreateThreejsObj.get(t.getId())&&this._mapNeedCreateThreejsObj.set(t.getId(),t),this._isCreateAllInstance||this._isGetAllBlocks&&n.isInitComplete()&&(this._isCreateAllInstance=this.createAllInstance(n)),this._isCreateAllInstance&&(this._mapNeedCreateThreejsObj.forEach(function(t,r,i){t.createThreejsObj(e,n)}),this._mapNeedCreateThreejsObj.clear())},_.prototype.createAllInstanceCall=function(t,e,n,i,a,o,s,l){if(1!=i[t.getId()]){i[t.getId()]=!0;var u=new p;if(u.mat=new r.Matrix4,u.mat.copy(n),u.mat.multiply(e.mat),e.ver<=3)if(0==e.clipPlans.clipPlanArray.length)u.clipPlans=l;else{u.clipPlans=e.clipPlans,u.clipPlans.ver=3;for(var c,d,f,m,g=u.clipPlans.clipPlanArray.length,v=function(){c=new r.Vector3(u.clipPlans.clipPlanArray[y].x1,u.clipPlans.clipPlanArray[y].y1,0),d=new r.Vector3(u.clipPlans.clipPlanArray[y].x2,u.clipPlans.clipPlanArray[y].y2,0),f=new r.Vector3(u.clipPlans.clipPlanArray[y].x1,u.clipPlans.clipPlanArray[y].y2,0),m=new r.Vector3(u.clipPlans.clipPlanArray[y].x2,u.clipPlans.clipPlanArray[y].y1,0),c.applyMatrix4(u.mat),d.applyMatrix4(u.mat),f.applyMatrix4(u.mat),m.applyMatrix4(u.mat);var t=c.x,e=c.x,n=c.y,i=c.y,a=[];a.push(d),a.push(f),a.push(m),a.forEach(function(r){t>r.x&&(t=r.x),e<r.x&&(e=r.x),n>r.y&&(n=r.y),i<r.y&&(i=r.y)}),u.clipPlans.clipPlanArray[y].x1=t,u.clipPlans.clipPlanArray[y].y1=n,u.clipPlans.clipPlanArray[y].x2=e,u.clipPlans.clipPlanArray[y].y2=i},y=0;y<g;y++)v()}else if(0==e.clipPlans.clipPoints.length)u.clipPlans=l;else{u.clipPlans=new h,u.clipPlans.ver=4,u.clipPlans.id=this._iClipIdCount,this._iClipIdCount++,u.clipPlans.instansClipePoints=l.instansClipePoints.slice(0);var x=[],b=e.clipPlans.clipPoints;for(g=b.length,y=0;y<g;y++){var w=new r.Vector3(b[y].x,b[y].y,0);w.applyMatrix4(u.mat),x.push(new r.Vector2(w.x,w.y))}u.clipPlans.instansClipePoints.push(x)}null==s?u.topLayerColor.push(1,1,1):u.topLayerColor.push(s[0],s[1],s[2]);var _=e.color>>24&255;if(2==_)u.color.push((255&a)/255,(a>>8&255)/255,(a>>16&255)/255);else if(1==_){var M=o.getColor(e.layerId);u.color.push((255&M)/255,(M>>8&255)/255,(M>>16&255)/255),a=M}else u.color.push((255&e.color)/255,(e.color>>8&255)/255,(e.color>>16&255)/255),a=e.color;t.addInstance(u);for(var S=t.getBlkRef(),T=null==s,C=0;C<S.length;C++)if(0!=S[C].blkRecId){var E=this.getBlock(S[C].blkRecId);if(null==E)return;T&&(s=[],M=o.getColor(S[C].layerId),s.push((255&M)/255,(M>>8&255)/255,(M>>16&255)/255)),this.createAllInstanceCall(E,S[C],u.mat,i,a,o,s,u.clipPlans)}i[t.getId()]=!1}},_.prototype.initRootBlockRef=function(t){null==t&&((t=new d).mat=new r.Matrix4,t.blkRecId=0,t.blkOwnerId=-1,t.layerId=-1,t.color=16777215),this._rootBlockRef=t},_);function _(){this._mapBlock=new Map,this._mapNeedCreateThreejsObj=new Map,this._isCreate=!1,this._isGetAllBlocks=!1,this._isCreateAllInstance=!1,this._rootBlockRef=void 0,this._iClipIdCount=1}n.Blocks=w;var M=function(){this.blocks=new w,this.layers=new a.MxBrowseLayerData};n.ExternalReferenceDatabase=M;var S=(T.prototype.createTzDwgExternalReferences=function(t){this._mapId2ExternalDatabase.get(t)||this.getBlocks(t).initRootBlockRef()},T.prototype.createExternalReferences=function(t){for(var e=t.getInt32(12,!0),n=80,i=0;i<e;i++){for(var a=new Array,o=0;o<16;o++){var s=t.getFloat32(n,!0);n+=4,a.push(s)}var l=t.getInt32(n,!0);n+=4;var u=t.getInt32(n,!0);if(n+=4,t.getInt32(n,!0),n+=4,0!=l){var c=this.getBlocks(l),h=new d;h.mat=new r.Matrix4,h.mat.fromArray(a),h.blkRecId=0,h.blkOwnerId=-1,h.layerId=-1,h.color=u,c.initRootBlockRef(h)}else console.log("mx error iDatabaseIndex")}},T.prototype.getBlocks=function(t){if(0!=t){var e=this._mapId2ExternalDatabase.get(t);return null==e&&(e=new M,this._mapId2ExternalDatabase.set(t,e)),e.blocks}console.log("mx error iDatabaseIndex")},T.prototype.getLayers=function(t){if(0!=t){var e=this._mapId2ExternalDatabase.get(t);return null==e&&(e=new M,this._mapId2ExternalDatabase.set(t,e)),e.layers}console.log("mx error iDatabaseIndex")},T);function T(){this._mapId2ExternalDatabase=new Map}n.ExternalReferenceManager=S},{"../MxFun":34,"../MxManager":36,"../MxNetData":38,"../MxShader":40,"../MxStencilObject":41,"./MxBrowseLayerData":69,three:19}],69:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxBrowseLayerData=void 0;var r=(i.prototype.add=function(t,e,n){this._layerColor[t]=e,this._nametoId[n]=t},i.prototype.setZeroLayerId=function(t){this._zeroLayerId=t},i.prototype.getZeroLayerId=function(){return this._zeroLayerId},i.prototype.getLayerIdForName=function(t){return null==this._nametoId[t]?0:this._nametoId[t]},i.prototype.getColor=function(t){return null==this._layerColor[t]?16777215:this._layerColor[t]},i.prototype.initComplete=function(){this._isSetInstanceComplete=!0},i.prototype.isInitComplete=function(){return this._isSetInstanceComplete},i);function i(){this._isSetInstanceComplete=!1,this._layerColor=new Map,this._nametoId=new Map,this._zeroLayerId=0}n.MxBrowseLayerData=r},{}],70:[function(t,e,n){var r=this&&this.__awaiter||function(t,e,n,r){return new(n=n||Promise)(function(i,a){function o(t){try{l(r.next(t))}catch(t){a(t)}}function s(t){try{l(r.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?i(t.value):((e=t.value)instanceof n?e:new n(function(t){t(e)})).then(o,s)}l((r=r.apply(t,e||[])).next())})},i=this&&this.__generator||function(t,e){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=0<(i=o.trys).length&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=e.call(t,o)}catch(t){a=[6,t],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}};Object.defineProperty(n,"__esModule",{value:!0}),n.MxDbDatabase=void 0;var a=t("three"),o=t("../MxFun"),s=t("./MxDbEntity"),l=t("./MxDbEntityGrip"),u=t("./MxDbEntitySelect"),c=t("../MxManager"),h=t("../MxType"),d=t("./MxDbLayerTable"),p=t("./MxDbGroup"),f=t("../MxDrawData"),m=t("../MxTools"),g=(v.prototype.getAllEntity=function(){return this.mapIdToEntity},v.prototype.getGroupDictionary=function(){return this.groupDictionary},v.prototype.upDirtyDisplay=function(){var t=!1;return this.mapIdToEntity.forEach(function(e){e.getDirtyDisplay()&&(e.upDisplay(),e.setDirtyDisplay(!1),t=!0)}),t},v.prototype.onViewChange=function(){var t=!1;return this.mapIdToEntity.forEach(function(e){e.onViewChange()&&(t=!0)}),t},v.prototype.saveJson=function(){var t=this,e={ver:1},n=new a.Vector3(0,0,0),r=new a.Vector3(this.mxObj.getViewWidth(),this.mxObj.getViewHeight(),0);e.correctLargeCoordinates=f.MxDrawData.m_isCorrectLargeCoordinates,f.MxDrawData.m_isCorrectLargeCoordinates&&(e.matDoc2Cad=this.mxObj.getDoc2CADMatrix());var i=this.mxObj.screenCoord2Doc(n.x,n.y,0),o=this.mxObj.screenCoord2Doc(r.x,r.y,0);e.view={ptView1:i,ptView2:o};var s=[];this.mapNameToLayer.forEach(function(t){var e={type:h.MxType.MxCloneType.kMxFileClone};t.dwgOut(e),e.TypeName="MxDbLayerTableRecord",s.push(e)}),e.layers=s,this.groupDictionary.dwgOut(e);var l=[];return this.mapIdToEntity.forEach(function(e){var n=e.getUserObject(),r={type:h.MxType.MxCloneType.kMxFileClone};n.dwgOut(r),r.TypeName=n.getTypeName(),r.group=t.groupDictionary.getEntityInGroupName(e.objectId()),l.push(r)}),e.entitys=l,e},v.prototype.reInit=function(){this.eraseAllEntity(),this.initLayerTable(),this.groupDictionary=new p.MxDbGroupDictionary},v.prototype.loadJson=function(t){return r(this,void 0,void 0,function(){var e,n,r,a,o,l,u,h,d,p,f=this;return i(this,function(m){switch(m.label){case 0:if(this.reInit(),(e=t).view&&(n=e.view,this.mxObj.zoomW(n.ptView1,n.ptView2,!1)),r=e.layers)for(a=r.length,p=0;p<a;p++)o=r[p],this.addLayer(o.name).dwgIn(o);this.groupDictionary.dwgIn(e),l=e.entitys,u=l.length,h=function(t){var e,n,r,a;return i(this,function(i){switch(i.label){case 0:return e=l[t],[4,c.MxManager.getMxDbEntityClassHierarchy().createMxEntity(e.TypeName)];case 1:return(n=i.sent())?(n.dwgIn(e),(r=new s.MxDbEntity).initUserObject(n),d.addEntityImp(r),(a=e.group)&&0<a.length&&a.forEach(function(t){f.groupDictionary.add(t).append(r.objectId())}),[2]):[2,"continue"]}})},d=this,p=0,m.label=1;case 1:return p<u?[5,h(p)]:[3,4];case 2:m.sent(),m.label=3;case 3:return p++,[3,1];case 4:return[2,new Promise(function(t){t(!0)})]}})})},v.prototype.getMxObject=function(){return this.mxObj},v.prototype.getGripManager=function(){return this.gripManager},v.prototype.getSelectManager=function(){return this.selectManager},v.prototype.clearMxCurrentSelect=function(){var t=!1;return this.gripManager.removeAllGrips()&&(t=!0),this.selectManager.removeAllEntity()&&(t=!0),t},v.prototype.eraseAllEntity=function(){this.mapIdToEntity.forEach(function(t){t.clearDisplayImp()}),this.mapIdToEntity=new Map,this.clearMxCurrentSelect()},v.prototype.intiDoc2Wold=function(t){this.parentObject.matrix=t,this.parentObject.matrixAutoUpdate=!1},v.prototype.initLayerTable=function(){this.mapNameToLayer=new Map,this.curLayer="0";var t=new d.MxDbLayerTableRecord;t.init(this.curLayer,this.parentObject),this.mapNameToLayer.set(this.curLayer,t)},v.prototype.init=function(t){this.mxObj=t,this.scene=t.getScene(),o.MxFun.removeThreejsObject(this.parentObject,this.scene),this.parentObject=new a.Object3D,this.parentObject.renderOrder=c.MxData.iMxEntityRenderOrder,this.scene.add(this.parentObject),this.initLayerTable()},v.prototype.getEntity=function(t){return this.mapIdToEntity.get(t)},v.prototype.isValidId=function(t){return this.mapIdToEntity.has(t)},v.prototype.setRenderOrder=function(t){var e=this.parentObject.renderOrder;return this.parentObject.renderOrder=t,e},v.prototype.eraseEntity=function(t){this.gripManager.deleteGripData(t),this.selectManager.deleteSelect(t),this.mapIdToEntity.delete(t)},v.prototype.showLayer=function(t,e){var n=this.getLayer(t);n&&n.setVisible(e)},v.prototype.setCurrentLayer=function(t){if(0!=t.length)return this.curLayer=t,this.addLayer(t)},v.prototype.addLayer=function(t){var e=this.mapNameToLayer.get(t);return e||((e=new d.MxDbLayerTableRecord).init(t,this.parentObject),this.mapNameToLayer.set(t,e),e)},v.prototype.getLayer=function(t){return this.mapNameToLayer.get(t)},v.prototype.addMxEntity=function(t){if(t.getImp())return t.objectId();var e=new s.MxDbEntity;return e.initUserObject(t),t.initGuid(m.MxTools.generateUUID()),this.addEntityImp(e)},v.prototype.addEntityImp=function(t){return this.mapIdToEntity.set(this.idCount,t),t.setMxDatabase(this),t.setObjectId(this.idCount),0==t.getLayer().length&&t.setLayer(this.curLayer),t.upDisplay(),this.idCount++},v.prototype.getThreeJSParentObject=function(){return this.parentObject},v.prototype.getIntersectObjects=function(t){var e=new a.Raycaster;e.linePrecision=this.mxObj.screenCoordLong2Doc(40);var n=this.mxObj.getCanvas(),r=n.clientWidth,i=n.clientHeight,o=new a.Vector2(t.x/r*2-1,-t.y/i*2+1);return e.setFromCamera(o,this.mxObj.getCamera()),e.intersectObjects(this.parentObject.children,!0)},v);function v(){this.mapIdToEntity=new Map,this.mxObj=null,this.scene=null,this.idCount=1,this.parentObject=null,this.mapNameToLayer=new Map,this.curLayer="0",this.gripManager=new l.MxDbEntityGrip(this),this.selectManager=new u.MxDbEntitySelect(this),this.groupDictionary=new p.MxDbGroupDictionary}n.MxDbDatabase=g},{"../MxDrawData":29,"../MxFun":34,"../MxManager":36,"../MxTools":45,"../MxType":46,"./MxDbEntity":71,"./MxDbEntityGrip":72,"./MxDbEntitySelect":73,"./MxDbGroup":74,"./MxDbLayerTable":75,three:19}],71:[function(t,e,n){var r=this&&this.__awaiter||function(t,e,n,r){return new(n=n||Promise)(function(i,a){function o(t){try{l(r.next(t))}catch(t){a(t)}}function s(t){try{l(r.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?i(t.value):((e=t.value)instanceof n?e:new n(function(t){t(e)})).then(o,s)}l((r=r.apply(t,e||[])).next())})},i=this&&this.__generator||function(t,e){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=0<(i=o.trys).length&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=e.call(t,o)}catch(t){a=[6,t],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}};Object.defineProperty(n,"__esModule",{value:!0}),n.MxDbEntity=n.MxDbEntityClassHierarchy=n.MxDbEntityUserObject=void 0;var a=t("three"),o=t("../Operate/McGiWorldDraw"),s=t("../MxManager"),l=t("../MxTools"),u=t("../MxType"),c=(h.prototype.getTypeName=function(){return""},h.prototype.initGuid=function(t){0<this.sGuid.length?console.log("mx: init guid error"):this.sGuid=t},h.prototype.guid=function(){return this.sGuid},h.prototype.setLayer=function(t){var e=this.getImp();e&&e.nodifySetLayer(),this.layer=t},h.prototype.getLayer=function(){return this.layer},h.prototype.setDash=function(t,e){this.dDashArray=t,this.dDashRatio=e,0==this.dLineWidth&&(this.dLineWidth=6,this.lineWidthByPixels=!0)},h.prototype.getDash=function(){return{dDashArray:this.dDashArray,dDashRatio:this.dDashRatio}},h.prototype.setDashLineDisplay=function(t){t?(this.dDashArray=.03,this.dDashRatio=.1,0==this.dLineWidth&&(this.dLineWidth=6,this.lineWidthByPixels=!0)):(this.dDashArray=0,this.dDashRatio=0)},h.prototype.isDashLineDisplay=function(){return 0<this.dDashArray&&0<this.dDashRatio},h.prototype.setLineWidthByPixels=function(t){this.lineWidthByPixels=t},h.prototype.getLineWidthByPixels=function(){return this.lineWidthByPixels},h.prototype.setLineWidth=function(t){this.dLineWidth=t},h.prototype.getLineWidth=function(){return this.dLineWidth},h.prototype.getMxObject=function(){var t=this.getImp();return t?t.getMxObject():null},h.prototype.onViewChange=function(){return!1},h.prototype.getImp=function(){return this.MxDbEntityImp},h.prototype.upDisplay=function(){var t=this.getImp();return!!t&&t.upDisplay()},h.prototype.erase=function(){var t=this.getImp();return!!t&&t.erase()},h.prototype.setColor=function(t){this.iColor=t},h.prototype.getColor=function(){return this.iColor},h.prototype.setRenderOrder=function(t){this.iRenderOrder=t},h.prototype.getRenderOrder=function(){return this.iRenderOrder},h.prototype.onEndGripEidt=function(){},h.prototype.onStartGripEidt=function(){},h.prototype.dwgIn=function(t){return this.iColor=t.iColor,this.iRenderOrder=t.iRenderOrder,this.opacity=t.opacity,this.visible=t.visible,this.dLineWidth=t.lineWidth,this.lineWidthByPixels=t.lineWidthByPixels,this.dDashArray=t.dashArray,this.dDashRatio=t.dashRatio,this.layer=t.layer,t.guid&&(this.sGuid=t.guid),!0},h.prototype.dwgOut=function(t){return t.iColor=this.iColor,t.iRenderOrder=this.iRenderOrder,t.opacity=this.opacity,t.visible=this.visible,t.lineWidth=this.dLineWidth,t.lineWidthByPixels=this.lineWidthByPixels,t.dashArray=this.dDashArray,t.dashRatio=this.dDashRatio,t.layer=this.layer,t.guid=this.sGuid,t},h.prototype.clone=function(t){var e=this.create(),n={type:t||u.MxType.MxCloneType.kClone};return this.dwgOut(n),e.dwgIn(n),e.sGuid="",e},h.prototype.init=function(){s.MxManager.getMxDbEntityClassHierarchy().init(this)},h.prototype.transformBy=function(t){},h.prototype.objectId=function(){var t=this.getImp();return t?t.objectId():0},h);function h(){this.iColor=16777215,this.iRenderOrder=s.MxData.iMxEntityRenderOrder,this.opacity=1,this.visible=!0,this.dLineWidth=0,this.lineWidthByPixels=!0,this.dDashArray=0,this.dDashRatio=0,this.layer="",this.sGuid=""}n.MxDbEntityUserObject=c;var d=(p.prototype.init=function(t){var e=t.getTypeName();this.mapType2Create.get(e)&&console.log("MxError:already has this class name "+e),this.mapType2Create.set(e,{type:0,createfun:t})},p.prototype.initDynamic=function(t){this.dynmaicCreate=t},p.prototype.createMxEntity=function(t){return r(this,void 0,void 0,function(){var e,n;return i(this,function(r){switch(r.label){case 0:return(e=this.mapType2Create.get(t))?[3,3]:this.dynmaicCreate?[4,this.dynmaicCreate(t)]:[3,2];case 1:return(n=r.sent())?(this.mapType2Create.set(t,{type:1,createfun:n}),[2,new Promise(function(t,e){t(new n)})]):(this.mapType2Create.set(t,{type:2,createfun:null}),[2,new Promise(function(t,e){t(null)})]);case 2:return[2,new Promise(function(t,e){t(null)})];case 3:return 0==e.type?[2,new Promise(function(t,n){t(e.createfun.create())})]:1==e.type?[2,new Promise(function(t,n){t(new e.createfun)})]:[2,new Promise(function(t,e){t(null)})]}})})},p);function p(){this.mapType2Create=new Map,this.dynmaicCreate=null}n.MxDbEntityClassHierarchy=d;var f=(m.prototype.setObjectId=function(t){this.id=t},m.prototype.nodifySetLayer=function(){this.layerObjectGroup&&this.clearDisplayImp()},m.prototype.setLayer=function(t){this.userObject.setLayer(t)},m.prototype.getLayer=function(){return this.userObject.getLayer()},m.prototype.setDirtyDisplay=function(t){this.isDirtyDisplay=t},m.prototype.getDirtyDisplay=function(){return this.isDirtyDisplay},m.prototype.setMxDatabase=function(t){this.mxDatabase=t},m.prototype.objectId=function(){return this.id},m.prototype.initUserObject=function(t){(this.userObject=t).MxDbEntityImp=this},m.prototype.upDisplay=function(){if(!this.mxDatabase)return console.log("mxassert(0) this.mxDatabase is null"),!1;this.updateDisplayImp(this.mxDatabase.getMxObject())},m.prototype.erase=function(){if(0==this.id)return!1;this.clearDisplayImp(),this.userObject=null,this.mxDatabase.eraseEntity(this.id),this.id=0,this.mxDatabase=null},m.prototype.clearDisplayImp=function(){this.layerObjectGroup&&(this.threeObjectGroup&&(this.threeObjectGroup.traverse(function(t){"Mesh"===t.type&&(t.geometry.dispose(),t.material.dispose())}),this.layerObjectGroup.remove(this.threeObjectGroup)),this.threeObjectGroup=null,this.layerObjectGroup=null)},m.prototype.updateDisplayImp=function(t){if(this.clearDisplayImp(),this.userObject){if(this.userObject.visible){var e=this.mxDatabase.addLayer(this.userObject.getLayer());if(!e)return console.log("mxassert(0) this.layerRecord is null"),!1;this.threeObjectGroup=new a.Group;var n=new o.McGiWorldDraw(t,o.McGiWorldDrawType.kWorldDraw);n.setupForEntity(this.userObject),this.worldDraw(n);for(var r=n.getEntitys(),i=r.length,s=0;s<i;s++){var u=r[s];(u.MxDbEntity=this).threeObjectGroup.add(u)}this.layerObjectGroup=e.getGroup(),this.layerObjectGroup.add(this.threeObjectGroup)}}else l.MxTools.MxASSERT(!1,"this.userObject == null")},m.prototype.worldDraw=function(t){this.userObject.worldDraw(t)},m.prototype.getGripPoints=function(){return this.userObject.getGripPoints()},m.prototype.getUserObject=function(){return this.userObject},m.prototype.clone=function(t){var e=new m;return e.initUserObject(this.userObject.clone(t)),e},m.prototype.transformBy=function(t){this.userObject.transformBy(t)},m.prototype.setColor=function(t){this.userObject.setColor(t)},m.prototype.onEndGripEidt=function(){this.userObject.onEndGripEidt()},m.prototype.onStartGripEidt=function(){return this.userObject.onStartGripEidt()},m.prototype.getColor=function(){return this.userObject.getColor()},m.prototype.getMxObject=function(){return this.mxDatabase?this.mxDatabase.getMxObject():null},m.prototype.onViewChange=function(){return!!this.userObject&&this.userObject.onViewChange()},m);function m(){this.threeObjectGroup=null,this.userObject=null,this.mxDatabase=null,this.isDirtyDisplay=!1,this.layerObjectGroup=null,this.id=0}n.MxDbEntity=f},{"../MxManager":36,"../MxTools":45,"../MxType":46,"../Operate/McGiWorldDraw":50,three:19}],72:[function(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0}),n.MxDbEntityGrip=n.MxDbEntityGripJig=n.MxDbEntityGripData=void 0;var a=t("three"),o=t("../MxFun"),s=t("../MxDrawData"),l=t("../Operate/MxJig"),u=t("../Operate/MxJigCmdManager"),c=t("../Operate/McGiWorldDraw"),h=t("../MxManager"),d=t("../MxType"),p=function(){this.threeObject=null};n.MxDbEntityGripData=p;var f,m=(i(g,f=l.McEdJigCommand),g.prototype.sampler=function(){var t=u.MxJigCmdManager.InType.kGetBegan|u.MxJigCmdManager.InType.kGetEnd,e=this.acquirePoint(t);return e.status==u.MxJigCmdManager.DragStatus.kNormal&&(this.currPt=e.pt),e.status},g.prototype.getTypeName=function(){return"MxGripEdit"},g.prototype.onStartCommand=function(){this.iscallOnStartCommand=!0,f.prototype.onStartCommand.call(this)},g.prototype.done=function(t){if(t==u.MxJigCmdManager.DragStatus.kNormal){var e=this.currPt.clone();e.sub(this.dragBasePt);for(var n=this.getMxObject(),r=n.getMxDatabase(),i=n.getMxDatabase().getGripManager(),a=this.grips.length,o=new Set,s=[],l=0;l<a;l++){var c=this.grips[l],h=this.ents[l];i.deleteGripData(h.objectId()),h.getUserObject().moveGripPointsAt(c.iIndex,e),i.addGripFromEntity(h),h.upDisplay(),o.add(h.objectId());var d={id:h.objectId(),index:c.iIndex,curentPoint:this.currPt};s.push(d)}n.updateDisplay(),0<s.length&&n.callEvent("objectGripEdit",s),r.getSelectManager().upSelectDilsplay(o)}var p=this.ents.length;for(l=0;l<p;l++)(h=this.ents[l]).onEndGripEidt();return u.MxJigCmdManager.DoneStatius.kExitCommand},g.prototype.upDisplay=function(){var t=this.currPt.clone();if(t.sub(this.dragBasePt),!(t.length()<.001)){if(this.iscallOnStartCommand){for(var e=this.ents.length,n=0;n<e;n++){var r=this.ents[n];this.aryParam.push(r.onStartGripEidt())}this.iscallOnStartCommand=!1}var i=this.getMxObject(),a=this.grips.length;for(n=0;n<a;n++){var o=this.grips[n],s=(r=this.ents[n],this.aryParam[n]),l=r.clone(d.MxType.MxCloneType.kDragClone);l.getUserObject().moveGripPointsAt(o.iIndex,t);var u=new c.McGiWorldDraw(i,c.McGiWorldDrawType.kDynDragDraw);u.setupForEntity(l.getUserObject()),l.worldDraw(u);var h=u.getEntitys(),p=h.length,f=31;s&&s.renderOrder&&(f=s.renderOrder);for(var m=0;m<p;m++)this.drawEntity(h[m],f)}}},g);function g(t,e,n){var r=f.call(this)||this;return r.aryParam=[],r.iscallOnStartCommand=!0,r.dragBasePt=t,r.grips=e,r.ents=n,r.currPt=t,r.iscallOnStartCommand=!0,r}n.MxDbEntityGripJig=m;var v=(y.prototype.getAllSelect=function(){var t=[];return this.mapGrips.forEach(function(e,n){t.push(n)}),t},y.prototype.getParentObject=function(){return this.database.getMxObject().getTheTempDrawContainer()},y.prototype.removeAllGrips=function(){if(0==this.mapGrips.size)return!1;this.database.getMxObject();var t=this.getParentObject();return this.mapGrips.forEach(function(e,n,r){for(var i=e.length,a=0;a<i;a++){var s=e[a];o.MxFun.removeThreejsObject(s.threeObject,t)}}),this.mapGrips=new Map,!0},y.prototype.deleteGripData=function(t){var e=this.getParentObject(),n=this.mapGrips.get(t);if(n)for(var r=n.length,i=0;i<r;i++){var a=n[i];o.MxFun.removeThreejsObject(a.threeObject,e)}this.mapGrips.delete(t)},y.prototype.createGripDisplayObject=function(t){var e=this.database.getMxObject(),n=this.getParentObject();t.geometry=new a.Geometry;var r=e.screenCoordLong2Doc(8);t.geometry.vertices.push(new a.Vector3(t.point.x-r,t.point.y-r,0)),t.geometry.vertices.push(new a.Vector3(t.point.x-r,t.point.y+r,0)),t.geometry.vertices.push(new a.Vector3(t.point.x+r,t.point.y+r,0)),t.geometry.vertices.push(new a.Vector3(t.point.x+r,t.point.y-r,0)),t.geometry.faces.push(new a.Face3(0,1,2)),t.geometry.faces.push(new a.Face3(2,3,0)),t.geometry.computeFaceNormals(),t.geometry.computeVertexNormals();var i=new a.MeshBasicMaterial({color:255,transparent:!0,depthTest:!1,side:a.DoubleSide,opacity:.9}),o=new a.Mesh(t.geometry,i);o.renderOrder=h.MxData.iGripRenderOrder,n.add(o),t.threeObject=o},y.prototype.addGripData=function(t,e,n){var r=this.mapGrips.get(t);null==r&&(r=new Array,this.mapGrips.set(t,r));var i=new p;return i.iIndex=e,i.point=new a.Vector3(n.x,n.y,0),r.push(i),i},y.prototype.hitTest=function(t){var e=this,n={grips:new Array,ents:new Array,pt:t},r=new a.Vector3(t.x,t.y,0),i=this.database.getMxObject().screenCoordLong2Doc(32);return this.mapGrips.forEach(function(t,a){for(var o=t.length,s=0;s<o;s++){var l=t[s];if(l.point.distanceTo(r)<=i){n.grips.push(l),n.ents.push(e.database.getEntity(a));break}}}),n},y.prototype.onMouseLBDown=function(t){var e=this.hitTest(t);return 0!=e.grips.length&&(o.MxFun.sendStringToExecute("Mx_FrontEndWebpageGripEdit",e),!0)},y.prototype.gripEditImp=function(t){var e=t.grips,n=t.ents,r=t.pt,i=new m(r,e,n);i.setDisableDynInput(!0),i.setDisableOsnap(!0),u.MxJigCmdManager.runCmd(i)},y.prototype.doWindowsSelect=function(t,e){},y.prototype.addGripFromEntity=function(t){var e=t.getGripPoints(),n=t.objectId();this.deleteGripData(n);for(var r=0;r<e.length;r++){var i=this.addGripData(n,r,e[r]);this.createGripDisplayObject(i)}},y.prototype.addSelect=function(t){var e=this.database.getSelectManager(),n=!1;if(this.getAllSelect().forEach(function(e){e==t&&(n=!0)}),!n){var r=this.database.getMxObject(),i=r.getMxEntity(t);if(i){var a=new Set;a.add(t),this.addGripFromEntity(i),e.upSelectDilsplay(a),this.isCallingMxEntitySelectChange||(this.isCallingMxEntitySelectChange=!0,r.callEvent("MxEntitySelectChange",this.getAllSelect()),this.isCallingMxEntitySelectChange=!1)}}},y.prototype.doPointSelect=function(t){for(var e=!1,n=this.database.getSelectManager(),r=this.database.getMxObject(),i=n.isEmptySelect(),a=!1,o=function(){s.MxDrawData.m_isMultipleSelect||(l.removeAllGrips(),n.removeAllEntity());var i=l.database.getIntersectObjects(t);if(0==i.length)return r.updateDisplay(),"break";var o=l,u=new Set;i.forEach(function(t){var e=t.object.MxDbEntity;if(e){var n=e.objectId();o.database.isValidId(n)&&!u.has(n)&&(u.add(n),o.addGripFromEntity(e))}});var c=new Set,h=l.database.getGroupDictionary();return u.forEach(function(t){c.add(t),h.getEntityInGroup(t).forEach(function(t){t.getAll().forEach(function(t){o.database.isValidId(t)&&c.add(t)})})}),a=!0,n.upSelectDilsplay(c),r.updateDisplay(),e=!0,"break"},l=this;"break"!==o(););return!a&&i==n.isEmptySelect()||this.isCallingMxEntitySelectChange||(this.isCallingMxEntitySelectChange=!0,r.callEvent("MxEntitySelectChange",this.getAllSelect()),this.isCallingMxEntitySelectChange=!1),e},y);function y(t){this.database=null,this.mapGrips=new Map,this.isCallingMxEntitySelectChange=!1,this.database=t}n.MxDbEntityGrip=v},{"../MxDrawData":29,"../MxFun":34,"../MxManager":36,"../MxType":46,"../Operate/McGiWorldDraw":50,"../Operate/MxJig":57,"../Operate/MxJigCmdManager":58,three:19}],73:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxDbEntitySelect=void 0;var r=t("three"),i=t("../MxFun"),a=t("three.meshline"),o=t("../Operate/McGiWorldDraw"),s=t("../MxManager"),l=(u.prototype.setRenderOrder=function(t){this.iRenderOrder=t},u.prototype.getRenderOrder=function(){return this.iRenderOrder},u.prototype.setCanvasSize=function(t,e){this.canvasWidth==t&&this.canvasHeight==e||(this.canvasWidth=t,this.canvasHeight=e,this.material.resolution=new r.Vector2(this.canvasWidth,this.canvasHeight),this.material.needsUpdate=!0)},u.prototype.removeAllEntity=function(){var t=this.getParentObject();return 0!=this.mapIdToThreeObject.size&&(this.mapIdToThreeObject.forEach(function(e){for(var n=e.length,r=0;r<n;r++)i.MxFun.removeThreejsObject(e[r],t)}),this.mapIdToThreeObject.clear(),!0)},u.prototype.isEmptySelect=function(){return 0==this.mapIdToThreeObject.size},u.prototype.getParentObject=function(){return this.mxDatabase.getMxObject().getTheTempDrawContainer()},u.prototype.getAllSelect=function(){var t=[];return this.mapIdToThreeObject.forEach(function(e,n){t.push(n)}),t},u.prototype.setPrvCommandSelect=function(t){this.aryPrvCommandSelect=t},u.prototype.getPrvCommandSelect=function(){return this.aryPrvCommandSelect},u.prototype.deleteSelect=function(t){var e=this.getParentObject(),n=this.mapIdToThreeObject.get(t);if(n){for(var r=n.length,a=0;a<r;a++)i.MxFun.removeThreejsObject(n[a],e);this.mapIdToThreeObject.delete(t)}},u.prototype.upSelectDilsplayFromId=function(t){var e=new Set;e.add(t),this.upSelectDilsplay(e)},u.prototype.upSelectDilsplay=function(t){var e=this,n=new o.McGiWorldDrawSelect(this.mxDatabase.getMxObject(),this);t.forEach(function(t){e.deleteSelect(t);var r=e.mxDatabase.getEntity(t);r&&(n.setCurEntityId(t),r.worldDraw(n))})},u.prototype.addCircleDisplay=function(t,e,n){var i=new r.CircleGeometry(n,64,3,2*Math.PI);if(i.vertices.shift(),0!=i.vertices.length){i.vertices.push(i.vertices[0]);var o=3*i.vertices.length;if(0!=o){for(var s=this.getParentObject(),l=new Float32Array(o),u=0,c=0;u+2<o;u+=3,c++)l[u]=i.vertices[c].x+e.x,l[u+1]=i.vertices[c].y+e.y,l[u+2]=e.z;var h=new a.MeshLine;h.setGeometry(l);var d=new r.Mesh(h.geometry,this.material);d.renderOrder=this.iRenderOrder,s.add(d);var p=this.mapIdToThreeObject.get(t);p||(p=new Array,this.mapIdToThreeObject.set(t,p)),p.push(d)}}},u.prototype.addLineDisplay=function(t,e,n){var i=this.getParentObject(),o=new Float32Array(6);o[0]=e.x,o[1]=e.y,o[2]=0,o[3]=n.x,o[4]=n.y,o[5]=0;var s=new a.MeshLine;s.setGeometry(o);var l=new r.Mesh(s.geometry,this.material);l.renderOrder=this.iRenderOrder,i.add(l);var u=this.mapIdToThreeObject.get(t);u||(u=new Array,this.mapIdToThreeObject.set(t,u)),u.push(l)},u);function u(t){this.mapIdToThreeObject=new Map,this.canvasWidth=800,this.canvasHeight=500,this.mxDatabase=null,this.material=new a.MeshLineMaterial({useMap:!1,color:new r.Color(2641557),opacity:.8,resolution:new r.Vector2(800,500),sizeAttenuation:!1,lineWidth:10,transparent:!0,depthTest:!1}),this.iRenderOrder=s.MxData.iSelectRenderOrder,this.aryPrvCommandSelect=[],this.mxDatabase=t}n.MxDbEntitySelect=l},{"../MxFun":34,"../MxManager":36,"../Operate/McGiWorldDraw":50,three:19,"three.meshline":18}],74:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxDbGroupDictionary=n.MxDbGroup=void 0;var r=(i.prototype.name=function(){return this.sName},i.prototype.append=function(t){this.has(t)||this.setId.add(t)},i.prototype.clear=function(){this.setId=new Set},i.prototype.getAll=function(){var t=[];return this.setId.forEach(function(e){t.push(e)}),t},i.prototype.has=function(t){return this.setId.has(t)},i.prototype.delete=function(t){return this.setId.delete(t)},i);function i(t){this.setId=new Set,this.sName="",this.sName=t}n.MxDbGroup=r;var a=(o.prototype.getAt=function(t){return this.mapNameToGroup.get(t)},o.prototype.delete=function(t){return!!this.mapNameToGroup.has(t)&&this.mapNameToGroup.delete(t)},o.prototype.add=function(t){var e=this.mapNameToGroup.get(t);return e||(e=new r(t),this.mapNameToGroup.set(t,e),e)},o.prototype.dwgOut=function(t){var e=[];return this.mapNameToGroup.forEach(function(t,n){e.push(n)}),t.groups=e,t},o.prototype.dwgIn=function(t){var e=this;return t.groups.forEach(function(t){var n=new r(t);e.mapNameToGroup.set(t,n)}),!0},o.prototype.getEntityInGroup=function(t){var e=[];return this.mapNameToGroup.forEach(function(n){n.has(t)&&e.push(n)}),e},o.prototype.getEntityInGroupName=function(t){var e=[];return this.mapNameToGroup.forEach(function(n,r){n.has(t)&&e.push(r)}),e},o);function o(){this.mapNameToGroup=new Map}n.MxDbGroupDictionary=a},{}],75:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxDbLayerTableRecord=void 0;var r=t("three"),i=t("../MxManager"),a=(o.prototype.getGroup=function(){return this.group},o.prototype.getName=function(){return this.name},o.prototype.setName=function(t){this.name=t},o.prototype.setVisible=function(t){this.visible=t,this.group.visible=t},o.prototype.getVisible=function(){return this.visible},o.prototype.init=function(t,e){return this.name=t,this.group.renderOrder=i.MxData.iMxEntityRenderOrder,e.add(this.group),!0},o.prototype.dwgIn=function(t){return this.visible=t.visible,this.name=t.name,this.group.visible=this.visible,!0},o.prototype.dwgOut=function(t){return t.visible=this.visible,t.name=this.name,t},o);function o(){this.group=new r.Group,this.name="",this.visible=!0}n.MxDbLayerTableRecord=a},{"../MxManager":36,three:19}],76:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxDbTextureManager=void 0;var r=t("three"),i=(a.prototype.loadImage=function(t,e){var n=this.mapImageUrlToMaterialTexture.get(t);if(n)e(n);else{var i=this;(new r.TextureLoader).load(t,function(n){var a=new r.MeshLambertMaterial({map:n,transparent:!0,side:r.DoubleSide});a.map&&(a.map.needsUpdate=!0),i.mapImageUrlToMaterialTexture.set(t,a),e&&e(a)},void 0,function(t){console.log(t),e&&e(null)})}},a);function a(){this.mapImageUrlToMaterialTexture=new Map}n.MxDbTextureManager=i},{three:19}],77:[function(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0}),n.MxDrawObject3dThreeJS=n.MxDrawObject2dThreeJS=n.MxDrawMapBoxThreeJS=n.MxDrawThreeJS=n.MxThreeJSType=void 0;var a,o,s=t("three"),l=t("../Operate/MxJigCmdManager");(o=a=n.MxThreeJSType||(n.MxThreeJSType={}))[o.k2d=0]="k2d",o[o.k3d=1]="k3d",o[o.kMapBox=2]="kMapBox";var u=(c.prototype.addControlsChangeEvent=function(){var t=this.mxObject;this.mxObject.getOrbitControls().addEventListener("change",function(){l.MxJigCmdManager.OnThreeControlsChage(),t.callEvent("viewchange"),t.getMxDatabase().onViewChange();var e=t.getMxCAD();e&&e.getGrip().onControlsChage(),t.updateDisplay()})},c.prototype.updateDisplay=function(t){void 0===t&&(t=!1),this.mxObject.updateDisplayImplement(t)},c.prototype.addWindowResizeEvent=function(){},c);function c(t){this.mxObject=t}n.MxDrawThreeJS=u;var h,d=(i(p,h=u),p.prototype.onInitThreejs=function(){var t=this,e=new s.Camera,n=new s.Scene,r=this.mapBox.canvas,i=new s.DirectionalLight(16777215);i.position.set(0,-70,100).normalize(),n.add(i);var a=new s.DirectionalLight(16777215);a.position.set(0,70,100).normalize(),n.add(a);var o=new s.WebGLRenderer({canvas:r,context:this.mapBox.gl});o.autoClear=!1,this.mxObject2d.mapBoxInitThreeJSObject(n,e,o);var l=this;this.mapBox.render=function(e,n){var r=(new s.Matrix4).fromArray(n);r.multiply(t.matCADLogicalCoordToMap);var i=new s.Vector3(0,0,0);if(i.applyMatrix4(r),1<i.z){var a=1-i.z-1e-5;r=(new s.Matrix4).makeTranslation(0,0,a).multiply(r)}l.mxObject2d.mapBoxRender(e,r)}},p.prototype.alignCoordSys=function(t,e,n,r,i){var a=1;0<e.x-t.x&&0<r.x-n.x&&(a=(r.x-n.x)/(e.x-t.x));var o=new s.Matrix4;o.makeTranslation(-t.x,-t.y,-t.z);var l=(new s.Matrix4).scale(new s.Vector3(a,-a,a));return(new s.Matrix4).makeTranslation(n.x,n.y+(r.y-n.y),i).multiply(l).multiply(o)},p.prototype.updateCameraDisplayRange=function(t,e,n){var r=new s.Matrix4;r.makeTranslation(-this.mapBox.cadOrigin.x,-this.mapBox.cadOrigin.y,-this.mapBox.cadOrigin.z);var i=new s.Matrix4;i.makeTranslation(this.mapBox.mapOrigin.x,this.mapBox.mapOrigin.y,this.mapBox.elevation);var a=new s.Matrix4;a.makeScale(this.mapBox.mapLenInCADUnits,-this.mapBox.mapLenInCADUnits,this.mapBox.mapLenInCADUnits);var o=i.multiply(a).multiply(r),l=this.mxObject2d.getWorldToDoc();this.matCADLogicalCoordToMap=o.clone().multiply(l),this.mapBox.matCadToMap=o,this.mapBox.matMapToCad=new s.Matrix4,this.mapBox.matMapToCad.getInverse(o)},p.prototype.onInitScene=function(){},p.prototype.addControlsChangeEvent=function(){},p.prototype.addWindowResizeEvent=function(){},p.prototype.updateDisplay=function(t){},p.prototype.getType=function(){return a.kMapBox},p);function p(t,e){var n=h.call(this,e)||this;return n.matCADLogicalCoordToMap=new s.Matrix4,n.mapBox=t,n.mxObject2d=e,n}n.MxDrawMapBoxThreeJS=d;var f,m=(i(g,f=u),g.prototype.onInitThreejs=function(){this.proxyObj.onInitThreejs()},g.prototype.onInitScene=function(){this.proxyObj.onInitScene()},g.prototype.getType=function(){return a.k2d},g.prototype.updateCameraDisplayRange=function(t,e,n){this.proxyObj.updateCameraDisplayRangeImp(t,e,n)},g);function g(t){var e=f.call(this,t)||this;return e.proxyObj=t,e}n.MxDrawObject2dThreeJS=m;var v,y=(i(x,v=u),x.prototype.onInitThreejs=function(){this.proxyObj.onInitThreejs()},x.prototype.onInitScene=function(){this.proxyObj.onInitScene()},x.prototype.getType=function(){return a.k3d},x.prototype.updateCameraDisplayRange=function(t,e,n){},x);function x(t){var e=v.call(this,t)||this;return e.proxyObj=t,e}n.MxDrawObject3dThreeJS=y},{"../Operate/MxJigCmdManager":58,three:19}]},{},[60])}function mxcadassemblyinit(){var t,e=(t="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,"undefined"!=typeof __filename&&(t=t||__filename),function(e){var n,r,i;e=e||{},n||(n=void 0!==e?e:{}),n.ready=new Promise(function(t,e){r=t,i=e});var a,o,s,l,u,c,h=Object.assign({},n),d="object"==typeof window,p="function"==typeof importScripts,f="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,m="";f?(m=p?xxxxx("path").dirname(m)+"/":__dirname+"/",c=(()=>{u||(l=xxxxx("fs"),u=xxxxx("path"))}),a=function(t,e){var n=H(t);return n?e?n:n.toString():(c(),t=u.normalize(t),l.readFileSync(t,e?void 0:"utf8"))},s=(t=>((t=a(t,!0)).buffer||(t=new Uint8Array(t)),t)),o=((t,e,n)=>{var r=H(t);r&&e(r),c(),t=u.normalize(t),l.readFile(t,function(t,r){t?n(t):e(r.buffer)})}),1<process.argv.length&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),process.on("uncaughtException",function(t){throw t}),process.on("unhandledRejection",function(t){throw t}),n.inspect=function(){return"[Emscripten Module object]"}):(d||p)&&(p?m=self.location.href:"undefined"!=typeof document&&document.currentScript&&(m=document.currentScript.src),t&&(m=t),m=0!==m.indexOf("blob:")?m.substr(0,m.replace(/[?#].*/,"").lastIndexOf("/")+1):"",a=(t=>{try{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(null),e.responseText}catch(i){if(t=H(t)){e=[];for(var n=0;n<t.length;n++){var r=t[n];255<r&&(r&=255),e.push(String.fromCharCode(r))}return e.join("")}throw i}}),p&&(s=(t=>{try{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}catch(e){if(t=H(t))return t;throw e}})),o=((t,e,n)=>{var r=new XMLHttpRequest;r.open("GET",t,!0),r.responseType="arraybuffer",r.onload=(()=>{if(200==r.status||0==r.status&&r.response)e(r.response);else{var i=H(t);i?e(i.buffer):n()}}),r.onerror=n,r.send(null)})),n.print||console.log.bind(console);var g,v=n.printErr||console.warn.bind(console);Object.assign(n,h),h=null,n.wasmBinary&&(g=n.wasmBinary),n.noExitRuntime;var y=Error,x={};g=[],"object"!=typeof x&&k("no native wasm support detected");var b,w,_,M,S,T=!1,C=n.INITIAL_MEMORY||16777216;(b=n.wasmMemory?n.wasmMemory:new function(){this.buffer=new ArrayBuffer(C/65536*65536)})&&(w=b.buffer),C=w.byteLength;var E=w;w=E,n.HEAP8=_=new Int8Array(E),n.HEAP16=new Int16Array(E),n.HEAP32=S=new Int32Array(E),n.HEAPU8=M=new Uint8Array(E),n.HEAPU16=new Uint16Array(E),n.HEAPU32=new Uint32Array(E),n.HEAPF32=new Float32Array(E),n.HEAPF64=new Float64Array(E);var D,A=[],O=[],L=[];function P(){var t=n.preRun.shift();A.unshift(t)}var R=0,I=null;function k(t){throw n.onAbort&&n.onAbort(t),v(t="Aborted("+t+")"),T=!0,t=new y(t+". Build with -s ASSERTIONS=1 for more info."),i(t),t}n.preloadedImages={},n.preloadedAudios={};var B,F="data:application/octet-stream;base64,";if(!(B="mxcadassembly_min.wasm").startsWith(F)){var N=B;B=n.locateFile?n.locateFile(N,m):m+N}function j(){var t=B;try{if(t==B&&g)return new Uint8Array(g);var e=H(t);if(e)return e;if(s)return s(t);throw"both async and sync fetching of the wasm failed"}catch(t){k(t)}}function z(t){for(;0<t.length;){var e=t.shift();if("function"==typeof e)e(n);else{var r=e.U;"number"==typeof r?void 0===e.G?G(r)():G(r)(e.G):r(void 0===e.G?null:e.G)}}}var V=[];function G(t){var e=V[t];return e||(t>=V.length&&(V.length=t+1),V[t]=e=D.get(t)),e}var U="function"==typeof atob?atob:function(t){var e="",n=0;t=t.replace(/[^A-Za-z0-9\+\/=]/g,"");do{var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(t.charAt(n++)),i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(t.charAt(n++)),a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(t.charAt(n++)),o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(t.charAt(n++));r=r<<2|i>>4,i=(15&i)<<4|a>>2;var s=(3&a)<<6|o;e+=String.fromCharCode(r),64!==a&&(e+=String.fromCharCode(i)),64!==o&&(e+=String.fromCharCode(s))}while(n<t.length);return e};function H(t){if(t.startsWith(F)){if(t=t.slice(F.length),"boolean"==typeof f&&f){var e=Buffer.from(t,"base64");e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}else try{var n=U(t),r=new Uint8Array(n.length);for(t=0;t<n.length;++t)r[t]=n.charCodeAt(t);e=r}catch(t){throw Error("Converting base64 string to bytes failed.")}return e}}var W={f:function(t){return dt(t+16)+16},e:function(t,e,n){throw new function(t){this.C=t-16,this.P=function(t){S[this.C+4>>2]=t},this.M=function(t){S[this.C+8>>2]=t},this.N=function(){S[this.C>>2]=0},this.L=function(){_[this.C+12>>0]=0},this.O=function(){_[this.C+13>>0]=0},this.K=function(t,e){this.P(t),this.M(e),this.N(),this.L(),this.O()}}(t).K(e,n),t},c:function(){k("")},d:function(t,e,n){M.copyWithin(t,e,e+n)},b:function(){k("OOM")},a:b};!function(){function t(t){n.asm=t.exports,D=n.asm.A,O.unshift(n.asm.g),R--,n.monitorRunDependencies&&n.monitorRunDependencies(R),0==R&&I&&(t=I,I=null,t())}function e(e){t(e.instance)}function r(t){return function(){if(!g&&(d||p)){if("function"==typeof fetch&&!B.startsWith("file://"))return fetch(B,{credentials:"same-origin"}).then(function(t){if(!t.ok)throw"failed to load wasm binary file at '"+B+"'";return t.arrayBuffer()}).catch(function(){return j()});if(o)return new Promise(function(t,e){o(B,function(e){t(new Uint8Array(e))},e)})}return Promise.resolve().then(function(){return j()})}().then(function(){return{then:function(t){t({instance:new function(){this.exports=function(t){for(var e,n=new Uint8Array(123),r=25;r>=0;--r)n[48+r]=52+r,n[65+r]=r,n[97+r]=26+r;function i(t,e,r){for(var i,a,o=0,s=e,l=r.length,u=e+(3*l>>2)-("="==r[l-2])-("="==r[l-1]);o<l;o+=4)i=n[r.charCodeAt(o+1)],a=n[r.charCodeAt(o+2)],t[s++]=n[r.charCodeAt(o)]<<2|i>>4,s<u&&(t[s++]=i<<4|a>>2),s<u&&(t[s++]=a<<6|n[r.charCodeAt(o+3)])}return n[43]=62,n[47]=63,function(t){var n=t.a.buffer,r=new Int8Array(n),a=new Int16Array(n),o=new Int32Array(n),s=new Uint8Array(n),l=new Uint32Array(n),u=new Float64Array(n),c=Math.imul,h=t.abort,d=t.b,p=t.c,f=t.d,m=t.e,g=t.f,v=5245008;function y(t){var e,n=0,r=0,i=0,a=0,u=0,c=0,h=0,d=0,p=0,f=0;v=e=v-16|0;t:{e:{n:{r:{i:{a:{o:{s:{l:{u:{c:{if((t|=0)>>>0<=244){if(3&(n=(a=o[404])>>>(r=(c=t>>>0<11?16:t+11&-8)>>>3|0)|0)){t=(u=o[1664+(n=(i=r+(1&(-1^n))|0)<<3)>>2])+8|0,(0|(r=o[u+8>>2]))!=(0|(n=n+1656|0))?(o[r+12>>2]=n,o[n+8>>2]=r):o[404]=A(i)&a,n=i<<3,o[u+4>>2]=3|n,o[4+(n=n+u|0)>>2]=1|o[n+4>>2];break t}if((f=o[406])>>>0>=c>>>0)break c;if(n){r=t=(n=(0-(t=(0-(t=2<<r)|t)&n<<r)&t)-1|0)>>>12&16,r|=t=(n=n>>>t|0)>>>5&8,r|=t=(n=n>>>t|0)>>>2&4,p=o[1664+(t=(r=((r|=t=(n=n>>>t|0)>>>1&2)|(t=(n=n>>>t|0)>>>1&1))+(n>>>t|0)|0)<<3)>>2],(0|(n=o[p+8>>2]))!=(0|(t=t+1656|0))?(o[n+12>>2]=t,o[t+8>>2]=n):(a=A(r)&a,o[404]=a),t=p+8|0,o[p+4>>2]=3|c,u=(n=r<<3)-c|0,o[4+(i=c+p|0)>>2]=1|u,o[n+p>>2]=u,f&&(r=1656+((n=f>>>3|0)<<3)|0,p=o[409],(n=1<<n)&a?n=o[r+8>>2]:(o[404]=n|a,n=r),o[r+8>>2]=p,o[n+12>>2]=p,o[p+12>>2]=r,o[p+8>>2]=n),o[409]=i,o[406]=u;break t}if(!(h=o[405]))break c;for(r=t=(n=(0-h&h)-1|0)>>>12&16,r|=t=(n=n>>>t|0)>>>5&8,r|=t=(n=n>>>t|0)>>>2&4,n=o[1920+(((r|=t=(n=n>>>t|0)>>>1&2)|(t=(n=n>>>t|0)>>>1&1))+(n>>>t|0)<<2)>>2],i=(-8&o[n+4>>2])-c|0,r=n;(t=o[r+16>>2])||(t=o[r+20>>2]);)i=(u=(r=(-8&o[t+4>>2])-c|0)>>>0<i>>>0)?r:i,n=u?t:n,r=t;if(d=o[n+24>>2],(0|(u=o[n+12>>2]))!=(0|n)){t=o[n+8>>2],o[t+12>>2]=u,o[u+8>>2]=t;break e}if(!(t=o[(r=n+20|0)>>2])){if(!(t=o[n+16>>2]))break u;r=n+16|0}for(;p=r,u=t,(t=o[(r=t+20|0)>>2])||(r=u+16|0,t=o[u+16>>2]););o[p>>2]=0;break e}if(c=-1,!(t>>>0>4294967231)&&(c=-8&(t=t+11|0),d=o[405])){i=0-c|0,a=0,c>>>0<256||(a=31,c>>>0>16777215||(t=t>>>8|0,t<<=p=t+1048320>>>16&8,a=28+((t=((t<<=r=t+520192>>>16&4)<<(n=t+245760>>>16&2)>>>15|0)-(n|r|p)|0)<<1|c>>>t+21&1)|0));h:{d:{if(r=o[1920+(a<<2)>>2])for(t=0,n=c<<(31==(0|a)?0:25-(a>>>1|0)|0);;){if(!((p=(h=-8&o[r+4>>2])-c|0)>>>0>=i>>>0)&&(i=p,u=r,(0|c)==(0|h))){i=0,t=r;break d}if(p=o[r+20>>2],r=o[16+((n>>>29&4)+r|0)>>2],t=p?(0|p)==(0|r)?t:p:t,n<<=1,!r)break}else t=0;if(!(t|u)){if(u=0,!(t=(0-(t=2<<a)|t)&d))break c;r=t=(n=(t&0-t)-1|0)>>>12&16,r|=t=(n=n>>>t|0)>>>5&8,r|=t=(n=n>>>t|0)>>>2&4,t=o[1920+(((r|=t=(n=n>>>t|0)>>>1&2)|(t=(n=n>>>t|0)>>>1&1))+(n>>>t|0)<<2)>>2]}if(!t)break h}for(;i=(r=(n=(-8&o[t+4>>2])-c|0)>>>0<i>>>0)?n:i,u=r?t:u,t=(n=o[t+16>>2])||o[t+20>>2];);}if(!(!u|o[406]-c>>>0<=i>>>0)){if(a=o[u+24>>2],(0|u)!=(0|(n=o[u+12>>2]))){t=o[u+8>>2],o[t+12>>2]=n,o[n+8>>2]=t;break n}if(!(t=o[(r=u+20|0)>>2])){if(!(t=o[u+16>>2]))break l;r=u+16|0}for(;p=r,n=t,(t=o[(r=t+20|0)>>2])||(r=n+16|0,t=o[n+16>>2]););o[p>>2]=0;break n}}}if((r=o[406])>>>0>=c>>>0){i=o[409],(n=r-c|0)>>>0>=16?(o[406]=n,t=i+c|0,o[409]=t,o[t+4>>2]=1|n,o[r+i>>2]=n,o[i+4>>2]=3|c):(o[409]=0,o[406]=0,o[i+4>>2]=3|r,o[4+(t=r+i|0)>>2]=1|o[t+4>>2]),t=i+8|0;break t}if((d=o[407])>>>0>c>>>0){n=d-c|0,o[407]=n,t=(r=o[410])+c|0,o[410]=t,o[t+4>>2]=1|n,o[r+4>>2]=3|c,t=r+8|0;break t}if(t=0,h=c+47|0,o[522]?r=o[524]:(o[525]=-1,o[526]=-1,o[523]=4096,o[524]=4096,o[522]=e+12&-16^1431655768,o[527]=0,o[515]=0,r=4096),(r=(p=h+r|0)&(u=0-r|0))>>>0<=c>>>0)break t;if((i=o[514])&&(a=(n=o[512])+r|0)>>>0>i>>>0|n>>>0>=a>>>0)break t;if(4&s[2060])break a;c:{h:{if(i=o[410])for(t=2064;;){if((n=o[t>>2])>>>0<=i>>>0&i>>>0<n+o[t+4>>2]>>>0)break h;if(!(t=o[t+8>>2]))break}if(-1==(0|(n=C(0))))break o;if(a=r,(t=(i=o[523])-1|0)&n&&(a=(r-n|0)+(t+n&0-i)|0),a>>>0<=c>>>0|a>>>0>2147483646)break o;if((i=o[514])&&i>>>0<(u=(t=o[512])+a|0)>>>0|t>>>0>=u>>>0)break o;if((0|n)!=(0|(t=C(a))))break c;break i}if((a=u&p-d)>>>0>2147483646)break o;if((0|(n=C(a)))==(o[t>>2]+o[t+4>>2]|0))break s;t=n}if(!(-1==(0|t)|c+48>>>0<=a>>>0)){if((n=(n=o[524])+(h-a|0)&0-n)>>>0>2147483646){n=t;break i}if(-1!=(0|C(n))){a=n+a|0,n=t;break i}C(0-a|0);break o}if(n=t,-1!=(0|t))break i;break o}u=0;break e}n=0;break n}if(-1!=(0|n))break i}o[515]=4|o[515]}if(r>>>0>2147483646)break r;if(-1==(0|(n=C(r)))|-1==(0|(t=C(0)))|t>>>0<=n>>>0)break r;if((a=t-n|0)>>>0<=c+40>>>0)break r}t=o[512]+a|0,o[512]=t,t>>>0>l[513]&&(o[513]=t);i:{a:{o:{if(h=o[410]){for(t=2064;;){if(((i=o[t>>2])+(r=o[t+4>>2])|0)==(0|n))break o;if(!(t=o[t+8>>2]))break}break a}for((t=o[408])>>>0<=n>>>0&&t||(o[408]=n),t=0,o[517]=a,o[516]=n,o[412]=-1,o[413]=o[522],o[519]=0;r=1656+(i=t<<3)|0,o[i+1664>>2]=r,o[i+1668>>2]=r,32!=(0|(t=t+1|0)););r=(i=a-40|0)-(t=n+8&7?-8-n&7:0)|0,o[407]=r,t=t+n|0,o[410]=t,o[t+4>>2]=1|r,o[4+(n+i|0)>>2]=40,o[411]=o[526];break i}if(!(8&s[t+12|0]|i>>>0>h>>>0|n>>>0<=h>>>0)){o[t+4>>2]=r+a,r=(t=h+8&7?-8-h&7:0)+h|0,o[410]=r,t=(n=o[407]+a|0)-t|0,o[407]=t,o[r+4>>2]=1|t,o[4+(n+h|0)>>2]=40,o[411]=o[526];break i}}l[408]>n>>>0&&(o[408]=n),r=n+a|0,t=2064;a:{o:{s:{l:{u:{c:{for(;;){if((0|r)!=o[t>>2]){if(t=o[t+8>>2])continue;break c}break}if(!(8&s[t+12|0]))break u}for(t=2064;;){if((r=o[t>>2])>>>0<=h>>>0&&(u=r+o[t+4>>2]|0)>>>0>h>>>0)break l;t=o[t+8>>2]}}if(o[t>>2]=n,o[t+4>>2]=o[t+4>>2]+a,o[4+(p=(n+8&7?-8-n&7:0)+n|0)>>2]=3|c,c=(a=r+(r+8&7?-8-r&7:0)|0)-(d=c+p|0)|0,(0|a)==(0|h)){o[410]=d,t=o[407]+c|0,o[407]=t,o[d+4>>2]=1|t;break o}if(o[409]==(0|a)){o[409]=d,t=o[406]+c|0,o[406]=t,o[d+4>>2]=1|t,o[t+d>>2]=t;break o}if(1==(3&(t=o[a+4>>2]))){u=-8&t;u:if(t>>>0<=255){if(r=o[a+8>>2],t=t>>>3|0,(0|(n=o[a+12>>2]))==(0|r)){o[404]=o[404]&A(t);break u}o[r+12>>2]=n,o[n+8>>2]=r}else{if(h=o[a+24>>2],(0|a)==(0|(n=o[a+12>>2])))if((i=o[(t=a+20|0)>>2])||(i=o[(t=a+16|0)>>2])){for(;r=t,(i=o[(t=(n=i)+20|0)>>2])||(t=n+16|0,i=o[n+16>>2]););o[r>>2]=0}else n=0;else t=o[a+8>>2],o[t+12>>2]=n,o[n+8>>2]=t;if(h){r=o[a+28>>2];c:{if(o[(t=1920+(r<<2)|0)>>2]==(0|a)){if(o[t>>2]=n,n)break c;o[405]=o[405]&A(r);break u}if(o[h+(o[h+16>>2]==(0|a)?16:20)>>2]=n,!n)break u}o[n+24>>2]=h,(t=o[a+16>>2])&&(o[n+16>>2]=t,o[t+24>>2]=n),(t=o[a+20>>2])&&(o[n+20>>2]=t,o[t+24>>2]=n)}}c=u+c|0,a=a+u|0}if(o[a+4>>2]=-2&o[a+4>>2],o[d+4>>2]=1|c,o[c+d>>2]=c,c>>>0<=255){n=1656+((t=c>>>3|0)<<3)|0,(r=o[404])&(t=1<<t)?t=o[n+8>>2]:(o[404]=t|r,t=n),o[n+8>>2]=d,o[t+12>>2]=d,o[d+12>>2]=n,o[d+8>>2]=t;break o}if(t=31,c>>>0<=16777215&&(t=c>>>8|0,t<<=i=t+1048320>>>16&8,t=28+((t=((t<<=r=t+520192>>>16&4)<<(n=t+245760>>>16&2)>>>15|0)-(n|r|i)|0)<<1|c>>>t+21&1)|0),o[d+28>>2]=t,o[d+16>>2]=0,o[d+20>>2]=0,i=1920+(t<<2)|0,(r=o[405])&(n=1<<t)){for(t=c<<(31==(0|t)?0:25-(t>>>1|0)|0),n=o[i>>2];;){if(r=n,(-8&o[n+4>>2])==(0|c))break s;if(n=t>>>29|0,t<<=1,!(n=o[16+(i=r+(4&n)|0)>>2]))break}o[i+16>>2]=d,o[d+24>>2]=r}else o[405]=n|r,o[i>>2]=d,o[d+24>>2]=i;o[d+12>>2]=d,o[d+8>>2]=d;break o}for(r=(i=a-40|0)-(t=n+8&7?-8-n&7:0)|0,o[407]=r,t=t+n|0,o[410]=t,o[t+4>>2]=1|r,o[4+(n+i|0)>>2]=40,o[411]=o[526],o[(r=(t=(u+(u-39&7?39-u&7:0)|0)-47|0)>>>0<h+16>>>0?h:t)+4>>2]=27,t=o[519],o[r+16>>2]=o[518],o[r+20>>2]=t,t=o[517],o[r+8>>2]=o[516],o[r+12>>2]=t,o[518]=r+8,o[517]=a,o[516]=n,o[519]=0,t=r+24|0;o[t+4>>2]=7,n=t+8|0,t=t+4|0,n>>>0<u>>>0;);if((0|r)==(0|h))break i;if(o[r+4>>2]=-2&o[r+4>>2],u=r-h|0,o[h+4>>2]=1|u,o[r>>2]=u,u>>>0<=255){n=1656+((t=u>>>3|0)<<3)|0,(r=o[404])&(t=1<<t)?t=o[n+8>>2]:(o[404]=t|r,t=n),o[n+8>>2]=h,o[t+12>>2]=h,o[h+12>>2]=n,o[h+8>>2]=t;break i}if(t=31,o[h+16>>2]=0,o[h+20>>2]=0,u>>>0<=16777215&&(t=u>>>8|0,t<<=i=t+1048320>>>16&8,t=28+((t=((t<<=r=t+520192>>>16&4)<<(n=t+245760>>>16&2)>>>15|0)-(n|r|i)|0)<<1|u>>>t+21&1)|0),o[h+28>>2]=t,i=1920+(t<<2)|0,(r=o[405])&(n=1<<t)){for(t=u<<(31==(0|t)?0:25-(t>>>1|0)|0),n=o[i>>2];;){if(r=n,(0|u)==(-8&o[n+4>>2]))break a;if(n=t>>>29|0,t<<=1,!(n=o[16+(i=r+(4&n)|0)>>2]))break}o[i+16>>2]=h,o[h+24>>2]=r}else o[405]=n|r,o[i>>2]=h,o[h+24>>2]=i;o[h+12>>2]=h,o[h+8>>2]=h;break i}t=o[r+8>>2],o[t+12>>2]=d,o[r+8>>2]=d,o[d+24>>2]=0,o[d+12>>2]=r,o[d+8>>2]=t}t=p+8|0;break t}t=o[r+8>>2],o[t+12>>2]=h,o[r+8>>2]=h,o[h+24>>2]=0,o[h+12>>2]=r,o[h+8>>2]=t}if(!((t=o[407])>>>0<=c>>>0)){n=t-c|0,o[407]=n,t=(r=o[410])+c|0,o[410]=t,o[t+4>>2]=1|n,o[r+4>>2]=3|c,t=r+8|0;break t}}o[403]=48,t=0;break t}n:if(a){r=o[u+28>>2];r:{if(o[(t=1920+(r<<2)|0)>>2]==(0|u)){if(o[t>>2]=n,n)break r;d=A(r)&d,o[405]=d;break n}if(o[a+(o[a+16>>2]==(0|u)?16:20)>>2]=n,!n)break n}o[n+24>>2]=a,(t=o[u+16>>2])&&(o[n+16>>2]=t,o[t+24>>2]=n),(t=o[u+20>>2])&&(o[n+20>>2]=t,o[t+24>>2]=n)}n:if(i>>>0<=15)t=i+c|0,o[u+4>>2]=3|t,o[4+(t=t+u|0)>>2]=1|o[t+4>>2];else if(o[u+4>>2]=3|c,o[4+(a=u+c|0)>>2]=1|i,o[a+i>>2]=i,i>>>0<=255)n=1656+((t=i>>>3|0)<<3)|0,(r=o[404])&(t=1<<t)?t=o[n+8>>2]:(o[404]=t|r,t=n),o[n+8>>2]=a,o[t+12>>2]=a,o[a+12>>2]=n,o[a+8>>2]=t;else{t=31,i>>>0<=16777215&&(t=i>>>8|0,t<<=p=t+1048320>>>16&8,t=28+((t=((t<<=r=t+520192>>>16&4)<<(n=t+245760>>>16&2)>>>15|0)-(n|r|p)|0)<<1|i>>>t+21&1)|0),o[a+28>>2]=t,o[a+16>>2]=0,o[a+20>>2]=0,n=1920+(t<<2)|0;r:{if((r=1<<t)&d){for(t=i<<(31==(0|t)?0:25-(t>>>1|0)|0),r=o[n>>2];;){if((-8&o[(n=r)+4>>2])==(0|i))break r;if(r=t>>>29|0,t<<=1,!(r=o[16+(p=(4&r)+n|0)>>2]))break}o[p+16>>2]=a}else o[405]=r|d,o[n>>2]=a;o[a+24>>2]=n,o[a+12>>2]=a,o[a+8>>2]=a;break n}t=o[n+8>>2],o[t+12>>2]=a,o[n+8>>2]=a,o[a+24>>2]=0,o[a+12>>2]=n,o[a+8>>2]=t}t=u+8|0;break t}e:if(d){r=o[n+28>>2];n:{if(o[(t=1920+(r<<2)|0)>>2]==(0|n)){if(o[t>>2]=u,u)break n;o[405]=A(r)&h;break e}if(o[d+(o[d+16>>2]==(0|n)?16:20)>>2]=u,!u)break e}o[u+24>>2]=d,(t=o[n+16>>2])&&(o[u+16>>2]=t,o[t+24>>2]=u),(t=o[n+20>>2])&&(o[u+20>>2]=t,o[t+24>>2]=u)}i>>>0<=15?(t=i+c|0,o[n+4>>2]=3|t,o[4+(t=t+n|0)>>2]=1|o[t+4>>2]):(o[n+4>>2]=3|c,o[4+(u=n+c|0)>>2]=1|i,o[i+u>>2]=i,f&&(r=1656+((t=f>>>3|0)<<3)|0,p=o[409],(t=1<<t)&a?t=o[r+8>>2]:(o[404]=t|a,t=r),o[r+8>>2]=p,o[t+12>>2]=p,o[p+12>>2]=r,o[p+8>>2]=t),o[409]=u,o[406]=i),t=n+8|0}return v=e+16|0,0|t}function x(t){var e=0,n=0,r=0,i=0,a=0,s=0,u=0;t:if(t){a=(r=t-8|0)+(t=-8&(e=o[t-4>>2]))|0;e:if(!(1&e)){if(!(3&e))break t;if((r=r-(e=o[r>>2])|0)>>>0<l[408])break t;if(t=t+e|0,o[409]==(0|r)){if(3==(3&(e=o[a+4>>2])))return o[406]=t,o[a+4>>2]=-2&e,o[r+4>>2]=1|t,void(o[t+r>>2]=t)}else{if(e>>>0<=255){if(i=o[r+8>>2],e=e>>>3|0,(0|(n=o[r+12>>2]))==(0|i)){o[404]=o[404]&A(e);break e}o[i+12>>2]=n,o[n+8>>2]=i;break e}if(u=o[r+24>>2],(0|r)==(0|(e=o[r+12>>2])))if((n=o[(i=r+20|0)>>2])||(n=o[(i=r+16|0)>>2])){for(;s=i,(n=o[(i=(e=n)+20|0)>>2])||(i=e+16|0,n=o[e+16>>2]););o[s>>2]=0}else e=0;else n=o[r+8>>2],o[n+12>>2]=e,o[e+8>>2]=n;if(!u)break e;i=o[r+28>>2];n:{if(o[(n=1920+(i<<2)|0)>>2]==(0|r)){if(o[n>>2]=e,e)break n;o[405]=o[405]&A(i);break e}if(o[u+(o[u+16>>2]==(0|r)?16:20)>>2]=e,!e)break e}if(o[e+24>>2]=u,(n=o[r+16>>2])&&(o[e+16>>2]=n,o[n+24>>2]=e),!(n=o[r+20>>2]))break e;o[e+20>>2]=n,o[n+24>>2]=e}}if(!(r>>>0>=a>>>0)&&1&(e=o[a+4>>2])){e:{if(!(2&e)){if(o[410]==(0|a)){if(o[410]=r,t=o[407]+t|0,o[407]=t,o[r+4>>2]=1|t,o[409]!=(0|r))break t;return o[406]=0,void(o[409]=0)}if(o[409]==(0|a))return o[409]=r,t=o[406]+t|0,o[406]=t,o[r+4>>2]=1|t,void(o[t+r>>2]=t);t=(-8&e)+t|0;n:if(e>>>0<=255){if(i=o[a+8>>2],e=e>>>3|0,(0|(n=o[a+12>>2]))==(0|i)){o[404]=o[404]&A(e);break n}o[i+12>>2]=n,o[n+8>>2]=i}else{if(u=o[a+24>>2],(0|a)==(0|(e=o[a+12>>2])))if((n=o[(i=a+20|0)>>2])||(n=o[(i=a+16|0)>>2])){for(;s=i,(n=o[(i=(e=n)+20|0)>>2])||(i=e+16|0,n=o[e+16>>2]););o[s>>2]=0}else e=0;else n=o[a+8>>2],o[n+12>>2]=e,o[e+8>>2]=n;if(u){i=o[a+28>>2];r:{if(o[(n=1920+(i<<2)|0)>>2]==(0|a)){if(o[n>>2]=e,e)break r;o[405]=o[405]&A(i);break n}if(o[u+(o[u+16>>2]==(0|a)?16:20)>>2]=e,!e)break n}o[e+24>>2]=u,(n=o[a+16>>2])&&(o[e+16>>2]=n,o[n+24>>2]=e),(n=o[a+20>>2])&&(o[e+20>>2]=n,o[n+24>>2]=e)}}if(o[r+4>>2]=1|t,o[t+r>>2]=t,o[409]!=(0|r))break e;return void(o[406]=t)}o[a+4>>2]=-2&e,o[r+4>>2]=1|t,o[t+r>>2]=t}if(t>>>0<=255)return e=1656+((t=t>>>3|0)<<3)|0,(n=o[404])&(t=1<<t)?t=o[e+8>>2]:(o[404]=t|n,t=e),o[e+8>>2]=r,o[t+12>>2]=r,o[r+12>>2]=e,void(o[r+8>>2]=t);i=31,o[r+16>>2]=0,o[r+20>>2]=0,t>>>0<=16777215&&(e=t>>>8|0,e<<=s=e+1048320>>>16&8,i=28+((e=((e<<=i=e+520192>>>16&4)<<(n=e+245760>>>16&2)>>>15|0)-(n|i|s)|0)<<1|t>>>e+21&1)|0),o[r+28>>2]=i,s=1920+(i<<2)|0;e:{n:{if((n=o[405])&(e=1<<i)){for(i=t<<(31==(0|i)?0:25-(i>>>1|0)|0),e=o[s>>2];;){if(n=e,(-8&o[e+4>>2])==(0|t))break n;if(e=i>>>29|0,i<<=1,!(e=o[16+(s=n+(4&e)|0)>>2]))break}o[s+16>>2]=r,o[r+24>>2]=n}else o[405]=e|n,o[s>>2]=r,o[r+24>>2]=s;o[r+12>>2]=r,o[r+8>>2]=r;break e}t=o[n+8>>2],o[t+12>>2]=r,o[n+8>>2]=r,o[r+24>>2]=0,o[r+12>>2]=n,o[r+8>>2]=t}t=o[412]-1|0,o[412]=t||-1}}}function b(t,e,n){var i,a=0,l=0;if(n>>>0>=512)return f(0|t,0|e,0|n),t;i=t+n|0;t:if(3&(t^e))if(i>>>0<4)n=t;else if((a=i-4|0)>>>0<t>>>0)n=t;else for(n=t;r[0|n]=s[0|e],r[n+1|0]=s[e+1|0],r[n+2|0]=s[e+2|0],r[n+3|0]=s[e+3|0],e=e+4|0,a>>>0>=(n=n+4|0)>>>0;);else{e:if(3&t)if(n)for(n=t;;){if(r[0|n]=s[0|e],e=e+1|0,!(3&(n=n+1|0)))break e;if(!(n>>>0<i>>>0))break}else n=t;else n=t;if(!((a=-4&i)>>>0<64||(l=a+-64|0)>>>0<n>>>0))for(;o[n>>2]=o[e>>2],o[n+4>>2]=o[e+4>>2],o[n+8>>2]=o[e+8>>2],o[n+12>>2]=o[e+12>>2],o[n+16>>2]=o[e+16>>2],o[n+20>>2]=o[e+20>>2],o[n+24>>2]=o[e+24>>2],o[n+28>>2]=o[e+28>>2],o[n+32>>2]=o[e+32>>2],o[n+36>>2]=o[e+36>>2],o[n+40>>2]=o[e+40>>2],o[n+44>>2]=o[e+44>>2],o[n+48>>2]=o[e+48>>2],o[n+52>>2]=o[e+52>>2],o[n+56>>2]=o[e+56>>2],o[n+60>>2]=o[e+60>>2],e=e- -64|0,l>>>0>=(n=n- -64|0)>>>0;);if(n>>>0>=a>>>0)break t;for(;o[n>>2]=o[e>>2],e=e+4|0,a>>>0>(n=n+4|0)>>>0;);}if(n>>>0<i>>>0)for(;r[0|n]=s[0|e],e=e+1|0,(0|i)!=(0|(n=n+1|0)););return t}function w(t,e){var n=0;if(e&&(r[0|t]=0,r[(n=t+e|0)-1|0]=0,!(e>>>0<3||(r[t+2|0]=0,r[t+1|0]=0,r[n-3|0]=0,r[n-2|0]=0,e>>>0<7||(r[t+3|0]=0,r[n-4|0]=0,e>>>0<9||(o[(t=(n=0-t&3)+t|0)>>2]=0,o[(e=(n=e-n&-4)+t|0)-4>>2]=0,n>>>0<9||(o[t+8>>2]=0,o[t+4>>2]=0,o[e-8>>2]=0,o[e-12>>2]=0,n>>>0<25||(o[t+24>>2]=0,o[t+20>>2]=0,o[t+16>>2]=0,o[t+12>>2]=0,o[e-16>>2]=0,o[e-20>>2]=0,o[e-24>>2]=0,o[e-28>>2]=0,(e=(e=n)-(n=4&t|24)|0)>>>0<32))))))))for(t=t+n|0;o[t+24>>2]=0,o[t+28>>2]=0,o[t+16>>2]=0,o[t+20>>2]=0,o[t+8>>2]=0,o[t+12>>2]=0,o[t>>2]=0,o[t+4>>2]=0,t=t+32|0,(e=e-32|0)>>>0>31;);}function _(t){var e,n=0,r=0,i=0;e=0|g(8),o[e>>2]=1348,o[e>>2]=1392;t:{e:{if(3&(n=t))for(;;){if(!s[0|n])break e;if(!(3&(n=n+1|0)))break}for(;r=n,n=n+4|0,!((-1^(i=o[r>>2]))&i-16843009&-2139062144););if(n=r-t|0,!(255&i))break t;for(;i=s[r+1|0],r=n=r+1|0,i;);}n=n-t|0}r=E(n+13|0),o[r+8>>2]=0,o[r+4>>2]=n,o[r>>2]=n,o[e+4>>2]=b(r+12|0,t,n+1|0),o[e>>2]=1440,m(0|e,1472,1),h()}function M(t,e,n,i){r[t+53|0]=1;t:if(o[t+4>>2]==(0|n)){r[t+52|0]=1;e:{if(!(n=o[t+16>>2])){if(o[t+36>>2]=1,o[t+24>>2]=i,o[t+16>>2]=e,1!=(0|i))break t;if(1==o[t+48>>2])break e;break t}if((0|e)==(0|n)){if(2==(0|(n=o[t+24>>2]))&&(o[t+24>>2]=i,n=i),1!=o[t+48>>2])break t;if(1==(0|n))break e;break t}o[t+36>>2]=o[t+36>>2]+1}r[t+54|0]=1}}function S(t,e,n){var r=0;if(!n)return o[t+4>>2]==o[e+4>>2];if((0|t)==(0|e))return 1;r=o[t+4>>2],t=s[0|r],n=o[e+4>>2];t:if(!(!t|(0|(e=s[0|n]))!=(0|t)))for(;;){if(e=s[n+1|0],!(t=s[r+1|0]))break t;if(n=n+1|0,r=r+1|0,(0|t)!=(0|e))break}return(0|t)==(0|e)}function T(t,e,n){var i;if(!(i=o[t+16>>2]))return o[t+36>>2]=1,o[t+24>>2]=n,void(o[t+16>>2]=e);t:{if((0|e)==(0|i)){if(2!=o[t+24>>2])break t;return void(o[t+24>>2]=n)}r[t+54|0]=1,o[t+24>>2]=2,o[t+36>>2]=o[t+36>>2]+1}}function C(t){var e,r;return(t=(e=o[377])+(r=t+3&-4)|0)>>>0<=e>>>0&&r||t>>>0>(n.byteLength/65536|0)<<16>>>0&&!(0|d(0|t))?(o[403]=48,-1):(o[377]=t,e)}function E(t){var e=0;t=t||1;t:{for(;;){if(e=y(t))break t;if(!(e=o[528]))break;k[0|e]()}p(),h()}return e}function D(t){var e,n;return o[(t|=0)>>2]=1392,e=o[t+4>>2]-12|0,n=o[e+8>>2]-1|0,o[e+8>>2]=n,(0|n)<0&&x(e),0|t}function A(t){var e;return(-1>>>(e=31&t)&-2)<<e|(-1<<(t=0-t&31)&-2)>>>t}function O(t){(t|=0)&&x(t)}function L(t){D(t|=0),x(t)}function P(t){return 0|t}function R(t){x(t|=0)}function I(t){}i(e=s,1024,"dmVjdG9yAHN0ZDo6ZXhjZXB0aW9uAGFsbG9jYXRvcjxUPjo6YWxsb2NhdGUoc2l6ZV90IG4pICduJyBleGNlZWRzIG1heGltdW0gc3VwcG9ydGVkIHNpemUATjEwX19jeHhhYml2MTE2X19zaGltX3R5cGVfaW5mb0UAAOgEAABaBAAA3AUAAE4xMF9fY3h4YWJpdjExN19fY2xhc3NfdHlwZV9pbmZvRQAAAOgEAACIBAAAfAQAAAAAAACsBAAAAgAAAAMAAAAEAAAABQAAAAYAAAAHAAAACAAAAAkAAAAAAAAAMAUAAAIAAAAKAAAABAAAAAUAAAAGAAAACwAAAAwAAAANAAAATjEwX19jeHhhYml2MTIwX19zaV9jbGFzc190eXBlX2luZm9FAAAAAOgEAAAIBQAArAQAAAAAAABgBQAADgAAAA8AAAAQAAAAU3Q5ZXhjZXB0aW9uAAAAAMAEAABQBQAAAAAAAIwFAAABAAAAEQAAABIAAABTdDExbG9naWNfZXJyb3IA6AQAAHwFAABgBQAAAAAAAMAFAAABAAAAEwAAABIAAABTdDEybGVuZ3RoX2Vycm9yAAAAAOgEAACsBQAAjAUAAFN0OXR5cGVfaW5mbwAAAADABAAAzAU="),i(e,1508,"UAhQ");var k=function(t){return t.grow=function(t){var e=this.length;return this.length=this.length+t,e},t.set=function(t,e){this[t]=e},t.get=function(t){return this[t]},t}([null,D,P,R,I,I,function(t,e,n){n|=0;var r,i=0,a=0,s=0,l=0;if(v=r=v+-64|0,i=1,!S(t|=0,e|=0,0)&&(i=0,e)){v=i=v+-64|0,a=o[e>>2],s=o[a-4>>2],l=o[a-8>>2],o[i+20>>2]=0,o[i+16>>2]=1148,o[i+12>>2]=e,o[i+8>>2]=1196,a=0,w(i+24|0,39),e=e+l|0;t:if(S(s,1196,0))o[i+56>>2]=1,k[o[o[s>>2]+20>>2]](s,i+8|0,e,e,1,0),a=1==o[i+32>>2]?e:0;else{k[o[o[s>>2]+24>>2]](s,i+8|0,e,1,0);e:switch(o[i+44>>2]){case 0:a=1==o[i+48>>2]&&1==o[i+36>>2]&&1==o[i+40>>2]?o[i+28>>2]:0;break t;case 1:break e;default:break t}1!=o[i+32>>2]&&o[i+48>>2]|1!=o[i+36>>2]|1!=o[i+40>>2]||(a=o[i+24>>2])}v=i- -64|0,i=0,a&&(w(4|(e=r+8|0),52),o[r+56>>2]=1,o[r+20>>2]=-1,o[r+16>>2]=t,o[r+8>>2]=a,k[o[o[a>>2]+28>>2]](a,e,o[n>>2],1),1==(0|(t=o[r+32>>2]))&&(o[n>>2]=o[r+24>>2]),i=1==(0|t))}return v=r- -64|0,0|i},function(t,e,n,r,i,a){n|=0,r|=0,i|=0,a|=0,S(t|=0,o[8+(e|=0)>>2],a)&&M(e,n,r,i)},function(t,e,n,i,a){if(n|=0,i|=0,a|=0,S(t|=0,o[8+(e|=0)>>2],a))1==o[e+28>>2]|o[e+4>>2]!=(0|n)||(o[e+28>>2]=i);else t:if(S(t,o[e>>2],a)){if(!(o[e+16>>2]!=(0|n)&o[e+20>>2]!=(0|n))){if(1!=(0|i))break t;return void(o[e+32>>2]=1)}o[e+20>>2]=n,o[e+32>>2]=i,o[e+40>>2]=o[e+40>>2]+1,1!=o[e+36>>2]|2!=o[e+24>>2]||(r[e+54|0]=1),o[e+44>>2]=4}},function(t,e,n,r){n|=0,r|=0,S(t|=0,o[8+(e|=0)>>2],0)&&T(e,n,r)},R,function(t,e,n,r,i,a){n|=0,r|=0,i|=0,a|=0,S(t|=0,o[8+(e|=0)>>2],a)?M(e,n,r,i):(t=o[t+8>>2],k[o[o[t>>2]+20>>2]](t,e,n,r,i,a))},function(t,e,n,i,l){if(n|=0,i|=0,l|=0,S(t|=0,o[8+(e|=0)>>2],l))1==o[e+28>>2]|o[e+4>>2]!=(0|n)||(o[e+28>>2]=i);else t:{if(S(t,o[e>>2],l)){if(!(o[e+16>>2]!=(0|n)&o[e+20>>2]!=(0|n))){if(1!=(0|i))break t;return void(o[e+32>>2]=1)}o[e+32>>2]=i;e:if(4!=o[e+44>>2]){if(a[e+52>>1]=0,t=o[t+8>>2],k[o[o[t>>2]+20>>2]](t,e,n,n,1,l),s[e+53|0]){if(o[e+44>>2]=3,!s[e+52|0])break e;break t}o[e+44>>2]=4}if(o[e+20>>2]=n,o[e+40>>2]=o[e+40>>2]+1,1!=o[e+36>>2]|2!=o[e+24>>2])break t;return void(r[e+54|0]=1)}t=o[t+8>>2],k[o[o[t>>2]+24>>2]](t,e,n,i,l)}},function(t,e,n,r){n|=0,r|=0,S(t|=0,o[8+(e|=0)>>2],0)?T(e,n,r):(t=o[t+8>>2],k[o[o[t>>2]+28>>2]](t,e,n,r))},P,R,function(t){return 1031},L,function(t){return o[4+(t|=0)>>2]},L]);return{g:function(){},h:O,i:function(){var t;return t=E(24),o[t>>2]=0,o[t+4>>2]=0,o[t+16>>2]=0,o[t+20>>2]=0,o[t+8>>2]=0,o[t+12>>2]=0,0|t},j:function(t,e,n){var r;return t=+t,e=+e,n=+n,r=E(24),u[r+16>>3]=n,u[r+8>>3]=e,u[r>>3]=t,0|r},k:function(t,e){e|=0,u[(t|=0)>>3]=u[t>>3]+u[e>>3],u[t+8>>3]=u[t+8>>3]+u[e+8>>3],u[t+16>>3]=u[t+16>>3]+u[e+16>>3]},l:function(t,e){e|=0,u[(t|=0)>>3]=u[t>>3]-u[e>>3],u[t+8>>3]=u[t+8>>3]-u[e+8>>3],u[t+16>>3]=u[t+16>>3]-u[e+16>>3]},m:function(t){return+u[(t|=0)>>3]},n:function(t,e){e=+e,u[(t|=0)>>3]=e},o:function(t){return+u[8+(t|=0)>>3]},p:function(t,e){e=+e,u[8+(t|=0)>>3]=e},q:function(t){return+u[16+(t|=0)>>3]},r:function(t,e){e=+e,u[16+(t|=0)>>3]=e},s:O,t:function(){var t;return t=E(12),o[t+8>>2]=0,o[t>>2]=0,o[t+4>>2]=0,0|t},u:function(t,e){e|=0;var n=0,r=0,i=0,a=0,s=0,l=0;t:if((0|(n=o[4+(t|=0)>>2]))==o[t+8>>2]){e:{if((i=1+(n=(0|(l=n-(r=o[t>>2])|0))/24|0)|0)>>>0<178956971){if(a=n<<1,i=n>>>0<89478485?i>>>0<a>>>0?a:i:178956970){if(i>>>0>=178956971)break e;a=E(c(i,24))}else a=0;n=a+c(n,24)|0,s=o[e+4>>2],o[n>>2]=o[e>>2],o[n+4>>2]=s,s=o[e+20>>2],o[n+16>>2]=o[e+16>>2],o[n+20>>2]=s,s=o[e+12>>2],o[n+8>>2]=o[e+8>>2],o[n+12>>2]=s,e=n+c((0|l)/-24|0,24)|0,(0|l)>0&&b(e,r,l),o[t+8>>2]=a+c(i,24),o[t+4>>2]=n+24,o[t>>2]=e,r&&x(r);break t}_(1024),h()}_(1046),h()}else r=o[e+4>>2],o[n>>2]=o[e>>2],o[n+4>>2]=r,r=o[e+20>>2],o[n+16>>2]=o[e+16>>2],o[n+20>>2]=r,r=o[e+12>>2],o[n+8>>2]=o[e+8>>2],o[n+12>>2]=r,o[t+4>>2]=n+24},v:function(t){var e=0;(t|=0)&&((e=o[t>>2])&&(o[t+4>>2]=e,x(e)),x(t))},w:function(){return 0|E(1)},x:function(t,e){t|=0;var n=0,r=0,i=0,a=0,s=0,l=0,h=0,d=0,p=0,f=0,m=0,g=0;if(t=o[(e|=0)>>2],(r=(0|(i=o[e+4>>2]-t|0))/24|0)>>>0>=2){if(!(i-24>>>0<24)){if(n=u[t+8>>3],e=1,m=1&(r=r-1|0),s=u[t>>3],i-48>>>0<24)l=n;else for(g=-2&r,r=0,h=s,d=n;i=t+c(e,24)|0,a=.5*((s=u[i+24>>3])-(p=u[i>>3]))*((f=u[i+8>>3]-n)+((l=u[i+32>>3])-n))+(.5*(p-h)*(d-n+f)+a),e=e+2|0,h=s,d=l,(0|g)!=(0|(r=r+2|0)););m&&(t=t+c(e,24)|0,a=.5*(u[t>>3]-s)*(l-n+(u[t+8>>3]-n))+a)}n=a<0?-a:a}else n=0;return+n},y:function(t,e,n){t|=0,e|=0;var r,i=0,a=0,s=0,l=0,h=0,d=0,p=0;if((r=((t=o[4+(n|=0)>>2])-(n=o[n>>2])|0)/24|0)>>>0>=3)for(t=r-1|0,i=u[e+8>>3],p=u[e>>3],e=0;l=n+c(t,24)|0,s=u[l+8>>3],t=e,e=n+c(e,24)|0,!(i<s&(a=u[e+8>>3])<=i)&(!(i>=s)|!(i<a))||p-(h=u[e>>3])<(i-a)*(u[l>>3]-h)/(s-a)&&(d^=1),(0|r)!=(0|(e=t+1|0)););return 1&d},z:O,A:k,B:y}}(t)}(W)}})}}}).then(function(t){return t}).then(t,function(t){v("failed to asynchronously prepare wasm: "+t),k(t)})}var a={a:W};if(R++,n.monitorRunDependencies&&n.monitorRunDependencies(R),n.instantiateWasm)try{return n.instantiateWasm(a,t)}catch(t){return v("Module.instantiateWasm callback failed with error: "+t),!1}(g||"function"!=typeof x.instantiateStreaming||B.startsWith(F)||B.startsWith("file://")||"function"!=typeof fetch?r(e):fetch(B,{credentials:"same-origin"}).then(function(t){return x.instantiateStreaming(t,a).then(e,function(t){return v("wasm streaming compile failed: "+t),v("falling back to ArrayBuffer instantiation"),r(e)})})).catch(i)}(),n.___wasm_call_ctors=function(){return(n.___wasm_call_ctors=n.asm.g).apply(null,arguments)};var J,q=n._emscripten_bind_VoidPtr___destroy___0=function(){return(q=n._emscripten_bind_VoidPtr___destroy___0=n.asm.h).apply(null,arguments)},X=n._emscripten_bind_McGePoint3d_McGePoint3d_0=function(){return(X=n._emscripten_bind_McGePoint3d_McGePoint3d_0=n.asm.i).apply(null,arguments)},Y=n._emscripten_bind_McGePoint3d_McGePoint3d_3=function(){return(Y=n._emscripten_bind_McGePoint3d_McGePoint3d_3=n.asm.j).apply(null,arguments)},Z=n._emscripten_bind_McGePoint3d_op_add_1=function(){return(Z=n._emscripten_bind_McGePoint3d_op_add_1=n.asm.k).apply(null,arguments)},$=n._emscripten_bind_McGePoint3d_op_sub_1=function(){return($=n._emscripten_bind_McGePoint3d_op_sub_1=n.asm.l).apply(null,arguments)},K=n._emscripten_bind_McGePoint3d_get_x_0=function(){return(K=n._emscripten_bind_McGePoint3d_get_x_0=n.asm.m).apply(null,arguments)},Q=n._emscripten_bind_McGePoint3d_set_x_1=function(){return(Q=n._emscripten_bind_McGePoint3d_set_x_1=n.asm.n).apply(null,arguments)},tt=n._emscripten_bind_McGePoint3d_get_y_0=function(){return(tt=n._emscripten_bind_McGePoint3d_get_y_0=n.asm.o).apply(null,arguments)},et=n._emscripten_bind_McGePoint3d_set_y_1=function(){return(et=n._emscripten_bind_McGePoint3d_set_y_1=n.asm.p).apply(null,arguments)},nt=n._emscripten_bind_McGePoint3d_get_z_0=function(){return(nt=n._emscripten_bind_McGePoint3d_get_z_0=n.asm.q).apply(null,arguments)},rt=n._emscripten_bind_McGePoint3d_set_z_1=function(){return(rt=n._emscripten_bind_McGePoint3d_set_z_1=n.asm.r).apply(null,arguments)},it=n._emscripten_bind_McGePoint3d___destroy___0=function(){return(it=n._emscripten_bind_McGePoint3d___destroy___0=n.asm.s).apply(null,arguments)},at=n._emscripten_bind_McGePoint3dArray_McGePoint3dArray_0=function(){return(at=n._emscripten_bind_McGePoint3dArray_McGePoint3dArray_0=n.asm.t).apply(null,arguments)},ot=n._emscripten_bind_McGePoint3dArray_append_1=function(){return(ot=n._emscripten_bind_McGePoint3dArray_append_1=n.asm.u).apply(null,arguments)},st=n._emscripten_bind_McGePoint3dArray___destroy___0=function(){return(st=n._emscripten_bind_McGePoint3dArray___destroy___0=n.asm.v).apply(null,arguments)},lt=n._emscripten_bind_McGeTool_McGeTool_0=function(){return(lt=n._emscripten_bind_McGeTool_McGeTool_0=n.asm.w).apply(null,arguments)},ut=n._emscripten_bind_McGeTool_calcArea_1=function(){return(ut=n._emscripten_bind_McGeTool_calcArea_1=n.asm.x).apply(null,arguments)},ct=n._emscripten_bind_McGeTool_pointInPolyline_2=function(){return(ct=n._emscripten_bind_McGeTool_pointInPolyline_2=n.asm.y).apply(null,arguments)},ht=n._emscripten_bind_McGeTool___destroy___0=function(){return(ht=n._emscripten_bind_McGeTool___destroy___0=n.asm.z).apply(null,arguments)},dt=n._malloc=function(){return(dt=n._malloc=n.asm.B).apply(null,arguments)};function pt(){function t(){if(!J&&(J=!0,n.calledRun=!0,!T)){if(z(O),r(n),n.onRuntimeInitialized&&n.onRuntimeInitialized(),n.postRun)for("function"==typeof n.postRun&&(n.postRun=[n.postRun]);n.postRun.length;){var t=n.postRun.shift();L.unshift(t)}z(L)}}if(!(0<R)){if(n.preRun)for("function"==typeof n.preRun&&(n.preRun=[n.preRun]);n.preRun.length;)P();z(A),0<R||(n.setStatus?(n.setStatus("Running..."),setTimeout(function(){setTimeout(function(){n.setStatus("")},1),t()},1)):t())}}if(I=function t(){J||pt(),J||(I=t)},n.run=pt,n.preInit)for("function"==typeof n.preInit&&(n.preInit=[n.preInit]);0<n.preInit.length;)n.preInit.pop()();function ft(){}function mt(t){return(t||ft).F}function gt(t,e){var n=mt(e),r=n[t];return r||((r=Object.create((e||ft).prototype)).C=t,n[t]=r)}function vt(){throw"cannot construct a VoidPtr, no constructor in IDL"}function yt(t,e,n){t&&"object"==typeof t&&(t=t.C),e&&"object"==typeof e&&(e=e.C),n&&"object"==typeof n&&(n=n.C),this.C=void 0===t?X():void 0===e?_emscripten_bind_McGePoint3d_McGePoint3d_1(t):void 0===n?_emscripten_bind_McGePoint3d_McGePoint3d_2(t,e):Y(t,e,n),mt(yt)[this.C]=this}function xt(){this.C=at(),mt(xt)[this.C]=this}function bt(){this.C=lt(),mt(bt)[this.C]=this}return pt(),ft.prototype=Object.create(ft.prototype),ft.prototype.constructor=ft,ft.prototype.D=ft,ft.F={},n.WrapperObject=ft,n.getCache=mt,n.wrapPointer=gt,n.castObject=function(t,e){return gt(t.C,e)},n.NULL=gt(0),n.destroy=function(t){if(!t.__destroy__)throw"Error: Cannot destroy object. (Did you create it yourself?)";t.__destroy__(),delete mt(t.D)[t.C]},n.compare=function(t,e){return t.C===e.C},n.getPointer=function(t){return t.C},n.getClass=function(t){return t.D},vt.prototype=Object.create(ft.prototype),vt.prototype.constructor=vt,vt.prototype.D=vt,vt.F={},n.VoidPtr=vt,vt.prototype.__destroy__=function(){q(this.C)},yt.prototype=Object.create(ft.prototype),yt.prototype.constructor=yt,yt.prototype.D=yt,yt.F={},n.McGePoint3d=yt,yt.prototype.op_add=function(t){var e=this.C;t&&"object"==typeof t&&(t=t.C),Z(e,t)},yt.prototype.op_sub=function(t){var e=this.C;t&&"object"==typeof t&&(t=t.C),$(e,t)},yt.prototype.get_x=yt.prototype.H=function(){return K(this.C)},yt.prototype.set_x=yt.prototype.R=function(t){var e=this.C;t&&"object"==typeof t&&(t=t.C),Q(e,t)},Object.defineProperty(yt.prototype,"x",{get:yt.prototype.H,set:yt.prototype.R}),yt.prototype.get_y=yt.prototype.I=function(){return tt(this.C)},yt.prototype.set_y=yt.prototype.S=function(t){var e=this.C;t&&"object"==typeof t&&(t=t.C),et(e,t)},Object.defineProperty(yt.prototype,"y",{get:yt.prototype.I,set:yt.prototype.S}),yt.prototype.get_z=yt.prototype.J=function(){return nt(this.C)},yt.prototype.set_z=yt.prototype.T=function(t){var e=this.C;t&&"object"==typeof t&&(t=t.C),rt(e,t)},Object.defineProperty(yt.prototype,"z",{get:yt.prototype.J,set:yt.prototype.T}),yt.prototype.__destroy__=function(){it(this.C)},xt.prototype=Object.create(ft.prototype),xt.prototype.constructor=xt,xt.prototype.D=xt,xt.F={},n.McGePoint3dArray=xt,xt.prototype.append=xt.prototype.append=function(t){var e=this.C;t&&"object"==typeof t&&(t=t.C),ot(e,t)},xt.prototype.__destroy__=function(){st(this.C)},bt.prototype=Object.create(ft.prototype),bt.prototype.constructor=bt,bt.prototype.D=bt,bt.F={},n.McGeTool=bt,bt.prototype.calcArea=function(t){var e=this.C;return t&&"object"==typeof t&&(t=t.C),ut(e,t)},bt.prototype.pointInPolyline=function(t,e){var n=this.C;return t&&"object"==typeof t&&(t=t.C),e&&"object"==typeof e&&(e=e.C),!!ct(n,t,e)},bt.prototype.__destroy__=function(){ht(this.C)},e.ready});return"object"==typeof exports&&"object"==typeof module?module.exports=e:"function"==typeof define&&define.amd?define([],function(){return e}):"object"==typeof exports&&(exports.mxcadassembly=e),e()}function rxInitMxEntity(){var t;null===(t=store.state.MxFun)||void 0===t||t.initDynamicCreate(dynamicCreateMxObject)}function loadCoreCode(){return __awaiter(this,void 0,void 0,function*(){return new Promise((t,e)=>__awaiter(this,void 0,void 0,function*(){try{if(store.state.MxFun)return console.error("mx loadCoreCode ady call"),void t();window.$=window.jQuery=yield dynamicImport("jquery"),window.MxDocumentReady=void 0,window.MxUiMain=(t=>{const e=t("./MxFun").MxFun;window.THREE=e.getTHREE(),store.commit("setMxFun",e),store.events.emit("MxUiMain",t),window.MxUiMain=void 0}),window.MxMain=(e=>(store.events.emit("MxMain",e),window.MxMain=void 0,rxInitMxEntity(),t(),0)),mxcadassemblyinit().then(function(t){store.commit("setMxassembly",t)}),mxfun()}catch(t){e({code:"error",msg:t})}}))})}function createCanvas(t="mx-canvas"){const e=document.getElementById(t)||document.createElement("canvas");return e.id=t,e}function createCanvasParent(t=createCanvas()){let e;return t||(t=createCanvas()),t.parentNode?e=t.parentNode:(e=document.createElement("div")).appendChild(t),e}var commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function unwrapExports(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function createCommonjsModule(t,e){return t(e={exports:{}},e.exports),e.exports}var lodash=createCommonjsModule(function(t,e){(function(){var n,r="Expected a function",i="__lodash_hash_undefined__",a="__lodash_placeholder__",o=16,s=32,l=64,u=128,c=256,h=1/0,d=9007199254740991,p=NaN,f=4294967295,m=[["ary",u],["bind",1],["bindKey",2],["curry",8],["curryRight",o],["flip",512],["partial",s],["partialRight",l],["rearg",c]],g="[object Arguments]",v="[object Array]",y="[object Boolean]",x="[object Date]",b="[object Error]",w="[object Function]",_="[object GeneratorFunction]",M="[object Map]",S="[object Number]",T="[object Object]",C="[object Promise]",E="[object RegExp]",D="[object Set]",A="[object String]",O="[object Symbol]",L="[object WeakMap]",P="[object ArrayBuffer]",R="[object DataView]",I="[object Float32Array]",k="[object Float64Array]",B="[object Int8Array]",F="[object Int16Array]",N="[object Int32Array]",j="[object Uint8Array]",z="[object Uint8ClampedArray]",V="[object Uint16Array]",G="[object Uint32Array]",U=/\b__p \+= '';/g,H=/\b(__p \+=) '' \+/g,W=/(__e\(.*?\)|\b__t\)) \+\n'';/g,J=/&(?:amp|lt|gt|quot|#39);/g,q=/[&<>"']/g,X=RegExp(J.source),Y=RegExp(q.source),Z=/<%-([\s\S]+?)%>/g,$=/<%([\s\S]+?)%>/g,K=/<%=([\s\S]+?)%>/g,Q=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,tt=/^\w*$/,et=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,nt=/[\\^$.*+?()[\]{}|]/g,rt=RegExp(nt.source),it=/^\s+/,at=/\s/,ot=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,st=/\{\n\/\* \[wrapped with (.+)\] \*/,lt=/,? & /,ut=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ct=/[()=,{}\[\]\/\s]/,ht=/\\(\\)?/g,dt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,pt=/\w*$/,ft=/^[-+]0x[0-9a-f]+$/i,mt=/^0b[01]+$/i,gt=/^\[object .+?Constructor\]$/,vt=/^0o[0-7]+$/i,yt=/^(?:0|[1-9]\d*)$/,xt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,bt=/($^)/,wt=/['\n\r\u2028\u2029\\]/g,_t="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Mt="a-z\\xdf-\\xf6\\xf8-\\xff",St="A-Z\\xc0-\\xd6\\xd8-\\xde",Tt="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ct="["+Tt+"]",Et="["+_t+"]",Dt="\\d+",At="["+Mt+"]",Ot="[^\\ud800-\\udfff"+Tt+Dt+"\\u2700-\\u27bf"+Mt+St+"]",Lt="\\ud83c[\\udffb-\\udfff]",Pt="[^\\ud800-\\udfff]",Rt="(?:\\ud83c[\\udde6-\\uddff]){2}",It="[\\ud800-\\udbff][\\udc00-\\udfff]",kt="["+St+"]",Bt="(?:"+At+"|"+Ot+")",Ft="(?:"+kt+"|"+Ot+")",Nt="(?:['’](?:d|ll|m|re|s|t|ve))?",jt="(?:['’](?:D|LL|M|RE|S|T|VE))?",zt="(?:"+Et+"|"+Lt+")?",Vt="[\\ufe0e\\ufe0f]?",Gt=Vt+zt+"(?:\\u200d(?:"+[Pt,Rt,It].join("|")+")"+Vt+zt+")*",Ut="(?:"+["[\\u2700-\\u27bf]",Rt,It].join("|")+")"+Gt,Ht="(?:"+[Pt+Et+"?",Et,Rt,It,"[\\ud800-\\udfff]"].join("|")+")",Wt=RegExp("['’]","g"),Jt=RegExp(Et,"g"),qt=RegExp(Lt+"(?="+Lt+")|"+Ht+Gt,"g"),Xt=RegExp([kt+"?"+At+"+"+Nt+"(?="+[Ct,kt,"$"].join("|")+")",Ft+"+"+jt+"(?="+[Ct,kt+Bt,"$"].join("|")+")",kt+"?"+Bt+"+"+Nt,kt+"+"+jt,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Dt,Ut].join("|"),"g"),Yt=RegExp("[\\u200d\\ud800-\\udfff"+_t+"\\ufe0e\\ufe0f]"),Zt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,$t=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Kt=-1,Qt={};Qt[I]=Qt[k]=Qt[B]=Qt[F]=Qt[N]=Qt[j]=Qt[z]=Qt[V]=Qt[G]=!0,Qt[g]=Qt[v]=Qt[P]=Qt[y]=Qt[R]=Qt[x]=Qt[b]=Qt[w]=Qt[M]=Qt[S]=Qt[T]=Qt[E]=Qt[D]=Qt[A]=Qt[L]=!1;var te={};te[g]=te[v]=te[P]=te[R]=te[y]=te[x]=te[I]=te[k]=te[B]=te[F]=te[N]=te[M]=te[S]=te[T]=te[E]=te[D]=te[A]=te[O]=te[j]=te[z]=te[V]=te[G]=!0,te[b]=te[w]=te[L]=!1;var ee={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ne=parseFloat,re=parseInt,ie="object"==typeof commonjsGlobal&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,ae="object"==typeof self&&self&&self.Object===Object&&self,oe=ie||ae||Function("return this")(),se=e&&!e.nodeType&&e,le=se&&t&&!t.nodeType&&t,ue=le&&le.exports===se,ce=ue&&ie.process,he=function(){try{return le&&le.require&&le.require("util").types||ce&&ce.binding&&ce.binding("util")}catch(t){}}(),de=he&&he.isArrayBuffer,pe=he&&he.isDate,fe=he&&he.isMap,me=he&&he.isRegExp,ge=he&&he.isSet,ve=he&&he.isTypedArray;function ye(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function xe(t,e,n,r){for(var i=-1,a=null==t?0:t.length;++i<a;){var o=t[i];e(r,o,n(o),t)}return r}function be(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t}function we(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(!e(t[n],n,t))return!1;return!0}function _e(t,e){for(var n=-1,r=null==t?0:t.length,i=0,a=[];++n<r;){var o=t[n];e(o,n,t)&&(a[i++]=o)}return a}function Me(t,e){return!(null==t||!t.length)&&Re(t,e,0)>-1}function Se(t,e,n){for(var r=-1,i=null==t?0:t.length;++r<i;)if(n(e,t[r]))return!0;return!1}function Te(t,e){for(var n=-1,r=null==t?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}function Ce(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}function Ee(t,e,n,r){var i=-1,a=null==t?0:t.length;for(r&&a&&(n=t[++i]);++i<a;)n=e(n,t[i],i,t);return n}function De(t,e,n,r){var i=null==t?0:t.length;for(r&&i&&(n=t[--i]);i--;)n=e(n,t[i],i,t);return n}function Ae(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}var Oe=Fe("length");function Le(t,e,n){var r;return n(t,function(t,n,i){if(e(t,n,i))return r=n,!1}),r}function Pe(t,e,n,r){for(var i=t.length,a=n+(r?1:-1);r?a--:++a<i;)if(e(t[a],a,t))return a;return-1}function Re(t,e,n){return e==e?function(t,e,n){for(var r=n-1,i=t.length;++r<i;)if(t[r]===e)return r;return-1}(t,e,n):Pe(t,ke,n)}function Ie(t,e,n,r){for(var i=n-1,a=t.length;++i<a;)if(r(t[i],e))return i;return-1}function ke(t){return t!=t}function Be(t,e){var n=null==t?0:t.length;return n?ze(t,e)/n:p}function Fe(t){return function(e){return null==e?n:e[t]}}function Ne(t){return function(e){return null==t?n:t[e]}}function je(t,e,n,r,i){return i(t,function(t,i,a){n=r?(r=!1,t):e(n,t,i,a)}),n}function ze(t,e){for(var r,i=-1,a=t.length;++i<a;){var o=e(t[i]);o!==n&&(r=r===n?o:r+o)}return r}function Ve(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function Ge(t){return t?t.slice(0,an(t)+1).replace(it,""):t}function Ue(t){return function(e){return t(e)}}function He(t,e){return Te(e,function(e){return t[e]})}function We(t,e){return t.has(e)}function Je(t,e){for(var n=-1,r=t.length;++n<r&&Re(e,t[n],0)>-1;);return n}function qe(t,e){for(var n=t.length;n--&&Re(e,t[n],0)>-1;);return n}var Xe=Ne({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),Ye=Ne({"&":"&","<":"<",">":">",'"':""","'":"'"});function Ze(t){return"\\"+ee[t]}function $e(t){return Yt.test(t)}function Ke(t){var e=-1,n=Array(t.size);return t.forEach(function(t,r){n[++e]=[r,t]}),n}function Qe(t,e){return function(n){return t(e(n))}}function tn(t,e){for(var n=-1,r=t.length,i=0,o=[];++n<r;){var s=t[n];s!==e&&s!==a||(t[n]=a,o[i++]=n)}return o}function en(t){var e=-1,n=Array(t.size);return t.forEach(function(t){n[++e]=t}),n}function nn(t){return $e(t)?function(t){for(var e=qt.lastIndex=0;qt.test(t);)++e;return e}(t):Oe(t)}function rn(t){return $e(t)?function(t){return t.match(qt)||[]}(t):function(t){return t.split("")}(t)}function an(t){for(var e=t.length;e--&&at.test(t.charAt(e)););return e}var on=Ne({"&":"&","<":"<",">":">",""":'"',"'":"'"}),sn=function t(e){var at,_t=(e=null==e?oe:sn.defaults(oe.Object(),e,sn.pick(oe,$t))).Array,Mt=e.Date,St=e.Error,Tt=e.Function,Ct=e.Math,Et=e.Object,Dt=e.RegExp,At=e.String,Ot=e.TypeError,Lt=_t.prototype,Pt=Tt.prototype,Rt=Et.prototype,It=e["__core-js_shared__"],kt=Pt.toString,Bt=Rt.hasOwnProperty,Ft=0,Nt=(at=/[^.]+$/.exec(It&&It.keys&&It.keys.IE_PROTO||""))?"Symbol(src)_1."+at:"",jt=Rt.toString,zt=kt.call(Et),Vt=oe._,Gt=Dt("^"+kt.call(Bt).replace(nt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ut=ue?e.Buffer:n,Ht=e.Symbol,qt=e.Uint8Array,Yt=Ut?Ut.allocUnsafe:n,ee=Qe(Et.getPrototypeOf,Et),ie=Et.create,ae=Rt.propertyIsEnumerable,se=Lt.splice,le=Ht?Ht.isConcatSpreadable:n,ce=Ht?Ht.iterator:n,he=Ht?Ht.toStringTag:n,Oe=function(){try{var t=ia(Et,"defineProperty");return t({},"",{}),t}catch(t){}}(),Ne=e.clearTimeout!==oe.clearTimeout&&e.clearTimeout,ln=Mt&&Mt.now!==oe.Date.now&&Mt.now,un=e.setTimeout!==oe.setTimeout&&e.setTimeout,cn=Ct.ceil,hn=Ct.floor,dn=Et.getOwnPropertySymbols,pn=Ut?Ut.isBuffer:n,fn=e.isFinite,mn=Lt.join,gn=Qe(Et.keys,Et),vn=Ct.max,yn=Ct.min,xn=Mt.now,bn=e.parseInt,wn=Ct.random,_n=Lt.reverse,Mn=ia(e,"DataView"),Sn=ia(e,"Map"),Tn=ia(e,"Promise"),Cn=ia(e,"Set"),En=ia(e,"WeakMap"),Dn=ia(Et,"create"),An=En&&new En,On={},Ln=La(Mn),Pn=La(Sn),Rn=La(Tn),In=La(Cn),kn=La(En),Bn=Ht?Ht.prototype:n,Fn=Bn?Bn.valueOf:n,Nn=Bn?Bn.toString:n;function jn(t){if(Yo(t)&&!No(t)&&!(t instanceof Un)){if(t instanceof Gn)return t;if(Bt.call(t,"__wrapped__"))return Pa(t)}return new Gn(t)}var zn=function(){function t(){}return function(e){if(!Xo(e))return{};if(ie)return ie(e);t.prototype=e;var r=new t;return t.prototype=n,r}}();function Vn(){}function Gn(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=n}function Un(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=f,this.__views__=[]}function Hn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Wn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Jn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function qn(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new Jn;++e<n;)this.add(t[e])}function Xn(t){var e=this.__data__=new Wn(t);this.size=e.size}function Yn(t,e){var n=No(t),r=!n&&Fo(t),i=!n&&!r&&Go(t),a=!n&&!r&&!i&&rs(t),o=n||r||i||a,s=o?Ve(t.length,At):[],l=s.length;for(var u in t)!e&&!Bt.call(t,u)||o&&("length"==u||i&&("offset"==u||"parent"==u)||a&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||ha(u,l))||s.push(u);return s}function Zn(t){var e=t.length;return e?t[Hr(0,e-1)]:n}function $n(t,e,r){(r!==n&&!Io(t[e],r)||r===n&&!(e in t))&&nr(t,e,r)}function Kn(t,e,r){var i=t[e];Bt.call(t,e)&&Io(i,r)&&(r!==n||e in t)||nr(t,e,r)}function Qn(t,e){for(var n=t.length;n--;)if(Io(t[n][0],e))return n;return-1}function tr(t,e,n,r){return ur(t,function(t,i,a){e(r,t,n(t),a)}),r}function er(t,e){return t&&Mi(e,Ts(e),t)}function nr(t,e,n){"__proto__"==e&&Oe?Oe(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function rr(t,e){for(var r=-1,i=e.length,a=_t(i),o=null==t;++r<i;)a[r]=o?n:bs(t,e[r]);return a}function ir(t,e,r){return t==t&&(r!==n&&(t=t<=r?t:r),e!==n&&(t=t>=e?t:e)),t}function ar(t,e,r,i,a,o){var s,l=1&e,u=2&e,c=4&e;if(r&&(s=a?r(t,i,a,o):r(t)),s!==n)return s;if(!Xo(t))return t;var h=No(t);if(h){if(s=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&Bt.call(t,"index")&&(n.index=t.index,n.input=t.input),n}(t),!l)return _i(t,s)}else{var d=sa(t),p=d==w||d==_;if(Go(t))return gi(t,l);if(d==T||d==g||p&&!a){if(s=u||p?{}:ua(t),!l)return u?function(t,e){return Mi(t,oa(t),e)}(t,function(t,e){return t&&Mi(e,Cs(e),t)}(s,t)):function(t,e){return Mi(t,aa(t),e)}(t,er(s,t))}else{if(!te[d])return a?t:{};s=function(t,e,n){var r,i=t.constructor;switch(e){case P:return vi(t);case y:case x:return new i(+t);case R:return function(t,e){var n=e?vi(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case I:case k:case B:case F:case N:case j:case z:case V:case G:return yi(t,n);case M:return new i;case S:case A:return new i(t);case E:return function(t){var e=new t.constructor(t.source,pt.exec(t));return e.lastIndex=t.lastIndex,e}(t);case D:return new i;case O:return r=t,Fn?Et(Fn.call(r)):{}}}(t,d,l)}}o||(o=new Xn);var f=o.get(t);if(f)return f;o.set(t,s),ts(t)?t.forEach(function(n){s.add(ar(n,e,r,n,t,o))}):Zo(t)&&t.forEach(function(n,i){s.set(i,ar(n,e,r,i,t,o))});var m=h?n:(c?u?$i:Zi:u?Cs:Ts)(t);return be(m||t,function(n,i){m&&(n=t[i=n]),Kn(s,i,ar(n,e,r,i,t,o))}),s}function or(t,e,r){var i=r.length;if(null==t)return!i;for(t=Et(t);i--;){var a=r[i],o=e[a],s=t[a];if(s===n&&!(a in t)||!o(s))return!1}return!0}function sr(t,e,i){if("function"!=typeof t)throw new Ot(r);return Sa(function(){t.apply(n,i)},e)}function lr(t,e,n,r){var i=-1,a=Me,o=!0,s=t.length,l=[],u=e.length;if(!s)return l;n&&(e=Te(e,Ue(n))),r?(a=Se,o=!1):e.length>=200&&(a=We,o=!1,e=new qn(e));t:for(;++i<s;){var c=t[i],h=null==n?c:n(c);if(c=r||0!==c?c:0,o&&h==h){for(var d=u;d--;)if(e[d]===h)continue t;l.push(c)}else a(e,h,r)||l.push(c)}return l}jn.templateSettings={escape:Z,evaluate:$,interpolate:K,variable:"",imports:{_:jn}},jn.prototype=Vn.prototype,jn.prototype.constructor=jn,Gn.prototype=zn(Vn.prototype),Gn.prototype.constructor=Gn,Un.prototype=zn(Vn.prototype),Un.prototype.constructor=Un,Hn.prototype.clear=function(){this.__data__=Dn?Dn(null):{},this.size=0},Hn.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},Hn.prototype.get=function(t){var e=this.__data__;if(Dn){var r=e[t];return r===i?n:r}return Bt.call(e,t)?e[t]:n},Hn.prototype.has=function(t){var e=this.__data__;return Dn?e[t]!==n:Bt.call(e,t)},Hn.prototype.set=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=Dn&&e===n?i:e,this},Wn.prototype.clear=function(){this.__data__=[],this.size=0},Wn.prototype.delete=function(t){var e=this.__data__,n=Qn(e,t);return!(n<0||(n==e.length-1?e.pop():se.call(e,n,1),--this.size,0))},Wn.prototype.get=function(t){var e=this.__data__,r=Qn(e,t);return r<0?n:e[r][1]},Wn.prototype.has=function(t){return Qn(this.__data__,t)>-1},Wn.prototype.set=function(t,e){var n=this.__data__,r=Qn(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this},Jn.prototype.clear=function(){this.size=0,this.__data__={hash:new Hn,map:new(Sn||Wn),string:new Hn}},Jn.prototype.delete=function(t){var e=na(this,t).delete(t);return this.size-=e?1:0,e},Jn.prototype.get=function(t){return na(this,t).get(t)},Jn.prototype.has=function(t){return na(this,t).has(t)},Jn.prototype.set=function(t,e){var n=na(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},qn.prototype.add=qn.prototype.push=function(t){return this.__data__.set(t,i),this},qn.prototype.has=function(t){return this.__data__.has(t)},Xn.prototype.clear=function(){this.__data__=new Wn,this.size=0},Xn.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Xn.prototype.get=function(t){return this.__data__.get(t)},Xn.prototype.has=function(t){return this.__data__.has(t)},Xn.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Wn){var r=n.__data__;if(!Sn||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Jn(r)}return n.set(t,e),this.size=n.size,this};var ur=Ci(vr),cr=Ci(yr,!0);function hr(t,e){var n=!0;return ur(t,function(t,r,i){return n=!!e(t,r,i)}),n}function dr(t,e,r){for(var i=-1,a=t.length;++i<a;){var o=t[i],s=e(o);if(null!=s&&(l===n?s==s&&!ns(s):r(s,l)))var l=s,u=o}return u}function pr(t,e){var n=[];return ur(t,function(t,r,i){e(t,r,i)&&n.push(t)}),n}function fr(t,e,n,r,i){var a=-1,o=t.length;for(n||(n=ca),i||(i=[]);++a<o;){var s=t[a];e>0&&n(s)?e>1?fr(s,e-1,n,r,i):Ce(i,s):r||(i[i.length]=s)}return i}var mr=Ei(),gr=Ei(!0);function vr(t,e){return t&&mr(t,e,Ts)}function yr(t,e){return t&&gr(t,e,Ts)}function xr(t,e){return _e(e,function(e){return Wo(t[e])})}function br(t,e){for(var r=0,i=(e=di(e,t)).length;null!=t&&r<i;)t=t[Oa(e[r++])];return r&&r==i?t:n}function wr(t,e,n){var r=e(t);return No(t)?r:Ce(r,n(t))}function _r(t){return null==t?t===n?"[object Undefined]":"[object Null]":he&&he in Et(t)?function(t){var e=Bt.call(t,he),r=t[he];try{t[he]=n;var i=!0}catch(t){}var a=jt.call(t);return i&&(e?t[he]=r:delete t[he]),a}(t):function(t){return jt.call(t)}(t)}function Mr(t,e){return t>e}function Sr(t,e){return null!=t&&Bt.call(t,e)}function Tr(t,e){return null!=t&&e in Et(t)}function Cr(t,e,r){for(var i=r?Se:Me,a=t[0].length,o=t.length,s=o,l=_t(o),u=1/0,c=[];s--;){var h=t[s];s&&e&&(h=Te(h,Ue(e))),u=yn(h.length,u),l[s]=!r&&(e||a>=120&&h.length>=120)?new qn(s&&h):n}h=t[0];var d=-1,p=l[0];t:for(;++d<a&&c.length<u;){var f=h[d],m=e?e(f):f;if(f=r||0!==f?f:0,!(p?We(p,m):i(c,m,r))){for(s=o;--s;){var g=l[s];if(!(g?We(g,m):i(t[s],m,r)))continue t}p&&p.push(m),c.push(f)}}return c}function Er(t,e,r){var i=null==(t=ba(t,e=di(e,t)))?t:t[Oa(Ua(e))];return null==i?n:ye(i,t,r)}function Dr(t){return Yo(t)&&_r(t)==g}function Ar(t,e,r,i,a){return t===e||(null==t||null==e||!Yo(t)&&!Yo(e)?t!=t&&e!=e:function(t,e,r,i,a,o){var s=No(t),l=No(e),u=s?v:sa(t),c=l?v:sa(e),h=(u=u==g?T:u)==T,d=(c=c==g?T:c)==T,p=u==c;if(p&&Go(t)){if(!Go(e))return!1;s=!0,h=!1}if(p&&!h)return o||(o=new Xn),s||rs(t)?Xi(t,e,r,i,a,o):function(t,e,n,r,i,a,o){switch(n){case R:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case P:return!(t.byteLength!=e.byteLength||!a(new qt(t),new qt(e)));case y:case x:case S:return Io(+t,+e);case b:return t.name==e.name&&t.message==e.message;case E:case A:return t==e+"";case M:var s=Ke;case D:var l=1&r;if(s||(s=en),t.size!=e.size&&!l)return!1;var u=o.get(t);if(u)return u==e;r|=2,o.set(t,e);var c=Xi(s(t),s(e),r,i,a,o);return o.delete(t),c;case O:if(Fn)return Fn.call(t)==Fn.call(e)}return!1}(t,e,u,r,i,a,o);if(!(1&r)){var f=h&&Bt.call(t,"__wrapped__"),m=d&&Bt.call(e,"__wrapped__");if(f||m){var w=f?t.value():t,_=m?e.value():e;return o||(o=new Xn),a(w,_,r,i,o)}}return!!p&&(o||(o=new Xn),function(t,e,r,i,a,o){var s=1&r,l=Zi(t),u=l.length;if(u!=Zi(e).length&&!s)return!1;for(var c=u;c--;){var h=l[c];if(!(s?h in e:Bt.call(e,h)))return!1}var d=o.get(t),p=o.get(e);if(d&&p)return d==e&&p==t;var f=!0;o.set(t,e),o.set(e,t);for(var m=s;++c<u;){var g=t[h=l[c]],v=e[h];if(i)var y=s?i(v,g,h,e,t,o):i(g,v,h,t,e,o);if(!(y===n?g===v||a(g,v,r,i,o):y)){f=!1;break}m||(m="constructor"==h)}if(f&&!m){var x=t.constructor,b=e.constructor;x==b||!("constructor"in t)||!("constructor"in e)||"function"==typeof x&&x instanceof x&&"function"==typeof b&&b instanceof b||(f=!1)}return o.delete(t),o.delete(e),f}(t,e,r,i,a,o))}(t,e,r,i,Ar,a))}function Or(t,e,r,i){var a=r.length,o=a,s=!i;if(null==t)return!o;for(t=Et(t);a--;){var l=r[a];if(s&&l[2]?l[1]!==t[l[0]]:!(l[0]in t))return!1}for(;++a<o;){var u=(l=r[a])[0],c=t[u],h=l[1];if(s&&l[2]){if(c===n&&!(u in t))return!1}else{var d=new Xn;if(i)var p=i(c,h,u,t,e,d);if(!(p===n?Ar(h,c,3,i,d):p))return!1}}return!0}function Lr(t){return!(!Xo(t)||(e=t,Nt&&Nt in e))&&(Wo(t)?Gt:gt).test(La(t));var e}function Pr(t){return"function"==typeof t?t:null==t?$s:"object"==typeof t?No(t)?Fr(t[0],t[1]):Br(t):ol(t)}function Rr(t){if(!ga(t))return gn(t);var e=[];for(var n in Et(t))Bt.call(t,n)&&"constructor"!=n&&e.push(n);return e}function Ir(t,e){return t<e}function kr(t,e){var n=-1,r=zo(t)?_t(t.length):[];return ur(t,function(t,i,a){r[++n]=e(t,i,a)}),r}function Br(t){var e=ra(t);return 1==e.length&&e[0][2]?ya(e[0][0],e[0][1]):function(n){return n===t||Or(n,t,e)}}function Fr(t,e){return pa(t)&&va(e)?ya(Oa(t),e):function(r){var i=bs(r,t);return i===n&&i===e?ws(r,t):Ar(e,i,3)}}function Nr(t,e,r,i,a){t!==e&&mr(e,function(o,s){if(a||(a=new Xn),Xo(o))!function(t,e,r,i,a,o,s){var l=_a(t,r),u=_a(e,r),c=s.get(u);if(c)$n(t,r,c);else{var h=o?o(l,u,r+"",t,e,s):n,d=h===n;if(d){var p=No(u),f=!p&&Go(u),m=!p&&!f&&rs(u);h=u,p||f||m?No(l)?h=l:Vo(l)?h=_i(l):f?(d=!1,h=gi(u,!0)):m?(d=!1,h=yi(u,!0)):h=[]:Ko(u)||Fo(u)?(h=l,Fo(l)?h=hs(l):Xo(l)&&!Wo(l)||(h=ua(u))):d=!1}d&&(s.set(u,h),a(h,u,i,o,s),s.delete(u)),$n(t,r,h)}}(t,e,s,r,Nr,i,a);else{var l=i?i(_a(t,s),o,s+"",t,e,a):n;l===n&&(l=o),$n(t,s,l)}},Cs)}function jr(t,e){var r=t.length;if(r)return ha(e+=e<0?r:0,r)?t[e]:n}function zr(t,e,n){var r=-1;return e=Te(e=e.length?Te(e,function(t){return No(t)?function(e){return br(e,1===t.length?t[0]:t)}:t}):[$s],Ue(ea())),function(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}(kr(t,function(t,n,i){return{criteria:Te(e,function(e){return e(t)}),index:++r,value:t}}),function(t,e){return function(t,e,n){for(var r=-1,i=t.criteria,a=e.criteria,o=i.length,s=n.length;++r<o;){var l=xi(i[r],a[r]);if(l)return r>=s?l:l*("desc"==n[r]?-1:1)}return t.index-e.index}(t,e,n)})}function Vr(t,e,n){for(var r=-1,i=e.length,a={};++r<i;){var o=e[r],s=br(t,o);n(s,o)&&qr(a,di(o,t),s)}return a}function Gr(t,e,n,r){var i=r?Ie:Re,a=-1,o=e.length,s=t;for(t===e&&(e=_i(e)),n&&(s=Te(t,Ue(n)));++a<o;)for(var l=0,u=e[a],c=n?n(u):u;(l=i(s,c,l,r))>-1;)s!==t&&se.call(s,l,1),se.call(t,l,1);return t}function Ur(t,e){for(var n=t?e.length:0,r=n-1;n--;){var i=e[n];if(n==r||i!==a){var a=i;ha(i)?se.call(t,i,1):ii(t,i)}}return t}function Hr(t,e){return t+hn(wn()*(e-t+1))}function Wr(t,e){var n="";if(!t||e<1||e>d)return n;do{e%2&&(n+=t),(e=hn(e/2))&&(t+=t)}while(e);return n}function Jr(t,e){return Ta(xa(t,e,$s),t+"")}function qr(t,e,r,i){if(!Xo(t))return t;for(var a=-1,o=(e=di(e,t)).length,s=o-1,l=t;null!=l&&++a<o;){var u=Oa(e[a]),c=r;if("__proto__"===u||"constructor"===u||"prototype"===u)return t;if(a!=s){var h=l[u];(c=i?i(h,u,l):n)===n&&(c=Xo(h)?h:ha(e[a+1])?[]:{})}Kn(l,u,c),l=l[u]}return t}var Xr=An?function(t,e){return An.set(t,e),t}:$s,Yr=Oe?function(t,e){return Oe(t,"toString",{configurable:!0,enumerable:!1,value:Xs(e),writable:!0})}:$s;function Zr(t,e,n){var r=-1,i=t.length;e<0&&(e=-e>i?0:i+e),(n=n>i?i:n)<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var a=_t(i);++r<i;)a[r]=t[r+e];return a}function $r(t,e){var n;return ur(t,function(t,r,i){return!(n=e(t,r,i))}),!!n}function Kr(t,e,n){var r=0,i=null==t?r:t.length;if("number"==typeof e&&e==e&&i<=2147483647){for(;r<i;){var a=r+i>>>1,o=t[a];null!==o&&!ns(o)&&(n?o<=e:o<e)?r=a+1:i=a}return i}return Qr(t,e,$s,n)}function Qr(t,e,r,i){var a=0,o=null==t?0:t.length;if(0===o)return 0;for(var s=(e=r(e))!=e,l=null===e,u=ns(e),c=e===n;a<o;){var h=hn((a+o)/2),d=r(t[h]),p=d!==n,f=null===d,m=d==d,g=ns(d);if(s)var v=i||m;else v=c?m&&(i||p):l?m&&p&&(i||!f):u?m&&p&&!f&&(i||!g):!f&&!g&&(i?d<=e:d<e);v?a=h+1:o=h}return yn(o,4294967294)}function ti(t,e){for(var n=-1,r=t.length,i=0,a=[];++n<r;){var o=t[n],s=e?e(o):o;if(!n||!Io(s,l)){var l=s;a[i++]=0===o?0:o}}return a}function ei(t){return"number"==typeof t?t:ns(t)?p:+t}function ni(t){if("string"==typeof t)return t;if(No(t))return Te(t,ni)+"";if(ns(t))return Nn?Nn.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function ri(t,e,n){var r=-1,i=Me,a=t.length,o=!0,s=[],l=s;if(n)o=!1,i=Se;else if(a>=200){var u=e?null:Gi(t);if(u)return en(u);o=!1,i=We,l=new qn}else l=e?[]:s;t:for(;++r<a;){var c=t[r],h=e?e(c):c;if(c=n||0!==c?c:0,o&&h==h){for(var d=l.length;d--;)if(l[d]===h)continue t;e&&l.push(h),s.push(c)}else i(l,h,n)||(l!==s&&l.push(h),s.push(c))}return s}function ii(t,e){return null==(t=ba(t,e=di(e,t)))||delete t[Oa(Ua(e))]}function ai(t,e,n,r){return qr(t,e,n(br(t,e)),r)}function oi(t,e,n,r){for(var i=t.length,a=r?i:-1;(r?a--:++a<i)&&e(t[a],a,t););return n?Zr(t,r?0:a,r?a+1:i):Zr(t,r?a+1:0,r?i:a)}function si(t,e){var n=t;return n instanceof Un&&(n=n.value()),Ee(e,function(t,e){return e.func.apply(e.thisArg,Ce([t],e.args))},n)}function li(t,e,n){var r=t.length;if(r<2)return r?ri(t[0]):[];for(var i=-1,a=_t(r);++i<r;)for(var o=t[i],s=-1;++s<r;)s!=i&&(a[i]=lr(a[i]||o,t[s],e,n));return ri(fr(a,1),e,n)}function ui(t,e,r){for(var i=-1,a=t.length,o=e.length,s={};++i<a;){var l=i<o?e[i]:n;r(s,t[i],l)}return s}function ci(t){return Vo(t)?t:[]}function hi(t){return"function"==typeof t?t:$s}function di(t,e){return No(t)?t:pa(t,e)?[t]:Aa(ds(t))}var pi=Jr;function fi(t,e,r){var i=t.length;return r=r===n?i:r,!e&&r>=i?t:Zr(t,e,r)}var mi=Ne||function(t){return oe.clearTimeout(t)};function gi(t,e){if(e)return t.slice();var n=t.length,r=Yt?Yt(n):new t.constructor(n);return t.copy(r),r}function vi(t){var e=new t.constructor(t.byteLength);return new qt(e).set(new qt(t)),e}function yi(t,e){var n=e?vi(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function xi(t,e){if(t!==e){var r=t!==n,i=null===t,a=t==t,o=ns(t),s=e!==n,l=null===e,u=e==e,c=ns(e);if(!l&&!c&&!o&&t>e||o&&s&&u&&!l&&!c||i&&s&&u||!r&&u||!a)return 1;if(!i&&!o&&!c&&t<e||c&&r&&a&&!i&&!o||l&&r&&a||!s&&a||!u)return-1}return 0}function bi(t,e,n,r){for(var i=-1,a=t.length,o=n.length,s=-1,l=e.length,u=vn(a-o,0),c=_t(l+u),h=!r;++s<l;)c[s]=e[s];for(;++i<o;)(h||i<a)&&(c[n[i]]=t[i]);for(;u--;)c[s++]=t[i++];return c}function wi(t,e,n,r){for(var i=-1,a=t.length,o=-1,s=n.length,l=-1,u=e.length,c=vn(a-s,0),h=_t(c+u),d=!r;++i<c;)h[i]=t[i];for(var p=i;++l<u;)h[p+l]=e[l];for(;++o<s;)(d||i<a)&&(h[p+n[o]]=t[i++]);return h}function _i(t,e){var n=-1,r=t.length;for(e||(e=_t(r));++n<r;)e[n]=t[n];return e}function Mi(t,e,r,i){var a=!r;r||(r={});for(var o=-1,s=e.length;++o<s;){var l=e[o],u=i?i(r[l],t[l],l,r,t):n;u===n&&(u=t[l]),a?nr(r,l,u):Kn(r,l,u)}return r}function Si(t,e){return function(n,r){var i=No(n)?xe:tr,a=e?e():{};return i(n,t,ea(r,2),a)}}function Ti(t){return Jr(function(e,r){var i=-1,a=r.length,o=a>1?r[a-1]:n,s=a>2?r[2]:n;for(o=t.length>3&&"function"==typeof o?(a--,o):n,s&&da(r[0],r[1],s)&&(o=a<3?n:o,a=1),e=Et(e);++i<a;){var l=r[i];l&&t(e,l,i,o)}return e})}function Ci(t,e){return function(n,r){if(null==n)return n;if(!zo(n))return t(n,r);for(var i=n.length,a=e?i:-1,o=Et(n);(e?a--:++a<i)&&!1!==r(o[a],a,o););return n}}function Ei(t){return function(e,n,r){for(var i=-1,a=Et(e),o=r(e),s=o.length;s--;){var l=o[t?s:++i];if(!1===n(a[l],l,a))break}return e}}function Di(t){return function(e){var r=$e(e=ds(e))?rn(e):n,i=r?r[0]:e.charAt(0),a=r?fi(r,1).join(""):e.slice(1);return i[t]()+a}}function Ai(t){return function(e){return Ee(Ws(Fs(e).replace(Wt,"")),t,"")}}function Oi(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var n=zn(t.prototype),r=t.apply(n,e);return Xo(r)?r:n}}function Li(t){return function(e,r,i){var a=Et(e);if(!zo(e)){var o=ea(r,3);e=Ts(e),r=function(t){return o(a[t],t,a)}}var s=t(e,r,i);return s>-1?a[o?e[s]:s]:n}}function Pi(t){return Yi(function(e){var i=e.length,a=i,o=Gn.prototype.thru;for(t&&e.reverse();a--;){var s=e[a];if("function"!=typeof s)throw new Ot(r);if(o&&!l&&"wrapper"==Qi(s))var l=new Gn([],!0)}for(a=l?a:i;++a<i;){var u=Qi(s=e[a]),c="wrapper"==u?Ki(s):n;l=c&&fa(c[0])&&424==c[1]&&!c[4].length&&1==c[9]?l[Qi(c[0])].apply(l,c[3]):1==s.length&&fa(s)?l[u]():l.thru(s)}return function(){var t=arguments,n=t[0];if(l&&1==t.length&&No(n))return l.plant(n).value();for(var r=0,a=i?e[r].apply(this,t):n;++r<i;)a=e[r].call(this,a);return a}})}function Ri(t,e,r,i,a,o,s,l,c,h){var d=e&u,p=1&e,f=2&e,m=24&e,g=512&e,v=f?n:Oi(t);return function n(){for(var u=arguments.length,y=_t(u),x=u;x--;)y[x]=arguments[x];if(m)var b=ta(n),w=function(t,e){for(var n=t.length,r=0;n--;)t[n]===e&&++r;return r}(y,b);if(i&&(y=bi(y,i,a,m)),o&&(y=wi(y,o,s,m)),u-=w,m&&u<h){var _=tn(y,b);return zi(t,e,Ri,n.placeholder,r,y,_,l,c,h-u)}var M=p?r:this,S=f?M[t]:t;return u=y.length,l?y=wa(y,l):g&&u>1&&y.reverse(),d&&c<u&&(y.length=c),this&&this!==oe&&this instanceof n&&(S=v||Oi(S)),S.apply(M,y)}}function Ii(t,e){return function(n,r){return function(t,e,n,r){return vr(t,function(t,i,a){e(r,n(t),i,a)}),r}(n,t,e(r),{})}}function ki(t,e){return function(r,i){var a;if(r===n&&i===n)return e;if(r!==n&&(a=r),i!==n){if(a===n)return i;"string"==typeof r||"string"==typeof i?(r=ni(r),i=ni(i)):(r=ei(r),i=ei(i)),a=t(r,i)}return a}}function Bi(t){return Yi(function(e){return e=Te(e,Ue(ea())),Jr(function(n){var r=this;return t(e,function(t){return ye(t,r,n)})})})}function Fi(t,e){var r=(e=e===n?" ":ni(e)).length;if(r<2)return r?Wr(e,t):e;var i=Wr(e,cn(t/nn(e)));return $e(e)?fi(rn(i),0,t).join(""):i.slice(0,t)}function Ni(t){return function(e,r,i){return i&&"number"!=typeof i&&da(e,r,i)&&(r=i=n),e=ss(e),r===n?(r=e,e=0):r=ss(r),function(t,e,n,r){for(var i=-1,a=vn(cn((e-t)/(n||1)),0),o=_t(a);a--;)o[r?a:++i]=t,t+=n;return o}(e,r,i=i===n?e<r?1:-1:ss(i),t)}}function ji(t){return function(e,n){return"string"==typeof e&&"string"==typeof n||(e=cs(e),n=cs(n)),t(e,n)}}function zi(t,e,r,i,a,o,u,c,h,d){var p=8&e;e|=p?s:l,4&(e&=~(p?l:s))||(e&=-4);var f=[t,e,a,p?o:n,p?u:n,p?n:o,p?n:u,c,h,d],m=r.apply(n,f);return fa(t)&&Ma(m,f),m.placeholder=i,Ca(m,t,e)}function Vi(t){var e=Ct[t];return function(t,n){if(t=cs(t),(n=null==n?0:yn(ls(n),292))&&fn(t)){var r=(ds(t)+"e").split("e");return+((r=(ds(e(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return e(t)}}var Gi=Cn&&1/en(new Cn([,-0]))[1]==h?function(t){return new Cn(t)}:nl;function Ui(t){return function(e){var n=sa(e);return n==M?Ke(e):n==D?function(t){var e=-1,n=Array(t.size);return t.forEach(function(t){n[++e]=[t,t]}),n}(e):function(t,e){return Te(e,function(e){return[e,t[e]]})}(e,t(e))}}function Hi(t,e,i,h,d,p,f,m){var g=2&e;if(!g&&"function"!=typeof t)throw new Ot(r);var v=h?h.length:0;if(v||(e&=-97,h=d=n),f=f===n?f:vn(ls(f),0),m=m===n?m:ls(m),v-=d?d.length:0,e&l){var y=h,x=d;h=d=n}var b=g?n:Ki(t),w=[t,e,i,h,d,y,x,p,f,m];if(b&&function(t,e){var n=t[1],r=e[1],i=n|r,o=i<131,s=r==u&&8==n||r==u&&n==c&&t[7].length<=e[8]||384==r&&e[7].length<=e[8]&&8==n;if(!o&&!s)return t;1&r&&(t[2]=e[2],i|=1&n?0:4);var l=e[3];if(l){var h=t[3];t[3]=h?bi(h,l,e[4]):l,t[4]=h?tn(t[3],a):e[4]}(l=e[5])&&(h=t[5],t[5]=h?wi(h,l,e[6]):l,t[6]=h?tn(t[5],a):e[6]),(l=e[7])&&(t[7]=l),r&u&&(t[8]=null==t[8]?e[8]:yn(t[8],e[8])),null==t[9]&&(t[9]=e[9]),t[0]=e[0],t[1]=i}(w,b),t=w[0],e=w[1],i=w[2],h=w[3],d=w[4],!(m=w[9]=w[9]===n?g?0:t.length:vn(w[9]-v,0))&&24&e&&(e&=-25),e&&1!=e)_=8==e||e==o?function(t,e,r){var i=Oi(t);return function a(){for(var o=arguments.length,s=_t(o),l=o,u=ta(a);l--;)s[l]=arguments[l];var c=o<3&&s[0]!==u&&s[o-1]!==u?[]:tn(s,u);return(o-=c.length)<r?zi(t,e,Ri,a.placeholder,n,s,c,n,n,r-o):ye(this&&this!==oe&&this instanceof a?i:t,this,s)}}(t,e,m):e!=s&&33!=e||d.length?Ri.apply(n,w):function(t,e,n,r){var i=1&e,a=Oi(t);return function e(){for(var o=-1,s=arguments.length,l=-1,u=r.length,c=_t(u+s),h=this&&this!==oe&&this instanceof e?a:t;++l<u;)c[l]=r[l];for(;s--;)c[l++]=arguments[++o];return ye(h,i?n:this,c)}}(t,e,i,h);else var _=function(t,e,n){var r=1&e,i=Oi(t);return function e(){return(this&&this!==oe&&this instanceof e?i:t).apply(r?n:this,arguments)}}(t,e,i);return Ca((b?Xr:Ma)(_,w),t,e)}function Wi(t,e,r,i){return t===n||Io(t,Rt[r])&&!Bt.call(i,r)?e:t}function Ji(t,e,r,i,a,o){return Xo(t)&&Xo(e)&&(o.set(e,t),Nr(t,e,n,Ji,o),o.delete(e)),t}function qi(t){return Ko(t)?n:t}function Xi(t,e,r,i,a,o){var s=1&r,l=t.length,u=e.length;if(l!=u&&!(s&&u>l))return!1;var c=o.get(t),h=o.get(e);if(c&&h)return c==e&&h==t;var d=-1,p=!0,f=2&r?new qn:n;for(o.set(t,e),o.set(e,t);++d<l;){var m=t[d],g=e[d];if(i)var v=s?i(g,m,d,e,t,o):i(m,g,d,t,e,o);if(v!==n){if(v)continue;p=!1;break}if(f){if(!Ae(e,function(t,e){if(!We(f,e)&&(m===t||a(m,t,r,i,o)))return f.push(e)})){p=!1;break}}else if(m!==g&&!a(m,g,r,i,o)){p=!1;break}}return o.delete(t),o.delete(e),p}function Yi(t){return Ta(xa(t,n,Na),t+"")}function Zi(t){return wr(t,Ts,aa)}function $i(t){return wr(t,Cs,oa)}var Ki=An?function(t){return An.get(t)}:nl;function Qi(t){for(var e=t.name+"",n=On[e],r=Bt.call(On,e)?n.length:0;r--;){var i=n[r],a=i.func;if(null==a||a==t)return i.name}return e}function ta(t){return(Bt.call(jn,"placeholder")?jn:t).placeholder}function ea(){var t=jn.iteratee||Ks;return t=t===Ks?Pr:t,arguments.length?t(arguments[0],arguments[1]):t}function na(t,e){var n,r,i=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof e?"string":"hash"]:i.map}function ra(t){for(var e=Ts(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,va(i)]}return e}function ia(t,e){var r=function(t,e){return null==t?n:t[e]}(t,e);return Lr(r)?r:n}var aa=dn?function(t){return null==t?[]:(t=Et(t),_e(dn(t),function(e){return ae.call(t,e)}))}:ul,oa=dn?function(t){for(var e=[];t;)Ce(e,aa(t)),t=ee(t);return e}:ul,sa=_r;function la(t,e,n){for(var r=-1,i=(e=di(e,t)).length,a=!1;++r<i;){var o=Oa(e[r]);if(!(a=null!=t&&n(t,o)))break;t=t[o]}return a||++r!=i?a:!!(i=null==t?0:t.length)&&qo(i)&&ha(o,i)&&(No(t)||Fo(t))}function ua(t){return"function"!=typeof t.constructor||ga(t)?{}:zn(ee(t))}function ca(t){return No(t)||Fo(t)||!!(le&&t&&t[le])}function ha(t,e){var n=typeof t;return!!(e=null==e?d:e)&&("number"==n||"symbol"!=n&&yt.test(t))&&t>-1&&t%1==0&&t<e}function da(t,e,n){if(!Xo(n))return!1;var r=typeof e;return!!("number"==r?zo(n)&&ha(e,n.length):"string"==r&&e in n)&&Io(n[e],t)}function pa(t,e){if(No(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!ns(t))||tt.test(t)||!Q.test(t)||null!=e&&t in Et(e)}function fa(t){var e=Qi(t),n=jn[e];if("function"!=typeof n||!(e in Un.prototype))return!1;if(t===n)return!0;var r=Ki(n);return!!r&&t===r[0]}(Mn&&sa(new Mn(new ArrayBuffer(1)))!=R||Sn&&sa(new Sn)!=M||Tn&&sa(Tn.resolve())!=C||Cn&&sa(new Cn)!=D||En&&sa(new En)!=L)&&(sa=function(t){var e=_r(t),r=e==T?t.constructor:n,i=r?La(r):"";if(i)switch(i){case Ln:return R;case Pn:return M;case Rn:return C;case In:return D;case kn:return L}return e});var ma=It?Wo:cl;function ga(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Rt)}function va(t){return t==t&&!Xo(t)}function ya(t,e){return function(r){return null!=r&&r[t]===e&&(e!==n||t in Et(r))}}function xa(t,e,r){return e=vn(e===n?t.length-1:e,0),function(){for(var n=arguments,i=-1,a=vn(n.length-e,0),o=_t(a);++i<a;)o[i]=n[e+i];i=-1;for(var s=_t(e+1);++i<e;)s[i]=n[i];return s[e]=r(o),ye(t,this,s)}}function ba(t,e){return e.length<2?t:br(t,Zr(e,0,-1))}function wa(t,e){for(var r=t.length,i=yn(e.length,r),a=_i(t);i--;){var o=e[i];t[i]=ha(o,r)?a[o]:n}return t}function _a(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}var Ma=Ea(Xr),Sa=un||function(t,e){return oe.setTimeout(t,e)},Ta=Ea(Yr);function Ca(t,e,n){var r=e+"";return Ta(t,function(t,e){var n=e.length;if(!n)return t;var r=n-1;return e[r]=(n>1?"& ":"")+e[r],e=e.join(n>2?", ":" "),t.replace(ot,"{\n/* [wrapped with "+e+"] */\n")}(r,function(t,e){return be(m,function(n){var r="_."+n[0];e&n[1]&&!Me(t,r)&&t.push(r)}),t.sort()}(function(t){var e=r.match(st);return e?e[1].split(lt):[]}(),n)))}function Ea(t){var e=0,r=0;return function(){var i=xn(),a=16-(i-r);if(r=i,a>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(n,arguments)}}function Da(t,e){var r=-1,i=t.length,a=i-1;for(e=e===n?i:e;++r<e;){var o=Hr(r,a),s=t[o];t[o]=t[r],t[r]=s}return t.length=e,t}var Aa=function(t){var e=Do(function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(et,function(t,n,r,i){e.push(r?i.replace(ht,"$1"):n||t)}),e},function(t){return 500===n.size&&n.clear(),t}),n=e.cache;return e}();function Oa(t){if("string"==typeof t||ns(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function La(t){if(null!=t){try{return kt.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Pa(t){if(t instanceof Un)return t.clone();var e=new Gn(t.__wrapped__,t.__chain__);return e.__actions__=_i(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}var Ra=Jr(function(t,e){return Vo(t)?lr(t,fr(e,1,Vo,!0)):[]}),Ia=Jr(function(t,e){var r=Ua(e);return Vo(r)&&(r=n),Vo(t)?lr(t,fr(e,1,Vo,!0),ea(r,2)):[]}),ka=Jr(function(t,e){var r=Ua(e);return Vo(r)&&(r=n),Vo(t)?lr(t,fr(e,1,Vo,!0),n,r):[]});function Ba(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:ls(n);return i<0&&(i=vn(r+i,0)),Pe(t,ea(e,3),i)}function Fa(t,e,r){var i=null==t?0:t.length;if(!i)return-1;var a=i-1;return r!==n&&(a=ls(r),a=r<0?vn(i+a,0):yn(a,i-1)),Pe(t,ea(e,3),a,!0)}function Na(t){return null!=t&&t.length?fr(t,1):[]}function ja(t){return t&&t.length?t[0]:n}var za=Jr(function(t){var e=Te(t,ci);return e.length&&e[0]===t[0]?Cr(e):[]}),Va=Jr(function(t){var e=Ua(t),r=Te(t,ci);return e===Ua(r)?e=n:r.pop(),r.length&&r[0]===t[0]?Cr(r,ea(e,2)):[]}),Ga=Jr(function(t){var e=Ua(t),r=Te(t,ci);return(e="function"==typeof e?e:n)&&r.pop(),r.length&&r[0]===t[0]?Cr(r,n,e):[]});function Ua(t){var e=null==t?0:t.length;return e?t[e-1]:n}var Ha=Jr(Wa);function Wa(t,e){return t&&t.length&&e&&e.length?Gr(t,e):t}var Ja=Yi(function(t,e){var n=null==t?0:t.length,r=rr(t,e);return Ur(t,Te(e,function(t){return ha(t,n)?+t:t}).sort(xi)),r});function qa(t){return null==t?t:_n.call(t)}var Xa=Jr(function(t){return ri(fr(t,1,Vo,!0))}),Ya=Jr(function(t){var e=Ua(t);return Vo(e)&&(e=n),ri(fr(t,1,Vo,!0),ea(e,2))}),Za=Jr(function(t){var e=Ua(t);return e="function"==typeof e?e:n,ri(fr(t,1,Vo,!0),n,e)});function $a(t){if(!t||!t.length)return[];var e=0;return t=_e(t,function(t){if(Vo(t))return e=vn(t.length,e),!0}),Ve(e,function(e){return Te(t,Fe(e))})}function Ka(t,e){if(!t||!t.length)return[];var r=$a(t);return null==e?r:Te(r,function(t){return ye(e,n,t)})}var Qa=Jr(function(t,e){return Vo(t)?lr(t,e):[]}),to=Jr(function(t){return li(_e(t,Vo))}),eo=Jr(function(t){var e=Ua(t);return Vo(e)&&(e=n),li(_e(t,Vo),ea(e,2))}),no=Jr(function(t){var e=Ua(t);return e="function"==typeof e?e:n,li(_e(t,Vo),n,e)}),ro=Jr($a),io=Jr(function(t){var e=t.length,r=e>1?t[e-1]:n;return Ka(t,r="function"==typeof r?(t.pop(),r):n)});function ao(t){var e=jn(t);return e.__chain__=!0,e}function oo(t,e){return e(t)}var so=Yi(function(t){var e=t.length,r=e?t[0]:0,i=this.__wrapped__,a=function(e){return rr(e,t)};return!(e>1||this.__actions__.length)&&i instanceof Un&&ha(r)?((i=i.slice(r,+r+(e?1:0))).__actions__.push({func:oo,args:[a],thisArg:n}),new Gn(i,this.__chain__).thru(function(t){return e&&!t.length&&t.push(n),t})):this.thru(a)}),lo=Si(function(t,e,n){Bt.call(t,n)?++t[n]:nr(t,n,1)}),uo=Li(Ba),co=Li(Fa);function ho(t,e){return(No(t)?be:ur)(t,ea(e,3))}function po(t,e){return(No(t)?function(t,e){for(var n=null==t?0:t.length;n--&&!1!==e(t[n],n,t););return t}:cr)(t,ea(e,3))}var fo=Si(function(t,e,n){Bt.call(t,n)?t[n].push(e):nr(t,n,[e])}),mo=Jr(function(t,e,n){var r=-1,i="function"==typeof e,a=zo(t)?_t(t.length):[];return ur(t,function(t){a[++r]=i?ye(e,t,n):Er(t,e,n)}),a}),go=Si(function(t,e,n){nr(t,n,e)});function vo(t,e){return(No(t)?Te:kr)(t,ea(e,3))}var yo=Si(function(t,e,n){t[n?0:1].push(e)},function(){return[[],[]]}),xo=Jr(function(t,e){if(null==t)return[];var n=e.length;return n>1&&da(t,e[0],e[1])?e=[]:n>2&&da(e[0],e[1],e[2])&&(e=[e[0]]),zr(t,fr(e,1),[])}),bo=ln||function(){return oe.Date.now()};function wo(t,e,r){return e=r?n:e,e=t&&null==e?t.length:e,Hi(t,u,n,n,n,n,e)}function _o(t,e){var i;if("function"!=typeof e)throw new Ot(r);return t=ls(t),function(){return--t>0&&(i=e.apply(this,arguments)),t<=1&&(e=n),i}}var Mo=Jr(function(t,e,n){var r=1;if(n.length){var i=tn(n,ta(Mo));r|=s}return Hi(t,r,e,n,i)}),So=Jr(function(t,e,n){var r=3;if(n.length){var i=tn(n,ta(So));r|=s}return Hi(e,r,t,n,i)});function To(t,e,i){var a,o,s,l,u,c,h=0,d=!1,p=!1,f=!0;if("function"!=typeof t)throw new Ot(r);function m(e){var r=a,i=o;return a=o=n,h=e,l=t.apply(i,r)}function g(t){var r=t-c;return c===n||r>=e||r<0||p&&t-h>=s}function v(){var t=bo();if(g(t))return y(t);u=Sa(v,function(t){var n=e-(t-c);return p?yn(n,s-(t-h)):n}(t))}function y(t){return u=n,f&&a?m(t):(a=o=n,l)}function x(){var t=bo(),r=g(t);if(a=arguments,o=this,c=t,r){if(u===n)return function(t){return h=t,u=Sa(v,e),d?m(t):l}(c);if(p)return mi(u),u=Sa(v,e),m(c)}return u===n&&(u=Sa(v,e)),l}return e=cs(e)||0,Xo(i)&&(d=!!i.leading,s=(p="maxWait"in i)?vn(cs(i.maxWait)||0,e):s,f="trailing"in i?!!i.trailing:f),x.cancel=function(){u!==n&&mi(u),h=0,a=c=o=u=n},x.flush=function(){return u===n?l:y(bo())},x}var Co=Jr(function(t,e){return sr(t,1,e)}),Eo=Jr(function(t,e,n){return sr(t,cs(e)||0,n)});function Do(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new Ot(r);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var o=t.apply(this,r);return n.cache=a.set(i,o)||a,o};return n.cache=new(Do.Cache||Jn),n}function Ao(t){if("function"!=typeof t)throw new Ot(r);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}Do.Cache=Jn;var Oo=pi(function(t,e){var n=(e=1==e.length&&No(e[0])?Te(e[0],Ue(ea())):Te(fr(e,1),Ue(ea()))).length;return Jr(function(r){for(var i=-1,a=yn(r.length,n);++i<a;)r[i]=e[i].call(this,r[i]);return ye(t,this,r)})}),Lo=Jr(function(t,e){var r=tn(e,ta(Lo));return Hi(t,s,n,e,r)}),Po=Jr(function(t,e){var r=tn(e,ta(Po));return Hi(t,l,n,e,r)}),Ro=Yi(function(t,e){return Hi(t,c,n,n,n,e)});function Io(t,e){return t===e||t!=t&&e!=e}var ko=ji(Mr),Bo=ji(function(t,e){return t>=e}),Fo=Dr(function(){return arguments}())?Dr:function(t){return Yo(t)&&Bt.call(t,"callee")&&!ae.call(t,"callee")},No=_t.isArray,jo=de?Ue(de):function(t){return Yo(t)&&_r(t)==P};function zo(t){return null!=t&&qo(t.length)&&!Wo(t)}function Vo(t){return Yo(t)&&zo(t)}var Go=pn||cl,Uo=pe?Ue(pe):function(t){return Yo(t)&&_r(t)==x};function Ho(t){if(!Yo(t))return!1;var e=_r(t);return e==b||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!Ko(t)}function Wo(t){if(!Xo(t))return!1;var e=_r(t);return e==w||e==_||"[object AsyncFunction]"==e||"[object Proxy]"==e}function Jo(t){return"number"==typeof t&&t==ls(t)}function qo(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=d}function Xo(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Yo(t){return null!=t&&"object"==typeof t}var Zo=fe?Ue(fe):function(t){return Yo(t)&&sa(t)==M};function $o(t){return"number"==typeof t||Yo(t)&&_r(t)==S}function Ko(t){if(!Yo(t)||_r(t)!=T)return!1;var e=ee(t);if(null===e)return!0;var n=Bt.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&kt.call(n)==zt}var Qo=me?Ue(me):function(t){return Yo(t)&&_r(t)==E},ts=ge?Ue(ge):function(t){return Yo(t)&&sa(t)==D};function es(t){return"string"==typeof t||!No(t)&&Yo(t)&&_r(t)==A}function ns(t){return"symbol"==typeof t||Yo(t)&&_r(t)==O}var rs=ve?Ue(ve):function(t){return Yo(t)&&qo(t.length)&&!!Qt[_r(t)]},is=ji(Ir),as=ji(function(t,e){return t<=e});function os(t){if(!t)return[];if(zo(t))return es(t)?rn(t):_i(t);if(ce&&t[ce])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[ce]());var e=sa(t);return(e==M?Ke:e==D?en:Is)(t)}function ss(t){return t?(t=cs(t))===h||t===-1/0?1.7976931348623157e308*(t<0?-1:1):t==t?t:0:0===t?t:0}function ls(t){var e=ss(t),n=e%1;return e==e?n?e-n:e:0}function us(t){return t?ir(ls(t),0,f):0}function cs(t){if("number"==typeof t)return t;if(ns(t))return p;if(Xo(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=Xo(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Ge(t);var n=mt.test(t);return n||vt.test(t)?re(t.slice(2),n?2:8):ft.test(t)?p:+t}function hs(t){return Mi(t,Cs(t))}function ds(t){return null==t?"":ni(t)}var ps=Ti(function(t,e){if(ga(e)||zo(e))Mi(e,Ts(e),t);else for(var n in e)Bt.call(e,n)&&Kn(t,n,e[n])}),fs=Ti(function(t,e){Mi(e,Cs(e),t)}),ms=Ti(function(t,e,n,r){Mi(e,Cs(e),t,r)}),gs=Ti(function(t,e,n,r){Mi(e,Ts(e),t,r)}),vs=Yi(rr),ys=Jr(function(t,e){t=Et(t);var r=-1,i=e.length,a=i>2?e[2]:n;for(a&&da(e[0],e[1],a)&&(i=1);++r<i;)for(var o=e[r],s=Cs(o),l=-1,u=s.length;++l<u;){var c=s[l],h=t[c];(h===n||Io(h,Rt[c])&&!Bt.call(t,c))&&(t[c]=o[c])}return t}),xs=Jr(function(t){return t.push(n,Ji),ye(Ds,n,t)});function bs(t,e,r){var i=null==t?n:br(t,e);return i===n?r:i}function ws(t,e){return null!=t&&la(t,e,Tr)}var _s=Ii(function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=jt.call(e)),t[e]=n},Xs($s)),Ms=Ii(function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=jt.call(e)),Bt.call(t,e)?t[e].push(n):t[e]=[n]},ea),Ss=Jr(Er);function Ts(t){return zo(t)?Yn(t):Rr(t)}function Cs(t){return zo(t)?Yn(t,!0):function(t){if(!Xo(t))return function(t){var e=[];if(null!=t)for(var n in Et(t))e.push(n);return e}(t);var e=ga(t),n=[];for(var r in t)("constructor"!=r||!e&&Bt.call(t,r))&&n.push(r);return n}(t)}var Es=Ti(function(t,e,n){Nr(t,e,n)}),Ds=Ti(function(t,e,n,r){Nr(t,e,n,r)}),As=Yi(function(t,e){var n={};if(null==t)return n;var r=!1;e=Te(e,function(e){return e=di(e,t),r||(r=e.length>1),e}),Mi(t,$i(t),n),r&&(n=ar(n,7,qi));for(var i=e.length;i--;)ii(n,e[i]);return n}),Os=Yi(function(t,e){return null==t?{}:function(t,e){return Vr(t,e,function(e,n){return ws(t,n)})}(t,e)});function Ls(t,e){if(null==t)return{};var n=Te($i(t),function(t){return[t]});return e=ea(e),Vr(t,n,function(t,n){return e(t,n[0])})}var Ps=Ui(Ts),Rs=Ui(Cs);function Is(t){return null==t?[]:He(t,Ts(t))}var ks=Ai(function(t,e,n){return e=e.toLowerCase(),t+(n?Bs(e):e)});function Bs(t){return Hs(ds(t).toLowerCase())}function Fs(t){return(t=ds(t))&&t.replace(xt,Xe).replace(Jt,"")}var Ns=Ai(function(t,e,n){return t+(n?"-":"")+e.toLowerCase()}),js=Ai(function(t,e,n){return t+(n?" ":"")+e.toLowerCase()}),zs=Di("toLowerCase"),Vs=Ai(function(t,e,n){return t+(n?"_":"")+e.toLowerCase()}),Gs=Ai(function(t,e,n){return t+(n?" ":"")+Hs(e)}),Us=Ai(function(t,e,n){return t+(n?" ":"")+e.toUpperCase()}),Hs=Di("toUpperCase");function Ws(t,e,r){return t=ds(t),(e=r?n:e)===n?function(t){return Zt.test(t)}(t)?function(t){return t.match(Xt)||[]}(t):function(t){return t.match(ut)||[]}(t):t.match(e)||[]}var Js=Jr(function(t,e){try{return ye(t,n,e)}catch(t){return Ho(t)?t:new St(t)}}),qs=Yi(function(t,e){return be(e,function(e){e=Oa(e),nr(t,e,Mo(t[e],t))}),t});function Xs(t){return function(){return t}}var Ys=Pi(),Zs=Pi(!0);function $s(t){return t}function Ks(t){return Pr("function"==typeof t?t:ar(t,1))}var Qs=Jr(function(t,e){return function(n){return Er(n,t,e)}}),tl=Jr(function(t,e){return function(n){return Er(t,n,e)}});function el(t,e,n){var r=Ts(e),i=xr(e,r);null!=n||Xo(e)&&(i.length||!r.length)||(n=e,e=t,t=this,i=xr(e,Ts(e)));var a=!(Xo(n)&&"chain"in n&&!n.chain),o=Wo(t);return be(i,function(n){var r=e[n];t[n]=r,o&&(t.prototype[n]=function(){var e=this.__chain__;if(a||e){var n=t(this.__wrapped__);return(n.__actions__=_i(this.__actions__)).push({func:r,args:arguments,thisArg:t}),n.__chain__=e,n}return r.apply(t,Ce([this.value()],arguments))})}),t}function nl(){}var rl=Bi(Te),il=Bi(we),al=Bi(Ae);function ol(t){return pa(t)?Fe(Oa(t)):function(t){return function(e){return br(e,t)}}(t)}var sl=Ni(),ll=Ni(!0);function ul(){return[]}function cl(){return!1}var hl,dl=ki(function(t,e){return t+e},0),pl=Vi("ceil"),fl=ki(function(t,e){return t/e},1),ml=Vi("floor"),gl=ki(function(t,e){return t*e},1),vl=Vi("round"),yl=ki(function(t,e){return t-e},0);return jn.after=function(t,e){if("function"!=typeof e)throw new Ot(r);return t=ls(t),function(){if(--t<1)return e.apply(this,arguments)}},jn.ary=wo,jn.assign=ps,jn.assignIn=fs,jn.assignInWith=ms,jn.assignWith=gs,jn.at=vs,jn.before=_o,jn.bind=Mo,jn.bindAll=qs,jn.bindKey=So,jn.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return No(t)?t:[t]},jn.chain=ao,jn.chunk=function(t,e,r){e=(r?da(t,e,r):e===n)?1:vn(ls(e),0);var i=null==t?0:t.length;if(!i||e<1)return[];for(var a=0,o=0,s=_t(cn(i/e));a<i;)s[o++]=Zr(t,a,a+=e);return s},jn.compact=function(t){for(var e=-1,n=null==t?0:t.length,r=0,i=[];++e<n;){var a=t[e];a&&(i[r++]=a)}return i},jn.concat=function(){var t=arguments.length;if(!t)return[];for(var e=_t(t-1),n=arguments[0],r=t;r--;)e[r-1]=arguments[r];return Ce(No(n)?_i(n):[n],fr(e,1))},jn.cond=function(t){var e=null==t?0:t.length,n=ea();return t=e?Te(t,function(t){if("function"!=typeof t[1])throw new Ot(r);return[n(t[0]),t[1]]}):[],Jr(function(n){for(var r=-1;++r<e;){var i=t[r];if(ye(i[0],this,n))return ye(i[1],this,n)}})},jn.conforms=function(t){return function(t){var e=Ts(t);return function(n){return or(n,t,e)}}(ar(t,1))},jn.constant=Xs,jn.countBy=lo,jn.create=function(t,e){var n=zn(t);return null==e?n:er(n,e)},jn.curry=function t(e,r,i){var a=Hi(e,8,n,n,n,n,n,r=i?n:r);return a.placeholder=t.placeholder,a},jn.curryRight=function t(e,r,i){var a=Hi(e,o,n,n,n,n,n,r=i?n:r);return a.placeholder=t.placeholder,a},jn.debounce=To,jn.defaults=ys,jn.defaultsDeep=xs,jn.defer=Co,jn.delay=Eo,jn.difference=Ra,jn.differenceBy=Ia,jn.differenceWith=ka,jn.drop=function(t,e,r){var i=null==t?0:t.length;return i?Zr(t,(e=r||e===n?1:ls(e))<0?0:e,i):[]},jn.dropRight=function(t,e,r){var i=null==t?0:t.length;return i?Zr(t,0,(e=i-(e=r||e===n?1:ls(e)))<0?0:e):[]},jn.dropRightWhile=function(t,e){return t&&t.length?oi(t,ea(e,3),!0,!0):[]},jn.dropWhile=function(t,e){return t&&t.length?oi(t,ea(e,3),!0):[]},jn.fill=function(t,e,r,i){var a=null==t?0:t.length;return a?(r&&"number"!=typeof r&&da(t,e,r)&&(r=0,i=a),function(t,e,r,i){var a=t.length;for((r=ls(r))<0&&(r=-r>a?0:a+r),(i=i===n||i>a?a:ls(i))<0&&(i+=a),i=r>i?0:us(i);r<i;)t[r++]=e;return t}(t,e,r,i)):[]},jn.filter=function(t,e){return(No(t)?_e:pr)(t,ea(e,3))},jn.flatMap=function(t,e){return fr(vo(t,e),1)},jn.flatMapDeep=function(t,e){return fr(vo(t,e),h)},jn.flatMapDepth=function(t,e,r){return r=r===n?1:ls(r),fr(vo(t,e),r)},jn.flatten=Na,jn.flattenDeep=function(t){return null!=t&&t.length?fr(t,h):[]},jn.flattenDepth=function(t,e){return null!=t&&t.length?fr(t,e=e===n?1:ls(e)):[]},jn.flip=function(t){return Hi(t,512)},jn.flow=Ys,jn.flowRight=Zs,jn.fromPairs=function(t){for(var e=-1,n=null==t?0:t.length,r={};++e<n;){var i=t[e];r[i[0]]=i[1]}return r},jn.functions=function(t){return null==t?[]:xr(t,Ts(t))},jn.functionsIn=function(t){return null==t?[]:xr(t,Cs(t))},jn.groupBy=fo,jn.initial=function(t){return null!=t&&t.length?Zr(t,0,-1):[]},jn.intersection=za,jn.intersectionBy=Va,jn.intersectionWith=Ga,jn.invert=_s,jn.invertBy=Ms,jn.invokeMap=mo,jn.iteratee=Ks,jn.keyBy=go,jn.keys=Ts,jn.keysIn=Cs,jn.map=vo,jn.mapKeys=function(t,e){var n={};return e=ea(e,3),vr(t,function(t,r,i){nr(n,e(t,r,i),t)}),n},jn.mapValues=function(t,e){var n={};return e=ea(e,3),vr(t,function(t,r,i){nr(n,r,e(t,r,i))}),n},jn.matches=function(t){return Br(ar(t,1))},jn.matchesProperty=function(t,e){return Fr(t,ar(e,1))},jn.memoize=Do,jn.merge=Es,jn.mergeWith=Ds,jn.method=Qs,jn.methodOf=tl,jn.mixin=el,jn.negate=Ao,jn.nthArg=function(t){return t=ls(t),Jr(function(e){return jr(e,t)})},jn.omit=As,jn.omitBy=function(t,e){return Ls(t,Ao(ea(e)))},jn.once=function(t){return _o(2,t)},jn.orderBy=function(t,e,r,i){return null==t?[]:(No(e)||(e=null==e?[]:[e]),No(r=i?n:r)||(r=null==r?[]:[r]),zr(t,e,r))},jn.over=rl,jn.overArgs=Oo,jn.overEvery=il,jn.overSome=al,jn.partial=Lo,jn.partialRight=Po,jn.partition=yo,jn.pick=Os,jn.pickBy=Ls,jn.property=ol,jn.propertyOf=function(t){return function(e){return null==t?n:br(t,e)}},jn.pull=Ha,jn.pullAll=Wa,jn.pullAllBy=function(t,e,n){return t&&t.length&&e&&e.length?Gr(t,e,ea(n,2)):t},jn.pullAllWith=function(t,e,r){return t&&t.length&&e&&e.length?Gr(t,e,n,r):t},jn.pullAt=Ja,jn.range=sl,jn.rangeRight=ll,jn.rearg=Ro,jn.reject=function(t,e){return(No(t)?_e:pr)(t,Ao(ea(e,3)))},jn.remove=function(t,e){var n=[];if(!t||!t.length)return n;var r=-1,i=[],a=t.length;for(e=ea(e,3);++r<a;){var o=t[r];e(o,r,t)&&(n.push(o),i.push(r))}return Ur(t,i),n},jn.rest=function(t,e){if("function"!=typeof t)throw new Ot(r);return Jr(t,e=e===n?e:ls(e))},jn.reverse=qa,jn.sampleSize=function(t,e,r){return e=(r?da(t,e,r):e===n)?1:ls(e),(No(t)?function(t,e){return Da(_i(t),ir(e,0,t.length))}:function(t,e){var n=Is(t);return Da(n,ir(e,0,n.length))})(t,e)},jn.set=function(t,e,n){return null==t?t:qr(t,e,n)},jn.setWith=function(t,e,r,i){return i="function"==typeof i?i:n,null==t?t:qr(t,e,r,i)},jn.shuffle=function(t){return(No(t)?function(t){return Da(_i(t))}:function(t){return Da(Is(t))})(t)},jn.slice=function(t,e,r){var i=null==t?0:t.length;return i?(r&&"number"!=typeof r&&da(t,e,r)?(e=0,r=i):(e=null==e?0:ls(e),r=r===n?i:ls(r)),Zr(t,e,r)):[]},jn.sortBy=xo,jn.sortedUniq=function(t){return t&&t.length?ti(t):[]},jn.sortedUniqBy=function(t,e){return t&&t.length?ti(t,ea(e,2)):[]},jn.split=function(t,e,r){return r&&"number"!=typeof r&&da(t,e,r)&&(e=r=n),(r=r===n?f:r>>>0)?(t=ds(t))&&("string"==typeof e||null!=e&&!Qo(e))&&!(e=ni(e))&&$e(t)?fi(rn(t),0,r):t.split(e,r):[]},jn.spread=function(t,e){if("function"!=typeof t)throw new Ot(r);return e=null==e?0:vn(ls(e),0),Jr(function(n){var r=n[e],i=fi(n,0,e);return r&&Ce(i,r),ye(t,this,i)})},jn.tail=function(t){var e=null==t?0:t.length;return e?Zr(t,1,e):[]},jn.take=function(t,e,r){return t&&t.length?Zr(t,0,(e=r||e===n?1:ls(e))<0?0:e):[]},jn.takeRight=function(t,e,r){var i=null==t?0:t.length;return i?Zr(t,(e=i-(e=r||e===n?1:ls(e)))<0?0:e,i):[]},jn.takeRightWhile=function(t,e){return t&&t.length?oi(t,ea(e,3),!1,!0):[]},jn.takeWhile=function(t,e){return t&&t.length?oi(t,ea(e,3)):[]},jn.tap=function(t,e){return e(t),t},jn.throttle=function(t,e,n){var i=!0,a=!0;if("function"!=typeof t)throw new Ot(r);return Xo(n)&&(i="leading"in n?!!n.leading:i,a="trailing"in n?!!n.trailing:a),To(t,e,{leading:i,maxWait:e,trailing:a})},jn.thru=oo,jn.toArray=os,jn.toPairs=Ps,jn.toPairsIn=Rs,jn.toPath=function(t){return No(t)?Te(t,Oa):ns(t)?[t]:_i(Aa(ds(t)))},jn.toPlainObject=hs,jn.transform=function(t,e,n){var r=No(t),i=r||Go(t)||rs(t);if(e=ea(e,4),null==n){var a=t&&t.constructor;n=i?r?new a:[]:Xo(t)&&Wo(a)?zn(ee(t)):{}}return(i?be:vr)(t,function(t,r,i){return e(n,t,r,i)}),n},jn.unary=function(t){return wo(t,1)},jn.union=Xa,jn.unionBy=Ya,jn.unionWith=Za,jn.uniq=function(t){return t&&t.length?ri(t):[]},jn.uniqBy=function(t,e){return t&&t.length?ri(t,ea(e,2)):[]},jn.uniqWith=function(t,e){return e="function"==typeof e?e:n,t&&t.length?ri(t,n,e):[]},jn.unset=function(t,e){return null==t||ii(t,e)},jn.unzip=$a,jn.unzipWith=Ka,jn.update=function(t,e,n){return null==t?t:ai(t,e,hi(n))},jn.updateWith=function(t,e,r,i){return i="function"==typeof i?i:n,null==t?t:ai(t,e,hi(r),i)},jn.values=Is,jn.valuesIn=function(t){return null==t?[]:He(t,Cs(t))},jn.without=Qa,jn.words=Ws,jn.wrap=function(t,e){return Lo(hi(e),t)},jn.xor=to,jn.xorBy=eo,jn.xorWith=no,jn.zip=ro,jn.zipObject=function(t,e){return ui(t||[],e||[],Kn)},jn.zipObjectDeep=function(t,e){return ui(t||[],e||[],qr)},jn.zipWith=io,jn.entries=Ps,jn.entriesIn=Rs,jn.extend=fs,jn.extendWith=ms,el(jn,jn),jn.add=dl,jn.attempt=Js,jn.camelCase=ks,jn.capitalize=Bs,jn.ceil=pl,jn.clamp=function(t,e,r){return r===n&&(r=e,e=n),r!==n&&(r=(r=cs(r))==r?r:0),e!==n&&(e=(e=cs(e))==e?e:0),ir(cs(t),e,r)},jn.clone=function(t){return ar(t,4)},jn.cloneDeep=function(t){return ar(t,5)},jn.cloneDeepWith=function(t,e){return ar(t,5,e="function"==typeof e?e:n)},jn.cloneWith=function(t,e){return ar(t,4,e="function"==typeof e?e:n)},jn.conformsTo=function(t,e){return null==e||or(t,e,Ts(e))},jn.deburr=Fs,jn.defaultTo=function(t,e){return null==t||t!=t?e:t},jn.divide=fl,jn.endsWith=function(t,e,r){t=ds(t),e=ni(e);var i=t.length,a=r=r===n?i:ir(ls(r),0,i);return(r-=e.length)>=0&&t.slice(r,a)==e},jn.eq=Io,jn.escape=function(t){return(t=ds(t))&&Y.test(t)?t.replace(q,Ye):t},jn.escapeRegExp=function(t){return(t=ds(t))&&rt.test(t)?t.replace(nt,"\\$&"):t},jn.every=function(t,e,r){var i=No(t)?we:hr;return r&&da(t,e,r)&&(e=n),i(t,ea(e,3))},jn.find=uo,jn.findIndex=Ba,jn.findKey=function(t,e){return Le(t,ea(e,3),vr)},jn.findLast=co,jn.findLastIndex=Fa,jn.findLastKey=function(t,e){return Le(t,ea(e,3),yr)},jn.floor=ml,jn.forEach=ho,jn.forEachRight=po,jn.forIn=function(t,e){return null==t?t:mr(t,ea(e,3),Cs)},jn.forInRight=function(t,e){return null==t?t:gr(t,ea(e,3),Cs)},jn.forOwn=function(t,e){return t&&vr(t,ea(e,3))},jn.forOwnRight=function(t,e){return t&&yr(t,ea(e,3))},jn.get=bs,jn.gt=ko,jn.gte=Bo,jn.has=function(t,e){return null!=t&&la(t,e,Sr)},jn.hasIn=ws,jn.head=ja,jn.identity=$s,jn.includes=function(t,e,n,r){t=zo(t)?t:Is(t),n=n&&!r?ls(n):0;var i=t.length;return n<0&&(n=vn(i+n,0)),es(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&Re(t,e,n)>-1},jn.indexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:ls(n);return i<0&&(i=vn(r+i,0)),Re(t,e,i)},jn.inRange=function(t,e,r){return e=ss(e),r===n?(r=e,e=0):r=ss(r),function(t,e,n){return t>=yn(e,n)&&t<vn(e,n)}(t=cs(t),e,r)},jn.invoke=Ss,jn.isArguments=Fo,jn.isArray=No,jn.isArrayBuffer=jo,jn.isArrayLike=zo,jn.isArrayLikeObject=Vo,jn.isBoolean=function(t){return!0===t||!1===t||Yo(t)&&_r(t)==y},jn.isBuffer=Go,jn.isDate=Uo,jn.isElement=function(t){return Yo(t)&&1===t.nodeType&&!Ko(t)},jn.isEmpty=function(t){if(null==t)return!0;if(zo(t)&&(No(t)||"string"==typeof t||"function"==typeof t.splice||Go(t)||rs(t)||Fo(t)))return!t.length;var e=sa(t);if(e==M||e==D)return!t.size;if(ga(t))return!Rr(t).length;for(var n in t)if(Bt.call(t,n))return!1;return!0},jn.isEqual=function(t,e){return Ar(t,e)},jn.isEqualWith=function(t,e,r){var i=(r="function"==typeof r?r:n)?r(t,e):n;return i===n?Ar(t,e,n,r):!!i},jn.isError=Ho,jn.isFinite=function(t){return"number"==typeof t&&fn(t)},jn.isFunction=Wo,jn.isInteger=Jo,jn.isLength=qo,jn.isMap=Zo,jn.isMatch=function(t,e){return t===e||Or(t,e,ra(e))},jn.isMatchWith=function(t,e,r){return r="function"==typeof r?r:n,Or(t,e,ra(e),r)},jn.isNaN=function(t){return $o(t)&&t!=+t},jn.isNative=function(t){if(ma(t))throw new St("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Lr(t)},jn.isNil=function(t){return null==t},jn.isNull=function(t){return null===t},jn.isNumber=$o,jn.isObject=Xo,jn.isObjectLike=Yo,jn.isPlainObject=Ko,jn.isRegExp=Qo,jn.isSafeInteger=function(t){return Jo(t)&&t>=-9007199254740991&&t<=d},jn.isSet=ts,jn.isString=es,jn.isSymbol=ns,jn.isTypedArray=rs,jn.isUndefined=function(t){return t===n},jn.isWeakMap=function(t){return Yo(t)&&sa(t)==L},jn.isWeakSet=function(t){return Yo(t)&&"[object WeakSet]"==_r(t)},jn.join=function(t,e){return null==t?"":mn.call(t,e)},jn.kebabCase=Ns,jn.last=Ua,jn.lastIndexOf=function(t,e,r){var i=null==t?0:t.length;if(!i)return-1;var a=i;return r!==n&&(a=(a=ls(r))<0?vn(i+a,0):yn(a,i-1)),e==e?function(t,e,n){for(var r=a+1;r--;)if(t[r]===e)return r;return r}(t,e):Pe(t,ke,a,!0)},jn.lowerCase=js,jn.lowerFirst=zs,jn.lt=is,jn.lte=as,jn.max=function(t){return t&&t.length?dr(t,$s,Mr):n},jn.maxBy=function(t,e){return t&&t.length?dr(t,ea(e,2),Mr):n},jn.mean=function(t){return Be(t,$s)},jn.meanBy=function(t,e){return Be(t,ea(e,2))},jn.min=function(t){return t&&t.length?dr(t,$s,Ir):n},jn.minBy=function(t,e){return t&&t.length?dr(t,ea(e,2),Ir):n},jn.stubArray=ul,jn.stubFalse=cl,jn.stubObject=function(){return{}},jn.stubString=function(){return""},jn.stubTrue=function(){return!0},jn.multiply=gl,jn.nth=function(t,e){return t&&t.length?jr(t,ls(e)):n},jn.noConflict=function(){return oe._===this&&(oe._=Vt),this},jn.noop=nl,jn.now=bo,jn.pad=function(t,e,n){t=ds(t);var r=(e=ls(e))?nn(t):0;if(!e||r>=e)return t;var i=(e-r)/2;return Fi(hn(i),n)+t+Fi(cn(i),n)},jn.padEnd=function(t,e,n){t=ds(t);var r=(e=ls(e))?nn(t):0;return e&&r<e?t+Fi(e-r,n):t},jn.padStart=function(t,e,n){t=ds(t);var r=(e=ls(e))?nn(t):0;return e&&r<e?Fi(e-r,n)+t:t},jn.parseInt=function(t,e,n){return n||null==e?e=0:e&&(e=+e),bn(ds(t).replace(it,""),e||0)},jn.random=function(t,e,r){if(r&&"boolean"!=typeof r&&da(t,e,r)&&(e=r=n),r===n&&("boolean"==typeof e?(r=e,e=n):"boolean"==typeof t&&(r=t,t=n)),t===n&&e===n?(t=0,e=1):(t=ss(t),e===n?(e=t,t=0):e=ss(e)),t>e){var i=t;t=e,e=i}if(r||t%1||e%1){var a=wn();return yn(t+a*(e-t+ne("1e-"+((a+"").length-1))),e)}return Hr(t,e)},jn.reduce=function(t,e,n){var r=No(t)?Ee:je,i=arguments.length<3;return r(t,ea(e,4),n,i,ur)},jn.reduceRight=function(t,e,n){var r=No(t)?De:je,i=arguments.length<3;return r(t,ea(e,4),n,i,cr)},jn.repeat=function(t,e,r){return e=(r?da(t,e,r):e===n)?1:ls(e),Wr(ds(t),e)},jn.replace=function(){var t=arguments,e=ds(t[0]);return t.length<3?e:e.replace(t[1],t[2])},jn.result=function(t,e,r){var i=-1,a=(e=di(e,t)).length;for(a||(a=1,t=n);++i<a;){var o=null==t?n:t[Oa(e[i])];o===n&&(i=a,o=r),t=Wo(o)?o.call(t):o}return t},jn.round=vl,jn.runInContext=t,jn.sample=function(t){return(No(t)?Zn:function(t){return Zn(Is(t))})(t)},jn.size=function(t){if(null==t)return 0;if(zo(t))return es(t)?nn(t):t.length;var e=sa(t);return e==M||e==D?t.size:Rr(t).length},jn.snakeCase=Vs,jn.some=function(t,e,r){var i=No(t)?Ae:$r;return r&&da(t,e,r)&&(e=n),i(t,ea(e,3))},jn.sortedIndex=function(t,e){return Kr(t,e)},jn.sortedIndexBy=function(t,e,n){return Qr(t,e,ea(n,2))},jn.sortedIndexOf=function(t,e){var n=null==t?0:t.length;if(n){var r=Kr(t,e);if(r<n&&Io(t[r],e))return r}return-1},jn.sortedLastIndex=function(t,e){return Kr(t,e,!0)},jn.sortedLastIndexBy=function(t,e,n){return Qr(t,e,ea(n,2),!0)},jn.sortedLastIndexOf=function(t,e){if(null!=t&&t.length){var n=Kr(t,e,!0)-1;if(Io(t[n],e))return n}return-1},jn.startCase=Gs,jn.startsWith=function(t,e,n){return t=ds(t),n=null==n?0:ir(ls(n),0,t.length),e=ni(e),t.slice(n,n+e.length)==e},jn.subtract=yl,jn.sum=function(t){return t&&t.length?ze(t,$s):0},jn.sumBy=function(t,e){return t&&t.length?ze(t,ea(e,2)):0},jn.template=function(t,e,r){var i=jn.templateSettings;r&&da(t,e,r)&&(e=n),t=ds(t),e=ms({},e,i,Wi);var a,o,s=ms({},e.imports,i.imports,Wi),l=Ts(s),u=He(s,l),c=0,h=e.interpolate||bt,d="__p += '",p=Dt((e.escape||bt).source+"|"+h.source+"|"+(h===K?dt:bt).source+"|"+(e.evaluate||bt).source+"|$","g"),f="//# sourceURL="+(Bt.call(e,"sourceURL")?(e.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Kt+"]")+"\n";t.replace(p,function(e,n,r,i,s,l){return r||(r=i),d+=t.slice(c,l).replace(wt,Ze),n&&(a=!0,d+="' +\n__e("+n+") +\n'"),s&&(o=!0,d+="';\n"+s+";\n__p += '"),r&&(d+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),c=l+e.length,e}),d+="';\n";var m=Bt.call(e,"variable")&&e.variable;if(m){if(ct.test(m))throw new St("Invalid `variable` option passed into `_.template`")}else d="with (obj) {\n"+d+"\n}\n";d=(o?d.replace(U,""):d).replace(H,"$1").replace(W,"$1;"),d="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(a?", __e = _.escape":"")+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var g=Js(function(){return Tt(l,f+"return "+d).apply(n,u)});if(g.source=d,Ho(g))throw g;return g},jn.times=function(t,e){if((t=ls(t))<1||t>d)return[];var n=f,r=yn(t,f);e=ea(e),t-=f;for(var i=Ve(r,e);++n<t;)e(n);return i},jn.toFinite=ss,jn.toInteger=ls,jn.toLength=us,jn.toLower=function(t){return ds(t).toLowerCase()},jn.toNumber=cs,jn.toSafeInteger=function(t){return t?ir(ls(t),-9007199254740991,d):0===t?t:0},jn.toString=ds,jn.toUpper=function(t){return ds(t).toUpperCase()},jn.trim=function(t,e,r){if((t=ds(t))&&(r||e===n))return Ge(t);if(!t||!(e=ni(e)))return t;var i=rn(t),a=rn(e);return fi(i,Je(i,a),qe(i,a)+1).join("")},jn.trimEnd=function(t,e,r){if((t=ds(t))&&(r||e===n))return t.slice(0,an(t)+1);if(!t||!(e=ni(e)))return t;var i=rn(t);return fi(i,0,qe(i,rn(e))+1).join("")},jn.trimStart=function(t,e,r){if((t=ds(t))&&(r||e===n))return t.replace(it,"");if(!t||!(e=ni(e)))return t;var i=rn(t);return fi(i,Je(i,rn(e))).join("")},jn.truncate=function(t,e){var r=30,i="...";if(Xo(e)){var a="separator"in e?e.separator:a;r="length"in e?ls(e.length):r,i="omission"in e?ni(e.omission):i}var o=(t=ds(t)).length;if($e(t)){var s=rn(t);o=s.length}if(r>=o)return t;var l=r-nn(i);if(l<1)return i;var u=s?fi(s,0,l).join(""):t.slice(0,l);if(a===n)return u+i;if(s&&(l+=u.length-l),Qo(a)){if(t.slice(l).search(a)){var c,h=u;for(a.global||(a=Dt(a.source,ds(pt.exec(a))+"g")),a.lastIndex=0;c=a.exec(h);)var d=c.index;u=u.slice(0,d===n?l:d)}}else if(t.indexOf(ni(a),l)!=l){var p=u.lastIndexOf(a);p>-1&&(u=u.slice(0,p))}return u+i},jn.unescape=function(t){return(t=ds(t))&&X.test(t)?t.replace(J,on):t},jn.uniqueId=function(t){var e=++Ft;return ds(t)+e},jn.upperCase=Us,jn.upperFirst=Hs,jn.each=ho,jn.eachRight=po,jn.first=ja,el(jn,(hl={},vr(jn,function(t,e){Bt.call(jn.prototype,e)||(hl[e]=t)}),hl),{chain:!1}),jn.VERSION="4.17.21",be(["bind","bindKey","curry","curryRight","partial","partialRight"],function(t){jn[t].placeholder=jn}),be(["drop","take"],function(t,e){Un.prototype[t]=function(r){r=r===n?1:vn(ls(r),0);var i=this.__filtered__&&!e?new Un(this):this.clone();return i.__filtered__?i.__takeCount__=yn(r,i.__takeCount__):i.__views__.push({size:yn(r,f),type:t+(i.__dir__<0?"Right":"")}),i},Un.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}}),be(["filter","map","takeWhile"],function(t,e){var n=e+1,r=1==n||3==n;Un.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:ea(t,3),type:n}),e.__filtered__=e.__filtered__||r,e}}),be(["head","last"],function(t,e){var n="take"+(e?"Right":"");Un.prototype[t]=function(){return this[n](1).value()[0]}}),be(["initial","tail"],function(t,e){var n="drop"+(e?"":"Right");Un.prototype[t]=function(){return this.__filtered__?new Un(this):this[n](1)}}),Un.prototype.compact=function(){return this.filter($s)},Un.prototype.find=function(t){return this.filter(t).head()},Un.prototype.findLast=function(t){return this.reverse().find(t)},Un.prototype.invokeMap=Jr(function(t,e){return"function"==typeof t?new Un(this):this.map(function(n){return Er(n,t,e)})}),Un.prototype.reject=function(t){return this.filter(Ao(ea(t)))},Un.prototype.slice=function(t,e){t=ls(t);var r=this;return r.__filtered__&&(t>0||e<0)?new Un(r):(t<0?r=r.takeRight(-t):t&&(r=r.drop(t)),e!==n&&(r=(e=ls(e))<0?r.dropRight(-e):r.take(e-t)),r)},Un.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Un.prototype.toArray=function(){return this.take(f)},vr(Un.prototype,function(t,e){var r=/^(?:filter|find|map|reject)|While$/.test(e),i=/^(?:head|last)$/.test(e),a=jn[i?"take"+("last"==e?"Right":""):e],o=i||/^find/.test(e);a&&(jn.prototype[e]=function(){var e=this.__wrapped__,s=i?[1]:arguments,l=e instanceof Un,u=s[0],c=l||No(e),h=function(t){var e=a.apply(jn,Ce([t],s));return i&&d?e[0]:e};c&&r&&"function"==typeof u&&1!=u.length&&(l=c=!1);var d=this.__chain__,p=!!this.__actions__.length,f=o&&!d,m=l&&!p;if(!o&&c){e=m?e:new Un(this);var g=t.apply(e,s);return g.__actions__.push({func:oo,args:[h],thisArg:n}),new Gn(g,d)}return f&&m?t.apply(this,s):(g=this.thru(h),f?i?g.value()[0]:g.value():g)})}),be(["pop","push","shift","sort","splice","unshift"],function(t){var e=Lt[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:pop|shift)$/.test(t);jn.prototype[t]=function(){var t=arguments;if(r&&!this.__chain__){var i=this.value();return e.apply(No(i)?i:[],t)}return this[n](function(n){return e.apply(No(n)?n:[],t)})}}),vr(Un.prototype,function(t,e){var n=jn[e];if(n){var r=n.name+"";Bt.call(On,r)||(On[r]=[]),On[r].push({name:e,func:n})}}),On[Ri(n,2).name]=[{name:"wrapper",func:n}],Un.prototype.clone=function(){var t=new Un(this.__wrapped__);return t.__actions__=_i(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=_i(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=_i(this.__views__),t},Un.prototype.reverse=function(){if(this.__filtered__){var t=new Un(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},Un.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=No(t),r=e<0,i=n?t.length:0,a=function(t,e,n){for(var r=-1,i=n.length;++r<i;){var a=n[r],o=a.size;switch(a.type){case"drop":t+=o;break;case"dropRight":e-=o;break;case"take":e=yn(e,t+o);break;case"takeRight":t=vn(t,e-o)}}return{start:t,end:e}}(0,i,this.__views__),o=a.start,s=a.end,l=s-o,u=r?s:o-1,c=this.__iteratees__,h=c.length,d=0,p=yn(l,this.__takeCount__);if(!n||!r&&i==l&&p==l)return si(t,this.__actions__);var f=[];t:for(;l--&&d<p;){for(var m=-1,g=t[u+=e];++m<h;){var v=c[m],y=v.iteratee,x=v.type,b=y(g);if(2==x)g=b;else if(!b){if(1==x)continue t;break t}}f[d++]=g}return f},jn.prototype.at=so,jn.prototype.chain=function(){return ao(this)},jn.prototype.commit=function(){return new Gn(this.value(),this.__chain__)},jn.prototype.next=function(){this.__values__===n&&(this.__values__=os(this.value()));var t=this.__index__>=this.__values__.length;return{done:t,value:t?n:this.__values__[this.__index__++]}},jn.prototype.plant=function(t){for(var e,r=this;r instanceof Vn;){var i=Pa(r);i.__index__=0,i.__values__=n,e?a.__wrapped__=i:e=i;var a=i;r=r.__wrapped__}return a.__wrapped__=t,e},jn.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof Un){var e=t;return this.__actions__.length&&(e=new Un(this)),(e=e.reverse()).__actions__.push({func:oo,args:[qa],thisArg:n}),new Gn(e,this.__chain__)}return this.thru(qa)},jn.prototype.toJSON=jn.prototype.valueOf=jn.prototype.value=function(){return si(this.__wrapped__,this.__actions__)},jn.prototype.first=jn.prototype.head,ce&&(jn.prototype[ce]=function(){return this}),jn}();le?((le.exports=sn)._=sn,se._=sn):oe._=sn}).call(commonjsGlobal)});function useCanvasResizeListener(t,e,n=100){return __awaiter(this,void 0,void 0,function*(){if(!store.state.MxFun)return void console.error("请先调用loadCoreCode方法! ");if(!t)return void console.error("请确保mxdrawObj参数 是通过调用MxFun.createMxObject的callback回调函数拿到的mxDraw对象");let r=t;if(!r.isLoadCanvasResizeListene){let i;r.isLoadCanvasResizeListene=!0,t.addEvent("addResizeEvent",t=>{i=t}),yield dynamicImport("element-resize-event-polyfill");let a=createCanvasParent(e);a.addEventListener?a.addEventListener("resize",lodash.throttle(function(t){i&&i()},n),!1):console.log("mx: parentdiv[addEventListener] invalid")}})}function createReandomId(t=10){return new Number(Math.random().toString().substr(3,t)+Date.now()).toString(36)}class MxCADObject{constructor(t){this._mxCAD=t}newFile(){this._mxCAD.newFile()}undo(){this._mxCAD.undo()}openFile(t,e){this._mxCAD.openFile(t,e)}saveFile(t,e){this._mxCAD.saveFile(t,e)}getDisplayFromServer(){this._mxCAD.getDisplayFromServer()}getFileName(){return this._mxCAD.getFileName()}getAllLayerData(){return this._mxCAD.getAllLayerData()}}class MxDbDatabase{constructor(t){this._mxDatabase=t}addLayer(t){return this._mxDatabase.addLayer(t)}showLayer(t,e){this._mxDatabase.showLayer(t,e)}setCurrentLayer(t){return this._mxDatabase.setCurrentLayer(t)}getLayer(t){return this._mxDatabase.getLayer(t)}addEntity(t){return this._mxDatabase.addMxEntity(t)}getGroup(t){return this._mxDatabase.getGroupDictionary().getAt(t)}addGroup(t){return this._mxDatabase.getGroupDictionary().add(t)}getEntityInGroup(t){return this._mxDatabase.getGroupDictionary().getEntityInGroup(t)}deleteGroup(t){return this._mxDatabase.getGroupDictionary().delete(t)}}function setGeometrPostion(t,e){for(let n=0;n<t.vertices.length;n++)t.vertices[n].x+=e.x,t.vertices[n].y+=e.y,t.vertices[n].z+=e.z}function repairGeometryFaceVertexUvs(t){t.computeBoundingBox();const e=t.boundingBox.min,n=t.boundingBox.max,r=new THREE.Vector2(0-e.x,0-e.y),i=new THREE.Vector2(n.x-e.x,n.y-e.y);t.faceVertexUvs[0]=[];const a=t.faces;for(let e=0;e<a.length;e++){const n=a[e],o=t.vertices[n.a],s=t.vertices[n.b],l=t.vertices[n.c];t.faceVertexUvs[0].push([new THREE.Vector2((o.x+r.x)/i.x,(o.y+r.y)/i.y),new THREE.Vector2((s.x+r.x)/i.x,(s.y+r.y)/i.y),new THREE.Vector2((l.x+r.x)/i.x,(l.y+r.y)/i.y)])}return t.uvsNeedUpdate=!0,t}function getToGenerateRoundedCorners(t,e,n=!0){if(e.length>0){const r=new THREE.CurvePath;n||t.push(t[0]);for(let i=0;i<t.length-1;i++){const a=e[i]||0;if(0===i&&!n){const e=t[0].clone().sub(t[1]);e.normalize();const n=t[1].clone();n.add(e.clone().multiplyScalar(a));const i=new THREE.LineCurve3(t[0],n);r.curves.push(i);continue}const o=!n||t[i-1]?t[i-1].clone().sub(t[i]):t[t.length-1].clone().sub(t[0]);o.normalize();const s=!n||t[i+1]?t[i+1].clone().sub(t[i]):t[1].clone().sub(t[0]);s.normalize(),t[i].clone().add(o.clone().multiplyScalar(a));const l=t[i].clone().add(o.clone().multiplyScalar(a)),u=t[i].clone(),c=t[i].clone().add(s.clone().multiplyScalar(a)),h=new THREE.QuadraticBezierCurve3(l,u,c);if(i===t.length-2){const e=t[i].clone();e.add(s.clone().multiplyScalar(a));const o=t[i+1].clone();n?o.add(s.clone().multiplyScalar(-a)):o.add(s.clone());const l=new THREE.LineCurve3(e,o);r.curves.push(h,l)}else r.curves.push(h);0===i&&t.push(t[0])}return r.getPoints(50)}return t}function computeRectPoints(t,e){return[t,t.clone().set(e.x,t.y,e.z),e,e.clone().set(t.x,e.y,t.z)]}function calculateArcOrigin(t,e,n){const r=t.x,i=e.x,a=n.x,o=t.y,s=e.y,l=n.y,u=r-i,c=o-s,h=r-a,d=o-l,p=(r*r-i*i+(o*o-s*s))/2,f=(r*r-a*a+(o*o-l*l))/2,m=c*h-u*d,g=-(d*p-c*f)/m,v=-(u*f-h*p)/m;return new THREE.Vector3(g,v,0)}function calculateRadiusArc(t,e){const n=t.x,r=t.y,i=e.x,a=e.y;return Math.sqrt((n-i)*(n-i)+(r-a)*(r-a))}function calculateArcAngle(t,e,n){const r=t.x,i=e.x;let a,o,s;return a=(t.y-e.y)/n,(o=(r-i)/n)>=.99999&&(o=.99999),o<=-.99999&&(o=-.99999),s=(s=Math.acos(o))/Math.PI*180,a<-.05&&(s=360-s),{sin:a,cos:o,angle:s}}function judgementArcRenderDirection(t,e,n){let r,i;return(i=t<e?e-t:e-t+360)>(r=t<n?n-t:n-t+360)}function createThreePointArc(t,e,n,r=!1,i=!1,a=new THREE.Color("#ff0000")){const o=calculateArcOrigin(t,e,n),s=o.x,l=o.y,u=calculateRadiusArc(t,o),c=calculateArcAngle(t,o,u),h=calculateArcAngle(e,o,u),d=calculateArcAngle(n,o,u);let p,f,m=c.angle,g=h.angle,v=d.angle,y=judgementArcRenderDirection(m,g,v);i&&(y=!0),r?(f=new THREE.ArcCurve(s,l,u,THREE.MathUtils.degToRad(m),THREE.MathUtils.degToRad(g),!y),p=y?g>m?THREE.MathUtils.radToDeg(f.aEndAngle-f.aStartAngle):360-Math.abs(THREE.MathUtils.radToDeg(f.aEndAngle-f.aStartAngle)):m>g?Math.abs(THREE.MathUtils.radToDeg(f.aEndAngle-f.aStartAngle)):360-THREE.MathUtils.radToDeg(f.aEndAngle-f.aStartAngle)):(f=new THREE.ArcCurve(s,l,u,THREE.MathUtils.degToRad(m),THREE.MathUtils.degToRad(v),y),p=y?v>m?360-THREE.MathUtils.radToDeg(f.aEndAngle-f.aStartAngle):Math.abs(THREE.MathUtils.radToDeg(f.aEndAngle-f.aStartAngle)):m>v?360+THREE.MathUtils.radToDeg(f.aEndAngle-f.aStartAngle):THREE.MathUtils.radToDeg(f.aEndAngle-f.aStartAngle));const x=p*Math.PI*u/180,b=(new THREE.BufferGeometry).setFromPoints(f.getPoints(50)),w=new THREE.LineBasicMaterial({color:a});return{arc:new THREE.Line(b,w),radius:u,angle:p,arcLength:x}}function createAnyLine(t){const e=new THREE.CatmullRomCurve3(t,!1,"chordal");t=e.getPoints(50);const n=new THREE.BufferGeometry,r=Math.round(12*t.length);let i=new THREE.Vector3;const a=[],o=[],s=new THREE.Color("#ff0000");for(let t=0,n=r;t<n;t++){const r=t/n;i=e.getPoint(r),a.push(i.x,i.y,i.z),o.push(s.r,s.g,s.b)}n.setAttribute("position",new THREE.Float32BufferAttribute(a,3)),n.setAttribute("color",new THREE.Float32BufferAttribute(o,3));const l=new THREE.LineBasicMaterial({vertexColors:THREE.VertexColors,linewidth:10}),u=new THREE.Line(n,l);return u.computeLineDistances(),u}function createThreeEllipse(t,e,n){const r=t.clone().set(e.x,t.y,e.z),i=e.clone().set(t.x,e.y,t.z),a=t.distanceTo(r)/2,o=t.distanceTo(i)/2,s=t.x>e.x,l=t.y>e.y,u=new THREE.EllipseCurve(s?t.x-a:t.x+a,l?t.y-o:t.y+o,-a,-o,0,2*Math.PI,!1,0).getPoints(50),c=(new THREE.Geometry).setFromPoints(u),h=new THREE.LineBasicMaterial({color:n});return new THREE.Line(c,h)}function computeRegularPolygonVertices(t=new THREE.Vector3,e=new THREE.Vector3,n=3){const r=[];n=Math.max(3,n),r.push(e);const i=2*Math.PI/n;for(let a=1;a<n;a++){const n=Math.cos(i*a),o=Math.sin(i*a),s=t.clone(),l=e.clone(),u=l.x-s.x,c=l.y-s.y,h=new THREE.Vector3(u*n-c*o+s.x,u*o+c*n+s.y);r.push(h)}return r}function createThreeRegularPolygon(t,e,n,r){const i=new THREE.Geometry;i.vertices=computeRegularPolygonVertices(t,e,n);const a=new THREE.LineBasicMaterial({color:r});return new THREE.LineLoop(i,a)}function computeBounding(t){if(0==t.length){let t=new THREE.Vector3;return{centerPoint:t,minPoint:t,maxPoint:t}}{let e=new THREE.Vector3(t[0].x,t[0].y,t[0].z||0),n=new THREE.Vector3(t[0].x,t[0].y,t[0].z||0),r=t.length;for(let i=1;i<r;i++){let r=t[i];e.x>r.x&&(e.x=r.x),e.y>r.y&&(e.y=r.y),n.x<r.x&&(n.x=r.x),n.y<r.y&&(n.y=r.y)}return{centerPoint:new THREE.Vector3(e.x+.5*(n.x-e.x),e.y+.5*(n.y-e.y),0),minPoint:e,maxPoint:n}}}function MxThreeJSMixin(t){return t.createImage=((t,e,n,r,i)=>{(new THREE.TextureLoader).load(r,function(r){let a=new THREE.PlaneGeometry(e,n),o=new THREE.MeshLambertMaterial({map:r,transparent:!0,side:THREE.DoubleSide});o.map&&(o.map.needsUpdate=!0),setGeometrPostion(a,t);let s=new THREE.Mesh(a,o);s.material.depthTest=!1,i&&i(s)},void 0,function(t){console.log(t),i&&i(null)})}),t}class MxThreeJS$1{createLine(t,e,n){const r=new THREE.Geometry,i=new THREE.LineBasicMaterial({color:n});return r.vertices.push(t,e),new THREE.Line(r,i)}createCircle(t,e,n){const r=new THREE.CircleGeometry(e,64,3,2*Math.PI),i=new THREE.LineBasicMaterial({color:n});r.vertices.shift();const a=new THREE.LineLoop(r,i);return a.position.x=t.x,a.position.y=t.y,a.position.z=t.z,a}createPoint(t,e){const n=new THREE.Geometry;n.vertices.push(t);const r=new THREE.PointsMaterial({color:e,size:3});return new THREE.Points(n,r)}creatTextSprite(t,e,n,r,i){return store.state.MxFun.getMxThreeJS().creatTextSprite(t,e,n,r,i)}clacTextSpriteSize(t,e,n){return store.state.MxFun.getMxThreeJS().clacTextSpriteSize(t,e,n)}clacTextSize(t,e){return store.state.MxFun.getMxThreeJS().clacTextSize(t,e)}createTriangle(t,e,n=1){if(t.length<3)return null;const r=t.length,i=new THREE.Geometry;for(let e=0;e+2<r;e+=3){i.vertices.push(t[e]),i.vertices.push(t[e+1]),i.vertices.push(t[e+2]);const n=new THREE.Face3(e,e+1,e+2);i.faces.push(n)}i.computeFaceNormals(),i.computeVertexNormals();const a=new THREE.MeshBasicMaterial({color:e,transparent:!0,depthTest:!1,side:THREE.DoubleSide,opacity:n});return new THREE.Mesh(i,a)}createLines(t,e){const n=new THREE.Geometry;n.vertices=t;const r=new THREE.LineBasicMaterial({color:e});return new THREE.Line(n,r)}createDashedLines(t,e,n,r){const i=new THREE.Geometry;i.vertices=t;const a=new THREE.Line(i,new THREE.LineDashedMaterial({color:e,dashSize:n,gapSize:r}));return a.computeLineDistances(),a}createImage(t,e,n,r,i){}loadSVG(t,e,n,r){return n?(store.state.MxFun.loadSVG(t,e,n,r),new Promise(t=>{t(null)})):new Promise(n=>{store.state.MxFun.loadSVG(t,e,t=>{n(t)},r)})}}const MxThreeJS=MxThreeJSMixin(new MxThreeJS$1);class MxDrawObject{constructor(t){this._mxdrawObj=t}getScene(){return this._mxdrawObj.getScene()}getCamera(){return this._mxdrawObj.getCamera()}getRenderer(){return this._mxdrawObj.renderer}setMouseRightRotate(t=!0){return this._mxdrawObj.setMouseRightRotate(t)}getFullDisplayRange(){return this._mxdrawObj.getFullDisplayRange()}getCanvas(){return this._mxdrawObj.getCanvas()}updateDisplay(){return this._mxdrawObj.updateDisplay()}createCanvasImageData(t,e){return this._mxdrawObj.createCanvasImageData(t,e)}setViewColor(t){return this._mxdrawObj.setViewColor(t)}setSize(t,e){return this._mxdrawObj.setSize(t,e)}getIntersectObjects(t){return this._mxdrawObj.getIntersectObjects(t)}addObject(t,e=!0){return this._mxdrawObj.addObject(t,e)}addViewObject(t){return this._mxdrawObj.addViewObject(t)}getViewWidth(){return this._mxdrawObj.getViewWidth()}getViewHeight(){return this._mxdrawObj.getViewHeight()}removeObject(t,e=!0){return this._mxdrawObj.removeObject(t,e)}zoomInitialStates(){return this._mxdrawObj.zoomInitialStates()}zoomScale(t){return this._mxdrawObj.zoomScale(t)}zoomW(t,e,n){return this._mxdrawObj.zoomW(t,e,n)}zoomCenter(t,e){return this._mxdrawObj.zoomCenter(t,e)}initZoomW(t,e){return this._mxdrawObj.initZoomW(t,e)}addEvent(t,e){return this._mxdrawObj.addEvent(t,e)}on(t,e){return this._mxdrawObj.addEvent(t,e)}setIniset(t){return this._mxdrawObj.setIniset(t)}screenCoord2World(t,e,n){return this._mxdrawObj.screenCoord2World(t,e,n)}worldCoord2Screen(t,e,n){return this._mxdrawObj.worldCoord2Screen(t,e,n)}screenCoord2Doc(t,e){return this._mxdrawObj.screenCoord2Doc(t,e,0)}worldCoordLong2Doc(t){return this._mxdrawObj.worldCoordLong2Doc(t)}docCoordLong2World(t){return this._mxdrawObj.docCoordLong2World(t)}docCoord2World(t,e,n){return this._mxdrawObj.docCoord2World(t,e,n)}docCoord2World2(t){return this._mxdrawObj.docCoord2World(t.x,t.y,t.z)}worldCoord2Doc(t,e,n){return this._mxdrawObj.worldCoord2Doc(t,e,n)}worldCoord2Doc2(t){return this._mxdrawObj.worldCoord2Doc(t.x,t.y,t.z)}docCoord2Screen(t,e){return this._mxdrawObj.docCoord2Screen(t,e,0)}screenCoordLong2Doc(t){return this._mxdrawObj.screenCoordLong2Doc(t)}docCoordLong2Screen(t){return this._mxdrawObj.docCoordLong2Screen(t)}screenCoordLong2World(t){return this._mxdrawObj.screenCoordLong2World(t)}worldCoordLong2Screen(t){return this._mxdrawObj.worldCoordLong2Screen(t)}initRendererParam(t){return this._mxdrawObj.initRendererParam(t)}addMxEntity(t){return this._mxdrawObj.addMxEntity(t)}getMxCurrentSelect(){let t=this._mxdrawObj.getMxAllSelect();return 0==t.length&&(t=this._mxdrawObj.getPrvCommandSelect()),t}addMxCurrentSelect(t){return this._mxdrawObj.addMxCurrentSelect(t)}clearMxCurrentSelect(){return this._mxdrawObj.clearMxCurrentSelect()}getMxEntity(t){return this._mxdrawObj.getMxEntityUserObject(t)}findMxEntityAtPoint(t){return this._mxdrawObj.findMxEntityAtPoint(t)}getAllMxEntity(){return this._mxdrawObj.getAllMxEntity()}setMouseMiddlePan(t){return this._mxdrawObj.setMouseMiddlePan(t)}resetThreeJSControls(){return this._mxdrawObj.resetThreeJSControls()}enableZoom(t){return this._mxdrawObj.enableZoom(t)}enablePan(t){return this._mxdrawObj.enablePan(t)}eraseMxEntity(t){return this._mxdrawObj.eraseMxEntity(t)}removeViewObject(t){this._mxdrawObj.removeViewObject(t)}saveMxEntityToJson(){return JSON.stringify(this._mxdrawObj.saveMxEntityToJson())}saveMxEntityToObject(){return this._mxdrawObj.saveMxEntityToJson()}loadMxEntityFromJson(t,e=null){return __awaiter(this,void 0,void 0,function*(){if(e){let t=e.length;for(let n=0;n<t;n++)yield MxThreeJS.loadSVG(e[n])}return"string"==typeof t?this._mxdrawObj.loadMxEntityFromJson(JSON.parse(t)):this._mxdrawObj.loadMxEntityFromJson(t)})}eraseAllMxEntity(){return this._mxdrawObj.eraseAllMxEntity()}makeCurrent(){this._mxdrawObj.makeCurrent()}getViewCenterDocCoord(){return this._mxdrawObj.getViewCenterDocCoord()}updateCanvasSize(){this._mxdrawObj.updateCanvasSize()}newFile(t,e,n,r){return this._mxdrawObj.newFile(t,e,n,r)}stopAllLoading(){this._mxdrawObj.stopAllLoading()}getOrbitControls(){return this._mxdrawObj.getOrbitControls()}enableViewControls(t){return this._mxdrawObj.enableViewControls(t)}getMxDatabase(){return new MxDbDatabase(this._mxdrawObj.getMxDatabase())}setZoomSpeed(t){return this._mxdrawObj.setZoomSpeed(t)}getMxCAD(){let t=this._mxdrawObj.getMxCAD();return new MxCADObject(t)}resetRenderer(){return this._mxdrawObj.resetRenderer()}setRequestHeader(t){return this._mxdrawObj.setRequestHeader(t)}closeWebSocket(){return this._mxdrawObj.closeWebSocket()}cadCoord2Doc(t,e,n){return this._mxdrawObj.cadCoord2Doc(t,e,n)}docCoord2Cad(t,e,n){return this._mxdrawObj.docCoord2Cad(t,e,n)}setViewAngle(t){return this._mxdrawObj.setViewAngle(t)}getViewAngle(){return this._mxdrawObj.getViewAngle()}}class McEdGetPointWorldDrawObject{constructor(){var t;this._McEdGetPointWorldDraw=new(null===(t=store.state.MxFun)||void 0===t?void 0:t.getMxJigCmdManager().McEdGetPointWorldDrawObjectClass()),this._get=(()=>this._McEdGetPointWorldDraw)}drawCircle(t,e){return this._McEdGetPointWorldDraw.drawCircle(t,e)}drawLine(t,e){return this._McEdGetPointWorldDraw.drawLine(t,e)}drawEntity(t,e){return this._McEdGetPointWorldDraw.drawEntity(t,e)}drawText(t,e,n,r){return this._McEdGetPointWorldDraw.drawText(t,e,n,r)}setDraw(t){return this._McEdGetPointWorldDraw.setDraw(t)}setColor(t){return this._McEdGetPointWorldDraw.setColor(t)}getColor(){return this._McEdGetPointWorldDraw.getColor()}drawCustomEntity(t,e){return this._McEdGetPointWorldDraw.drawCustomEntity(t,e)}}let _MrxDbgUiPrPoint;class MrxDbgUiPrPoint{constructor(){var t;_MrxDbgUiPrPoint=new(null===(t=store.state.MxFun)||void 0===t?void 0:t.getMxJigCmdManager().getMrxDbgUiPrPointClass())}keyWords(){return _MrxDbgUiPrPoint.keyWords()}setKeyWords(t){return _MrxDbgUiPrPoint.setKeyWords(t)}message(){return _MrxDbgUiPrPoint.message()}setMessage(t){return _MrxDbgUiPrPoint.setMessage(t)}keyWordPicked(){return _MrxDbgUiPrPoint.keyWordPicked()}isKeyWordPicked(t){return _MrxDbgUiPrPoint.isKeyWordPicked(t)}setUserDraw(t){if("function"!=typeof t)return _MrxDbgUiPrPoint.setUserDraw(t._get?t._get():t);{const e=new McEdGetPointWorldDrawObject;e.setDraw(t),_MrxDbgUiPrPoint.setUserDraw(e._get())}}value(){return _MrxDbgUiPrPoint.value()}valueDocCoord(){return _MrxDbgUiPrPoint.valueDocCoord()}basePt(){return _MrxDbgUiPrPoint.basePt()}setBasePt(t){return _MrxDbgUiPrPoint.setBasePt(t)}setUseBasePt(t){return _MrxDbgUiPrPoint.setUseBasePt(t)}go(t){return t?(_MrxDbgUiPrPoint.go(t),new Promise((t,e)=>{t(null)})):new Promise((t,e)=>{_MrxDbgUiPrPoint.go(e=>{t(0!=e?null:_MrxDbgUiPrPoint.value())})})}goWhile(t,e){return _MrxDbgUiPrPoint.goWhile(t,e)}drawReserve(t){return _MrxDbgUiPrPoint.drawReserve(t)}setInputToucheType(t){return _MrxDbgUiPrPoint.setInputToucheType(t)}getInputToucheType(){return _MrxDbgUiPrPoint.getInputToucheType()}}class MxVueComandLine{constructor(){this.msCmdText="",this.msCmdDisplay="",this.msCmdTip="",this.mUpDisplayFun=void 0,this.mxFunObject=void 0,this.mountUpDisplayFun=(t=>{this.mUpDisplayFun=t}),this.setCmdText=(t=>{this.msCmdText=t}),this.getCmdText=(()=>this.msCmdText),this.getCmdDisplay=(()=>this.msCmdDisplay),this.setCmdDisplay=(t=>{this.msCmdDisplay=t}),this.addCmdDisplay=(t=>{this.msCmdDisplay.length>1024?(this.msCmdDisplay=this.msCmdDisplay.substring(this.msCmdDisplay.length-1024,this.msCmdDisplay.length),this.msCmdDisplay=this.msCmdDisplay+t):this.msCmdDisplay=this.msCmdDisplay+t}),this.setCmdTip=(t=>{this.msCmdTip=t}),this.getCmdTip=(()=>this.msCmdTip)}upDisplay(){const{msCmdTip:t,msCmdDisplay:e,msCmdText:n}=this;null!=this.mUpDisplayFun&&this.mUpDisplayFun({msCmdTip:t,msCmdDisplay:e,msCmdText:n})}}const MxInputType={kNoInput:0,kXYCoordInput:1,kDistanceInput:2,kDynTip:3},MxInputPostionType={kRelative:0,kAbsolutely:1};class MxDynamicInput{constructor(){this.mType=MxInputType.kNoInput,this.mPos=[0,0],this.mTip="",this.mValue1="",this.mValue1Pos=[0,0],this.mValue2="",this.mValue2Pos=[0,0],this.misShow=!1,this.mOnKeydownEvent=void 0,this.mFocusValue="",this.setFocusValue=(t=>{this.mFocusValue=t}),this.getFocusValue=(()=>this.mFocusValue),this.mountKeydownEvent=(t=>{this.mOnKeydownEvent=t}),this.onKeydown=(t=>{null!=this.mOnKeydownEvent&&this.mOnKeydownEvent(t)}),this.setType=(t=>{this.mType=t}),this.getType=(()=>this.mType),this.isShow=(()=>this.misShow),this.setPos=(t=>{this.mPos=t}),this.setTip=(t=>{this.mTip=t}),this.setValue1=(t=>{this.mValue1=t}),this.getValue1=(()=>this.mValue1),this.setValue1Pos=(t=>{this.mValue1Pos=t}),this.setValue2=(t=>{this.mValue2=t}),this.getValue2=(()=>this.mValue2),this.setValue2Pos=(t=>{this.mValue2Pos=t}),this.setShow=(t=>{this.misShow=t}),this.getData=(()=>{if(!this.misShow)return;let t={list:[{value:"",readonly:!0},{value:"",readonly:!1},{value:"",readonly:!1}],pos:this.mPos,postype:MxInputPostionType.kRelative};return this.mType!=MxInputType.kNoInput?(this.mType==MxInputType.kXYCoordInput?(t.list[0].show=!0,t.list[0].value=this.mTip,t.list[0].readonly=!0,t.list[1].show=!0,t.list[1].value=this.mValue1,t.list[1].readonly=!1,t.list[2].show=!0,t.list[2].value=this.mValue2,t.list[2].readonly=!1):this.mType==MxInputType.kDistanceInput?(t.list[0].show=!0,t.list[0].value=this.mTip,t.list[0].readonly=!0,t.list[1].show=!0,t.list[1].value=this.mValue1,t.list[1].readonly=!1,t.list[1].pos=this.mValue1Pos,t.list[2].show=!0,t.list[2].value=this.mValue2,t.list[2].readonly=!0,t.list[2].pos=this.mValue2Pos,t.postype=MxInputPostionType.kAbsolutely):this.mType==MxInputType.kDynTip?(t.list[0].show=!0,t.list[0].value=this.mTip,t.list[0].readonly=!0,t.list[1].show=!1,t.list[2].show=!1):t=void 0,t):void 0})}}const CursorType={kNormal:"Normal",kRect:"Rect",kCross:"Cross"};class MxVueInterface{constructor(){this.mSetCoordFun=void 0,this.mUpdateCursorFun=void 0,this.mOnKeydownEvent=void 0,this.mCursorType=CursorType.kNormal,this.mComandLine=new MxVueComandLine,this.mdynamicInput=new MxDynamicInput,this.mMxEvents={},this.mountSetCoordFun=(t=>{this.mSetCoordFun=t}),this.mountUpdateCursorFun=(t=>{this.mUpdateCursorFun=t}),this.mountKeydownEvent=(t=>{this.mOnKeydownEvent=t}),this.onKeydown=(t=>{null!=this.mOnKeydownEvent&&this.mOnKeydownEvent(t)}),this.setTipCoord=(t=>{null!=this.mSetCoordFun&&this.mSetCoordFun(t)}),this.getCursorType=(()=>this.mCursorType),this.setCursorType=(t=>{if("number"==typeof t)switch(t){case 0:this.mCursorType=CursorType.kNormal;break;case 1:this.mCursorType=CursorType.kRect;break;case 2:this.mCursorType=CursorType.kCross}else this.mCursorType=t;null!=this.mUpdateCursorFun&&this.mUpdateCursorFun(this.mCursorType)}),this.getTitle=(()=>this.mTitle),this.getTopButtonBarData=(()=>this.mTopButtonBarData),this.getMenuBarData=(()=>this.mMenuBarData),this.getRighButtonBarData=(()=>this.mRighButtonBarData),this.getLeftButtonBarData=(()=>this.mLeftButtonBarData),this.getTitleButtonBarData=(()=>this.mTitleButtonBarData),this.getLayerComboxData=(()=>this.mLayerComboxData),this.getColorComboxData=(()=>this.mColorComboxData),this.getLinetypeComboxData=(()=>this.mLinetypeComboxData),this.getFooterData=(()=>this.mFooterData),this.sendStringToExecute=(t=>{this.mxFunObject.sendStringToExecute(t)}),this.getCmdLine=(()=>this.mComandLine),this.getDynamicInput=(()=>this.mdynamicInput),this.init=(t=>{this.mxFunObject=t}),this.OnMxEvent=(t=>{const e=t.name;if(null==e)return;const n=this.mMxEvents[e];null!=n&&n(t.param)}),this.mountMxEvent=((t,e)=>{this.mMxEvents[t]=e})}}const mxUiData$1=new MxVueInterface;let mxUiData=mxUiData$1;class MxFunClass{constructor(){this.listenForUpdateCursor=(t=>{mxUiData.mountUpdateCursorFun(t)})}createMxObject({canvasId:t=createReandomId(),cadFile:e="",callback:n,isNewFile:r=!1,useWebsocket:i=!1,isAutoResize:a=!0,mapBox:o,isMxCAD:s=!1,userIdentitySign:l="emptyUserIdentity"}){if(this.initUiDataObject(mxUiData),!i&&r&&(r=!1),o){const t=o.canvas;store.state.MxFun.createMxObject(t,e,e=>{let r=new MxDrawObject(e);e.setIniset({EnableOsnapFunction:!0}),n&&n(r,{canvas:t,canvasParent:void 0})},void 0,r,i,o)}else{const o=createCanvas(t),u=createCanvasParent(o);let c;u.parentNode&&11!=u.parentNode.nodeType||document.body.appendChild(u),s&&(c=!0,i=!0),store.state.MxFun.createMxObject(t,e,t=>{let e=new MxDrawObject(t);if(s){const e=2;0==l.length&&(l="invalidUserIdentity"),t.initRunMode(e),t.initUserLoginData(l,"")}t.setMouseRightRotate(!1),t.setIniset({EnableOsnapFunction:!0}),t.addEvent("onResize",()=>(u.tabindex=3,{width:u.clientWidth,height:u.clientHeight})),a&&useCanvasResizeListener(e,o),n&&n(e,{canvas:o,canvasParent:u})},c,r,i,void 0)}}setMxServer(t="ws://localhost:5090"){store.state.MxFun.setMxServer(t)}enablStaticLoad(t){store.state.MxFun.enablStaticLoad(t)}setStaticServer(t){store.state.MxFun.setStaticServer(t)}addCommand(t,e){store.state.MxFun.addCommand(t,e)}sendStringToExecute(t,...e){return store.state.MxFun.sendStringToExecute(t,...e)}call(t,e,n){return store.state.MxFun.call(t,e,n)}getCurrentDraw(){return new MxDrawObject(store.state.MxFun.getCurrentDraw())}getCurrentDatabase(){let t=store.state.MxFun.getCurrentDraw();return new MxDbDatabase(t.getMxDatabase())}screenCoordLong2World(t){return store.state.MxFun.screenCoordLong2World(t)}screenCoordLong2Doc(t){return store.state.MxFun.screenCoordLong2Doc(t)}docCoordLong2Screen(t){return store.state.MxFun.docCoordLong2Screen(t)}worldCoordLong2Doc(t){return store.state.MxFun.worldCoordLong2Doc(t)}docCoordLong2World(t){return store.state.MxFun.docCoordLong2World(t)}screenCoord2World(t,e,n){return store.state.MxFun.screenCoord2World(t,e,n)}worldCoord2Screen(t,e,n){return store.state.MxFun.worldCoord2Screen(t,e,n)}docCoord2World(t,e,n){return store.state.MxFun.docCoord2World(t,e,n)}worldCoord2Doc(t,e,n){return store.state.MxFun.worldCoord2Doc(t,e,n)}screenCoord2Doc(t,e){return store.state.MxFun.screenCoord2Doc(t,e,0)}docCoord2Screen(t,e){return store.state.MxFun.docCoord2Screen(t,e,0)}updateDisplay(){return store.state.MxFun.updateDisplay()}addWindowsEvent(t){return store.state.MxFun.addWindowsEvent(t)}isRunningCommand(){return store.state.MxFun.isRunningCommand()}zoomW(t,e,n,r,i){return store.state.MxFun.zoomW(t,e,n,r,i)}showLayer(t,e,n){return store.state.MxFun.showLayer(t,e,n)}getCurrentMxCAD(){let t=store.state.MxFun.getCurrentMxCAD();return new MxCADObject(t)}getQueryString(t){return store.state.MxFun.getQueryString(t)}setIniset(t){return store.state.MxFun.setIniset(t)}upDisplayForLayerData(t){return store.state.MxFun.upDisplayForLayerData(t)}initUiDataObject(t){return mxUiData=t,store.state.MxFun.initUiDataObject(t)}getUIData(){return mxUiData}testMX(t){return 11}loadImageMaterial(t,e){return e?(store.state.MxFun.loadImageMaterial(t,e),new Promise((t,e)=>{t(null)})):new Promise((e,n)=>{store.state.MxFun.loadImageMaterial(t,t=>{e(t||null)})})}openFile(t,e=!1){return store.state.MxFun.openFile(t,e)}addToCurrentSpace(t){return this.getCurrentDraw().addMxEntity(t)}selectEnt(t,e=null){return new Promise((n,r)=>{const i=new MrxDbgUiPrPoint;i.setMessage(t),i.go(t=>{if(0!=t)return void n(0);const r=i.value();let a=this.getCurrentDraw().findMxEntityAtPoint(r),o=0;for(;0!=a.length;){let t=a.length;for(let n=0;n<t;n++){let t=a[n];if(!e||!e.type||e.type==t.getTypeName()){o=t.objectId();break}}break}n(o)})})}listenForCommandLineInput(t){mxUiData.getCmdLine().mountUpDisplayFun(t)}setCommandLineInputData(t,e){mxUiData.getCmdLine().setCmdText(t),mxUiData.onKeydown(e)}listenForCoordTip(t){mxUiData.mountSetCoordFun(t)}getMxFunTHREE(){return store.state.MxFun.getTHREE()}getMxFunThreeTool(){return store.state.MxFun.getMxThreeJS()}ceneratecursor(t=128,e=10,n=!0){return store.state.MxFun.ceneratecursor(t,e,n)}callCommand(t,e,n){return store.state.MxFun.callCommand(t,e,n)}cadCoord2Doc(t,e,n){return store.state.MxFun.cadCoord2Doc(t,e,n)}docCoord2Cad(t,e,n){return store.state.MxFun.docCoord2Cad(t,e,n)}getMxEntity(t){return store.state.MxFun.getMxEntity(t)}}const MxFun=new MxFunClass;var MxCloneType,MxDefaultRenderOrder,InputToucheType;!function(t){t[t.kClone=1]="kClone",t[t.kDragClone=2]="kDragClone",t[t.kMxFileClone=3]="kMxFileClone"}(MxCloneType||(MxCloneType={})),function(t){t[t.kCADMeshRenderOrder=10]="kCADMeshRenderOrder",t[t.kCADCurveRenderOrder=20]="kCADCurveRenderOrder",t[t.kMxEntityRenderOrder=30]="kMxEntityRenderOrder",t[t.kGripRenderOrder=110]="kGripRenderOrder",t[t.kDynJigRenderOrder=120]="kDynJigRenderOrder"}(MxDefaultRenderOrder||(MxDefaultRenderOrder={})),function(t){t[t.kGetBegan=1]="kGetBegan",t[t.kGetEnd=2]="kGetEnd"}(InputToucheType||(InputToucheType={}));const MxType={MxCloneType:MxCloneType,MxDefaultRenderOrder:MxDefaultRenderOrder,InputToucheType:InputToucheType};class MxassemblyClass{constructor(){this.mxassembly=null}initImp(){this.mxassembly||store.state.Mxassembly&&(this.mxassembly=store.state.Mxassembly)}NewMcGePoint3d(t,e,n){this.initImp();let r=new this.mxassembly.McGePoint3d;return t&&(r.x=t),e&&(r.y=e),n&&(r.z=n),r}NewMcGePoint3dArray(t){this.initImp();let e=new this.mxassembly.McGePoint3dArray;return t&&t.forEach(t=>{let n=this.NewMcGePoint3d();n.x=t.x,n.y=t.y,n.z=t.z,e.append(n)}),e}}const Mxassembly=new MxassemblyClass;class McGeToolClass{constructor(){this.mxgeTool=null}initImp(){this.mxgeTool||store.state.Mxassembly&&(this.mxgeTool=new store.state.Mxassembly.McGeTool)}calcArea(t){if(this.initImp(),t instanceof Array){let e=Mxassembly.NewMcGePoint3dArray(t);return this.mxgeTool.calcArea(e)}return this.mxgeTool.calcArea(t)}pointInPolyline(t,e){this.initImp();let n=e;e instanceof Array&&(n=Mxassembly.NewMcGePoint3dArray(e));let r=Mxassembly.NewMcGePoint3d(t.x,t.y,t.z);return this.mxgeTool.pointInPolyline(r,n)}}const McGeTool=new McGeToolClass;class MrxDbgUtilsClass{constructor(){this.imp=null}initImp(){if(!this.imp&&store.state.MxFun){let t=store.state.MxFun;this.imp=new t.getMrxDbgUtilsClass}}findEntAtPoint(t,e=null,n){return this.initImp(),n||(n=MxFun.getCurrentDraw()),this.imp.findEntAtPoint(n,t,e)}selectEnt(t,e){return this.initImp(),this.imp.selectEnt(t)}}const MrxDbgUtils=new MrxDbgUtilsClass;var MrxDbgUiPrBaseReturn;!function(t){t[t.kCancel=-2]="kCancel",t[t.kNone=-1]="kNone",t[t.kOk=0]="kOk",t[t.kKeyWord=1]="kKeyWord"}(MrxDbgUiPrBaseReturn||(MrxDbgUiPrBaseReturn={}));var MrxDbgUiPrBaseReturn$1=MrxDbgUiPrBaseReturn;class MxDbEntity{constructor(){this.color=16777215,this.renderOrder=30,this.opacity=1,this.visible=!0,this.userData={},this.sGuid="",this.dLineWidth=0,this.lineWidthByPixels=!0,this.dDashArray=0,this.dDashRatio=0,this.layer="",this._event={}}initGuid(t){this.sGuid.length>0?console.log("mx: init guid error"):this.sGuid=t}dwgInHelp(t,e){const n=t=>t instanceof Array?r(t):"object"==typeof t?(t=>!!(t.isVector3||t.isVector2||t.isVector4))(t)?t.clone():2==t.datatype?new THREE.Vector2(t.x,t.y):3==t.datatype?new THREE.Vector3(t.x,t.y,t.z):4==t.datatype?new THREE.Vector4(t.x,t.y,t.z,t.w):i(t,Object.create(null)):t,r=t=>t.map(t=>n(t)),i=(t,e)=>{for(let r in t)t[r]&&(e[r]=n(t[r]));return e};let a=this;return e.forEach(e=>{t[e]&&(a[e]=n(t[e]))}),!0}dwgOutHelp(t,e){let n=this;return e.forEach(e=>{t[e]=n[e];let r=(i=n[e]).isVector3?3:i.isVector2?2:i.isVector4?4:0;var i;r&&(t[e].datatype=r)}),t}callEvent(t,e){return null!=this._event[t]?this._event[t](e):void 0}create(){return new(0,this.constructor)}transformBy(t){}getGeomExtents(){return null}getImp(){return this.MxDbEntityImp}setNeedUpdateDisplay(t){let e=this.getImp();return!!e&&(t?e.upDisplay():e.setDirtyDisplay(!0),!0)}getMxObject(){let t=this.getImp();return t?t.getMxObject():null}onViewChange(){return!1}objectId(){let t=this.getImp();return t?t.objectId():0}erase(){let t=this.getImp();return!!t&&t.erase()}setLayer(t){let e=this.getImp();e&&e.nodifySetLayer(),this.layer=t}getLayer(){return this.layer}setColor(t){this.color=t}getColor(){return this.color}clone(t){let e=this.create(),n={type:t||MxType.MxCloneType.kClone};return this.dwgOut(n),e.dwgIn(n),e.sGuid="",e}onDwgIn(t){this.color=t.color,this.renderOrder=t.renderOrder,this.opacity=t.opacity,this.visible=t.visible,t.userData?this.userData=JSON.parse(JSON.stringify(t.userData)):this.userData={},this.dLineWidth=t.lineWidth,this.lineWidthByPixels=t.lineWidthByPixels,this.dDashArray=t.dashArray,this.dDashRatio=t.dashRatio,this.layer=t.layer,t.guid&&(this.sGuid=t.guid)}onDwgOut(t){t.color=this.color,t.renderOrder=this.renderOrder,t.opacity=this.opacity,t.visible=this.visible,Object.keys(this.userData).length>0&&(t.userData=this.userData),t.lineWidth=this.dLineWidth,t.lineWidthByPixels=this.lineWidthByPixels,t.dashArray=this.dDashArray,t.dashRatio=this.dDashRatio,t.layer=this.layer,t.guid=this.sGuid}rxInit(){store.state.MxFun.initMxDbEntityType(this)}setRenderOrder(t){this.renderOrder=t}getRenderOrder(){return this.renderOrder}setLineWidthByPixels(t){this.lineWidthByPixels=t}getLineWidthByPixels(){return this.lineWidthByPixels}setLineWidth(t){this.dLineWidth=t}getLineWidth(){return this.dLineWidth}getGetLength(){return 0}setDashLen(t){let e=this.getGetLength();if(e<1e-6||t<1e-6)return;let n=Math.floor(e/t);n<1e-6&&(this.dDashRatio=0),this.dDashArray=1/n}setDashRatio(t){this.dDashRatio=t}setDashArray(t){this.dDashArray=t}setDash(t,e){this.dDashArray=t,this.dDashRatio=e,0==this.dLineWidth&&(this.dLineWidth=6,this.lineWidthByPixels=!0)}getDash(){return{dDashArray:this.dDashArray,dDashRatio:this.dDashRatio}}setDashLineDisplay(t){t?(this.dDashArray<1e-5&&(this.dDashArray=.03),this.dDashRatio<1e-5&&(this.dDashRatio=.1),0==this.dLineWidth&&(this.dLineWidth=6,this.lineWidthByPixels=!0)):(this.dDashArray=0,this.dDashRatio=0)}isDashLineDisplay(){return this.dDashArray>0&&this.dDashRatio>0}guid(){return this.sGuid}onEndGripEidt(){this.callEvent("onEndGripEidt")}onStartGripEidt(){return this.callEvent("onStartGripEidt")}addEvent(t,e){this._event[t]=e}removeEvent(t){this._event[t]=void 0}}class MxDbImage extends MxDbEntity{constructor(){super(...arguments),this.pt1=new THREE.Vector3,this.pt2=new THREE.Vector3,this.imagePath="",this.isLoadMaterialFromPath=!0,this.material=null,this.angle=0}getTypeName(){return"MxDbImage"}getAngle(){return this.angle}setAngle(t){this.angle=t}worldDraw(t){let e=new THREE.Vector3(this.pt1.x,this.pt2.y),n=new THREE.Vector3(this.pt2.x,this.pt1.y);if(Math.abs(this.angle)>1e-5){let e=new THREE.Vector3(.5*(this.pt1.x-this.pt2.x)+this.pt2.x,.5*(this.pt1.y-this.pt2.y)+this.pt2.y),n=new THREE.Matrix4;n.makeRotationZ(this.angle);let r=(new THREE.Matrix4).makeTranslation(e.x,e.y,e.z).multiply(n).multiply((new THREE.Matrix4).makeTranslation(-e.x,-e.y,-e.z));t.setMatrix(r)}if(1==t.getType()){if(t.drawSelectLine(this.pt1,e),t.drawSelectLine(e,this.pt2),t.drawSelectLine(this.pt2,n),t.drawSelectLine(n,this.pt1),this.material){let e=Math.abs(this.pt1.x-this.pt2.x),n=Math.abs(this.pt1.y-this.pt2.y),r=new THREE.PlaneGeometry(e,n),i=Math.min(this.pt1.x,this.pt2.x),a=Math.min(this.pt1.y,this.pt2.y);for(let t=0;t<r.vertices.length;t++)r.vertices[t].x+=i+.5*e,r.vertices[t].y+=a+.5*n,r.vertices[t].z=0;let o=new THREE.Mesh(r,this.material);o.material.depthTest=!1,t.drawEntity(o)}else if(this.imagePath.length>0&&this.isLoadMaterialFromPath){let e=this,n=t.getMxObject();MxFun.loadImageMaterial(this.imagePath,t=>{this.isLoadMaterialFromPath=!1,t&&(e.setMaterial(t),e.setNeedUpdateDisplay(),n.updateDisplay())})}}else if(this.material){let e=Math.abs(this.pt1.x-this.pt2.x),n=Math.abs(this.pt1.y-this.pt2.y),r=new THREE.PlaneGeometry(e,n),i=Math.min(this.pt1.x,this.pt2.x),a=Math.min(this.pt1.y,this.pt2.y);for(let t=0;t<r.vertices.length;t++)r.vertices[t].x+=i+.5*e,r.vertices[t].y+=a+.5*n,r.vertices[t].z=0;let o=new THREE.Mesh(r,this.material);o.material.depthTest=!1,t.drawEntity(o)}else t.drawLine(this.pt1,e),t.drawLine(e,this.pt2),t.drawLine(this.pt2,n),t.drawLine(n,this.pt1);t.setMatrix(null)}setImagePath(t){this.imagePath=t,this.isLoadMaterialFromPath=!0,this.material=null}getImagePath(){return this.imagePath}setMaterial(t){this.material=t}loadMaterial(t){t&&(this.imagePath=t),this.isLoadMaterialFromPath=!1,this.material=null;let e=this;MxFun.loadImageMaterial(this.imagePath,t=>{this.isLoadMaterialFromPath=!1,e.setMaterial(t)})}setPoint1(t){this.pt1=t}getPoint1(){return this.pt1}setPoint2(t){this.pt2=t}getPoint2(){return this.pt2}getGripPoints(){let t=[];t.push(this.pt1),t.push(this.pt2);let e=new THREE.Vector3(this.pt1.x+.5*(this.pt2.x-this.pt1.x),this.pt1.y+.5*(this.pt2.y-this.pt1.y));return t.push(e),t}moveGripPointsAt(t,e){return 0==t?this.pt1.add(e):1==t?this.pt2.add(e):2==t&&(this.pt1.add(e),this.pt2.add(e)),!0}dwgIn(t){return this.onDwgIn(t),this.pt1.copy(t.pt1),this.pt2.copy(t.pt2),this.imagePath=t.imagePath.substr(0),this.isLoadMaterialFromPath=!0,t.angle&&(this.angle=t.angle),t.material&&(this.material=t.material),!0}dwgOut(t){return this.onDwgOut(t),t.pt1=this.pt1,t.pt2=this.pt2,t.imagePath=this.imagePath,t.angle=this.angle,t.type==MxType.MxCloneType.kDragClone&&(t.material=this.material),t}create(){return new MxDbImage}}var index$j=Object.freeze({__proto__:null,default:MxDbImage});class MxDbSVGText{constructor(){this.txtPos=new THREE.Vector3,this.txt="",this.txtHeight=1,this.color=void 0,this._txtObject=null,this._txtAspectRatio=-1}}var index$i=Object.freeze({__proto__:null,default:MxDbSVGText});class MxDbSVG extends MxDbEntity{constructor(){super(...arguments),this.svgPos=new THREE.Vector3,this.svg=null,this.svgPath="",this.svgSize=new THREE.Vector2(50,50),this.svgAlignmentRatio=new THREE.Vector2(0,0),this.svgRotate=0,this.svgReverse=!1,this.svgMirror=!1,this.svgChildColor=[],this.svgMargin=new THREE.Vector2(0,0),this.isSvgDirtyLocation=!1,this.isLoadFromPath=!0,this.aryText=[],this.svgBoxSize=null,this.fixedSize=!1,this.useSvgColor=!1}setSvgChildColor(t){if(this.svgChildColor=t,!this.useSvgColor&&this.svg){let t=new THREE.Color(this.getColor()),e=0,n=this;this.svg.traverse(function(r){r.material&&(e<n.svgChildColor.length?r.material.color=new THREE.Color(n.svgChildColor[e]):r.material.color=t,e++)}),this.setNeedUpdateDisplay(!0)}}getSvgChildColor(){return this.svgChildColor}calcVewSize(t){let e=this.svgSize.x,n=this.svgSize.y;return n<=0&&(n=this.svgBoxSize?this.svgBoxSize.y/this.svgBoxSize.x*e:e),this.fixedSize&&(e=t.screenCoordLong2Doc(e),n=t.screenCoordLong2Doc(n)),[e,n]}worldDraw(t){let e=t.getMxObject();this.calcSvgPosition(e);let[n,r]=this.calcVewSize(e),i=new THREE.Matrix4;i.makeScale(this.svgMirror?-1:1,this.svgReverse?-1:1,1);let a=new THREE.Matrix4;a.makeRotationZ(this.svgRotate);let o=new THREE.Matrix4,s=new THREE.Vector3(this.svgPos.x-n*this.svgAlignmentRatio.x,this.svgPos.y-r*this.svgAlignmentRatio.y,0);o.makeTranslation(s.x,s.y,s.z),a.multiply(i),a.premultiply(o);let l=new THREE.Vector3(0,0,0),u=new THREE.Vector3(n,0,0),c=new THREE.Vector3(n,r,0),h=new THREE.Vector3(0,r,0);if(l.applyMatrix4(a),u.applyMatrix4(a),c.applyMatrix4(a),h.applyMatrix4(a),1==t.getType()){if(this.aryText.forEach(n=>{if(n.txt.length>0){let r,i=new THREE.Vector3(n.txtPos.x,n.txtPos.y,0);this.fixedSize&&(n.txtPos.x>0?i.x=this.svgPos.x+e.screenCoordLong2Doc(n.txtPos.x):i.x=this.svgPos.x-e.screenCoordLong2Doc(n.txtPos.x),n.txtPos.y>0?i.y=this.svgPos.y+e.screenCoordLong2Doc(n.txtPos.y):i.y=this.svgPos.y-e.screenCoordLong2Doc(n.txtPos.y)),n.color&&(r=t.getColor(),t.setColor(n.color));let a=n.txtHeight;this.fixedSize&&(a=e.screenCoordLong2Doc(n.txtHeight)),n._txtObject=t.drawText(n.txt,a,0,i),n._txtAspectRatio=-1,r&&t.setColor(r)}}),this.svg)t.drawEntity(this.svg);else if(this.svgPath.length>0&&this.isLoadFromPath){let n=this,r=t.getMxObject();MxThreeJS.loadSVG(this.svgPath,void 0,i=>{if(i){let a=i;if(a.boxSize)n.svgBoxSize=a.boxSize.clone();else{let t=(new THREE.Box3).setFromObject(i);n.svgBoxSize||(n.svgBoxSize=new THREE.Vector3),n.svgBoxSize.x=t.max.x-t.min.x,n.svgBoxSize.y=t.max.y-t.min.y}let[o,s]=n.calcVewSize(e);n.svgBoxSize&&(i.scale.x=o/n.svgBoxSize.x,i.scale.y=s/n.svgBoxSize.y),i.scale.z=i.scale.x,n.svgReverse&&(i.scale.y*=-1),n.svgMirror&&(i.scale.x*=-1),i.rotateZ(n.svgRotate),n.isSvgDirtyLocation=!0;let l=new THREE.Color(t.getColor()),u=0;i.traverse(function(t){t.material&&(t.material=t.material.clone(),t.material.transparent=!0,t.material.depthTest=!1,n.useSvgColor||(u<n.svgChildColor.length?t.material.color=new THREE.Color(n.svgChildColor[u]):t.material.color=l),u++)}),n.svg=i,n.setNeedUpdateDisplay(),r.updateDisplay()}else console.log("mx LoadSVG:"+n.svgPath+" failed");n.isLoadFromPath=!1})}t.drawSelectLine(l,c),t.drawSelectLine(u,h),t.drawSelectLine(l,u),t.drawSelectLine(u,c),t.drawSelectLine(c,h),t.drawSelectLine(h,l)}else t.drawLine(l,u),t.drawLine(u,c),t.drawLine(c,h),t.drawLine(h,l)}setSvgPath(t,e=!1){return __awaiter(this,void 0,void 0,function*(){this.svgPath=t,this.svg=null,this.isLoadFromPath=!0,this.svgBoxSize=null,e&&(yield MxThreeJS.loadSVG(t))})}getSvgPath(){return this.svgPath}setSvgPostion(t){this.svgPos=t.clone(),this.isSvgDirtyLocation=!0}getSvgPostion(){return this.svgPos}setSvgSize(t){this.svgSize=t,this.isSvgDirtyLocation=!0}getSvgSize(){return this.svgSize}setSvgAlignmentRatio(t){this.svgAlignmentRatio=t,this.isSvgDirtyLocation=!0}getSvgAlignmentRatio(){return this.svgAlignmentRatio}getText(t){return t<this.aryText.length?this.aryText[t]:null}addText(t){this.aryText.push(t)}getGripPoints(){let t=[];return t.push(this.svgPos),t}moveGripPointsAt(t,e){return 0==t&&(this.svgPos.add(e),this.fixedSize||this.aryText.forEach(t=>{t.txtPos.add(e)})),this.isSvgDirtyLocation=!0,!0}calcSvgPosition(t){if(!this.svg||!this.isSvgDirtyLocation)return;this.isSvgDirtyLocation=!1;let[e,n]=this.calcVewSize(t);this.svg.position.x=this.svgPos.x-e*this.svgAlignmentRatio.x-this.svgMargin.x*e,this.svg.position.y=this.svgPos.y-n*this.svgAlignmentRatio.y-this.svgMargin.y*n}dwgIn(t){this.onDwgIn(t),this.fixedSize=t.fixedSize,this.fixedSize?this.svg=null:t.type==MxType.MxCloneType.kClone&&t.svg&&(this.svg=t.svg.clone()),this.svgPos.copy(t.svgPos),this.svgPath=t.svgPath.substr(0),this.svgSize.copy(t.svgSize),this.svgAlignmentRatio.copy(t.svgAlignmentRatio),this.isSvgDirtyLocation=!0,this.svg||(this.isLoadFromPath=!0),this.svgBoxSize=null;let e=t.txts;return this.aryText=[],e.forEach(t=>{let e=new MxDbSVGText;e.txt=t.txt,e.txtHeight=t.txtHeight,e.txtPos.copy(t.txtPos),this.aryText.push(e)}),this.svgRotate=t.svgRotate,this.useSvgColor=t.useSvgColor,this.svgReverse=t.svgReverse,this.svgMirror=t.svgMirror,this.svgMargin=t.svgMargin,t.svgChildColor?this.svgChildColor=t.svgChildColor:this.svgChildColor=[],!0}dwgOut(t){return this.onDwgOut(t),t.type==MxType.MxCloneType.kClone&&(t.svg=this.svg),t.svgPath=this.svgPath,t.svgPos=this.svgPos,t.svgSize=this.svgSize,t.svgAlignmentRatio=this.svgAlignmentRatio,t.txts=[],this.aryText.forEach(e=>{let n={txtPos:e.txtPos,txt:e.txt,txtHeight:e.txtHeight,color:e.color,_txtAspectRatio:e._txtAspectRatio};t.txts.push(n)}),t.fixedSize=this.fixedSize,t.svgRotate=this.svgRotate,t.useSvgColor=this.useSvgColor,t.svgReverse=this.svgReverse,t.svgMirror=this.svgMirror,t.svgMargin=this.svgMargin,t.svgChildColor=this.svgChildColor,t}create(){return new MxDbSVG}transformBy(t){this.svgPos.applyMatrix4(t),this.isSvgDirtyLocation=!0,this.fixedSize||this.aryText.forEach(e=>{e.txtPos.applyMatrix4(t)})}getTypeName(){return"MxDbSVG"}setColor(t){if(super.setColor(t),this.svg){let t=new THREE.Color(this.color);this.svg.traverse(function(e){e.material&&(e.material.color=t)})}}setSvg(t){this.svg=t,this.isLoadFromPath=!1,this.svgBoxSize=null}calcSvgBoxSize(t){if(!this.svgBoxSize)if(t.boxSize)this.svgBoxSize=t.boxSize.clone();else{let e=(new THREE.Box3).setFromObject(t);this.svgBoxSize||(this.svgBoxSize=new THREE.Vector3),this.svgBoxSize.x=e.max.x-e.min.x,this.svgBoxSize.y=e.max.y-e.min.y}}reComputeSVG(){if(!this.svg)return;let t=this.getMxObject();if(!t)return;this.calcSvgBoxSize(this.svg);let[e,n]=this.calcVewSize(t);this.svgBoxSize&&(this.svg.scale.x=e/this.svgBoxSize.x,this.svg.scale.y=n/this.svgBoxSize.y),this.svg.scale.z=this.svg.scale.x,this.svgReverse&&(this.svg.scale.y*=-1),this.svgMirror&&(this.svg.scale.x*=-1),this.isSvgDirtyLocation=!0,this.calcSvgPosition(t)}onViewChange(){if(!this.fixedSize)return!1;let t=this.getMxObject();if(null==t)return!1;if(this.svg){this.calcSvgBoxSize(this.svg);let[e,n]=this.calcVewSize(t);this.svgBoxSize&&(this.svg.scale.x=e/this.svgBoxSize.x,this.svg.scale.y=n/this.svgBoxSize.y),this.svg.scale.z=this.svg.scale.x,this.svgReverse&&(this.svg.scale.y*=-1),this.svgMirror&&(this.svg.scale.x*=-1),this.isSvgDirtyLocation=!0,this.calcSvgPosition(t)}let e=this;return this.aryText.forEach(n=>{if(n._txtObject&&t){let r=t.screenCoordLong2Doc(n.txtHeight);r>1e-5&&(n._txtAspectRatio<=0&&(n._txtAspectRatio=n._txtObject.scale.x/n._txtObject.scale.y),n._txtObject.scale.set(n._txtAspectRatio*r,r,1),n.txtPos.x>0?n._txtObject.position.x=e.svgPos.x+t.screenCoordLong2Doc(n.txtPos.x):n._txtObject.position.x=e.svgPos.x-t.screenCoordLong2Doc(n.txtPos.x),n.txtPos.y>0?n._txtObject.position.y=e.svgPos.y+t.screenCoordLong2Doc(n.txtPos.y):n._txtObject.position.y=e.svgPos.y-t.screenCoordLong2Doc(n.txtPos.y),n._txtObject.updateMatrix())}}),!0}}var index$h=Object.freeze({__proto__:null,default:MxDbSVG});class MxDbPolyline extends MxDbEntity{constructor(){super(...arguments),this.points=[]}getTypeName(){return"MxDbPolyline"}worldDraw(t){this.points.length<2||t.drawLines(this.points)}getGripPoints(){return this.points}moveGripPointsAt(t,e){return!(t>=this.points.length||(this.points[t].add(e),0))}create(){return new MxDbPolyline}dwgIn(t){this.onDwgIn(t);let e=t.points;return this.points=[],e.forEach(t=>{this.points.push(new THREE.Vector3(t.x,t.y,t.z))}),!0}dwgOut(t){return this.onDwgOut(t),t.points=this.points,t}addVertexAt(t){this.points.push(t)}numVerts(){return this.points.length}getPointAt(t){return t<this.points.length?this.points[t]:null}setPointAt(t,e){return t<this.points.length&&(this.points[t]=e,!0)}}var index$g=Object.freeze({__proto__:null,default:MxDbPolyline}),McGiWorldDrawType;!function(t){t[t.kWorldDraw=1]="kWorldDraw",t[t.kDynDragDraw=2]="kDynDragDraw",t[t.kSelectDraw=3]="kSelectDraw"}(McGiWorldDrawType||(McGiWorldDrawType={}));var McGiWorldDrawType$1=McGiWorldDrawType;class MxDb2LineAngularDimension extends MxDbEntity{constructor(){super(...arguments),this.point1=new THREE.Vector3,this.point2=new THREE.Vector3,this.point3=new THREE.Vector3}calculateLineAngle(t,e,n){const r=2*Math.PI/360;return{startAngle:180*Math.atan2(e.y-t.y,e.x-t.x)/Math.PI*r,endAngle:180*Math.atan2(n.y-t.y,n.x-t.x)/Math.PI*r}}worldDraw(t){if(t.getType()==McGiWorldDrawType$1.kWorldDraw||t.getType()==McGiWorldDrawType$1.kDynDragDraw){let e=t.getColor(),n=t.getMxObject(),r=MxThreeJS.createLine(this.point1,this.point2,e);t.drawEntity(r);let i=MxThreeJS.createLine(this.point2,this.point3,e);t.drawEntity(i);const{startAngle:a,endAngle:o}=this.calculateLineAngle(this.point2,this.point1,this.point3),s=this.point2.distanceTo(this.point1),l=this.point2.distanceTo(this.point3);let u,c=(u=s>l?l:s)/4,h=THREE.MathUtils.radToDeg(a-o);h<0&&(h+=360);let d=n.screenCoordLong2Doc(50);const p=new THREE.ArcCurve(this.point2.x,this.point2.y,c,a,o,!0),f=(new THREE.BufferGeometry).setFromPoints(p.getPoints(50)),m=new THREE.LineBasicMaterial({color:"#ff0000"}),g=new THREE.Line(f,m);t.drawEntity(g);let v=p.getPoint(.5),y=new THREE.Vector3(v.x,v.y,0),x=y.sub(this.point2),b=x.length()+.5*d;x.normalize().multiplyScalar(b),y=this.point2.clone().add(x);let w=MxThreeJS.creatTextSprite(h.toFixed(3)+"°",y,.5*d,0,e);null!=w&&t.drawEntity(w)}else t.drawLine(this.point1,this.point2),t.drawLine(this.point3,this.point2)}getGripPoints(){return[this.point1,this.point2,this.point3]}moveGripPointsAt(t,e){return 0===t?this.point1.add(e):1===t?this.point2.add(e):2===t&&this.point3.add(e),!0}dwgIn(t){return this.onDwgIn(t),this.point1.copy(t.point1),this.point2.copy(t.point2),this.point3.copy(t.point3),t}dwgOut(t){return this.onDwgOut(t),t.point1=this.point1,t.point2=this.point2,t.point3=this.point3,t}create(){return new MxDb2LineAngularDimension}transformBy(t){this.point1.applyMatrix4(t),this.point2.applyMatrix4(t)}getTypeName(){return"MxDb2LineAngularDimension"}}var index$f=Object.freeze({__proto__:null,default:MxDb2LineAngularDimension});class Mx3PointArc extends MxDbEntity{constructor(){super(...arguments),this.point1=new THREE.Vector3,this.point2=new THREE.Vector3,this.point3=new THREE.Vector3}getTypeName(){return"Mx3PointArc"}create(){return new Mx3PointArc}worldDraw(t){const{arc:e}=createThreePointArc(this.point1,this.point2,this.point3,!0);t.drawEntity(e)}getGripPoints(){return[this.point1,this.point2,this.point3]}moveGripPointsAt(t,e){return 0===t?this.point1.add(e):1===t?this.point2.add(e):2===t&&this.point3.add(e),!0}dwgIn(t){return this.onDwgIn(t),this.point1.copy(t.point1),this.point2.copy(t.point2),this.point3.copy(t.point3),t}dwgOut(t){return this.onDwgOut(t),t.point1=this.point1,t.point2=this.point2,t.point3=this.point3,t}}var index$e=Object.freeze({__proto__:null,default:Mx3PointArc});class MxDbCoord extends MxDbEntity{constructor(){super(...arguments),this.point1=new THREE.Vector3,this.point2=new THREE.Vector3}worldDraw(t){let e=t.getMxObject();t.drawLine(this.point1,this.point2);let n=this.point2.clone();var r=e.screenCoordLong2Doc(20),i=6*r;n.x=n.x+i,t.drawLine(this.point2,n);var a=new THREE.Vector3,o=new THREE.Vector3;let s=e.docCoord2Cad(this.point1.x,this.point1.y,this.point1.z),l=s.x.toFixed(3),u=s.y.toFixed(3);a.x=this.point2.x+.3*r+.5*i,a.y=this.point2.y+.1*r+.5*r,t.drawText(l,r,0,a),o.x=this.point2.x+.3*r+.5*i,o.y=this.point2.y-.1*r-.5*r,t.drawText(u,r,0,o)}getGripPoints(){let t=[];return t.push(this.point1),t.push(this.point2),t}moveGripPointsAt(t,e){return 0==t?this.point1.add(e):1==t&&this.point2.add(e),!0}dwgIn(t){return this.onDwgIn(t),this.point1.copy(t.point1),this.point2.copy(t.point2),!0}dwgOut(t){return this.onDwgOut(t),t.point1=this.point1,t.point2=this.point2,t}create(){return new MxDbCoord}transformBy(t){this.point1.applyMatrix4(t),this.point2.applyMatrix4(t)}getTypeName(){return"MxDbCoord"}}var index$d=Object.freeze({__proto__:null,default:MxDbCoord});class MxDbLine extends MxDbEntity{constructor(){super(...arguments),this.pt1=new THREE.Vector3,this.pt2=new THREE.Vector3}getTypeName(){return"MxDbLine"}worldDraw(t){t.drawLine(this.pt1,this.pt2)}setPoint1(t){this.pt1=t}getPoint1(){return this.pt1}setPoint2(t){this.pt2=t}getPoint2(){return this.pt2}getGripPoints(){let t=[];t.push(this.pt1),t.push(this.pt2);let e=new THREE.Vector3(this.pt1.x+.5*(this.pt2.x-this.pt1.x),this.pt1.y+.5*(this.pt2.y-this.pt1.y),0);return t.push(e),t}moveGripPointsAt(t,e){return 0==t?this.pt1.add(e):1==t?this.pt2.add(e):2==t&&(this.pt1.add(e),this.pt2.add(e)),!0}dwgIn(t){return this.onDwgIn(t),this.pt1.copy(t.pt1),this.pt2.copy(t.pt2),!0}dwgOut(t){return this.onDwgOut(t),t.pt1=this.pt1,t.pt2=this.pt2,t}create(){return new MxDbLine}getGeomExtents(){return new THREE.Box3(this.pt1,this.pt2)}getGetLength(){return this.pt1.distanceTo(this.pt2)}}var index$c=Object.freeze({__proto__:null,default:MxDbLine});class MxDbRect extends MxDbEntity{constructor(){super(...arguments),this.cornerRadius=[],this.pt1=new THREE.Vector3,this.pt2=new THREE.Vector3,this.isSolidColorFill=!1,this.isLoadMaterialFromPath=!0,this.material=null}worldDraw(t){let e=computeRectPoints(this.pt1,this.pt2);if(this.cornerRadius.length>0&&(e=getToGenerateRoundedCorners(e,this.cornerRadius)),t.getType()!=McGiWorldDrawType$1.kWorldDraw)return e.push(e[0]),void t.drawLines(e);const n={transparent:!0,depthTest:!1,opacity:this.opacity,visible:this.visible};if(this.isSolidColorFill){let r;e=e.map(({x:t,y:e})=>new THREE.Vector2(t,e)),r=new THREE.ShapeGeometry(new THREE.Shape(e));let i=new THREE.MeshBasicMaterial(Object.assign({color:this.filter?this.filter._getFilterColor(this.color,this.opacity):new THREE.Color(this.color)},n)),a=new THREE.Mesh(r,i);t.drawEntity(a)}else if(this.fillImageSrc){if(this.material){e=e.map(({x:t,y:e})=>new THREE.Vector2(t,e));let r=this.material,i=new THREE.ShapeGeometry(new THREE.Shape(e));if(i=repairGeometryFaceVertexUvs(i),this.filter){const t=r.map;this.fillImageParam&&(this.fillImageParam.center&&(t.center=this.fillImageParam.center),this.fillImageParam.offset&&(t.offset=this.fillImageParam.offset),this.fillImageParam.repeat&&(t.repeat=this.fillImageParam.repeat),this.fillImageParam.rotation&&(t.rotation=this.fillImageParam.rotation));const e=this.filter._getFilterShaderData(t);r=new THREE.ShaderMaterial(Object.assign(Object.assign({},e),n))}r.depthTest=!1,r.transparent=!0,r.opacity=this.opacity,r.visible=this.visible;let a=new THREE.Mesh(i,r);t.drawEntity(a)}else if(this.fillImageSrc.length>0&&this.isLoadMaterialFromPath){let t=this;MxFun.loadImageMaterial(this.fillImageSrc,e=>{this.isLoadMaterialFromPath=!1,e&&(t.material=e,t.setNeedUpdateDisplay(),MxFun.updateDisplay())})}}else{let r=(new THREE.BufferGeometry).setFromPoints(e),i=new THREE.LineBasicMaterial(Object.assign({color:this.getColor()},n)),a=new THREE.LineLoop(r,i);t.drawEntity(a)}}getGripPoints(){let t=[];t.push(this.pt1);const e=new THREE.Line3(this.pt1,this.pt2);let n=new THREE.Vector3;return e.getCenter(n),t.push(n),t.push(this.pt2),t}moveGripPointsAt(t,e){return 0==t?this.pt1.add(e):1==t?(this.pt1.add(e),this.pt2.add(e)):2==t&&this.pt2.add(e),!0}dwgIn(t){return this.onDwgIn(t),this.pt1.copy(t.pt1),this.pt2.copy(t.pt2),this.isSolidColorFill=t.isSolidColorFill,this.fillImageSrc=t.fillImageSrc,this.fillImageParam=t.fillImageParam,this.cornerRadius=t.cornerRadius,this.filter=t.filter,this.isLoadMaterialFromPath=!0,this.material=null,!0}dwgOut(t){return this.onDwgOut(t),t.pt1=this.pt1,t.pt2=this.pt2,t.isSolidColorFill=this.isSolidColorFill,t.fillImageSrc=this.fillImageSrc,t.fillImageParam=this.fillImageParam,t.cornerRadius=this.cornerRadius,t.filter=this.filter,t}create(){return new MxDbRect}transformBy(t){this.pt1.applyMatrix4(t),this.pt2.applyMatrix4(t)}setRadius(t,e=!0){this.cornerRadius=t instanceof Array?t.map(t=>e?MxFun.screenCoordLong2Doc(t):t):t>0?e?[MxFun.screenCoordLong2Doc(t),MxFun.screenCoordLong2Doc(t),MxFun.screenCoordLong2Doc(t),MxFun.screenCoordLong2Doc(t)]:[t,t,t,t]:[]}getTypeName(){return"MxDbRect"}getFilter(){return this.filter}setFilter(t){this.filter=t,this.isLoadMaterialFromPath=!0,this.material=null}setFillImagePath(t){this.fillImageSrc=t,this.isLoadMaterialFromPath=!0,this.material=null,this.fillImageSrc&&(this.isSolidColorFill=!1)}getFillImagePath(){return this.fillImageSrc}}var index$b=Object.freeze({__proto__:null,default:MxDbRect});class MxDbAlignedDimension extends MxDbEntity{constructor(){super(...arguments),this.point1=new THREE.Vector3,this.point2=new THREE.Vector3}getTypeName(){return"MxDbAlignedDimension"}getDirection(t,e,n){var r=new THREE.Vector3(t.x,t.y,0),i=new THREE.Vector3(1,0,0),a=t.angleTo(i),o=-1;(a<7*Math.PI/18||a>10*Math.PI/18)&&e.x>n.x&&(o=1);var s=new THREE.Matrix4;return s.makeRotationZ(Math.PI/2*o),r.applyMatrix4(s),r}getDimText(){return new THREE.Vector3(this.point1.x-this.point2.x,this.point1.y-this.point2.y,0).length().toFixed(3)}worldDraw(t){if(t.getType()==McGiWorldDrawType$1.kWorldDraw||t.getType()==McGiWorldDrawType$1.kDynDragDraw){let w=this.point1,_=this.point2;var e,n,r,i,a,o,s,l=new THREE.Vector3(w.x-_.x,w.y-_.y,0),u=this.getDirection(l,w,_),c=new THREE.Matrix4;c.makeScale(.01,.01,.01),(f=new THREE.Vector3(u.x,u.y,0)).applyMatrix4(c);var h=new THREE.Vector3(w.x+f.x,w.y+f.y,0),d=new THREE.Vector3(_.x+f.x,_.y+f.y,0);const M=16777215;o=MxThreeJS.createPoint(w,M),s=MxThreeJS.createPoint(_,M),c.identity(),c.makeScale(.2,.2,0),new THREE.Vector3(u.x,u.y,0).applyMatrix4(c),c.identity(),c.makeScale(.02,.02,0);var p=new THREE.Vector3(u.x,u.y,0);p.applyMatrix4(c),t.drawLine(h,d),e=MxThreeJS.createLine(new THREE.Vector3(h.x+2*p.x,h.y+2*p.y,0),new THREE.Vector3(w.x+p.x,w.y+p.y,0),M),n=MxThreeJS.createLine(new THREE.Vector3(d.x+2*p.x,d.y+2*p.y,0),new THREE.Vector3(_.x+p.x,_.y+p.y,0),M);{var f,m=new THREE.Vector3(1,0,0),g=l.angleTo(m);(f=new THREE.Vector3(u.x,u.y,0)).normalize();var v=w.distanceTo(_);l.y<0?g=g<Math.PI/2?2*Math.PI-g:Math.PI-g:g>Math.PI/2&&(g=Math.PI+g);let e=t.getMxObject();e&&(g-=e.getViewAngle());let n=this.getDimText();null!=(r=MxThreeJS.creatTextSprite(n,new THREE.Vector3(d.x+l.x/2+f.x*v/30,d.y+l.y/2+f.y*v/30,0),.07*v,g,M))&&t.drawEntity(r)}{c.identity(),c.makeScale(.08,.08,.08);var y=new THREE.Matrix4;y.makeRotationZ(17*Math.PI/18);var x=new THREE.Vector3(l.x,l.y,0);x.applyMatrix4(c),x.applyMatrix4(y),y.identity(),y.makeRotationZ(17*-Math.PI/18);var b=new THREE.Vector3(l.x,l.y,0);b.applyMatrix4(c),b.applyMatrix4(y);let t=new Array;t.push(new THREE.Vector3(h.x,h.y,0),new THREE.Vector3(h.x+x.x,h.y+x.y,0),new THREE.Vector3(h.x+b.x,h.y+b.y,0)),i=MxThreeJS.createTriangle(t,M),y.identity(),y.makeRotationZ(Math.PI/18),(x=new THREE.Vector3(l.x,l.y,0)).applyMatrix4(c),x.applyMatrix4(y),y.identity(),y.makeRotationZ(-Math.PI/18),(b=new THREE.Vector3(l.x,l.y,0)).applyMatrix4(c),b.applyMatrix4(y);let e=new Array;e.push(new THREE.Vector3(d.x,d.y,0),new THREE.Vector3(d.x+x.x,d.y+x.y,0),new THREE.Vector3(d.x+b.x,d.y+b.y,0)),a=MxThreeJS.createTriangle(e,M)}t.drawEntity(e),t.drawEntity(n),i&&t.drawEntity(i),a&&t.drawEntity(a),t.drawEntity(o),t.drawEntity(s)}else t.drawLine(this.point1,this.point2)}setPoint1(t){this.point1=t}setPoint2(t){this.point2=t}getGripPoints(){let t=[];return t.push(this.point1),t.push(this.point2),t}moveGripPointsAt(t,e){return 0==t?this.point1.add(e):(t=1)&&this.point2.add(e),!0}dwgIn(t){return this.onDwgIn(t),this.point1.copy(t.point1),this.point2.copy(t.point2),!0}dwgOut(t){return this.onDwgOut(t),t.point1=this.point1,t.point2=this.point2,t}create(){return new MxDbAlignedDimension}}var index$a=Object.freeze({__proto__:null,default:MxDbAlignedDimension});class MxFilters{constructor(){this.uniformObj={},this.filtersStr="",this.filtersTypes="",this.VSHADER_SOURCE="\n varying vec2 v_Uv; \n void main () {\n v_Uv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n }\n ",this.FSHADER_SOURCE=`\n varying vec2 v_Uv;\n uniform sampler2D e_Texture;\n uniform mat4 colorMatrix;\n ${this.filtersStr}\n void main () {\n vec4 color = texture2D( e_Texture, v_Uv );\n color = color * colorMatrix;\n ${this.filtersTypes}\n gl_FragColor = color;\n }`,this._matrix=new THREE.Matrix4}channel({r:t=1,g:e=1,b:n=1}){return this._matrix=(new THREE.Matrix4).set(t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1).multiply(this._matrix),this}brightness(t){return this._matrix=(new THREE.Matrix4).set(t,0,0,0,0,t,0,0,0,0,t,0,0,0,0,1).multiply(this._matrix),this}saturate(t){const e=.2126*(1-t),n=.7152*(1-t),r=.0722*(1-t);return this._matrix=(new THREE.Matrix4).set(e+t,n,r,0,e,n+t,r,0,e,n,r+t,0,0,0,0,1).multiply(this._matrix),this}contrast(t){const e=.5*(1-t);return this._matrix=(new THREE.Matrix4).set(t,0,0,0,0,t,0,0,0,0,t,0,e,e,e,1).multiply(this._matrix),this}opacity(t){return this._matrix=(new THREE.Matrix4).set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,t).multiply(this._matrix),this}invert(t){const e=1-2*t;return this._matrix=(new THREE.Matrix4).set(e,0,0,0,0,e,0,0,0,0,e,0,t,t,t,1).multiply(this._matrix),this}grayscale(t=1){const e=.2126*t,n=.7152*t,r=.0722*t;return this._matrix=(new THREE.Matrix4).set(e+1-t,n,r,0,e,n+1-t,r,0,e,n,r+1-t,0,0,0,0,1).multiply(this._matrix),this}sepia(t=1){return this._matrix=(new THREE.Matrix4).set(1-.607*t,.769*t,.189*t,0,.349*t,1-.314*t,.168*t,0,.272*t,.534*t,1-.869*t,0,0,0,0,1).multiply(this._matrix),this}hueRotate(t){const e=t/180*Math.PI,n=Math.cos(e),r=Math.sin(e),i=.2126,a=.7152,o=.0722;return this._matrix=(new THREE.Matrix4).set(i+.7874*n+r*-i,a+n*-a+r*-a,o+n*-o+.9278*r,0,i+n*-i+.143*r,a+n*(1-a)+.14*r,o+n*-o+-.283*r,0,i+n*-i+-.7874*r,a+n*-a+r*a,o+.9278*n+r*o,0,0,0,0,1).multiply(this._matrix),this}convolution(t,e=1/9,n=521){return this.uniformObj=Object.assign(Object.assign({},this.uniformObj),{cKernel:{value:t.toArray()},stStep:{value:e},scaleFactor:{value:n}}),this.filtersTypes.indexOf("convolutionTextureColor")<0&&(this.filtersStr+="\n uniform float cKernel[9];\n uniform float stStep;\n uniform float scaleFactor;\n vec4 convolutionTextureColor(vec4 color) {\n vec2 offsets[9];\n offsets[0] = vec2(-1.0,-1.0);\n offsets[1] = vec2(0.0,-1.0);\n offsets[2] = vec2(1.0,-1.0);\n offsets[3] = vec2(-1.0,0.0);\n offsets[4] = vec2(0.0,0.0);\n offsets[5] = vec2(1.0,0.0);\n offsets[6] = vec2(-1.0,1.0);\n offsets[7] = vec2(0.0,1.0);\n offsets[8] = vec2(1.0,1.0);\n \n vec4 sum = color;\n for(int i = 0; i < 9; i++) {\n sum = sum + cKernel[i] * scaleFactor * texture2D(e_Texture, v_Uv + offsets[i] / stStep);\n };\n return sum;\n }",this.filtersTypes+="color = convolutionTextureColor(color);\n"),this}reset(){return this.uniformObj={},this.filtersStr="",this.filtersTypes="",this._matrix=new THREE.Matrix4,this}_getFilterShaderData(t){return{uniforms:Object.assign({e_Texture:{value:t},colorMatrix:{value:this._matrix}},this.uniformObj),vertexShader:this.VSHADER_SOURCE,fragmentShader:this.FSHADER_SOURCE}}_getFilterColor(t="#000000",e=1){t=new THREE.Color(t);let{r:n,g:r,b:i}=t;const a=this._matrix.toArray();a[12],a[13],a[14],a[15];const o=a[0]*n+a[1]*n+a[2]*n+a[3]*e,s=a[4]*r+a[5]*r+a[6]*r+a[7]*e,l=a[8]*i+a[9]*i+a[10]*i+a[11]*e;return t.setRGB(o,s,l),t}}class MxDbHatch extends MxDbEntity{constructor(){super(...arguments),this.points=[]}worldDraw(t){t.getType()===McGiWorldDrawType$1.kWorldDraw?t.drawSolid(this.points):t.drawLines([...this.points,this.points[0]])}getTypeName(){return"MxDbHatch"}moveGripPointsAt(t,e){return 0===t?this.points.forEach(t=>{t.add(e)}):this.points[t-1]&&this.points[t-1].add(e),!0}setPoints(t){this.points=t.map(t=>t.clone())}getGripPoints(){if(this.points.length>0){const{centerPoint:t}=computeBounding(this.points);return[t,...this.points]}return[]}dwgIn(t){this.onDwgIn(t);const e=t.points;return this.points=e.map(({x:t,y:e,z:n})=>new THREE.Vector3(t,e,n)),!0}dwgOut(t){return this.onDwgOut(t),t.points=this.points,t}}var index$9=Object.freeze({__proto__:null,default:MxDbHatch});class MxDbArea extends MxDbEntity{constructor(){super(...arguments),this.points=[],this.isFill=!1,this.fillColor=6697540,this.fillOpacity=.7}getTypeName(){return"MxDbArea"}create(){return new MxDbArea}getDimText(){return McGeTool.calcArea(this.points).toFixed(2)}worldDraw(t){if(this.points.length<3)return void(2==this.points.length&&t.drawLine(this.points[0],this.points[1]));let e=this.points[0],n=e.clone(),r=e.clone(),i=this.points.length;for(let a=1;a<i;a++){let i=this.points[a];n.x>i.x&&(n.x=i.x),n.y>i.y&&(n.y=i.y),r.x<i.x&&(r.x=i.x),r.y<i.y&&(r.y=i.y),t.drawLine(e,i),e=i}t.drawLine(e,this.points[0]);let a=new THREE.Vector3(n.x+.5*(r.x-n.x),n.y+.5*(r.y-n.y));const o=t.getColor();let s=MxFun.screenCoordLong2Doc(20),l=MxThreeJS.creatTextSprite(this.getDimText(),a,s,0,o);if(null!=l&&t.drawEntity(l),t.getType()==McGiWorldDrawType$1.kWorldDraw&&this.isFill){t.setColor(this.fillColor),t.setOpacity(this.fillOpacity),t.setRenderOrder(t.getRenderOrder()-1);const e=new MxDbHatch;e.points=this.points,e.worldDraw(t)}}getGripPoints(){return this.points}moveGripPointsAt(t,e){return!(t>=this.points.length||(this.points[t].add(e),0))}dwgIn(t){this.onDwgIn(t);let e=t.points;return this.points=[],e.forEach(t=>{this.points.push(new THREE.Vector3(t.x,t.y,t.z))}),this.dwgInHelp(t,["isFill","fillColor","fillOpacity"]),!0}dwgOut(t){return this.onDwgOut(t),t.points=this.points,this.dwgOutHelp(t,["isFill","fillColor","fillOpacity"]),t}addPoint(t){this.points.push(t.clone())}getPoints(){return this.points}clearPoint(){this.points=[]}}var index$8=Object.freeze({__proto__:null,default:MxDbArea});class MxDbLeadTag extends MxDbEntity{constructor(){super(...arguments),this.point=new THREE.Vector3,this.leadLen=88,this.text="",this.textHeight=24}getTypeName(){return"MxDbLeadTag"}createDots(t,e){const{x:n,y:r,z:i}=t,a=new THREE.Shape;a.arc(n,r,e.screenCoordLong2Doc(6),0,2*Math.PI,!0);const o=new THREE.Path;o.arc(n,r,e.screenCoordLong2Doc(3),0,2*Math.PI,!0),a.holes.push(o);const s=new THREE.ShapeGeometry(a),l=new THREE.MeshPhongMaterial({color:"#ff0000",transparent:!0}),u=new THREE.Shape;u.arc(n,r,e.screenCoordLong2Doc(3),0,2*Math.PI,!0);const c=new THREE.ShapeGeometry(u),h=new THREE.MeshPhongMaterial({color:"#e2da8f",transparent:!0}),d=new THREE.Mesh(s,l),p=new THREE.Mesh(c,h);return d.add(p),d}worldDraw(t){let e=t.getMxObject();const n=this.createDots(this.point,e);if(t.drawEntity(n),n.geometry.computeBoundingBox(),t.drawSelectLine(n.geometry.boundingBox.max,n.geometry.boundingBox.min),2===t.getType())return;let r=t.getMxObject().screenCoordLong2Doc(this.leadLen),i=new THREE.Vector3(this.point.x+2*r,this.point.y+r,0);const a=i.x-r,o=new THREE.Vector3(a,i.y,i.z);t.setLineWidth(4),t.setColor("#ffe605"),t.drawLines([this.point,o,i]);const s=t.getMxObject().screenCoordLong2Doc(this.textHeight),l=i.clone().setX(i.x);t.setColor(16744448);const u=MxThreeJS.creatTextSprite(this.text,l,s,0,t.getColor());if(u){const e=new THREE.Box3,n=new THREE.Vector3;e.expandByObject(u),e.getSize(n),u.position.setX(u.position.x+n.x/2);const r=t.getMxObject().screenCoordLong2Doc(5),i=e.min.clone().setX(e.min.x+n.x/2).setY(e.min.y-r),a=e.max.clone().setX(e.max.x+n.x/2).setY(e.min.y+r);a.setY(e.max.y+r);const o=new THREE.Vector3(i.x,a.y),s=new THREE.Vector3(a.x,i.y);t.setColor("#ffffff"),t.setLineWidth(0),t.drawLine(i,o),t.drawLine(a,s),t.drawLine(i,s),t.drawLine(o,a);const l=r/2,c=[],h=[];c.push(new THREE.Vector3(o.x+l,o.y-r,o.z),new THREE.Vector3(o.x+l,o.y-l,o.z),new THREE.Vector3(o.x+r,o.y-l,o.z)),h.push(new THREE.Vector3(s.x-l,s.y+r,s.z),new THREE.Vector3(s.x-l,s.y+l,s.z),new THREE.Vector3(s.x-r,s.y+l,s.z)),t.drawLines(c),t.drawLines(h),t.setOpacity(.5),t.setColor("#663244"),t.setRenderOrder(-100),t.drawSolid([i,o,a,s]),t.setRenderOrder(100),t.drawEntity(u)}}getGripPoints(){return[this.point]}onViewChange(){return this.setNeedUpdateDisplay(),!0}moveGripPointsAt(t,e){return 0===t&&this.point.add(e),!0}dwgIn(t){return this.onDwgIn(t),this.dwgInHelp(t,["point","text","textHeight","leadLen"]),!0}dwgOut(t){return this.onDwgOut(t),this.dwgOutHelp(t,["point","text","textHeight","leadLen"]),t}}var index$7=Object.freeze({__proto__:null,default:MxDbLeadTag});class MxDbAnyLine extends MxDbEntity{constructor(){super(...arguments),this.points=[]}getTypeName(){return"MxDbAnyLine"}create(){return new MxDbAnyLine}worldDraw(t){let e=t.getMxObject();const n=createAnyLine(this.points);n.geometry.computeBoundingBox();let r=new THREE.Vector3;if(n.geometry.boundingBox.getCenter(r),t.drawEntity(n),t.getType()===McGiWorldDrawType$1.kSelectDraw){const i=new THREE.Vector3;n.geometry.boundingBox.getSize(i),i.addScalar(e.screenCoordLong2Doc(20));const a=i.x/2,o=i.y/2,s={x:r.x-a,y:r.y-o},l={x:r.x+a,y:r.y-o},u={x:r.x+a,y:r.y+o},c={x:r.x-a,y:r.y+o};t.drawLine(s.x,s.y,l.x,l.y),t.drawLine(l.x,l.y,u.x,u.y),t.drawLine(u.x,u.y,c.x,c.y),t.drawLine(c.x,c.y,s.x,s.y)}}getCenter(){const t=new THREE.Geometry;t.vertices=this.points;let e=new THREE.Vector3;return t.computeBoundingBox(),t.boundingBox.getCenter(e),e}getGripPoints(){return[this.getCenter()]}moveGripPointsAt(t,e){return this.points.forEach(t=>{t.add(e)}),!0}dwgIn(t){this.onDwgIn(t);let e=t.points;return this.points=[],e.forEach(t=>{this.points.push(new THREE.Vector3(t.x,t.y,t.z))}),!0}dwgOut(t){return this.onDwgOut(t),t.points=this.points,t}}var index$6=Object.freeze({__proto__:null,default:MxDbAnyLine});class MxDbCloudLine extends MxDbEntity{constructor(){super(...arguments),this.points=[],this.radius=16,this.drawGeometry=null}getTypeName(){return"MxDbCloudLine"}create(){return new MxDbCloudLine}setRadius(t){this.radius=t,this.drawGeometry=null}getRadius(){return this.radius}clacNewArcDiameterPoint(t){if(0==this.points.length)return t;let e=this.points[this.points.length-1];const n=2*this.radius,r=e.distanceTo(t);if(r<n)return null;const i=n*(t.x-e.x)/r+e.x,a=n*(t.y-e.y)/r+e.y;return new THREE.Vector3(i,a,e.z)}createCloudArcCurvePoints(t,e,n){const r=new THREE.Vector3((t.x+e.x)/2,(t.y+e.y)/2,0);n||(n=r.distanceTo(t));const{startAngle:i,endAngle:a}=function(t,e,n){const r=2*Math.PI/360;return{startAngle:180*Math.atan2(e.y-t.y,e.x-t.x)/Math.PI*r,endAngle:180*Math.atan2(n.y-t.y,n.x-t.x)/Math.PI*r}}(r,t,e);return new THREE.ArcCurve(r.x,r.y,n,i,a,!0).getPoints(10)}addPoint(t,e){let n=this.clacNewArcDiameterPoint(t);if(n)if(this.points.push(n),e){if(this.points.length<2)return;let t=this.points[this.points.length-2];const e=this.createCloudArcCurvePoints(t,n);let r=this.drawGeometry;r||(r=new THREE.Geometry),e.forEach(t=>{null==r||r.vertices.push(new THREE.Vector3(t.x,t.y,0))}),this.drawGeometry=new THREE.Geometry,this.drawGeometry.vertices=r.vertices}else this.drawGeometry=null}addLine(t,e){this.addPoint(t);const n=2*this.radius;let r=this.points[this.points.length-1],i=r.distanceTo(e);const a=Math.round(i/n);for(let t=0;t<a;t++){i=r.distanceTo(e);const t=n*(e.x-r.x)/i+r.x,a=n*(e.y-r.y)/i+r.y;let o=new THREE.Vector3(t,a,e.z);this.addPoint(o),r=o}return this.points[this.points.length-1]}reCalculateDrawGeometry(){if(this.drawGeometry=new THREE.Geometry,this.points.length<2)return;let t=this.points[0],e=this.points.length;for(let n=1;n<e;n++){let e=this.points[n];this.createCloudArcCurvePoints(t,e).forEach(t=>{var e;null===(e=this.drawGeometry)||void 0===e||e.vertices.push(new THREE.Vector3(t.x,t.y,0))}),t=e}}worldDraw(t){var e;if(t.getType()===McGiWorldDrawType$1.kSelectDraw){if(!this.drawGeometry)return;this.drawGeometry.computeBoundingBox();const e=new THREE.Vector3;this.drawGeometry.boundingBox.getSize(e);let n=new THREE.Vector3;this.drawGeometry.boundingBox.getCenter(n);const r=e.x/2,i=e.y/2,a={x:n.x-r,y:n.y-i},o={x:n.x+r,y:n.y-i},s={x:n.x+r,y:n.y+i},l={x:n.x-r,y:n.y+i};t.drawLine(a.x,a.y,o.x,o.y),t.drawLine(o.x,o.y,s.x,s.y),t.drawLine(s.x,s.y,l.x,l.y),t.drawLine(l.x,l.y,a.x,a.y)}else{if(this.drawGeometry||this.reCalculateDrawGeometry(),0==(null===(e=this.drawGeometry)||void 0===e?void 0:e.vertices.length))return;t.drawGeometryLines(this.drawGeometry)}}getCenter(){const t=new THREE.Geometry;t.vertices=this.points;let e=new THREE.Vector3;return t.computeBoundingBox(),t.boundingBox.getCenter(e),e}getGripPoints(){return[this.getCenter()]}moveGripPointsAt(t,e){return this.points.forEach(t=>{t.add(e)}),this.drawGeometry=null,!0}dwgIn(t){this.onDwgIn(t);let e=t.points;return this.points=[],e.forEach(t=>{this.points.push(new THREE.Vector3(t.x,t.y,t.z))}),this.drawGeometry=null,this.radius=t.radius,!0}dwgOut(t){return this.onDwgOut(t),t.points=this.points,t.radius=this.radius,t}}var index$5=Object.freeze({__proto__:null,default:MxDbCloudLine});class MxDbRegularPolygon extends MxDbEntity{constructor(){super(...arguments),this.centerPoint=new THREE.Vector3,this.otherPoint=new THREE.Vector3,this.sidesNumber=5}getTypeName(){return"MxDbRegularPolygon"}worldDraw(t){const e=createThreeRegularPolygon(this.centerPoint,this.otherPoint,this.sidesNumber,t.getColor());if(e.geometry.computeBoundingBox(),t.getType()===McGiWorldDrawType$1.kSelectDraw){const n=new THREE.Vector3;e.geometry.boundingBox.getSize(n),n.addScalar(MxFun.screenCoordLong2Doc(10));const r=n.x/2,i=n.y/2,a={x:this.centerPoint.x-r,y:this.centerPoint.y-i},o={x:this.centerPoint.x+r,y:this.centerPoint.y-i},s={x:this.centerPoint.x+r,y:this.centerPoint.y+i},l={x:this.centerPoint.x-r,y:this.centerPoint.y+i};t.drawLine(a.x,a.y,o.x,o.y),t.drawLine(o.x,o.y,s.x,s.y),t.drawLine(s.x,s.y,l.x,l.y),t.drawLine(l.x,l.y,a.x,a.y)}t.drawEntity(e)}getGripPoints(){return[this.centerPoint,this.otherPoint]}moveGripPointsAt(t,e){return 0===t?(this.centerPoint.add(e),this.otherPoint.add(e)):1===t&&this.otherPoint.add(e),!0}create(){return new MxDbRegularPolygon}dwgIn(t){return this.onDwgIn(t),this.centerPoint.copy(t.centerPoint),this.otherPoint.copy(t.otherPoint),this.sidesNumber=t.sidesNumber,!0}dwgOut(t){return this.onDwgOut(t),t.centerPoint=this.centerPoint,t.otherPoint=this.otherPoint,t.sidesNumber=this.sidesNumber,t}}var index$4=Object.freeze({__proto__:null,default:MxDbRegularPolygon});class MxDbLeadComment extends MxDbEntity{constructor(){super(...arguments),this.point1=new THREE.Vector3,this.point2=new THREE.Vector3,this.text="",this.textHeight=20,this.textWidth=0}getTypeName(){return"MxDbLeadComment"}create(){return new MxDbLeadComment}worldDraw(t){if(t.drawLine(this.point1,this.point2),this.text.length>0){const e=new THREE.Vector3;let n=MxThreeJS.clacTextSpriteSize(this.text,this.textHeight,this.textWidth);e.x=this.point2.x+.5*n.spritewidth,e.y=this.point2.y+.5*n.spriteheight,t.drawText(this.text,this.textHeight,0,e,this.textWidth);const r=new THREE.Vector3;r.x=this.point2.x+n.textwidth,r.y=this.point2.y,t.drawLine(r,this.point2)}}getGripPoints(){let t=[];return t.push(this.point1),t.push(this.point2),t}moveGripPointsAt(t,e){return 0==t?this.point1.add(e):1==t&&this.point2.add(e),!0}dwgIn(t){return this.onDwgIn(t),this.point1.copy(t.point1),this.point2.copy(t.point2),this.text=t.text.substr(0),this.textHeight=t.textHeight,t.textWidth&&(this.textWidth=t.textWidth),!0}dwgOut(t){return this.onDwgOut(t),t.point1=this.point1,t.point2=this.point2,t.textHeight=this.textHeight,t.text=this.text,t.textWidth=this.textWidth,t}}var index$3=Object.freeze({__proto__:null,default:MxDbLeadComment});class MxDbRectBoxLeadComment extends MxDbEntity{constructor(){super(...arguments),this.point1=new THREE.Vector3,this.point2=new THREE.Vector3,this.point3=new THREE.Vector3,this.text="",this.textHeight=20,this.radius=16}getTypeName(){return"MxDbRectBoxLeadComment"}create(){return new MxDbRectBoxLeadComment}worldDraw(t){let e=new MxDbCloudLine;e.setRadius(this.radius);let n=this.point1.clone(),r=this.point2.clone();if(n.x>r.x){let t=n.x;n.x=r.x,r.x=t}if(n.y>r.y){let t=n.y;n.y=r.y,r.y=t}let i=new THREE.Vector3(n.x,r.y,n.z);i=e.addLine(n,i),r=new THREE.Vector3(r.x,i.y,r.z),r=e.addLine(i,r);let a=new THREE.Vector3(r.x,n.y,n.z);if(a=e.addLine(r,a),n=e.addLine(a,n),e.worldDraw(t),this.text.length>0){let e=n,o=n.distanceTo(this.point3);o>i.distanceTo(this.point3)&&(e=i,o=i.distanceTo(this.point3)),o>r.distanceTo(this.point3)&&(e=r,o=r.distanceTo(this.point3)),o>a.distanceTo(this.point3)&&(e=a,o=a.distanceTo(this.point3));let s=new MxDbLeadComment;s.point1=e,s.point2=this.point3,s.text=this.text,s.textHeight=this.textHeight,s.worldDraw(t)}}getGripPoints(){let t=[];return t.push(this.point1),t.push(this.point2),t.push(this.point3),t}moveGripPointsAt(t,e){return 0==t?this.point1.add(e):1==t?this.point2.add(e):2==t&&this.point3.add(e),!0}dwgIn(t){return this.onDwgIn(t),this.point1.copy(t.point1),this.point2.copy(t.point2),this.point3.copy(t.point3),this.text=t.text.substr(0),this.textHeight=t.textHeight,this.radius=t.radius,!0}dwgOut(t){return this.onDwgOut(t),t.point1=this.point1,t.point2=this.point2,t.point3=this.point3,t.textHeight=this.textHeight,t.text=this.text,t.radius=this.radius,t}}var index$2=Object.freeze({__proto__:null,default:MxDbRectBoxLeadComment});class MxDbEllipse extends MxDbEntity{constructor(){super(...arguments),this.point1=new THREE.Vector3,this.point2=new THREE.Vector3}getTypeName(){return"MxDbEllipse"}worldDraw(t){const e=createThreeEllipse(this.point1,this.point2,t.getColor());let n=t.getMxObject();e.geometry.computeBoundingBox();let r=new THREE.Vector3;if(e.geometry.boundingBox.getCenter(r),t.getType()===McGiWorldDrawType$1.kSelectDraw){const i=new THREE.Vector3;e.geometry.boundingBox.getSize(i),i.addScalar(n.screenCoordLong2Doc(10));const a=i.x/2,o=i.y/2,s={x:r.x-a,y:r.y-o},l={x:r.x+a,y:r.y-o},u={x:r.x+a,y:r.y+o},c={x:r.x-a,y:r.y+o};t.drawLine(s.x,s.y,l.x,l.y),t.drawLine(l.x,l.y,u.x,u.y),t.drawLine(u.x,u.y,c.x,c.y),t.drawLine(c.x,c.y,s.x,s.y)}t.drawEntity(e)}getGripPoints(){let t=new THREE.Vector3(.5*(this.point2.x+this.point1.x),.5*(this.point2.y+this.point1.y),0);return[this.point1,this.point2,t]}moveGripPointsAt(t,e){return 0===t?this.point1.add(e):1===t?this.point2.add(e):2===t&&(this.point1.add(e),this.point2.add(e)),!0}create(){return new MxDbEllipse}dwgIn(t){return this.onDwgIn(t),this.point1.copy(t.point1),this.point2.copy(t.point2),t}dwgOut(t){return this.onDwgOut(t),t.point1=this.point1,t.point2=this.point2,t}}var index$1=Object.freeze({__proto__:null,default:MxDbEllipse});function formatString(t,...e){for(let n=0;n<e.length;n++)t=t.replace(`{${n}}`,e[n]);return t}class MxDbText extends MxDbEntity{constructor(){super(...arguments),this.position=new THREE.Vector3,this.text="",this.height=1,this.angle=0}getTypeName(){return"MxDbText"}worldDraw(t){if(this.text.length>0&&(t.drawText(this.text,this.height,this.angle,this.position),t.getType()===McGiWorldDrawType$1.kSelectDraw)){let e=MxThreeJS.creatTextSprite(this.text,this.position,this.height,this.angle,16777215);if(e){const n=new THREE.Box3;n.expandByObject(e);const r=n.min,i=n.max,a={x:r.x,y:i.y},o={x:i.x,y:r.y};t.drawLine(r.x,r.y,a.x,a.y),t.drawLine(a.x,a.y,i.x,i.y),t.drawLine(i.x,i.y,o.x,o.y),t.drawLine(o.x,o.y,r.x,r.y)}}}getGripPoints(){return[this.position]}moveGripPointsAt(t,e){return 0===t&&this.position.add(e),!0}create(){return new MxDbText}dwgIn(t){return this.onDwgIn(t),this.position.copy(t.position),this.text=t.text.substr(0),this.height=t.height,this.angle=t.angle,!0}dwgOut(t){return this.onDwgOut(t),t.position=this.position,t.text=this.text,t.height=this.height,t.angle=this.angle,t}getGeomExtents(){var t=document.createElement("canvas").getContext("2d");if(null==t)return null;var e=formatString("normal {0}px Arial","256");t.font=e;let n=t.measureText(this.text).width/256,r=this.position.x-n*this.height*.5,i=this.position.y-.5*this.height,a=this.position.x+n*this.height*.5,o=this.position.y+.5*this.height;return new THREE.Box3(new THREE.Vector3(r,i,this.position.z),new THREE.Vector3(a,o,this.position.z))}}var index=Object.freeze({__proto__:null,default:MxDbText}),Mx=Object.freeze({__proto__:null,loadCoreCode:loadCoreCode,useCanvasResizeListener:useCanvasResizeListener,store:store,MxFun:MxFun,MxThreeJS:MxThreeJS,MxType:MxType,Mxassembly:Mxassembly,McGeTool:McGeTool,MrxDbgUtils:MrxDbgUtils,MrxDbgUiPrPoint:MrxDbgUiPrPoint,McEdGetPointWorldDrawObject:McEdGetPointWorldDrawObject,MrxDbgUiPrBaseReturn:MrxDbgUiPrBaseReturn$1,MxDbEntity:MxDbEntity,MxDbImage:MxDbImage,MxDbSVG:MxDbSVG,MxDbSVGText:MxDbSVGText,MxDbPolyline:MxDbPolyline,MxDb2LineAngularDimension:MxDb2LineAngularDimension,Mx3PointArc:Mx3PointArc,MxDbCoord:MxDbCoord,MxDbLine:MxDbLine,MxDbRect:MxDbRect,MxDbAlignedDimension:MxDbAlignedDimension,MxFilters:MxFilters,McGiWorldDrawType:McGiWorldDrawType$1,MxDbArea:MxDbArea,MxDbLeadTag:MxDbLeadTag,MxDbAnyLine:MxDbAnyLine,MxDbCloudLine:MxDbCloudLine,MxDbRegularPolygon:MxDbRegularPolygon,MxDbLeadComment:MxDbLeadComment,MxDbRectBoxLeadComment:MxDbRectBoxLeadComment,MxDbEllipse:MxDbEllipse,MxDbText:MxDbText,MxDrawObject:MxDrawObject,MxDbHatch:MxDbHatch,MxDbDatabase:MxDbDatabase,MxCADObject:MxCADObject}),elementResizeEventPolyfill_umd_min=createCommonjsModule(function(t,e){"undefined"!=typeof self&&self,t.exports=function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s="fae3")}({"6dd8":function(t,e,n){(function(t){var n=function(){if("undefined"!=typeof Map)return Map;function t(t,e){var n=-1;return t.some(function(t,r){return t[0]===e&&(n=r,!0)}),n}return function(){function e(){this.__entries__=[]}return Object.defineProperty(e.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),e.prototype.get=function(e){var n=t(this.__entries__,e),r=this.__entries__[n];return r&&r[1]},e.prototype.set=function(e,n){var r=t(this.__entries__,e);~r?this.__entries__[r][1]=n:this.__entries__.push([e,n])},e.prototype.delete=function(e){var n=this.__entries__,r=t(n,e);~r&&n.splice(r,1)},e.prototype.has=function(e){return!!~t(this.__entries__,e)},e.prototype.clear=function(){this.__entries__.splice(0)},e.prototype.forEach=function(t,e){void 0===e&&(e=null);for(var n=0,r=this.__entries__;n<r.length;n++){var i=r[n];t.call(e,i[1],i[0])}},e}()}(),r="undefined"!=typeof window&&"undefined"!=typeof document&&window.document===document,i=void 0!==t&&t.Math===Math?t:"undefined"!=typeof self&&self.Math===Math?self:"undefined"!=typeof window&&window.Math===Math?window:Function("return this")(),a="function"==typeof requestAnimationFrame?requestAnimationFrame.bind(i):function(t){return setTimeout(function(){return t(Date.now())},1e3/60)},o=2;var s=20,l=["top","right","bottom","left","width","height","size","weight"],u="undefined"!=typeof MutationObserver,c=function(){function t(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(t,e){var n=!1,r=!1,i=0;function s(){n&&(n=!1,t()),r&&u()}function l(){a(s)}function u(){var t=Date.now();if(n){if(t-i<o)return;r=!0}else n=!0,r=!1,setTimeout(l,e);i=t}return u}(this.refresh.bind(this),s)}return t.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},t.prototype.removeObserver=function(t){var e=this.observers_,n=e.indexOf(t);~n&&e.splice(n,1),!e.length&&this.connected_&&this.disconnect_()},t.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},t.prototype.updateObservers_=function(){var t=this.observers_.filter(function(t){return t.gatherActive(),t.hasActive()});return t.forEach(function(t){return t.broadcastActive()}),t.length>0},t.prototype.connect_=function(){r&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),u?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},t.prototype.disconnect_=function(){r&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},t.prototype.onTransitionEnd_=function(t){var e=t.propertyName,n=void 0===e?"":e;l.some(function(t){return!!~n.indexOf(t)})&&this.refresh()},t.getInstance=function(){return this.instance_||(this.instance_=new t),this.instance_},t.instance_=null,t}(),h=function(t,e){for(var n=0,r=Object.keys(e);n<r.length;n++){var i=r[n];Object.defineProperty(t,i,{value:e[i],enumerable:!1,writable:!1,configurable:!0})}return t},d=function(t){return t&&t.ownerDocument&&t.ownerDocument.defaultView||i},p=x(0,0,0,0);function f(t){return parseFloat(t)||0}function m(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return e.reduce(function(e,n){return e+f(t["border-"+n+"-width"])},0)}function g(t){var e=t.clientWidth,n=t.clientHeight;if(!e&&!n)return p;var r=d(t).getComputedStyle(t),i=function(t){for(var e={},n=0,r=["top","right","bottom","left"];n<r.length;n++){var i=r[n],a=t["padding-"+i];e[i]=f(a)}return e}(r),a=i.left+i.right,o=i.top+i.bottom,s=f(r.width),l=f(r.height);if("border-box"===r.boxSizing&&(Math.round(s+a)!==e&&(s-=m(r,"left","right")+a),Math.round(l+o)!==n&&(l-=m(r,"top","bottom")+o)),!function(t){return t===d(t).document.documentElement}(t)){var u=Math.round(s+a)-e,c=Math.round(l+o)-n;1!==Math.abs(u)&&(s-=u),1!==Math.abs(c)&&(l-=c)}return x(i.left,i.top,s,l)}var v="undefined"!=typeof SVGGraphicsElement?function(t){return t instanceof d(t).SVGGraphicsElement}:function(t){return t instanceof d(t).SVGElement&&"function"==typeof t.getBBox};function y(t){return r?v(t)?function(t){var e=t.getBBox();return x(0,0,e.width,e.height)}(t):g(t):p}function x(t,e,n,r){return{x:t,y:e,width:n,height:r}}var b=function(){function t(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=x(0,0,0,0),this.target=t}return t.prototype.isActive=function(){var t=y(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},t.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t},t}(),w=function(){return function(t,e){var n=function(t){var e=t.x,n=t.y,r=t.width,i=t.height,a="undefined"!=typeof DOMRectReadOnly?DOMRectReadOnly:Object,o=Object.create(a.prototype);return h(o,{x:e,y:n,width:r,height:i,top:n,right:e+r,bottom:i+n,left:e}),o}(e);h(this,{target:t,contentRect:n})}}(),_=function(){function t(t,e,r){if(this.activeObservations_=[],this.observations_=new n,"function"!=typeof t)throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=t,this.controller_=e,this.callbackCtx_=r}return t.prototype.observe=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(t instanceof d(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var e=this.observations_;e.has(t)||(e.set(t,new b(t)),this.controller_.addObserver(this),this.controller_.refresh())}},t.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(t instanceof d(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var e=this.observations_;e.has(t)&&(e.delete(t),e.size||this.controller_.removeObserver(this))}},t.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},t.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(e){e.isActive()&&t.activeObservations_.push(e)})},t.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,e=this.activeObservations_.map(function(t){return new w(t.target,t.broadcastRect())});this.callback_.call(t,e,t),this.clearActive()}},t.prototype.clearActive=function(){this.activeObservations_.splice(0)},t.prototype.hasActive=function(){return this.activeObservations_.length>0},t}(),M="undefined"!=typeof WeakMap?new WeakMap:new n,S=function(){return function t(e){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=c.getInstance(),r=new _(e,n,this);M.set(this,r)}}();["observe","unobserve","disconnect"].forEach(function(t){S.prototype[t]=function(){var e;return(e=M.get(this))[t].apply(e,arguments)}});var T=void 0!==i.ResizeObserver?i.ResizeObserver:S;e.a=T}).call(this,n("c8ba"))},c8ba:function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},f6fd:function(t,e){!function(t){var e="currentScript",n=t.getElementsByTagName("script");e in t||Object.defineProperty(t,e,{get:function(){try{throw new Error}catch(r){var t,e=(/.*at [^\(]*\((.*):.+:.+\)$/gi.exec(r.stack)||[!1])[1];for(t in n)if(n[t].src==e||"interactive"==n[t].readyState)return n[t];return null}}})}(document)},fae3:function(t,e,n){var r;n.r(e),n.d(e,"EventListenerWrapper",function(){return s}),"undefined"!=typeof window&&(n("f6fd"),(r=window.document.currentScript)&&(r=r.src.match(/(.+\/)[^/]+\.js(\?.*)?$/))&&(n.p=r[1]));var i=n("6dd8");const a=EventTarget.prototype.addEventListener,o=function(t){const e=document.createEvent("HTMLEvents");return e.initEvent(t),e},s=function(t){"resize"===t&&u(this),a.apply(this,arguments)};function l(t){const e=l.observer=l.observer||new i.a(t);return e.initialized=!0,e}function u(t){const e=l(t=>{if(e.initialized)e.initialized=!1;else for(let e of t){const t=o("resize");e.target.dispatchEvent(t),e&&e.target&&"function"==typeof e.target.onresize&&e.target.onresize(t)}});e.observe(t)}HTMLElement.prototype.addEventListener=s,Reflect.defineProperty(HTMLElement.prototype,"onresize",{set(t){this._onresize=t,"function"==typeof t&&u(this)},get(){return this._onresize||null}})}})}),elementResizeEventPolyfill_umd_min$1=unwrapExports(elementResizeEventPolyfill_umd_min),elementResizeEventPolyfill_umd_min$2=Object.freeze({__proto__:null,default:elementResizeEventPolyfill_umd_min$1,__moduleExports:elementResizeEventPolyfill_umd_min}),jquery=createCommonjsModule(function(t){var e,n;e="undefined"!=typeof window?window:commonjsGlobal,n=function(t,e){var n=[],r=Object.getPrototypeOf,i=n.slice,a=n.flat?function(t){return n.flat.call(t)}:function(t){return n.concat.apply([],t)},o=n.push,s=n.indexOf,l={},u=l.toString,c=l.hasOwnProperty,h=c.toString,d=h.call(Object),p={},f=function(t){return"function"==typeof t&&"number"!=typeof t.nodeType&&"function"!=typeof t.item},m=function(t){return null!=t&&t===t.window},g=t.document,v={type:!0,src:!0,nonce:!0,noModule:!0};function y(t,e,n){var r,i,a=(n=n||g).createElement("script");if(a.text=t,e)for(r in v)(i=e[r]||e.getAttribute&&e.getAttribute(r))&&a.setAttribute(r,i);n.head.appendChild(a).parentNode.removeChild(a)}function x(t){return null==t?t+"":"object"==typeof t||"function"==typeof t?l[u.call(t)]||"object":typeof t}var b="3.6.0",w=function(t,e){return new w.fn.init(t,e)};function _(t){var e=!!t&&"length"in t&&t.length,n=x(t);return!f(t)&&!m(t)&&("array"===n||0===e||"number"==typeof e&&e>0&&e-1 in t)}w.fn=w.prototype={jquery:b,constructor:w,length:0,toArray:function(){return i.call(this)},get:function(t){return null==t?i.call(this):t<0?this[t+this.length]:this[t]},pushStack:function(t){var e=w.merge(this.constructor(),t);return e.prevObject=this,e},each:function(t){return w.each(this,t)},map:function(t){return this.pushStack(w.map(this,function(e,n){return t.call(e,n,e)}))},slice:function(){return this.pushStack(i.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(w.grep(this,function(t,e){return(e+1)%2}))},odd:function(){return this.pushStack(w.grep(this,function(t,e){return e%2}))},eq:function(t){var e=this.length,n=+t+(t<0?e:0);return this.pushStack(n>=0&&n<e?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:o,sort:n.sort,splice:n.splice},w.extend=w.fn.extend=function(){var t,e,n,r,i,a,o=arguments[0]||{},s=1,l=arguments.length,u=!1;for("boolean"==typeof o&&(u=o,o=arguments[s]||{},s++),"object"==typeof o||f(o)||(o={}),s===l&&(o=this,s--);s<l;s++)if(null!=(t=arguments[s]))for(e in t)r=t[e],"__proto__"!==e&&o!==r&&(u&&r&&(w.isPlainObject(r)||(i=Array.isArray(r)))?(n=o[e],a=i&&!Array.isArray(n)?[]:i||w.isPlainObject(n)?n:{},i=!1,o[e]=w.extend(u,a,r)):void 0!==r&&(o[e]=r));return o},w.extend({expando:"jQuery"+(b+Math.random()).replace(/\D/g,""),isReady:!0,error:function(t){throw new Error(t)},noop:function(){},isPlainObject:function(t){var e,n;return!(!t||"[object Object]"!==u.call(t)||(e=r(t))&&("function"!=typeof(n=c.call(e,"constructor")&&e.constructor)||h.call(n)!==d))},isEmptyObject:function(t){var e;for(e in t)return!1;return!0},globalEval:function(t,e,n){y(t,{nonce:e&&e.nonce},n)},each:function(t,e){var n,r=0;if(_(t))for(n=t.length;r<n&&!1!==e.call(t[r],r,t[r]);r++);else for(r in t)if(!1===e.call(t[r],r,t[r]))break;return t},makeArray:function(t,e){var n=e||[];return null!=t&&(_(Object(t))?w.merge(n,"string"==typeof t?[t]:t):o.call(n,t)),n},inArray:function(t,e,n){return null==e?-1:s.call(e,t,n)},merge:function(t,e){for(var n=+e.length,r=0,i=t.length;r<n;r++)t[i++]=e[r];return t.length=i,t},grep:function(t,e,n){for(var r=[],i=0,a=t.length,o=!n;i<a;i++)!e(t[i],i)!==o&&r.push(t[i]);return r},map:function(t,e,n){var r,i,o=0,s=[];if(_(t))for(r=t.length;o<r;o++)null!=(i=e(t[o],o,n))&&s.push(i);else for(o in t)null!=(i=e(t[o],o,n))&&s.push(i);return a(s)},guid:1,support:p}),"function"==typeof Symbol&&(w.fn[Symbol.iterator]=n[Symbol.iterator]),w.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(t,e){l["[object "+e+"]"]=e.toLowerCase()});var M=function(t){var e,n,r,i,a,o,s,l,u,c,h,d,p,f,m,g,v,y,x,b="sizzle"+1*new Date,w=t.document,_=0,M=0,S=lt(),T=lt(),C=lt(),E=lt(),D=function(t,e){return t===e&&(h=!0),0},A={}.hasOwnProperty,O=[],L=O.pop,P=O.push,R=O.push,I=O.slice,k=function(t,e){for(var n=0,r=t.length;n<r;n++)if(t[n]===e)return n;return-1},B="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",F="[\\x20\\t\\r\\n\\f]",N="(?:\\\\[\\da-fA-F]{1,6}[\\x20\\t\\r\\n\\f]?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",j="\\[[\\x20\\t\\r\\n\\f]*("+N+")(?:"+F+"*([*^$|!~]?=)"+F+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+N+"))|)"+F+"*\\]",z=":("+N+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+j+")*)|.*)\\)|)",V=new RegExp(F+"+","g"),G=new RegExp("^[\\x20\\t\\r\\n\\f]+|((?:^|[^\\\\])(?:\\\\.)*)[\\x20\\t\\r\\n\\f]+$","g"),U=new RegExp("^[\\x20\\t\\r\\n\\f]*,[\\x20\\t\\r\\n\\f]*"),H=new RegExp("^[\\x20\\t\\r\\n\\f]*([>+~]|[\\x20\\t\\r\\n\\f])[\\x20\\t\\r\\n\\f]*"),W=new RegExp(F+"|>"),J=new RegExp(z),q=new RegExp("^"+N+"$"),X={ID:new RegExp("^#("+N+")"),CLASS:new RegExp("^\\.("+N+")"),TAG:new RegExp("^("+N+"|[*])"),ATTR:new RegExp("^"+j),PSEUDO:new RegExp("^"+z),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\([\\x20\\t\\r\\n\\f]*(even|odd|(([+-]|)(\\d*)n|)[\\x20\\t\\r\\n\\f]*(?:([+-]|)[\\x20\\t\\r\\n\\f]*(\\d+)|))[\\x20\\t\\r\\n\\f]*\\)|)","i"),bool:new RegExp("^(?:"+B+")$","i"),needsContext:new RegExp("^[\\x20\\t\\r\\n\\f]*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\([\\x20\\t\\r\\n\\f]*((?:-\\d)?\\d*)[\\x20\\t\\r\\n\\f]*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Z=/^(?:input|select|textarea|button)$/i,$=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Q=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,tt=/[+~]/,et=new RegExp("\\\\[\\da-fA-F]{1,6}[\\x20\\t\\r\\n\\f]?|\\\\([^\\r\\n\\f])","g"),nt=function(t,e){var n="0x"+t.slice(1)-65536;return e||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},rt=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,it=function(t,e){return e?"\0"===t?"�":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t},at=function(){d()},ot=bt(function(t){return!0===t.disabled&&"fieldset"===t.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{R.apply(O=I.call(w.childNodes),w.childNodes),O[w.childNodes.length].nodeType}catch(t){R={apply:O.length?function(t,e){P.apply(t,I.call(e))}:function(t,e){for(var n=t.length,r=0;t[n++]=e[r++];);t.length=n-1}}}function st(t,e,r,i){var a,s,u,c,h,f,v,y=e&&e.ownerDocument,w=e?e.nodeType:9;if(r=r||[],"string"!=typeof t||!t||1!==w&&9!==w&&11!==w)return r;if(!i&&(d(e),e=e||p,m)){if(11!==w&&(h=Q.exec(t)))if(a=h[1]){if(9===w){if(!(u=e.getElementById(a)))return r;if(u.id===a)return r.push(u),r}else if(y&&(u=y.getElementById(a))&&x(e,u)&&u.id===a)return r.push(u),r}else{if(h[2])return R.apply(r,e.getElementsByTagName(t)),r;if((a=h[3])&&n.getElementsByClassName&&e.getElementsByClassName)return R.apply(r,e.getElementsByClassName(a)),r}if(n.qsa&&!E[t+" "]&&(!g||!g.test(t))&&(1!==w||"object"!==e.nodeName.toLowerCase())){if(v=t,y=e,1===w&&(W.test(t)||H.test(t))){for((y=tt.test(t)&&vt(e.parentNode)||e)===e&&n.scope||((c=e.getAttribute("id"))?c=c.replace(rt,it):e.setAttribute("id",c=b)),s=(f=o(t)).length;s--;)f[s]=(c?"#"+c:":scope")+" "+xt(f[s]);v=f.join(",")}try{return R.apply(r,y.querySelectorAll(v)),r}catch(e){E(t,!0)}finally{c===b&&e.removeAttribute("id")}}}return l(t.replace(G,"$1"),e,r,i)}function lt(){var t=[];return function e(n,i){return t.push(n+" ")>r.cacheLength&&delete e[t.shift()],e[n+" "]=i}}function ut(t){return t[b]=!0,t}function ct(t){var e=p.createElement("fieldset");try{return!!t(e)}catch(t){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function ht(t,e){for(var n=t.split("|"),i=n.length;i--;)r.attrHandle[n[i]]=e}function dt(t,e){var n=e&&t,r=n&&1===t.nodeType&&1===e.nodeType&&t.sourceIndex-e.sourceIndex;if(r)return r;if(n)for(;n=n.nextSibling;)if(n===e)return-1;return t?1:-1}function pt(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function ft(t){return function(e){var n=e.nodeName.toLowerCase();return("input"===n||"button"===n)&&e.type===t}}function mt(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ot(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function gt(t){return ut(function(e){return e=+e,ut(function(n,r){for(var i,a=t([],n.length,e),o=a.length;o--;)n[i=a[o]]&&(n[i]=!(r[i]=n[i]))})})}function vt(t){return t&&void 0!==t.getElementsByTagName&&t}for(e in n=st.support={},a=st.isXML=function(t){var e=t&&t.namespaceURI,n=t&&(t.ownerDocument||t).documentElement;return!Y.test(e||n&&n.nodeName||"HTML")},d=st.setDocument=function(t){var e,i,o=t?t.ownerDocument||t:w;return o!=p&&9===o.nodeType&&o.documentElement?(f=(p=o).documentElement,m=!a(p),w!=p&&(i=p.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",at,!1):i.attachEvent&&i.attachEvent("onunload",at)),n.scope=ct(function(t){return f.appendChild(t).appendChild(p.createElement("div")),void 0!==t.querySelectorAll&&!t.querySelectorAll(":scope fieldset div").length}),n.attributes=ct(function(t){return t.className="i",!t.getAttribute("className")}),n.getElementsByTagName=ct(function(t){return t.appendChild(p.createComment("")),!t.getElementsByTagName("*").length}),n.getElementsByClassName=K.test(p.getElementsByClassName),n.getById=ct(function(t){return f.appendChild(t).id=b,!p.getElementsByName||!p.getElementsByName(b).length}),n.getById?(r.filter.ID=function(t){var e=t.replace(et,nt);return function(t){return t.getAttribute("id")===e}},r.find.ID=function(t,e){if(void 0!==e.getElementById&&m){var n=e.getElementById(t);return n?[n]:[]}}):(r.filter.ID=function(t){var e=t.replace(et,nt);return function(t){var n=void 0!==t.getAttributeNode&&t.getAttributeNode("id");return n&&n.value===e}},r.find.ID=function(t,e){if(void 0!==e.getElementById&&m){var n,r,i,a=e.getElementById(t);if(a){if((n=a.getAttributeNode("id"))&&n.value===t)return[a];for(i=e.getElementsByName(t),r=0;a=i[r++];)if((n=a.getAttributeNode("id"))&&n.value===t)return[a]}return[]}}),r.find.TAG=n.getElementsByTagName?function(t,e){return void 0!==e.getElementsByTagName?e.getElementsByTagName(t):n.qsa?e.querySelectorAll(t):void 0}:function(t,e){var n,r=[],i=0,a=e.getElementsByTagName(t);if("*"===t){for(;n=a[i++];)1===n.nodeType&&r.push(n);return r}return a},r.find.CLASS=n.getElementsByClassName&&function(t,e){if(void 0!==e.getElementsByClassName&&m)return e.getElementsByClassName(t)},v=[],g=[],(n.qsa=K.test(p.querySelectorAll))&&(ct(function(t){var e;f.appendChild(t).innerHTML="<a id='"+b+"'></a><select id='"+b+"-\r\\' msallowcapture=''><option selected=''></option></select>",t.querySelectorAll("[msallowcapture^='']").length&&g.push("[*^$]=[\\x20\\t\\r\\n\\f]*(?:''|\"\")"),t.querySelectorAll("[selected]").length||g.push("\\[[\\x20\\t\\r\\n\\f]*(?:value|"+B+")"),t.querySelectorAll("[id~="+b+"-]").length||g.push("~="),(e=p.createElement("input")).setAttribute("name",""),t.appendChild(e),t.querySelectorAll("[name='']").length||g.push("\\[[\\x20\\t\\r\\n\\f]*name[\\x20\\t\\r\\n\\f]*=[\\x20\\t\\r\\n\\f]*(?:''|\"\")"),t.querySelectorAll(":checked").length||g.push(":checked"),t.querySelectorAll("a#"+b+"+*").length||g.push(".#.+[+~]"),t.querySelectorAll("\\\f"),g.push("[\\r\\n\\f]")}),ct(function(t){t.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var e=p.createElement("input");e.setAttribute("type","hidden"),t.appendChild(e).setAttribute("name","D"),t.querySelectorAll("[name=d]").length&&g.push("name[\\x20\\t\\r\\n\\f]*[*^$|!~]?="),2!==t.querySelectorAll(":enabled").length&&g.push(":enabled",":disabled"),f.appendChild(t).disabled=!0,2!==t.querySelectorAll(":disabled").length&&g.push(":enabled",":disabled"),t.querySelectorAll("*,:x"),g.push(",.*:")})),(n.matchesSelector=K.test(y=f.matches||f.webkitMatchesSelector||f.mozMatchesSelector||f.oMatchesSelector||f.msMatchesSelector))&&ct(function(t){n.disconnectedMatch=y.call(t,"*"),y.call(t,"[s!='']:x"),v.push("!=",z)}),g=g.length&&new RegExp(g.join("|")),v=v.length&&new RegExp(v.join("|")),e=K.test(f.compareDocumentPosition),x=e||K.test(f.contains)?function(t,e){var n=9===t.nodeType?t.documentElement:t,r=e&&e.parentNode;return t===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):t.compareDocumentPosition&&16&t.compareDocumentPosition(r)))}:function(t,e){if(e)for(;e=e.parentNode;)if(e===t)return!0;return!1},D=e?function(t,e){if(t===e)return h=!0,0;var r=!t.compareDocumentPosition-!e.compareDocumentPosition;return r||(1&(r=(t.ownerDocument||t)==(e.ownerDocument||e)?t.compareDocumentPosition(e):1)||!n.sortDetached&&e.compareDocumentPosition(t)===r?t==p||t.ownerDocument==w&&x(w,t)?-1:e==p||e.ownerDocument==w&&x(w,e)?1:c?k(c,t)-k(c,e):0:4&r?-1:1)}:function(t,e){if(t===e)return h=!0,0;var n,r=0,i=t.parentNode,a=e.parentNode,o=[t],s=[e];if(!i||!a)return t==p?-1:e==p?1:i?-1:a?1:c?k(c,t)-k(c,e):0;if(i===a)return dt(t,e);for(n=t;n=n.parentNode;)o.unshift(n);for(n=e;n=n.parentNode;)s.unshift(n);for(;o[r]===s[r];)r++;return r?dt(o[r],s[r]):o[r]==w?-1:s[r]==w?1:0},p):p},st.matches=function(t,e){return st(t,null,null,e)},st.matchesSelector=function(t,e){if(d(t),n.matchesSelector&&m&&!E[e+" "]&&(!v||!v.test(e))&&(!g||!g.test(e)))try{var r=y.call(t,e);if(r||n.disconnectedMatch||t.document&&11!==t.document.nodeType)return r}catch(t){E(e,!0)}return st(e,p,null,[t]).length>0},st.contains=function(t,e){return(t.ownerDocument||t)!=p&&d(t),x(t,e)},st.attr=function(t,e){(t.ownerDocument||t)!=p&&d(t);var i=r.attrHandle[e.toLowerCase()],a=i&&A.call(r.attrHandle,e.toLowerCase())?i(t,e,!m):void 0;return void 0!==a?a:n.attributes||!m?t.getAttribute(e):(a=t.getAttributeNode(e))&&a.specified?a.value:null},st.escape=function(t){return(t+"").replace(rt,it)},st.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},st.uniqueSort=function(t){var e,r=[],i=0,a=0;if(h=!n.detectDuplicates,c=!n.sortStable&&t.slice(0),t.sort(D),h){for(;e=t[a++];)e===t[a]&&(i=r.push(a));for(;i--;)t.splice(r[i],1)}return c=null,t},i=st.getText=function(t){var e,n="",r=0,a=t.nodeType;if(a){if(1===a||9===a||11===a){if("string"==typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)n+=i(t)}else if(3===a||4===a)return t.nodeValue}else for(;e=t[r++];)n+=i(e);return n},(r=st.selectors={cacheLength:50,createPseudo:ut,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(et,nt),t[3]=(t[3]||t[4]||t[5]||"").replace(et,nt),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||st.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&st.error(t[0]),t},PSEUDO:function(t){var e,n=!t[6]&&t[2];return X.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":n&&J.test(n)&&(e=o(n,!0))&&(e=n.indexOf(")",n.length-e)-n.length)&&(t[0]=t[0].slice(0,e),t[2]=n.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(et,nt).toLowerCase();return"*"===t?function(){return!0}:function(t){return t.nodeName&&t.nodeName.toLowerCase()===e}},CLASS:function(t){var e=S[t+" "];return e||(e=new RegExp("(^|[\\x20\\t\\r\\n\\f])"+t+"("+F+"|$)"))&&S(t,function(t){return e.test("string"==typeof t.className&&t.className||void 0!==t.getAttribute&&t.getAttribute("class")||"")})},ATTR:function(t,e,n){return function(r){var i=st.attr(r,t);return null==i?"!="===e:!e||(i+="","="===e?i===n:"!="===e?i!==n:"^="===e?n&&0===i.indexOf(n):"*="===e?n&&i.indexOf(n)>-1:"$="===e?n&&i.slice(-n.length)===n:"~="===e?(" "+i.replace(V," ")+" ").indexOf(n)>-1:"|="===e&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(t,e,n,r,i){var a="nth"!==t.slice(0,3),o="last"!==t.slice(-4),s="of-type"===e;return 1===r&&0===i?function(t){return!!t.parentNode}:function(e,n,l){var u,c,h,d,p,f,m=a!==o?"nextSibling":"previousSibling",g=e.parentNode,v=s&&e.nodeName.toLowerCase(),y=!l&&!s,x=!1;if(g){if(a){for(;m;){for(d=e;d=d[m];)if(s?d.nodeName.toLowerCase()===v:1===d.nodeType)return!1;f=m="only"===t&&!f&&"nextSibling"}return!0}if(f=[o?g.firstChild:g.lastChild],o&&y){for(x=(p=(u=(c=(h=(d=g)[b]||(d[b]={}))[d.uniqueID]||(h[d.uniqueID]={}))[t]||[])[0]===_&&u[1])&&u[2],d=p&&g.childNodes[p];d=++p&&d&&d[m]||(x=p=0)||f.pop();)if(1===d.nodeType&&++x&&d===e){c[t]=[_,p,x];break}}else if(y&&(x=p=(u=(c=(h=(d=e)[b]||(d[b]={}))[d.uniqueID]||(h[d.uniqueID]={}))[t]||[])[0]===_&&u[1]),!1===x)for(;(d=++p&&d&&d[m]||(x=p=0)||f.pop())&&((s?d.nodeName.toLowerCase()!==v:1!==d.nodeType)||!++x||(y&&((c=(h=d[b]||(d[b]={}))[d.uniqueID]||(h[d.uniqueID]={}))[t]=[_,x]),d!==e)););return(x-=i)===r||x%r==0&&x/r>=0}}},PSEUDO:function(t,e){var n,i=r.pseudos[t]||r.setFilters[t.toLowerCase()]||st.error("unsupported pseudo: "+t);return i[b]?i(e):i.length>1?(n=[t,t,"",e],r.setFilters.hasOwnProperty(t.toLowerCase())?ut(function(t,n){for(var r,a=i(t,e),o=a.length;o--;)t[r=k(t,a[o])]=!(n[r]=a[o])}):function(t){return i(t,0,n)}):i}},pseudos:{not:ut(function(t){var e=[],n=[],r=s(t.replace(G,"$1"));return r[b]?ut(function(t,e,n,i){for(var a,o=r(t,null,i,[]),s=t.length;s--;)(a=o[s])&&(t[s]=!(e[s]=a))}):function(t,i,a){return e[0]=t,r(e,null,a,n),e[0]=null,!n.pop()}}),has:ut(function(t){return function(e){return st(t,e).length>0}}),contains:ut(function(t){return t=t.replace(et,nt),function(e){return(e.textContent||i(e)).indexOf(t)>-1}}),lang:ut(function(t){return q.test(t||"")||st.error("unsupported lang: "+t),t=t.replace(et,nt).toLowerCase(),function(e){var n;do{if(n=m?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(n=n.toLowerCase())===t||0===n.indexOf(t+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var n=t.location&&t.location.hash;return n&&n.slice(1)===e.id},root:function(t){return t===f},focus:function(t){return t===p.activeElement&&(!p.hasFocus||p.hasFocus())&&!!(t.type||t.href||~t.tabIndex)},enabled:mt(!1),disabled:mt(!0),checked:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&!!t.checked||"option"===e&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,!0===t.selected},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!r.pseudos.empty(t)},header:function(t){return $.test(t.nodeName)},input:function(t){return Z.test(t.nodeName)},button:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&"button"===t.type||"button"===e},text:function(t){var e;return"input"===t.nodeName.toLowerCase()&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:gt(function(){return[0]}),last:gt(function(t,e){return[e-1]}),eq:gt(function(t,e,n){return[n<0?n+e:n]}),even:gt(function(t,e){for(var n=0;n<e;n+=2)t.push(n);return t}),odd:gt(function(t,e){for(var n=1;n<e;n+=2)t.push(n);return t}),lt:gt(function(t,e,n){for(var r=n<0?n+e:n>e?e:n;--r>=0;)t.push(r);return t}),gt:gt(function(t,e,n){for(var r=n<0?n+e:n;++r<e;)t.push(r);return t})}}).pseudos.nth=r.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})r.pseudos[e]=pt(e);for(e in{submit:!0,reset:!0})r.pseudos[e]=ft(e);function yt(){}function xt(t){for(var e=0,n=t.length,r="";e<n;e++)r+=t[e].value;return r}function bt(t,e,n){var r=e.dir,i=e.next,a=i||r,o=n&&"parentNode"===a,s=M++;return e.first?function(e,n,i){for(;e=e[r];)if(1===e.nodeType||o)return t(e,n,i);return!1}:function(e,n,l){var u,c,h,d=[_,s];if(l){for(;e=e[r];)if((1===e.nodeType||o)&&t(e,n,l))return!0}else for(;e=e[r];)if(1===e.nodeType||o)if(c=(h=e[b]||(e[b]={}))[e.uniqueID]||(h[e.uniqueID]={}),i&&i===e.nodeName.toLowerCase())e=e[r]||e;else{if((u=c[a])&&u[0]===_&&u[1]===s)return d[2]=u[2];if(c[a]=d,d[2]=t(e,n,l))return!0}return!1}}function wt(t){return t.length>1?function(e,n,r){for(var i=t.length;i--;)if(!t[i](e,n,r))return!1;return!0}:t[0]}function _t(t,e,n,r,i){for(var a,o=[],s=0,l=t.length,u=null!=e;s<l;s++)(a=t[s])&&(n&&!n(a,r,i)||(o.push(a),u&&e.push(s)));return o}function Mt(t,e,n,r,i,a){return r&&!r[b]&&(r=Mt(r)),i&&!i[b]&&(i=Mt(i,a)),ut(function(a,o,s,l){var u,c,h,d=[],p=[],f=o.length,m=a||function(t,e,n){for(var r=0,i=e.length;r<i;r++)st(t,e[r],n);return n}(e||"*",s.nodeType?[s]:s,[]),g=!t||!a&&e?m:_t(m,d,t,s,l),v=n?i||(a?t:f||r)?[]:o:g;if(n&&n(g,v,s,l),r)for(u=_t(v,p),r(u,[],s,l),c=u.length;c--;)(h=u[c])&&(v[p[c]]=!(g[p[c]]=h));if(a){if(i||t){if(i){for(u=[],c=v.length;c--;)(h=v[c])&&u.push(g[c]=h);i(null,v=[],u,l)}for(c=v.length;c--;)(h=v[c])&&(u=i?k(a,h):d[c])>-1&&(a[u]=!(o[u]=h))}}else v=_t(v===o?v.splice(f,v.length):v),i?i(null,o,v,l):R.apply(o,v)})}function St(t){for(var e,n,i,a=t.length,o=r.relative[t[0].type],s=o||r.relative[" "],l=o?1:0,c=bt(function(t){return t===e},s,!0),h=bt(function(t){return k(e,t)>-1},s,!0),d=[function(t,n,r){var i=!o&&(r||n!==u)||((e=n).nodeType?c(t,n,r):h(t,n,r));return e=null,i}];l<a;l++)if(n=r.relative[t[l].type])d=[bt(wt(d),n)];else{if((n=r.filter[t[l].type].apply(null,t[l].matches))[b]){for(i=++l;i<a&&!r.relative[t[i].type];i++);return Mt(l>1&&wt(d),l>1&&xt(t.slice(0,l-1).concat({value:" "===t[l-2].type?"*":""})).replace(G,"$1"),n,l<i&&St(t.slice(l,i)),i<a&&St(t=t.slice(i)),i<a&&xt(t))}d.push(n)}return wt(d)}return yt.prototype=r.filters=r.pseudos,r.setFilters=new yt,o=st.tokenize=function(t,e){var n,i,a,o,s,l,u,c=T[t+" "];if(c)return e?0:c.slice(0);for(s=t,l=[],u=r.preFilter;s;){for(o in n&&!(i=U.exec(s))||(i&&(s=s.slice(i[0].length)||s),l.push(a=[])),n=!1,(i=H.exec(s))&&(n=i.shift(),a.push({value:n,type:i[0].replace(G," ")}),s=s.slice(n.length)),r.filter)!(i=X[o].exec(s))||u[o]&&!(i=u[o](i))||(n=i.shift(),a.push({value:n,type:o,matches:i}),s=s.slice(n.length));if(!n)break}return e?s.length:s?st.error(t):T(t,l).slice(0)},s=st.compile=function(t,e){var n,i=[],a=[],s=C[t+" "];if(!s){for(e||(e=o(t)),n=e.length;n--;)(s=St(e[n]))[b]?i.push(s):a.push(s);(s=C(t,function(t,e){var n=e.length>0,i=t.length>0,a=function(a,o,s,l,c){var h,f,g,v=0,y="0",x=a&&[],b=[],w=u,M=a||i&&r.find.TAG("*",c),S=_+=null==w?1:Math.random()||.1,T=M.length;for(c&&(u=o==p||o||c);y!==T&&null!=(h=M[y]);y++){if(i&&h){for(f=0,o||h.ownerDocument==p||(d(h),s=!m);g=t[f++];)if(g(h,o||p,s)){l.push(h);break}c&&(_=S)}n&&((h=!g&&h)&&v--,a&&x.push(h))}if(v+=y,n&&y!==v){for(f=0;g=e[f++];)g(x,b,o,s);if(a){if(v>0)for(;y--;)x[y]||b[y]||(b[y]=L.call(l));b=_t(b)}R.apply(l,b),c&&!a&&b.length>0&&v+e.length>1&&st.uniqueSort(l)}return c&&(_=S,u=w),x};return n?ut(a):a}(a,i))).selector=t}return s},l=st.select=function(t,e,n,i){var a,l,u,c,h,d="function"==typeof t&&t,p=!i&&o(t=d.selector||t);if(n=n||[],1===p.length){if((l=p[0]=p[0].slice(0)).length>2&&"ID"===(u=l[0]).type&&9===e.nodeType&&m&&r.relative[l[1].type]){if(!(e=(r.find.ID(u.matches[0].replace(et,nt),e)||[])[0]))return n;d&&(e=e.parentNode),t=t.slice(l.shift().value.length)}for(a=X.needsContext.test(t)?0:l.length;a--&&(u=l[a],!r.relative[c=u.type]);)if((h=r.find[c])&&(i=h(u.matches[0].replace(et,nt),tt.test(l[0].type)&&vt(e.parentNode)||e))){if(l.splice(a,1),!(t=i.length&&xt(l)))return R.apply(n,i),n;break}}return(d||s(t,p))(i,e,!m,n,!e||tt.test(t)&&vt(e.parentNode)||e),n},n.sortStable=b.split("").sort(D).join("")===b,n.detectDuplicates=!!h,d(),n.sortDetached=ct(function(t){return 1&t.compareDocumentPosition(p.createElement("fieldset"))}),ct(function(t){return t.innerHTML="<a href='#'></a>","#"===t.firstChild.getAttribute("href")})||ht("type|href|height|width",function(t,e,n){if(!n)return t.getAttribute(e,"type"===e.toLowerCase()?1:2)}),n.attributes&&ct(function(t){return t.innerHTML="<input/>",t.firstChild.setAttribute("value",""),""===t.firstChild.getAttribute("value")})||ht("value",function(t,e,n){if(!n&&"input"===t.nodeName.toLowerCase())return t.defaultValue}),ct(function(t){return null==t.getAttribute("disabled")})||ht(B,function(t,e,n){var r;if(!n)return!0===t[e]?e.toLowerCase():(r=t.getAttributeNode(e))&&r.specified?r.value:null}),st}(t);w.find=M,w.expr=M.selectors,w.expr[":"]=w.expr.pseudos,w.uniqueSort=w.unique=M.uniqueSort,w.text=M.getText,w.isXMLDoc=M.isXML,w.contains=M.contains,w.escapeSelector=M.escape;var S=function(t,e,n){for(var r=[],i=void 0!==n;(t=t[e])&&9!==t.nodeType;)if(1===t.nodeType){if(i&&w(t).is(n))break;r.push(t)}return r},T=function(t,e){for(var n=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&n.push(t);return n},C=w.expr.match.needsContext;function E(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()}var D=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function A(t,e,n){return f(e)?w.grep(t,function(t,r){return!!e.call(t,r,t)!==n}):e.nodeType?w.grep(t,function(t){return t===e!==n}):"string"!=typeof e?w.grep(t,function(t){return s.call(e,t)>-1!==n}):w.filter(e,t,n)}w.filter=function(t,e,n){var r=e[0];return n&&(t=":not("+t+")"),1===e.length&&1===r.nodeType?w.find.matchesSelector(r,t)?[r]:[]:w.find.matches(t,w.grep(e,function(t){return 1===t.nodeType}))},w.fn.extend({find:function(t){var e,n,r=this.length,i=this;if("string"!=typeof t)return this.pushStack(w(t).filter(function(){for(e=0;e<r;e++)if(w.contains(i[e],this))return!0}));for(n=this.pushStack([]),e=0;e<r;e++)w.find(t,i[e],n);return r>1?w.uniqueSort(n):n},filter:function(t){return this.pushStack(A(this,t||[],!1))},not:function(t){return this.pushStack(A(this,t||[],!0))},is:function(t){return!!A(this,"string"==typeof t&&C.test(t)?w(t):t||[],!1).length}});var O,L=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(w.fn.init=function(t,e,n){var r,i;if(!t)return this;if(n=n||O,"string"==typeof t){if(!(r="<"===t[0]&&">"===t[t.length-1]&&t.length>=3?[null,t,null]:L.exec(t))||!r[1]&&e)return!e||e.jquery?(e||n).find(t):this.constructor(e).find(t);if(r[1]){if(e=e instanceof w?e[0]:e,w.merge(this,w.parseHTML(r[1],e&&e.nodeType?e.ownerDocument||e:g,!0)),D.test(r[1])&&w.isPlainObject(e))for(r in e)f(this[r])?this[r](e[r]):this.attr(r,e[r]);return this}return(i=g.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return t.nodeType?(this[0]=t,this.length=1,this):f(t)?void 0!==n.ready?n.ready(t):t(w):w.makeArray(t,this)}).prototype=w.fn,O=w(g);var P=/^(?:parents|prev(?:Until|All))/,R={children:!0,contents:!0,next:!0,prev:!0};function I(t,e){for(;(t=t[e])&&1!==t.nodeType;);return t}w.fn.extend({has:function(t){var e=w(t,this),n=e.length;return this.filter(function(){for(var t=0;t<n;t++)if(w.contains(this,e[t]))return!0})},closest:function(t,e){var n,r=0,i=this.length,a=[],o="string"!=typeof t&&w(t);if(!C.test(t))for(;r<i;r++)for(n=this[r];n&&n!==e;n=n.parentNode)if(n.nodeType<11&&(o?o.index(n)>-1:1===n.nodeType&&w.find.matchesSelector(n,t))){a.push(n);break}return this.pushStack(a.length>1?w.uniqueSort(a):a)},index:function(t){return t?"string"==typeof t?s.call(w(t),this[0]):s.call(this,t.jquery?t[0]:t):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(t,e){return this.pushStack(w.uniqueSort(w.merge(this.get(),w(t,e))))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),w.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return S(t,"parentNode")},parentsUntil:function(t,e,n){return S(t,"parentNode",n)},next:function(t){return I(t,"nextSibling")},prev:function(t){return I(t,"previousSibling")},nextAll:function(t){return S(t,"nextSibling")},prevAll:function(t){return S(t,"previousSibling")},nextUntil:function(t,e,n){return S(t,"nextSibling",n)},prevUntil:function(t,e,n){return S(t,"previousSibling",n)},siblings:function(t){return T((t.parentNode||{}).firstChild,t)},children:function(t){return T(t.firstChild)},contents:function(t){return null!=t.contentDocument&&r(t.contentDocument)?t.contentDocument:(E(t,"template")&&(t=t.content||t),w.merge([],t.childNodes))}},function(t,e){w.fn[t]=function(n,r){var i=w.map(this,e,n);return"Until"!==t.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=w.filter(r,i)),this.length>1&&(R[t]||w.uniqueSort(i),P.test(t)&&i.reverse()),this.pushStack(i)}});var k=/[^\x20\t\r\n\f]+/g;function B(t){return t}function F(t){throw t}function N(t,e,n,r){var i;try{t&&f(i=t.promise)?i.call(t).done(e).fail(n):t&&f(i=t.then)?i.call(t,e,n):e.apply(void 0,[t].slice(r))}catch(t){n.apply(void 0,[t])}}w.Callbacks=function(t){t="string"==typeof t?function(t){var e={};return w.each(t.match(k)||[],function(t,n){e[n]=!0}),e}(t):w.extend({},t);var e,n,r,i,a=[],o=[],s=-1,l=function(){for(i=i||t.once,r=e=!0;o.length;s=-1)for(n=o.shift();++s<a.length;)!1===a[s].apply(n[0],n[1])&&t.stopOnFalse&&(s=a.length,n=!1);t.memory||(n=!1),e=!1,i&&(a=n?[]:"")},u={add:function(){return a&&(n&&!e&&(s=a.length-1,o.push(n)),function e(n){w.each(n,function(n,r){f(r)?t.unique&&u.has(r)||a.push(r):r&&r.length&&"string"!==x(r)&&e(r)})}(arguments),n&&!e&&l()),this},remove:function(){return w.each(arguments,function(t,e){for(var n;(n=w.inArray(e,a,n))>-1;)a.splice(n,1),n<=s&&s--}),this},has:function(t){return t?w.inArray(t,a)>-1:a.length>0},empty:function(){return a&&(a=[]),this},disable:function(){return i=o=[],a=n="",this},disabled:function(){return!a},lock:function(){return i=o=[],n||e||(a=n=""),this},locked:function(){return!!i},fireWith:function(t,n){return i||(n=[t,(n=n||[]).slice?n.slice():n],o.push(n),e||l()),this},fire:function(){return u.fireWith(this,arguments),this},fired:function(){return!!r}};return u},w.extend({Deferred:function(e){var n=[["notify","progress",w.Callbacks("memory"),w.Callbacks("memory"),2],["resolve","done",w.Callbacks("once memory"),w.Callbacks("once memory"),0,"resolved"],["reject","fail",w.Callbacks("once memory"),w.Callbacks("once memory"),1,"rejected"]],r="pending",i={state:function(){return r},always:function(){return a.done(arguments).fail(arguments),this},catch:function(t){return i.then(null,t)},pipe:function(){var t=arguments;return w.Deferred(function(e){w.each(n,function(n,r){var i=f(t[r[4]])&&t[r[4]];a[r[1]](function(){var t=i&&i.apply(this,arguments);t&&f(t.promise)?t.promise().progress(e.notify).done(e.resolve).fail(e.reject):e[r[0]+"With"](this,i?[t]:arguments)})}),t=null}).promise()},then:function(e,r,i){var a=0;function o(e,n,r,i){return function(){var s=this,l=arguments,u=function(){var t,u;if(!(e<a)){if((t=r.apply(s,l))===n.promise())throw new TypeError("Thenable self-resolution");u=t&&("object"==typeof t||"function"==typeof t)&&t.then,f(u)?i?u.call(t,o(a,n,B,i),o(a,n,F,i)):(a++,u.call(t,o(a,n,B,i),o(a,n,F,i),o(a,n,B,n.notifyWith))):(r!==B&&(s=void 0,l=[t]),(i||n.resolveWith)(s,l))}},c=i?u:function(){try{u()}catch(t){w.Deferred.exceptionHook&&w.Deferred.exceptionHook(t,c.stackTrace),e+1>=a&&(r!==F&&(s=void 0,l=[t]),n.rejectWith(s,l))}};e?c():(w.Deferred.getStackHook&&(c.stackTrace=w.Deferred.getStackHook()),t.setTimeout(c))}}return w.Deferred(function(t){n[0][3].add(o(0,t,f(i)?i:B,t.notifyWith)),n[1][3].add(o(0,t,f(e)?e:B)),n[2][3].add(o(0,t,f(r)?r:F))}).promise()},promise:function(t){return null!=t?w.extend(t,i):i}},a={};return w.each(n,function(t,e){var o=e[2],s=e[5];i[e[1]]=o.add,s&&o.add(function(){r=s},n[3-t][2].disable,n[3-t][3].disable,n[0][2].lock,n[0][3].lock),o.add(e[3].fire),a[e[0]]=function(){return a[e[0]+"With"](this===a?void 0:this,arguments),this},a[e[0]+"With"]=o.fireWith}),i.promise(a),e&&e.call(a,a),a},when:function(t){var e=arguments.length,n=e,r=Array(n),a=i.call(arguments),o=w.Deferred(),s=function(t){return function(n){r[t]=this,a[t]=arguments.length>1?i.call(arguments):n,--e||o.resolveWith(r,a)}};if(e<=1&&(N(t,o.done(s(n)).resolve,o.reject,!e),"pending"===o.state()||f(a[n]&&a[n].then)))return o.then();for(;n--;)N(a[n],s(n),o.reject);return o.promise()}});var j=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;w.Deferred.exceptionHook=function(e,n){t.console&&t.console.warn&&e&&j.test(e.name)&&t.console.warn("jQuery.Deferred exception: "+e.message,e.stack,n)},w.readyException=function(e){t.setTimeout(function(){throw e})};var z=w.Deferred();function V(){g.removeEventListener("DOMContentLoaded",V),t.removeEventListener("load",V),w.ready()}w.fn.ready=function(t){return z.then(t).catch(function(t){w.readyException(t)}),this},w.extend({isReady:!1,readyWait:1,ready:function(t){(!0===t?--w.readyWait:w.isReady)||(w.isReady=!0,!0!==t&&--w.readyWait>0||z.resolveWith(g,[w]))}}),w.ready.then=z.then,"complete"===g.readyState||"loading"!==g.readyState&&!g.documentElement.doScroll?t.setTimeout(w.ready):(g.addEventListener("DOMContentLoaded",V),t.addEventListener("load",V));var G=function(t,e,n,r,i,a,o){var s=0,l=t.length,u=null==n;if("object"===x(n))for(s in i=!0,n)G(t,e,s,n[s],!0,a,o);else if(void 0!==r&&(i=!0,f(r)||(o=!0),u&&(o?(e.call(t,r),e=null):(u=e,e=function(t,e,n){return u.call(w(t),n)})),e))for(;s<l;s++)e(t[s],n,o?r:r.call(t[s],s,e(t[s],n)));return i?t:u?e.call(t):l?e(t[0],n):a},U=/^-ms-/,H=/-([a-z])/g;function W(t,e){return e.toUpperCase()}function J(t){return t.replace(U,"ms-").replace(H,W)}var q=function(t){return 1===t.nodeType||9===t.nodeType||!+t.nodeType};function X(){this.expando=w.expando+X.uid++}X.uid=1,X.prototype={cache:function(t){var e=t[this.expando];return e||(e={},q(t)&&(t.nodeType?t[this.expando]=e:Object.defineProperty(t,this.expando,{value:e,configurable:!0}))),e},set:function(t,e,n){var r,i=this.cache(t);if("string"==typeof e)i[J(e)]=n;else for(r in e)i[J(r)]=e[r];return i},get:function(t,e){return void 0===e?this.cache(t):t[this.expando]&&t[this.expando][J(e)]},access:function(t,e,n){return void 0===e||e&&"string"==typeof e&&void 0===n?this.get(t,e):(this.set(t,e,n),void 0!==n?n:e)},remove:function(t,e){var n,r=t[this.expando];if(void 0!==r){if(void 0!==e){n=(e=Array.isArray(e)?e.map(J):(e=J(e))in r?[e]:e.match(k)||[]).length;for(;n--;)delete r[e[n]]}(void 0===e||w.isEmptyObject(r))&&(t.nodeType?t[this.expando]=void 0:delete t[this.expando])}},hasData:function(t){var e=t[this.expando];return void 0!==e&&!w.isEmptyObject(e)}};var Y=new X,Z=new X,$=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,K=/[A-Z]/g;function Q(t,e,n){var r;if(void 0===n&&1===t.nodeType)if(r="data-"+e.replace(K,"-$&").toLowerCase(),"string"==typeof(n=t.getAttribute(r))){try{n=function(t){return"true"===t||"false"!==t&&("null"===t?null:t===+t+""?+t:$.test(t)?JSON.parse(t):t)}(n)}catch(t){}Z.set(t,e,n)}else n=void 0;return n}w.extend({hasData:function(t){return Z.hasData(t)||Y.hasData(t)},data:function(t,e,n){return Z.access(t,e,n)},removeData:function(t,e){Z.remove(t,e)},_data:function(t,e,n){return Y.access(t,e,n)},_removeData:function(t,e){Y.remove(t,e)}}),w.fn.extend({data:function(t,e){var n,r,i,a=this[0],o=a&&a.attributes;if(void 0===t){if(this.length&&(i=Z.get(a),1===a.nodeType&&!Y.get(a,"hasDataAttrs"))){for(n=o.length;n--;)o[n]&&0===(r=o[n].name).indexOf("data-")&&(r=J(r.slice(5)),Q(a,r,i[r]));Y.set(a,"hasDataAttrs",!0)}return i}return"object"==typeof t?this.each(function(){Z.set(this,t)}):G(this,function(e){var n;if(a&&void 0===e)return void 0!==(n=Z.get(a,t))||void 0!==(n=Q(a,t))?n:void 0;this.each(function(){Z.set(this,t,e)})},null,e,arguments.length>1,null,!0)},removeData:function(t){return this.each(function(){Z.remove(this,t)})}}),w.extend({queue:function(t,e,n){var r;if(t)return e=(e||"fx")+"queue",r=Y.get(t,e),n&&(!r||Array.isArray(n)?r=Y.access(t,e,w.makeArray(n)):r.push(n)),r||[]},dequeue:function(t,e){e=e||"fx";var n=w.queue(t,e),r=n.length,i=n.shift(),a=w._queueHooks(t,e);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===e&&n.unshift("inprogress"),delete a.stop,i.call(t,function(){w.dequeue(t,e)},a)),!r&&a&&a.empty.fire()},_queueHooks:function(t,e){var n=e+"queueHooks";return Y.get(t,n)||Y.access(t,n,{empty:w.Callbacks("once memory").add(function(){Y.remove(t,[e+"queue",n])})})}}),w.fn.extend({queue:function(t,e){var n=2;return"string"!=typeof t&&(e=t,t="fx",n--),arguments.length<n?w.queue(this[0],t):void 0===e?this:this.each(function(){var n=w.queue(this,t,e);w._queueHooks(this,t),"fx"===t&&"inprogress"!==n[0]&&w.dequeue(this,t)})},dequeue:function(t){return this.each(function(){w.dequeue(this,t)})},clearQueue:function(t){return this.queue(t||"fx",[])},promise:function(t,e){var n,r=1,i=w.Deferred(),a=this,o=this.length,s=function(){--r||i.resolveWith(a,[a])};for("string"!=typeof t&&(e=t,t=void 0),t=t||"fx";o--;)(n=Y.get(a[o],t+"queueHooks"))&&n.empty&&(r++,n.empty.add(s));return s(),i.promise(e)}});var tt=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,et=new RegExp("^(?:([+-])=|)("+tt+")([a-z%]*)$","i"),nt=["Top","Right","Bottom","Left"],rt=g.documentElement,it=function(t){return w.contains(t.ownerDocument,t)},at={composed:!0};rt.getRootNode&&(it=function(t){return w.contains(t.ownerDocument,t)||t.getRootNode(at)===t.ownerDocument});var ot=function(t,e){return"none"===(t=e||t).style.display||""===t.style.display&&it(t)&&"none"===w.css(t,"display")};function st(t,e,n,r){var i,a,o=20,s=r?function(){return r.cur()}:function(){return w.css(t,e,"")},l=s(),u=n&&n[3]||(w.cssNumber[e]?"":"px"),c=t.nodeType&&(w.cssNumber[e]||"px"!==u&&+l)&&et.exec(w.css(t,e));if(c&&c[3]!==u){for(l/=2,u=u||c[3],c=+l||1;o--;)w.style(t,e,c+u),(1-a)*(1-(a=s()/l||.5))<=0&&(o=0),c/=a;c*=2,w.style(t,e,c+u),n=n||[]}return n&&(c=+c||+l||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=u,r.start=c,r.end=i)),i}var lt={};function ut(t){var e,n=t.ownerDocument,r=t.nodeName,i=lt[r];return i||(e=n.body.appendChild(n.createElement(r)),i=w.css(e,"display"),e.parentNode.removeChild(e),"none"===i&&(i="block"),lt[r]=i,i)}function ct(t,e){for(var n,r,i=[],a=0,o=t.length;a<o;a++)(r=t[a]).style&&(n=r.style.display,e?("none"===n&&(i[a]=Y.get(r,"display")||null,i[a]||(r.style.display="")),""===r.style.display&&ot(r)&&(i[a]=ut(r))):"none"!==n&&(i[a]="none",Y.set(r,"display",n)));for(a=0;a<o;a++)null!=i[a]&&(t[a].style.display=i[a]);return t}w.fn.extend({show:function(){return ct(this,!0)},hide:function(){return ct(this)},toggle:function(t){return"boolean"==typeof t?t?this.show():this.hide():this.each(function(){ot(this)?w(this).show():w(this).hide()})}});var ht,dt,pt=/^(?:checkbox|radio)$/i,ft=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,mt=/^$|^module$|\/(?:java|ecma)script/i;ht=g.createDocumentFragment().appendChild(g.createElement("div")),(dt=g.createElement("input")).setAttribute("type","radio"),dt.setAttribute("checked","checked"),dt.setAttribute("name","t"),ht.appendChild(dt),p.checkClone=ht.cloneNode(!0).cloneNode(!0).lastChild.checked,ht.innerHTML="<textarea>x</textarea>",p.noCloneChecked=!!ht.cloneNode(!0).lastChild.defaultValue,ht.innerHTML="<option></option>",p.option=!!ht.lastChild;var gt={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function vt(t,e){var n;return n=void 0!==t.getElementsByTagName?t.getElementsByTagName(e||"*"):void 0!==t.querySelectorAll?t.querySelectorAll(e||"*"):[],void 0===e||e&&E(t,e)?w.merge([t],n):n}function yt(t,e){for(var n=0,r=t.length;n<r;n++)Y.set(t[n],"globalEval",!e||Y.get(e[n],"globalEval"))}gt.tbody=gt.tfoot=gt.colgroup=gt.caption=gt.thead,gt.th=gt.td,p.option||(gt.optgroup=gt.option=[1,"<select multiple='multiple'>","</select>"]);var xt=/<|&#?\w+;/;function bt(t,e,n,r,i){for(var a,o,s,l,u,c,h=e.createDocumentFragment(),d=[],p=0,f=t.length;p<f;p++)if((a=t[p])||0===a)if("object"===x(a))w.merge(d,a.nodeType?[a]:a);else if(xt.test(a)){for(o=o||h.appendChild(e.createElement("div")),s=(ft.exec(a)||["",""])[1].toLowerCase(),l=gt[s]||gt._default,o.innerHTML=l[1]+w.htmlPrefilter(a)+l[2],c=l[0];c--;)o=o.lastChild;w.merge(d,o.childNodes),(o=h.firstChild).textContent=""}else d.push(e.createTextNode(a));for(h.textContent="",p=0;a=d[p++];)if(r&&w.inArray(a,r)>-1)i&&i.push(a);else if(u=it(a),o=vt(h.appendChild(a),"script"),u&&yt(o),n)for(c=0;a=o[c++];)mt.test(a.type||"")&&n.push(a);return h}var wt=/^([^.]*)(?:\.(.+)|)/;function _t(){return!0}function Mt(){return!1}function St(t,e){return t===function(){try{return g.activeElement}catch(t){}}()==("focus"===e)}function Tt(t,e,n,r,i,a){var o,s;if("object"==typeof e){for(s in"string"!=typeof n&&(r=r||n,n=void 0),e)Tt(t,s,n,r,e[s],a);return t}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Mt;else if(!i)return t;return 1===a&&(o=i,(i=function(t){return w().off(t),o.apply(this,arguments)}).guid=o.guid||(o.guid=w.guid++)),t.each(function(){w.event.add(this,e,i,r,n)})}function Ct(t,e,n){n?(Y.set(t,e,!1),w.event.add(t,e,{namespace:!1,handler:function(t){var r,a,o=Y.get(this,e);if(1&t.isTrigger&&this[e]){if(o.length)(w.event.special[e]||{}).delegateType&&t.stopPropagation();else if(o=i.call(arguments),Y.set(this,e,o),r=n(this,e),this[e](),o!==(a=Y.get(this,e))||r?Y.set(this,e,!1):a={},o!==a)return t.stopImmediatePropagation(),t.preventDefault(),a&&a.value}else o.length&&(Y.set(this,e,{value:w.event.trigger(w.extend(o[0],w.Event.prototype),o.slice(1),this)}),t.stopImmediatePropagation())}})):void 0===Y.get(t,e)&&w.event.add(t,e,_t)}w.event={global:{},add:function(t,e,n,r,i){var a,o,s,l,u,c,h,d,p,f,m,g=Y.get(t);if(q(t))for(n.handler&&(n=(a=n).handler,i=a.selector),i&&w.find.matchesSelector(rt,i),n.guid||(n.guid=w.guid++),(l=g.events)||(l=g.events=Object.create(null)),(o=g.handle)||(o=g.handle=function(e){return void 0!==w&&w.event.triggered!==e.type?w.event.dispatch.apply(t,arguments):void 0}),u=(e=(e||"").match(k)||[""]).length;u--;)p=m=(s=wt.exec(e[u])||[])[1],f=(s[2]||"").split(".").sort(),p&&(h=w.event.special[p]||{},p=(i?h.delegateType:h.bindType)||p,h=w.event.special[p]||{},c=w.extend({type:p,origType:m,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&w.expr.match.needsContext.test(i),namespace:f.join(".")},a),(d=l[p])||((d=l[p]=[]).delegateCount=0,h.setup&&!1!==h.setup.call(t,r,f,o)||t.addEventListener&&t.addEventListener(p,o)),h.add&&(h.add.call(t,c),c.handler.guid||(c.handler.guid=n.guid)),i?d.splice(d.delegateCount++,0,c):d.push(c),w.event.global[p]=!0)},remove:function(t,e,n,r,i){var a,o,s,l,u,c,h,d,p,f,m,g=Y.hasData(t)&&Y.get(t);if(g&&(l=g.events)){for(u=(e=(e||"").match(k)||[""]).length;u--;)if(p=m=(s=wt.exec(e[u])||[])[1],f=(s[2]||"").split(".").sort(),p){for(h=w.event.special[p]||{},d=l[p=(r?h.delegateType:h.bindType)||p]||[],s=s[2]&&new RegExp("(^|\\.)"+f.join("\\.(?:.*\\.|)")+"(\\.|$)"),o=a=d.length;a--;)c=d[a],!i&&m!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(d.splice(a,1),c.selector&&d.delegateCount--,h.remove&&h.remove.call(t,c));o&&!d.length&&(h.teardown&&!1!==h.teardown.call(t,f,g.handle)||w.removeEvent(t,p,g.handle),delete l[p])}else for(p in l)w.event.remove(t,p+e[u],n,r,!0);w.isEmptyObject(l)&&Y.remove(t,"handle events")}},dispatch:function(t){var e,n,r,i,a,o,s=new Array(arguments.length),l=w.event.fix(t),u=(Y.get(this,"events")||Object.create(null))[l.type]||[],c=w.event.special[l.type]||{};for(s[0]=l,e=1;e<arguments.length;e++)s[e]=arguments[e];if(l.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,l)){for(o=w.event.handlers.call(this,l,u),e=0;(i=o[e++])&&!l.isPropagationStopped();)for(l.currentTarget=i.elem,n=0;(a=i.handlers[n++])&&!l.isImmediatePropagationStopped();)l.rnamespace&&!1!==a.namespace&&!l.rnamespace.test(a.namespace)||(l.handleObj=a,l.data=a.data,void 0!==(r=((w.event.special[a.origType]||{}).handle||a.handler).apply(i.elem,s))&&!1===(l.result=r)&&(l.preventDefault(),l.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,l),l.result}},handlers:function(t,e){var n,r,i,a,o,s=[],l=e.delegateCount,u=t.target;if(l&&u.nodeType&&!("click"===t.type&&t.button>=1))for(;u!==this;u=u.parentNode||this)if(1===u.nodeType&&("click"!==t.type||!0!==u.disabled)){for(a=[],o={},n=0;n<l;n++)void 0===o[i=(r=e[n]).selector+" "]&&(o[i]=r.needsContext?w(i,this).index(u)>-1:w.find(i,this,null,[u]).length),o[i]&&a.push(r);a.length&&s.push({elem:u,handlers:a})}return u=this,l<e.length&&s.push({elem:u,handlers:e.slice(l)}),s},addProp:function(t,e){Object.defineProperty(w.Event.prototype,t,{enumerable:!0,configurable:!0,get:f(e)?function(){if(this.originalEvent)return e(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[t]},set:function(e){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:e})}})},fix:function(t){return t[w.expando]?t:new w.Event(t)},special:{load:{noBubble:!0},click:{setup:function(t){var e=this||t;return pt.test(e.type)&&e.click&&E(e,"input")&&Ct(e,"click",_t),!1},trigger:function(t){var e=this||t;return pt.test(e.type)&&e.click&&E(e,"input")&&Ct(e,"click"),!0},_default:function(t){var e=t.target;return pt.test(e.type)&&e.click&&E(e,"input")&&Y.get(e,"click")||E(e,"a")}},beforeunload:{postDispatch:function(t){void 0!==t.result&&t.originalEvent&&(t.originalEvent.returnValue=t.result)}}}},w.removeEvent=function(t,e,n){t.removeEventListener&&t.removeEventListener(e,n)},w.Event=function(t,e){if(!(this instanceof w.Event))return new w.Event(t,e);t&&t.type?(this.originalEvent=t,this.type=t.type,this.isDefaultPrevented=t.defaultPrevented||void 0===t.defaultPrevented&&!1===t.returnValue?_t:Mt,this.target=t.target&&3===t.target.nodeType?t.target.parentNode:t.target,this.currentTarget=t.currentTarget,this.relatedTarget=t.relatedTarget):this.type=t,e&&w.extend(this,e),this.timeStamp=t&&t.timeStamp||Date.now(),this[w.expando]=!0},w.Event.prototype={constructor:w.Event,isDefaultPrevented:Mt,isPropagationStopped:Mt,isImmediatePropagationStopped:Mt,isSimulated:!1,preventDefault:function(){var t=this.originalEvent;this.isDefaultPrevented=_t,t&&!this.isSimulated&&t.preventDefault()},stopPropagation:function(){var t=this.originalEvent;this.isPropagationStopped=_t,t&&!this.isSimulated&&t.stopPropagation()},stopImmediatePropagation:function(){var t=this.originalEvent;this.isImmediatePropagationStopped=_t,t&&!this.isSimulated&&t.stopImmediatePropagation(),this.stopPropagation()}},w.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,char:!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:!0},w.event.addProp),w.each({focus:"focusin",blur:"focusout"},function(t,e){w.event.special[t]={setup:function(){return Ct(this,t,St),!1},trigger:function(){return Ct(this,t),!0},_default:function(){return!0},delegateType:e}}),w.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(t,e){w.event.special[t]={delegateType:e,bindType:e,handle:function(t){var n,r=t.relatedTarget,i=t.handleObj;return r&&(r===this||w.contains(this,r))||(t.type=i.origType,n=i.handler.apply(this,arguments),t.type=e),n}}}),w.fn.extend({on:function(t,e,n,r){return Tt(this,t,e,n,r)},one:function(t,e,n,r){return Tt(this,t,e,n,r,1)},off:function(t,e,n){var r,i;if(t&&t.preventDefault&&t.handleObj)return r=t.handleObj,w(t.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof t){for(i in t)this.off(i,e,t[i]);return this}return!1!==e&&"function"!=typeof e||(n=e,e=void 0),!1===n&&(n=Mt),this.each(function(){w.event.remove(this,t,n,e)})}});var Et=/<script|<style|<link/i,Dt=/checked\s*(?:[^=]|=\s*.checked.)/i,At=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function Ot(t,e){return E(t,"table")&&E(11!==e.nodeType?e:e.firstChild,"tr")&&w(t).children("tbody")[0]||t}function Lt(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function Pt(t){return"true/"===(t.type||"").slice(0,5)?t.type=t.type.slice(5):t.removeAttribute("type"),t}function Rt(t,e){var n,r,i,a,o,s;if(1===e.nodeType){if(Y.hasData(t)&&(s=Y.get(t).events))for(i in Y.remove(e,"handle events"),s)for(n=0,r=s[i].length;n<r;n++)w.event.add(e,i,s[i][n]);Z.hasData(t)&&(a=Z.access(t),o=w.extend({},a),Z.set(e,o))}}function It(t,e){var n=e.nodeName.toLowerCase();"input"===n&&pt.test(t.type)?e.checked=t.checked:"input"!==n&&"textarea"!==n||(e.defaultValue=t.defaultValue)}function kt(t,e,n,r){e=a(e);var i,o,s,l,u,c,h=0,d=t.length,m=d-1,g=e[0],v=f(g);if(v||d>1&&"string"==typeof g&&!p.checkClone&&Dt.test(g))return t.each(function(i){var a=t.eq(i);v&&(e[0]=g.call(this,i,a.html())),kt(a,e,n,r)});if(d&&(o=(i=bt(e,t[0].ownerDocument,!1,t,r)).firstChild,1===i.childNodes.length&&(i=o),o||r)){for(l=(s=w.map(vt(i,"script"),Lt)).length;h<d;h++)u=i,h!==m&&(u=w.clone(u,!0,!0),l&&w.merge(s,vt(u,"script"))),n.call(t[h],u,h);if(l)for(c=s[s.length-1].ownerDocument,w.map(s,Pt),h=0;h<l;h++)u=s[h],mt.test(u.type||"")&&!Y.access(u,"globalEval")&&w.contains(c,u)&&(u.src&&"module"!==(u.type||"").toLowerCase()?w._evalUrl&&!u.noModule&&w._evalUrl(u.src,{nonce:u.nonce||u.getAttribute("nonce")},c):y(u.textContent.replace(At,""),u,c))}return t}function Bt(t,e,n){for(var r,i=e?w.filter(e,t):t,a=0;null!=(r=i[a]);a++)n||1!==r.nodeType||w.cleanData(vt(r)),r.parentNode&&(n&&it(r)&&yt(vt(r,"script")),r.parentNode.removeChild(r));return t}w.extend({htmlPrefilter:function(t){return t},clone:function(t,e,n){var r,i,a,o,s=t.cloneNode(!0),l=it(t);if(!(p.noCloneChecked||1!==t.nodeType&&11!==t.nodeType||w.isXMLDoc(t)))for(o=vt(s),r=0,i=(a=vt(t)).length;r<i;r++)It(a[r],o[r]);if(e)if(n)for(a=a||vt(t),o=o||vt(s),r=0,i=a.length;r<i;r++)Rt(a[r],o[r]);else Rt(t,s);return(o=vt(s,"script")).length>0&&yt(o,!l&&vt(t,"script")),s},cleanData:function(t){for(var e,n,r,i=w.event.special,a=0;void 0!==(n=t[a]);a++)if(q(n)){if(e=n[Y.expando]){if(e.events)for(r in e.events)i[r]?w.event.remove(n,r):w.removeEvent(n,r,e.handle);n[Y.expando]=void 0}n[Z.expando]&&(n[Z.expando]=void 0)}}}),w.fn.extend({detach:function(t){return Bt(this,t,!0)},remove:function(t){return Bt(this,t)},text:function(t){return G(this,function(t){return void 0===t?w.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=t)})},null,t,arguments.length)},append:function(){return kt(this,arguments,function(t){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Ot(this,t).appendChild(t)})},prepend:function(){return kt(this,arguments,function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=Ot(this,t);e.insertBefore(t,e.firstChild)}})},before:function(){return kt(this,arguments,function(t){this.parentNode&&this.parentNode.insertBefore(t,this)})},after:function(){return kt(this,arguments,function(t){this.parentNode&&this.parentNode.insertBefore(t,this.nextSibling)})},empty:function(){for(var t,e=0;null!=(t=this[e]);e++)1===t.nodeType&&(w.cleanData(vt(t,!1)),t.textContent="");return this},clone:function(t,e){return t=null!=t&&t,e=null==e?t:e,this.map(function(){return w.clone(this,t,e)})},html:function(t){return G(this,function(t){var e=this[0]||{},n=0,r=this.length;if(void 0===t&&1===e.nodeType)return e.innerHTML;if("string"==typeof t&&!Et.test(t)&&!gt[(ft.exec(t)||["",""])[1].toLowerCase()]){t=w.htmlPrefilter(t);try{for(;n<r;n++)1===(e=this[n]||{}).nodeType&&(w.cleanData(vt(e,!1)),e.innerHTML=t);e=0}catch(t){}}e&&this.empty().append(t)},null,t,arguments.length)},replaceWith:function(){var t=[];return kt(this,arguments,function(e){var n=this.parentNode;w.inArray(this,t)<0&&(w.cleanData(vt(this)),n&&n.replaceChild(e,this))},t)}}),w.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(t,e){w.fn[t]=function(t){for(var n,r=[],i=w(t),a=i.length-1,s=0;s<=a;s++)n=s===a?this:this.clone(!0),w(i[s])[e](n),o.apply(r,n.get());return this.pushStack(r)}});var Ft=new RegExp("^("+tt+")(?!px)[a-z%]+$","i"),Nt=function(e){var n=e.ownerDocument.defaultView;return n&&n.opener||(n=t),n.getComputedStyle(e)},jt=function(t,e,n){var r,i,a={};for(i in e)a[i]=t.style[i],t.style[i]=e[i];for(i in r=n.call(t),e)t.style[i]=a[i];return r},zt=new RegExp(nt.join("|"),"i");function Vt(t,e,n){var r,i,a,o,s=t.style;return(n=n||Nt(t))&&(""!==(o=n.getPropertyValue(e)||n[e])||it(t)||(o=w.style(t,e)),!p.pixelBoxStyles()&&Ft.test(o)&&zt.test(e)&&(r=s.width,i=s.minWidth,a=s.maxWidth,s.minWidth=s.maxWidth=s.width=o,o=n.width,s.width=r,s.minWidth=i,s.maxWidth=a)),void 0!==o?o+"":o}function Gt(t,e){return{get:function(){if(!t())return(this.get=e).apply(this,arguments);delete this.get}}}!function(){function e(){if(c){u.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",c.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",rt.appendChild(u).appendChild(c);var e=t.getComputedStyle(c);r="1%"!==e.top,l=12===n(e.marginLeft),c.style.right="60%",o=36===n(e.right),i=36===n(e.width),c.style.position="absolute",a=12===n(c.offsetWidth/3),rt.removeChild(u),c=null}}function n(t){return Math.round(parseFloat(t))}var r,i,a,o,s,l,u=g.createElement("div"),c=g.createElement("div");c.style&&(c.style.backgroundClip="content-box",c.cloneNode(!0).style.backgroundClip="",p.clearCloneStyle="content-box"===c.style.backgroundClip,w.extend(p,{boxSizingReliable:function(){return e(),i},pixelBoxStyles:function(){return e(),o},pixelPosition:function(){return e(),r},reliableMarginLeft:function(){return e(),l},scrollboxSize:function(){return e(),a},reliableTrDimensions:function(){var e,n,r,i;return null==s&&(e=g.createElement("table"),n=g.createElement("tr"),r=g.createElement("div"),e.style.cssText="position:absolute;left:-11111px;border-collapse:separate",n.style.cssText="border:1px solid",n.style.height="1px",r.style.height="9px",r.style.display="block",rt.appendChild(e).appendChild(n).appendChild(r),i=t.getComputedStyle(n),s=parseInt(i.height,10)+parseInt(i.borderTopWidth,10)+parseInt(i.borderBottomWidth,10)===n.offsetHeight,rt.removeChild(e)),s}}))}();var Ut=["Webkit","Moz","ms"],Ht=g.createElement("div").style,Wt={};function Jt(t){return w.cssProps[t]||Wt[t]||(t in Ht?t:Wt[t]=function(t){for(var e=t[0].toUpperCase()+t.slice(1),n=Ut.length;n--;)if((t=Ut[n]+e)in Ht)return t}(t)||t)}var qt=/^(none|table(?!-c[ea]).+)/,Xt=/^--/,Yt={position:"absolute",visibility:"hidden",display:"block"},Zt={letterSpacing:"0",fontWeight:"400"};function $t(t,e,n){var r=et.exec(e);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):e}function Kt(t,e,n,r,i,a){var o="width"===e?1:0,s=0,l=0;if(n===(r?"border":"content"))return 0;for(;o<4;o+=2)"margin"===n&&(l+=w.css(t,n+nt[o],!0,i)),r?("content"===n&&(l-=w.css(t,"padding"+nt[o],!0,i)),"margin"!==n&&(l-=w.css(t,"border"+nt[o]+"Width",!0,i))):(l+=w.css(t,"padding"+nt[o],!0,i),"padding"!==n?l+=w.css(t,"border"+nt[o]+"Width",!0,i):s+=w.css(t,"border"+nt[o]+"Width",!0,i));return!r&&a>=0&&(l+=Math.max(0,Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-a-l-s-.5))||0),l}function Qt(t,e,n){var r=Nt(t),i=(!p.boxSizingReliable()||n)&&"border-box"===w.css(t,"boxSizing",!1,r),a=i,o=Vt(t,e,r),s="offset"+e[0].toUpperCase()+e.slice(1);if(Ft.test(o)){if(!n)return o;o="auto"}return(!p.boxSizingReliable()&&i||!p.reliableTrDimensions()&&E(t,"tr")||"auto"===o||!parseFloat(o)&&"inline"===w.css(t,"display",!1,r))&&t.getClientRects().length&&(i="border-box"===w.css(t,"boxSizing",!1,r),(a=s in t)&&(o=t[s])),(o=parseFloat(o)||0)+Kt(t,e,n||(i?"border":"content"),a,r,o)+"px"}function te(t,e,n,r,i){return new te.prototype.init(t,e,n,r,i)}w.extend({cssHooks:{opacity:{get:function(t,e){if(e){var n=Vt(t,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(t,e,n,r){if(t&&3!==t.nodeType&&8!==t.nodeType&&t.style){var i,a,o,s=J(e),l=Xt.test(e),u=t.style;if(l||(e=Jt(s)),o=w.cssHooks[e]||w.cssHooks[s],void 0===n)return o&&"get"in o&&void 0!==(i=o.get(t,!1,r))?i:u[e];"string"==(a=typeof n)&&(i=et.exec(n))&&i[1]&&(n=st(t,e,i),a="number"),null!=n&&n==n&&("number"!==a||l||(n+=i&&i[3]||(w.cssNumber[s]?"":"px")),p.clearCloneStyle||""!==n||0!==e.indexOf("background")||(u[e]="inherit"),o&&"set"in o&&void 0===(n=o.set(t,n,r))||(l?u.setProperty(e,n):u[e]=n))}},css:function(t,e,n,r){var i,a,o,s=J(e);return Xt.test(e)||(e=Jt(s)),(o=w.cssHooks[e]||w.cssHooks[s])&&"get"in o&&(i=o.get(t,!0,n)),void 0===i&&(i=Vt(t,e,r)),"normal"===i&&e in Zt&&(i=Zt[e]),""===n||n?(a=parseFloat(i),!0===n||isFinite(a)?a||0:i):i}}),w.each(["height","width"],function(t,e){w.cssHooks[e]={get:function(t,n,r){if(n)return!qt.test(w.css(t,"display"))||t.getClientRects().length&&t.getBoundingClientRect().width?Qt(t,e,r):jt(t,Yt,function(){return Qt(t,e,r)})},set:function(t,n,r){var i,a=Nt(t),o=!p.scrollboxSize()&&"absolute"===a.position,s=(o||r)&&"border-box"===w.css(t,"boxSizing",!1,a),l=r?Kt(t,e,r,s,a):0;return s&&o&&(l-=Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-parseFloat(a[e])-Kt(t,e,"border",!1,a)-.5)),l&&(i=et.exec(n))&&"px"!==(i[3]||"px")&&(t.style[e]=n,n=w.css(t,e)),$t(0,n,l)}}}),w.cssHooks.marginLeft=Gt(p.reliableMarginLeft,function(t,e){if(e)return(parseFloat(Vt(t,"marginLeft"))||t.getBoundingClientRect().left-jt(t,{marginLeft:0},function(){return t.getBoundingClientRect().left}))+"px"}),w.each({margin:"",padding:"",border:"Width"},function(t,e){w.cssHooks[t+e]={expand:function(n){for(var r=0,i={},a="string"==typeof n?n.split(" "):[n];r<4;r++)i[t+nt[r]+e]=a[r]||a[r-2]||a[0];return i}},"margin"!==t&&(w.cssHooks[t+e].set=$t)}),w.fn.extend({css:function(t,e){return G(this,function(t,e,n){var r,i,a={},o=0;if(Array.isArray(e)){for(r=Nt(t),i=e.length;o<i;o++)a[e[o]]=w.css(t,e[o],!1,r);return a}return void 0!==n?w.style(t,e,n):w.css(t,e)},t,e,arguments.length>1)}}),w.Tween=te,te.prototype={constructor:te,init:function(t,e,n,r,i,a){this.elem=t,this.prop=n,this.easing=i||w.easing._default,this.options=e,this.start=this.now=this.cur(),this.end=r,this.unit=a||(w.cssNumber[n]?"":"px")},cur:function(){var t=te.propHooks[this.prop];return t&&t.get?t.get(this):te.propHooks._default.get(this)},run:function(t){var e,n=te.propHooks[this.prop];return this.options.duration?this.pos=e=w.easing[this.easing](t,this.options.duration*t,0,1,this.options.duration):this.pos=e=t,this.now=(this.end-this.start)*e+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):te.propHooks._default.set(this),this}},te.prototype.init.prototype=te.prototype,te.propHooks={_default:{get:function(t){var e;return 1!==t.elem.nodeType||null!=t.elem[t.prop]&&null==t.elem.style[t.prop]?t.elem[t.prop]:(e=w.css(t.elem,t.prop,""))&&"auto"!==e?e:0},set:function(t){w.fx.step[t.prop]?w.fx.step[t.prop](t):1!==t.elem.nodeType||!w.cssHooks[t.prop]&&null==t.elem.style[Jt(t.prop)]?t.elem[t.prop]=t.now:w.style(t.elem,t.prop,t.now+t.unit)}}},te.propHooks.scrollTop=te.propHooks.scrollLeft={set:function(t){t.elem.nodeType&&t.elem.parentNode&&(t.elem[t.prop]=t.now)}},w.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2},_default:"swing"},w.fx=te.prototype.init,w.fx.step={};var ee,ne,re=/^(?:toggle|show|hide)$/,ie=/queueHooks$/;function ae(){ne&&(!1===g.hidden&&t.requestAnimationFrame?t.requestAnimationFrame(ae):t.setTimeout(ae,w.fx.interval),w.fx.tick())}function oe(){return t.setTimeout(function(){ee=void 0}),ee=Date.now()}function se(t,e){var n,r=0,i={height:t};for(e=e?1:0;r<4;r+=2-e)i["margin"+(n=nt[r])]=i["padding"+n]=t;return e&&(i.opacity=i.width=t),i}function le(t,e,n){for(var r,i=(ue.tweeners[e]||[]).concat(ue.tweeners["*"]),a=0,o=i.length;a<o;a++)if(r=i[a].call(n,e,t))return r}function ue(t,e,n){var r,i,a=0,o=ue.prefilters.length,s=w.Deferred().always(function(){delete l.elem}),l=function(){if(i)return!1;for(var e=ee||oe(),n=Math.max(0,u.startTime+u.duration-e),r=1-(n/u.duration||0),a=0,o=u.tweens.length;a<o;a++)u.tweens[a].run(r);return s.notifyWith(t,[u,r,n]),r<1&&o?n:(o||s.notifyWith(t,[u,1,0]),s.resolveWith(t,[u]),!1)},u=s.promise({elem:t,props:w.extend({},e),opts:w.extend(!0,{specialEasing:{},easing:w.easing._default},n),originalProperties:e,originalOptions:n,startTime:ee||oe(),duration:n.duration,tweens:[],createTween:function(e,n){var r=w.Tween(t,u.opts,e,n,u.opts.specialEasing[e]||u.opts.easing);return u.tweens.push(r),r},stop:function(e){var n=0,r=e?u.tweens.length:0;if(i)return this;for(i=!0;n<r;n++)u.tweens[n].run(1);return e?(s.notifyWith(t,[u,1,0]),s.resolveWith(t,[u,e])):s.rejectWith(t,[u,e]),this}}),c=u.props;for(function(t,e){var n,r,i,a,o;for(n in t)if(i=e[r=J(n)],a=t[n],Array.isArray(a)&&(i=a[1],a=t[n]=a[0]),n!==r&&(t[r]=a,delete t[n]),(o=w.cssHooks[r])&&"expand"in o)for(n in a=o.expand(a),delete t[r],a)n in t||(t[n]=a[n],e[n]=i);else e[r]=i}(c,u.opts.specialEasing);a<o;a++)if(r=ue.prefilters[a].call(u,t,c,u.opts))return f(r.stop)&&(w._queueHooks(u.elem,u.opts.queue).stop=r.stop.bind(r)),r;return w.map(c,le,u),f(u.opts.start)&&u.opts.start.call(t,u),u.progress(u.opts.progress).done(u.opts.done,u.opts.complete).fail(u.opts.fail).always(u.opts.always),w.fx.timer(w.extend(l,{elem:t,anim:u,queue:u.opts.queue})),u}w.Animation=w.extend(ue,{tweeners:{"*":[function(t,e){var n=this.createTween(t,e);return st(n.elem,t,et.exec(e),n),n}]},tweener:function(t,e){f(t)?(e=t,t=["*"]):t=t.match(k);for(var n,r=0,i=t.length;r<i;r++)n=t[r],ue.tweeners[n]=ue.tweeners[n]||[],ue.tweeners[n].unshift(e)},prefilters:[function(t,e,n){var r,i,a,o,s,l,u,c,h="width"in e||"height"in e,d=this,p={},f=t.style,m=t.nodeType&&ot(t),g=Y.get(t,"fxshow");for(r in n.queue||(null==(o=w._queueHooks(t,"fx")).unqueued&&(o.unqueued=0,s=o.empty.fire,o.empty.fire=function(){o.unqueued||s()}),o.unqueued++,d.always(function(){d.always(function(){o.unqueued--,w.queue(t,"fx").length||o.empty.fire()})})),e)if(i=e[r],re.test(i)){if(delete e[r],a=a||"toggle"===i,i===(m?"hide":"show")){if("show"!==i||!g||void 0===g[r])continue;m=!0}p[r]=g&&g[r]||w.style(t,r)}if((l=!w.isEmptyObject(e))||!w.isEmptyObject(p))for(r in h&&1===t.nodeType&&(n.overflow=[f.overflow,f.overflowX,f.overflowY],null==(u=g&&g.display)&&(u=Y.get(t,"display")),"none"===(c=w.css(t,"display"))&&(u?c=u:(ct([t],!0),u=t.style.display||u,c=w.css(t,"display"),ct([t]))),("inline"===c||"inline-block"===c&&null!=u)&&"none"===w.css(t,"float")&&(l||(d.done(function(){f.display=u}),null==u&&(c=f.display,u="none"===c?"":c)),f.display="inline-block")),n.overflow&&(f.overflow="hidden",d.always(function(){f.overflow=n.overflow[0],f.overflowX=n.overflow[1],f.overflowY=n.overflow[2]})),l=!1,p)l||(g?"hidden"in g&&(m=g.hidden):g=Y.access(t,"fxshow",{display:u}),a&&(g.hidden=!m),m&&ct([t],!0),d.done(function(){for(r in m||ct([t]),Y.remove(t,"fxshow"),p)w.style(t,r,p[r])})),l=le(m?g[r]:0,r,d),r in g||(g[r]=l.start,m&&(l.end=l.start,l.start=0))}],prefilter:function(t,e){e?ue.prefilters.unshift(t):ue.prefilters.push(t)}}),w.speed=function(t,e,n){var r=t&&"object"==typeof t?w.extend({},t):{complete:n||!n&&e||f(t)&&t,duration:t,easing:n&&e||e&&!f(e)&&e};return w.fx.off?r.duration=0:"number"!=typeof r.duration&&(r.duration in w.fx.speeds?r.duration=w.fx.speeds[r.duration]:r.duration=w.fx.speeds._default),null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){f(r.old)&&r.old.call(this),r.queue&&w.dequeue(this,r.queue)},r},w.fn.extend({fadeTo:function(t,e,n,r){return this.filter(ot).css("opacity",0).show().end().animate({opacity:e},t,n,r)},animate:function(t,e,n,r){var i=w.isEmptyObject(t),a=w.speed(e,n,r),o=function(){var e=ue(this,w.extend({},t),a);(i||Y.get(this,"finish"))&&e.stop(!0)};return o.finish=o,i||!1===a.queue?this.each(o):this.queue(a.queue,o)},stop:function(t,e,n){var r=function(t){var e=t.stop;delete t.stop,e(n)};return"string"!=typeof t&&(n=e,e=t,t=void 0),e&&this.queue(t||"fx",[]),this.each(function(){var e=!0,i=null!=t&&t+"queueHooks",a=w.timers,o=Y.get(this);if(i)o[i]&&o[i].stop&&r(o[i]);else for(i in o)o[i]&&o[i].stop&&ie.test(i)&&r(o[i]);for(i=a.length;i--;)a[i].elem!==this||null!=t&&a[i].queue!==t||(a[i].anim.stop(n),e=!1,a.splice(i,1));!e&&n||w.dequeue(this,t)})},finish:function(t){return!1!==t&&(t=t||"fx"),this.each(function(){var e,n=Y.get(this),r=n[t+"queue"],i=n[t+"queueHooks"],a=w.timers,o=r?r.length:0;for(n.finish=!0,w.queue(this,t,[]),i&&i.stop&&i.stop.call(this,!0),e=a.length;e--;)a[e].elem===this&&a[e].queue===t&&(a[e].anim.stop(!0),a.splice(e,1));for(e=0;e<o;e++)r[e]&&r[e].finish&&r[e].finish.call(this);delete n.finish})}}),w.each(["toggle","show","hide"],function(t,e){var n=w.fn[e];w.fn[e]=function(t,r,i){return null==t||"boolean"==typeof t?n.apply(this,arguments):this.animate(se(e,!0),t,r,i)}}),w.each({slideDown:se("show"),slideUp:se("hide"),slideToggle:se("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(t,e){w.fn[t]=function(t,n,r){return this.animate(e,t,n,r)}}),w.timers=[],w.fx.tick=function(){var t,e=0,n=w.timers;for(ee=Date.now();e<n.length;e++)(t=n[e])()||n[e]!==t||n.splice(e--,1);n.length||w.fx.stop(),ee=void 0},w.fx.timer=function(t){w.timers.push(t),w.fx.start()},w.fx.interval=13,w.fx.start=function(){ne||(ne=!0,ae())},w.fx.stop=function(){ne=null},w.fx.speeds={slow:600,fast:200,_default:400},w.fn.delay=function(e,n){return e=w.fx&&w.fx.speeds[e]||e,n=n||"fx",this.queue(n,function(n,r){var i=t.setTimeout(n,e);r.stop=function(){t.clearTimeout(i)}})},function(){var t=g.createElement("input"),e=g.createElement("select").appendChild(g.createElement("option"));t.type="checkbox",p.checkOn=""!==t.value,p.optSelected=e.selected,(t=g.createElement("input")).value="t",t.type="radio",p.radioValue="t"===t.value}();var ce,he=w.expr.attrHandle;w.fn.extend({attr:function(t,e){return G(this,w.attr,t,e,arguments.length>1)},removeAttr:function(t){return this.each(function(){w.removeAttr(this,t)})}}),w.extend({attr:function(t,e,n){var r,i,a=t.nodeType;if(3!==a&&8!==a&&2!==a)return void 0===t.getAttribute?w.prop(t,e,n):(1===a&&w.isXMLDoc(t)||(i=w.attrHooks[e.toLowerCase()]||(w.expr.match.bool.test(e)?ce:void 0)),void 0!==n?null===n?void w.removeAttr(t,e):i&&"set"in i&&void 0!==(r=i.set(t,n,e))?r:(t.setAttribute(e,n+""),n):i&&"get"in i&&null!==(r=i.get(t,e))?r:null==(r=w.find.attr(t,e))?void 0:r)},attrHooks:{type:{set:function(t,e){if(!p.radioValue&&"radio"===e&&E(t,"input")){var n=t.value;return t.setAttribute("type",e),n&&(t.value=n),e}}}},removeAttr:function(t,e){var n,r=0,i=e&&e.match(k);if(i&&1===t.nodeType)for(;n=i[r++];)t.removeAttribute(n)}}),ce={set:function(t,e,n){return!1===e?w.removeAttr(t,n):t.setAttribute(n,n),n}},w.each(w.expr.match.bool.source.match(/\w+/g),function(t,e){var n=he[e]||w.find.attr;he[e]=function(t,e,r){var i,a,o=e.toLowerCase();return r||(a=he[o],he[o]=i,i=null!=n(t,e,r)?o:null,he[o]=a),i}});var de=/^(?:input|select|textarea|button)$/i,pe=/^(?:a|area)$/i;function fe(t){return(t.match(k)||[]).join(" ")}function me(t){return t.getAttribute&&t.getAttribute("class")||""}function ge(t){return Array.isArray(t)?t:"string"==typeof t&&t.match(k)||[]}w.fn.extend({prop:function(t,e){return G(this,w.prop,t,e,arguments.length>1)},removeProp:function(t){return this.each(function(){delete this[w.propFix[t]||t]})}}),w.extend({prop:function(t,e,n){var r,i,a=t.nodeType;if(3!==a&&8!==a&&2!==a)return 1===a&&w.isXMLDoc(t)||(e=w.propFix[e]||e,i=w.propHooks[e]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(t,n,e))?r:t[e]=n:i&&"get"in i&&null!==(r=i.get(t,e))?r:t[e]},propHooks:{tabIndex:{get:function(t){var e=w.find.attr(t,"tabindex");return e?parseInt(e,10):de.test(t.nodeName)||pe.test(t.nodeName)&&t.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),p.optSelected||(w.propHooks.selected={get:function(t){var e=t.parentNode;return e&&e.parentNode&&e.parentNode.selectedIndex,null},set:function(t){var e=t.parentNode;e&&(e.selectedIndex,e.parentNode&&e.parentNode.selectedIndex)}}),w.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){w.propFix[this.toLowerCase()]=this}),w.fn.extend({addClass:function(t){var e,n,r,i,a,o,s,l=0;if(f(t))return this.each(function(e){w(this).addClass(t.call(this,e,me(this)))});if((e=ge(t)).length)for(;n=this[l++];)if(i=me(n),r=1===n.nodeType&&" "+fe(i)+" "){for(o=0;a=e[o++];)r.indexOf(" "+a+" ")<0&&(r+=a+" ");i!==(s=fe(r))&&n.setAttribute("class",s)}return this},removeClass:function(t){var e,n,r,i,a,o,s,l=0;if(f(t))return this.each(function(e){w(this).removeClass(t.call(this,e,me(this)))});if(!arguments.length)return this.attr("class","");if((e=ge(t)).length)for(;n=this[l++];)if(i=me(n),r=1===n.nodeType&&" "+fe(i)+" "){for(o=0;a=e[o++];)for(;r.indexOf(" "+a+" ")>-1;)r=r.replace(" "+a+" "," ");i!==(s=fe(r))&&n.setAttribute("class",s)}return this},toggleClass:function(t,e){var n=typeof t,r="string"===n||Array.isArray(t);return"boolean"==typeof e&&r?e?this.addClass(t):this.removeClass(t):f(t)?this.each(function(n){w(this).toggleClass(t.call(this,n,me(this),e),e)}):this.each(function(){var e,i,a,o;if(r)for(i=0,a=w(this),o=ge(t);e=o[i++];)a.hasClass(e)?a.removeClass(e):a.addClass(e);else void 0!==t&&"boolean"!==n||((e=me(this))&&Y.set(this,"__className__",e),this.setAttribute&&this.setAttribute("class",e||!1===t?"":Y.get(this,"__className__")||""))})},hasClass:function(t){var e,n,r=0;for(e=" "+t+" ";n=this[r++];)if(1===n.nodeType&&(" "+fe(me(n))+" ").indexOf(e)>-1)return!0;return!1}});var ve=/\r/g;w.fn.extend({val:function(t){var e,n,r,i=this[0];return arguments.length?(r=f(t),this.each(function(n){var i;1===this.nodeType&&(null==(i=r?t.call(this,n,w(this).val()):t)?i="":"number"==typeof i?i+="":Array.isArray(i)&&(i=w.map(i,function(t){return null==t?"":t+""})),(e=w.valHooks[this.type]||w.valHooks[this.nodeName.toLowerCase()])&&"set"in e&&void 0!==e.set(this,i,"value")||(this.value=i))})):i?(e=w.valHooks[i.type]||w.valHooks[i.nodeName.toLowerCase()])&&"get"in e&&void 0!==(n=e.get(i,"value"))?n:"string"==typeof(n=i.value)?n.replace(ve,""):null==n?"":n:void 0}}),w.extend({valHooks:{option:{get:function(t){var e=w.find.attr(t,"value");return null!=e?e:fe(w.text(t))}},select:{get:function(t){var e,n,r,i=t.options,a=t.selectedIndex,o="select-one"===t.type,s=o?null:[],l=o?a+1:i.length;for(r=a<0?l:o?a:0;r<l;r++)if(((n=i[r]).selected||r===a)&&!n.disabled&&(!n.parentNode.disabled||!E(n.parentNode,"optgroup"))){if(e=w(n).val(),o)return e;s.push(e)}return s},set:function(t,e){for(var n,r,i=t.options,a=w.makeArray(e),o=i.length;o--;)((r=i[o]).selected=w.inArray(w.valHooks.option.get(r),a)>-1)&&(n=!0);return n||(t.selectedIndex=-1),a}}}}),w.each(["radio","checkbox"],function(){w.valHooks[this]={set:function(t,e){if(Array.isArray(e))return t.checked=w.inArray(w(t).val(),e)>-1}},p.checkOn||(w.valHooks[this].get=function(t){return null===t.getAttribute("value")?"on":t.value})}),p.focusin="onfocusin"in t;var ye=/^(?:focusinfocus|focusoutblur)$/,xe=function(t){t.stopPropagation()};w.extend(w.event,{trigger:function(e,n,r,i){var a,o,s,l,u,h,d,p,v=[r||g],y=c.call(e,"type")?e.type:e,x=c.call(e,"namespace")?e.namespace.split("."):[];if(o=p=s=r=r||g,3!==r.nodeType&&8!==r.nodeType&&!ye.test(y+w.event.triggered)&&(y.indexOf(".")>-1&&(y=(x=y.split(".")).shift(),x.sort()),u=y.indexOf(":")<0&&"on"+y,(e=e[w.expando]?e:new w.Event(y,"object"==typeof e&&e)).isTrigger=i?2:3,e.namespace=x.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+x.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=r),n=null==n?[e]:w.makeArray(n,[e]),d=w.event.special[y]||{},i||!d.trigger||!1!==d.trigger.apply(r,n))){if(!i&&!d.noBubble&&!m(r)){for(l=d.delegateType||y,ye.test(l+y)||(o=o.parentNode);o;o=o.parentNode)v.push(o),s=o;s===(r.ownerDocument||g)&&v.push(s.defaultView||s.parentWindow||t)}for(a=0;(o=v[a++])&&!e.isPropagationStopped();)p=o,e.type=a>1?l:d.bindType||y,(h=(Y.get(o,"events")||Object.create(null))[e.type]&&Y.get(o,"handle"))&&h.apply(o,n),(h=u&&o[u])&&h.apply&&q(o)&&(e.result=h.apply(o,n),!1===e.result&&e.preventDefault());return e.type=y,i||e.isDefaultPrevented()||d._default&&!1!==d._default.apply(v.pop(),n)||!q(r)||u&&f(r[y])&&!m(r)&&((s=r[u])&&(r[u]=null),w.event.triggered=y,e.isPropagationStopped()&&p.addEventListener(y,xe),r[y](),e.isPropagationStopped()&&p.removeEventListener(y,xe),w.event.triggered=void 0,s&&(r[u]=s)),e.result}},simulate:function(t,e,n){var r=w.extend(new w.Event,n,{type:t,isSimulated:!0});w.event.trigger(r,null,e)}}),w.fn.extend({trigger:function(t,e){return this.each(function(){w.event.trigger(t,e,this)})},triggerHandler:function(t,e){var n=this[0];if(n)return w.event.trigger(t,e,n,!0)}}),p.focusin||w.each({focus:"focusin",blur:"focusout"},function(t,e){var n=function(t){w.event.simulate(e,t.target,w.event.fix(t))};w.event.special[e]={setup:function(){var r=this.ownerDocument||this.document||this,i=Y.access(r,e);i||r.addEventListener(t,n,!0),Y.access(r,e,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this.document||this,i=Y.access(r,e)-1;i?Y.access(r,e,i):(r.removeEventListener(t,n,!0),Y.remove(r,e))}}});var be=t.location,we={guid:Date.now()},_e=/\?/;w.parseXML=function(e){var n,r;if(!e||"string"!=typeof e)return null;try{n=(new t.DOMParser).parseFromString(e,"text/xml")}catch(t){}return r=n&&n.getElementsByTagName("parsererror")[0],n&&!r||w.error("Invalid XML: "+(r?w.map(r.childNodes,function(t){return t.textContent}).join("\n"):e)),n};var Me=/\[\]$/,Se=/\r?\n/g,Te=/^(?:submit|button|image|reset|file)$/i,Ce=/^(?:input|select|textarea|keygen)/i;function Ee(t,e,n,r){var i;if(Array.isArray(e))w.each(e,function(e,i){n||Me.test(t)?r(t,i):Ee(t+"["+("object"==typeof i&&null!=i?e:"")+"]",i,n,r)});else if(n||"object"!==x(e))r(t,e);else for(i in e)Ee(t+"["+i+"]",e[i],n,r)}w.param=function(t,e){var n,r=[],i=function(t,e){var n=f(e)?e():e;r[r.length]=encodeURIComponent(t)+"="+encodeURIComponent(null==n?"":n)};if(null==t)return"";if(Array.isArray(t)||t.jquery&&!w.isPlainObject(t))w.each(t,function(){i(this.name,this.value)});else for(n in t)Ee(n,t[n],e,i);return r.join("&")},w.fn.extend({serialize:function(){return w.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var t=w.prop(this,"elements");return t?w.makeArray(t):this}).filter(function(){var t=this.type;return this.name&&!w(this).is(":disabled")&&Ce.test(this.nodeName)&&!Te.test(t)&&(this.checked||!pt.test(t))}).map(function(t,e){var n=w(this).val();return null==n?null:Array.isArray(n)?w.map(n,function(t){return{name:e.name,value:t.replace(Se,"\r\n")}}):{name:e.name,value:n.replace(Se,"\r\n")}}).get()}});var De=/%20/g,Ae=/#.*$/,Oe=/([?&])_=[^&]*/,Le=/^(.*?):[ \t]*([^\r\n]*)$/gm,Pe=/^(?:GET|HEAD)$/,Re=/^\/\//,Ie={},ke={},Be="*/".concat("*"),Fe=g.createElement("a");function Ne(t){return function(e,n){"string"!=typeof e&&(n=e,e="*");var r,i=0,a=e.toLowerCase().match(k)||[];if(f(n))for(;r=a[i++];)"+"===r[0]?(r=r.slice(1)||"*",(t[r]=t[r]||[]).unshift(n)):(t[r]=t[r]||[]).push(n)}}function je(t,e,n,r){var i={},a=t===ke;function o(s){var l;return i[s]=!0,w.each(t[s]||[],function(t,s){var u=s(e,n,r);return"string"!=typeof u||a||i[u]?a?!(l=u):void 0:(e.dataTypes.unshift(u),o(u),!1)}),l}return o(e.dataTypes[0])||!i["*"]&&o("*")}function ze(t,e){var n,r,i=w.ajaxSettings.flatOptions||{};for(n in e)void 0!==e[n]&&((i[n]?t:r||(r={}))[n]=e[n]);return r&&w.extend(!0,t,r),t}Fe.href=be.href,w.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:be.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(be.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Be,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":w.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(t,e){return e?ze(ze(t,w.ajaxSettings),e):ze(w.ajaxSettings,t)},ajaxPrefilter:Ne(Ie),ajaxTransport:Ne(ke),ajax:function(e,n){"object"==typeof e&&(n=e,e=void 0),n=n||{};var r,i,a,o,s,l,u,c,h,d,p=w.ajaxSetup({},n),f=p.context||p,m=p.context&&(f.nodeType||f.jquery)?w(f):w.event,v=w.Deferred(),y=w.Callbacks("once memory"),x=p.statusCode||{},b={},_={},M="canceled",S={readyState:0,getResponseHeader:function(t){var e;if(u){if(!o)for(o={};e=Le.exec(a);)o[e[1].toLowerCase()+" "]=(o[e[1].toLowerCase()+" "]||[]).concat(e[2]);e=o[t.toLowerCase()+" "]}return null==e?null:e.join(", ")},getAllResponseHeaders:function(){return u?a:null},setRequestHeader:function(t,e){return null==u&&(t=_[t.toLowerCase()]=_[t.toLowerCase()]||t,b[t]=e),this},overrideMimeType:function(t){return null==u&&(p.mimeType=t),this},statusCode:function(t){var e;if(t)if(u)S.always(t[S.status]);else for(e in t)x[e]=[x[e],t[e]];return this},abort:function(t){var e=t||M;return r&&r.abort(e),T(0,e),this}};if(v.promise(S),p.url=((e||p.url||be.href)+"").replace(Re,be.protocol+"//"),p.type=n.method||n.type||p.method||p.type,p.dataTypes=(p.dataType||"*").toLowerCase().match(k)||[""],null==p.crossDomain){l=g.createElement("a");try{l.href=p.url,l.href=l.href,p.crossDomain=Fe.protocol+"//"+Fe.host!=l.protocol+"//"+l.host}catch(t){p.crossDomain=!0}}if(p.data&&p.processData&&"string"!=typeof p.data&&(p.data=w.param(p.data,p.traditional)),je(Ie,p,n,S),u)return S;for(h in(c=w.event&&p.global)&&0==w.active++&&w.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!Pe.test(p.type),i=p.url.replace(Ae,""),p.hasContent?p.data&&p.processData&&0===(p.contentType||"").indexOf("application/x-www-form-urlencoded")&&(p.data=p.data.replace(De,"+")):(d=p.url.slice(i.length),p.data&&(p.processData||"string"==typeof p.data)&&(i+=(_e.test(i)?"&":"?")+p.data,delete p.data),!1===p.cache&&(i=i.replace(Oe,"$1"),d=(_e.test(i)?"&":"?")+"_="+we.guid+++d),p.url=i+d),p.ifModified&&(w.lastModified[i]&&S.setRequestHeader("If-Modified-Since",w.lastModified[i]),w.etag[i]&&S.setRequestHeader("If-None-Match",w.etag[i])),(p.data&&p.hasContent&&!1!==p.contentType||n.contentType)&&S.setRequestHeader("Content-Type",p.contentType),S.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+Be+"; q=0.01":""):p.accepts["*"]),p.headers)S.setRequestHeader(h,p.headers[h]);if(p.beforeSend&&(!1===p.beforeSend.call(f,S,p)||u))return S.abort();if(M="abort",y.add(p.complete),S.done(p.success),S.fail(p.error),r=je(ke,p,n,S)){if(S.readyState=1,c&&m.trigger("ajaxSend",[S,p]),u)return S;p.async&&p.timeout>0&&(s=t.setTimeout(function(){S.abort("timeout")},p.timeout));try{u=!1,r.send(b,T)}catch(t){if(u)throw t;T(-1,t)}}else T(-1,"No Transport");function T(e,n,o,l){var h,d,g,b,_,M=n;u||(u=!0,s&&t.clearTimeout(s),r=void 0,a=l||"",S.readyState=e>0?4:0,h=e>=200&&e<300||304===e,o&&(b=function(t,e,n){for(var r,i,a,o,s=t.contents,l=t.dataTypes;"*"===l[0];)l.shift(),void 0===r&&(r=t.mimeType||e.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){l.unshift(i);break}if(l[0]in n)a=l[0];else{for(i in n){if(!l[0]||t.converters[i+" "+l[0]]){a=i;break}o||(o=i)}a=a||o}if(a)return a!==l[0]&&l.unshift(a),n[a]}(p,S,o)),!h&&w.inArray("script",p.dataTypes)>-1&&w.inArray("json",p.dataTypes)<0&&(p.converters["text script"]=function(){}),b=function(t,e,n,r){var i,a,o,s,l,u={},c=t.dataTypes.slice();if(c[1])for(o in t.converters)u[o.toLowerCase()]=t.converters[o];for(a=c.shift();a;)if(t.responseFields[a]&&(n[t.responseFields[a]]=e),!l&&r&&t.dataFilter&&(e=t.dataFilter(e,t.dataType)),l=a,a=c.shift())if("*"===a)a=l;else if("*"!==l&&l!==a){if(!(o=u[l+" "+a]||u["* "+a]))for(i in u)if((s=i.split(" "))[1]===a&&(o=u[l+" "+s[0]]||u["* "+s[0]])){!0===o?o=u[i]:!0!==u[i]&&(a=s[0],c.unshift(s[1]));break}if(!0!==o)if(o&&t.throws)e=o(e);else try{e=o(e)}catch(t){return{state:"parsererror",error:o?t:"No conversion from "+l+" to "+a}}}return{state:"success",data:e}}(p,b,S,h),h?(p.ifModified&&((_=S.getResponseHeader("Last-Modified"))&&(w.lastModified[i]=_),(_=S.getResponseHeader("etag"))&&(w.etag[i]=_)),204===e||"HEAD"===p.type?M="nocontent":304===e?M="notmodified":(M=b.state,d=b.data,h=!(g=b.error))):(g=M,!e&&M||(M="error",e<0&&(e=0))),S.status=e,S.statusText=(n||M)+"",h?v.resolveWith(f,[d,M,S]):v.rejectWith(f,[S,M,g]),S.statusCode(x),x=void 0,c&&m.trigger(h?"ajaxSuccess":"ajaxError",[S,p,h?d:g]),y.fireWith(f,[S,M]),c&&(m.trigger("ajaxComplete",[S,p]),--w.active||w.event.trigger("ajaxStop")))}return S},getJSON:function(t,e,n){return w.get(t,e,n,"json")},getScript:function(t,e){return w.get(t,void 0,e,"script")}}),w.each(["get","post"],function(t,e){w[e]=function(t,n,r,i){return f(n)&&(i=i||r,r=n,n=void 0),w.ajax(w.extend({url:t,type:e,dataType:i,data:n,success:r},w.isPlainObject(t)&&t))}}),w.ajaxPrefilter(function(t){var e;for(e in t.headers)"content-type"===e.toLowerCase()&&(t.contentType=t.headers[e]||"")}),w._evalUrl=function(t,e,n){return w.ajax({url:t,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(t){w.globalEval(t,e,n)}})},w.fn.extend({wrapAll:function(t){var e;return this[0]&&(f(t)&&(t=t.call(this[0])),e=w(t,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&e.insertBefore(this[0]),e.map(function(){for(var t=this;t.firstElementChild;)t=t.firstElementChild;return t}).append(this)),this},wrapInner:function(t){return f(t)?this.each(function(e){w(this).wrapInner(t.call(this,e))}):this.each(function(){var e=w(this),n=e.contents();n.length?n.wrapAll(t):e.append(t)})},wrap:function(t){var e=f(t);return this.each(function(n){w(this).wrapAll(e?t.call(this,n):t)})},unwrap:function(t){return this.parent(t).not("body").each(function(){w(this).replaceWith(this.childNodes)}),this}}),w.expr.pseudos.hidden=function(t){return!w.expr.pseudos.visible(t)},w.expr.pseudos.visible=function(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)},w.ajaxSettings.xhr=function(){try{return new t.XMLHttpRequest}catch(t){}};var Ve={0:200,1223:204},Ge=w.ajaxSettings.xhr();p.cors=!!Ge&&"withCredentials"in Ge,p.ajax=Ge=!!Ge,w.ajaxTransport(function(e){var n,r;if(p.cors||Ge&&!e.crossDomain)return{send:function(i,a){var o,s=e.xhr();if(s.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(o in e.xhrFields)s[o]=e.xhrFields[o];for(o in e.mimeType&&s.overrideMimeType&&s.overrideMimeType(e.mimeType),e.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest"),i)s.setRequestHeader(o,i[o]);n=function(t){return function(){n&&(n=r=s.onload=s.onerror=s.onabort=s.ontimeout=s.onreadystatechange=null,"abort"===t?s.abort():"error"===t?"number"!=typeof s.status?a(0,"error"):a(s.status,s.statusText):a(Ve[s.status]||s.status,s.statusText,"text"!==(s.responseType||"text")||"string"!=typeof s.responseText?{binary:s.response}:{text:s.responseText},s.getAllResponseHeaders()))}},s.onload=n(),r=s.onerror=s.ontimeout=n("error"),void 0!==s.onabort?s.onabort=r:s.onreadystatechange=function(){4===s.readyState&&t.setTimeout(function(){n&&r()})},n=n("abort");try{s.send(e.hasContent&&e.data||null)}catch(t){if(n)throw t}},abort:function(){n&&n()}}}),w.ajaxPrefilter(function(t){t.crossDomain&&(t.contents.script=!1)}),w.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(t){return w.globalEval(t),t}}}),w.ajaxPrefilter("script",function(t){void 0===t.cache&&(t.cache=!1),t.crossDomain&&(t.type="GET")}),w.ajaxTransport("script",function(t){var e,n;if(t.crossDomain||t.scriptAttrs)return{send:function(r,i){e=w("<script>").attr(t.scriptAttrs||{}).prop({charset:t.scriptCharset,src:t.url}).on("load error",n=function(t){e.remove(),n=null,t&&i("error"===t.type?404:200,t.type)}),g.head.appendChild(e[0])},abort:function(){n&&n()}}});var Ue,He=[],We=/(=)\?(?=&|$)|\?\?/;w.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var t=He.pop()||w.expando+"_"+we.guid++;return this[t]=!0,t}}),w.ajaxPrefilter("json jsonp",function(e,n,r){var i,a,o,s=!1!==e.jsonp&&(We.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&We.test(e.data)&&"data");if(s||"jsonp"===e.dataTypes[0])return i=e.jsonpCallback=f(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,s?e[s]=e[s].replace(We,"$1"+i):!1!==e.jsonp&&(e.url+=(_e.test(e.url)?"&":"?")+e.jsonp+"="+i),e.converters["script json"]=function(){return o||w.error(i+" was not called"),o[0]},e.dataTypes[0]="json",a=t[i],t[i]=function(){o=arguments},r.always(function(){void 0===a?w(t).removeProp(i):t[i]=a,e[i]&&(e.jsonpCallback=n.jsonpCallback,He.push(i)),o&&f(a)&&a(o[0]),o=a=void 0}),"script"}),p.createHTMLDocument=((Ue=g.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===Ue.childNodes.length),w.parseHTML=function(t,e,n){return"string"!=typeof t?[]:("boolean"==typeof e&&(n=e,e=!1),e||(p.createHTMLDocument?((r=(e=g.implementation.createHTMLDocument("")).createElement("base")).href=g.location.href,e.head.appendChild(r)):e=g),a=!n&&[],(i=D.exec(t))?[e.createElement(i[1])]:(i=bt([t],e,a),a&&a.length&&w(a).remove(),w.merge([],i.childNodes)));var r,i,a},w.fn.load=function(t,e,n){var r,i,a,o=this,s=t.indexOf(" ");return s>-1&&(r=fe(t.slice(s)),t=t.slice(0,s)),f(e)?(n=e,e=void 0):e&&"object"==typeof e&&(i="POST"),o.length>0&&w.ajax({url:t,type:i||"GET",dataType:"html",data:e}).done(function(t){a=arguments,o.html(r?w("<div>").append(w.parseHTML(t)).find(r):t)}).always(n&&function(t,e){o.each(function(){n.apply(this,a||[t.responseText,e,t])})}),this},w.expr.pseudos.animated=function(t){return w.grep(w.timers,function(e){return t===e.elem}).length},w.offset={setOffset:function(t,e,n){var r,i,a,o,s,l,u=w.css(t,"position"),c=w(t),h={};"static"===u&&(t.style.position="relative"),s=c.offset(),a=w.css(t,"top"),l=w.css(t,"left"),("absolute"===u||"fixed"===u)&&(a+l).indexOf("auto")>-1?(o=(r=c.position()).top,i=r.left):(o=parseFloat(a)||0,i=parseFloat(l)||0),f(e)&&(e=e.call(t,n,w.extend({},s))),null!=e.top&&(h.top=e.top-s.top+o),null!=e.left&&(h.left=e.left-s.left+i),"using"in e?e.using.call(t,h):c.css(h)}},w.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){w.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var t,e,n,r=this[0],i={top:0,left:0};if("fixed"===w.css(r,"position"))e=r.getBoundingClientRect();else{for(e=this.offset(),n=r.ownerDocument,t=r.offsetParent||n.documentElement;t&&(t===n.body||t===n.documentElement)&&"static"===w.css(t,"position");)t=t.parentNode;t&&t!==r&&1===t.nodeType&&((i=w(t).offset()).top+=w.css(t,"borderTopWidth",!0),i.left+=w.css(t,"borderLeftWidth",!0))}return{top:e.top-i.top-w.css(r,"marginTop",!0),left:e.left-i.left-w.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var t=this.offsetParent;t&&"static"===w.css(t,"position");)t=t.offsetParent;return t||rt})}}),w.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,e){var n="pageYOffset"===e;w.fn[t]=function(r){return G(this,function(t,r,i){var a;if(m(t)?a=t:9===t.nodeType&&(a=t.defaultView),void 0===i)return a?a[e]:t[r];a?a.scrollTo(n?a.pageXOffset:i,n?i:a.pageYOffset):t[r]=i},t,r,arguments.length)}}),w.each(["top","left"],function(t,e){w.cssHooks[e]=Gt(p.pixelPosition,function(t,n){if(n)return n=Vt(t,e),Ft.test(n)?w(t).position()[e]+"px":n})}),w.each({Height:"height",Width:"width"},function(t,e){w.each({padding:"inner"+t,content:e,"":"outer"+t},function(n,r){w.fn[r]=function(i,a){var o=arguments.length&&(n||"boolean"!=typeof i),s=n||(!0===i||!0===a?"margin":"border");return G(this,function(e,n,i){var a;return m(e)?0===r.indexOf("outer")?e["inner"+t]:e.document.documentElement["client"+t]:9===e.nodeType?(a=e.documentElement,Math.max(e.body["scroll"+t],a["scroll"+t],e.body["offset"+t],a["offset"+t],a["client"+t])):void 0===i?w.css(e,n,s):w.style(e,n,i,s)},e,o?i:void 0,o)}})}),w.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(t,e){w.fn[e]=function(t){return this.on(e,t)}}),w.fn.extend({bind:function(t,e,n){return this.on(t,null,e,n)},unbind:function(t,e){return this.off(t,null,e)},delegate:function(t,e,n,r){return this.on(e,t,n,r)},undelegate:function(t,e,n){return 1===arguments.length?this.off(t,"**"):this.off(e,t||"**",n)},hover:function(t,e){return this.mouseenter(t).mouseleave(e||t)}}),w.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(t,e){w.fn[e]=function(t,n){return arguments.length>0?this.on(e,null,t,n):this.trigger(e)}});var Je=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;w.proxy=function(t,e){var n,r,a;if("string"==typeof e&&(n=t[e],e=t,t=n),f(t))return r=i.call(arguments,2),(a=function(){return t.apply(e||this,r.concat(i.call(arguments)))}).guid=t.guid=t.guid||w.guid++,a},w.holdReady=function(t){t?w.readyWait++:w.ready(!0)},w.isArray=Array.isArray,w.parseJSON=JSON.parse,w.nodeName=E,w.isFunction=f,w.isWindow=m,w.camelCase=J,w.type=x,w.now=Date.now,w.isNumeric=function(t){var e=w.type(t);return("number"===e||"string"===e)&&!isNaN(t-parseFloat(t))},w.trim=function(t){return null==t?"":(t+"").replace(Je,"")};var qe=t.jQuery,Xe=t.$;return w.noConflict=function(e){return t.$===w&&(t.$=Xe),e&&t.jQuery===w&&(t.jQuery=qe),w},void 0===e&&(t.jQuery=t.$=w),w},t.exports=e.document?n(e,!0):function(t){if(!t.document)throw new Error("jQuery requires a window with a document");return n(t)}}),jquery$1=Object.freeze({__proto__:null,default:jquery,__moduleExports:jquery});export{McEdGetPointWorldDrawObject,McGeTool,McGiWorldDrawType$1 as McGiWorldDrawType,MrxDbgUiPrBaseReturn$1 as MrxDbgUiPrBaseReturn,MrxDbgUiPrPoint,MrxDbgUtils,Mx3PointArc,MxCADObject,MxDb2LineAngularDimension,MxDbAlignedDimension,MxDbAnyLine,MxDbArea,MxDbCloudLine,MxDbCoord,MxDbDatabase,MxDbEllipse,MxDbEntity,MxDbHatch,MxDbImage,MxDbLeadComment,MxDbLeadTag,MxDbLine,MxDbPolyline,MxDbRect,MxDbRectBoxLeadComment,MxDbRegularPolygon,MxDbSVG,MxDbSVGText,MxDbText,MxDrawObject,MxFilters,MxFun,MxThreeJS,MxType,Mxassembly,Mx as default,loadCoreCode,store,useCanvasResizeListener};
|