diff --git a/frontend/src/globals/unity-util.ts b/frontend/src/globals/unity-util.ts index 80d620d013..ff241da39d 100644 --- a/frontend/src/globals/unity-util.ts +++ b/frontend/src/globals/unity-util.ts @@ -2485,19 +2485,15 @@ export class UnityUtil { } /** - * Highlights the Lower Floor Plane in Vertical mode, and makes it interactive. + * Activates the Gizmo for the specified vertical plane, or none, if a valid plane is not given. * @category Calibration */ - public static selectCalibrationToolLowerPlane() { - UnityUtil.toUnity('SelectCalibrationToolLowerPlane', UnityUtil.LoadingState.VIEWER_READY); - } - - /** - * Highlights the Upper Floor Plane in Vertical mode, and makes it interactive. - * @category Calibration - */ - public static selectCalibrationToolUpperPlane() { - UnityUtil.toUnity('SelectCalibrationToolUpperPlane', UnityUtil.LoadingState.VIEWER_READY); + public static selectCalibrationToolVerticalPlane(plane: 'upper' | 'lower' | undefined) { + if (plane) { + UnityUtil.toUnity('SelectCalibrationToolVerticalPlane', UnityUtil.LoadingState.VIEWER_READY, plane); + } else { + UnityUtil.toUnity('SelectCalibrationToolVerticalPlane', UnityUtil.LoadingState.VIEWER_READY, 'none'); // (Don't try to call sendMessage with null) + } } /** @@ -2546,21 +2542,20 @@ export class UnityUtil { } /** - * Sets tint and border colours of the image in the image preview, for the level that is selected. - * Both properties must be provided, and as HTML colour strings. + * Sets the colour scheme of the image preview plane, for the specific level. All three colours should be + * provided as HTML colour strings (see: https://docs.unity3d.com/ScriptReference/ColorUtility.TryParseHtmlString.html) + * fill is the tint applied to the image, including the background. + * border is the colour of the border around the image. + * drawing is the tint applied to the image, before the background. + * + * All three arguments support alpha values. For example, setting drawing to #00000000 and fill to #ff000008 would + * result in a purely red plane with an alpha value of 0.5 compared to the geometry. + * * @category Calibration */ - public static setCalibrationToolSelectedColors(fill: string, border: string) { - UnityUtil.toUnity('SetCalibrationToolSelectedColours', UnityUtil.LoadingState.VIEWER_READY, JSON.stringify({ fill, border })); - } + public static setCalibrationToolVerticalPlaneColours(plane: 'lower' | 'upper', fill: string, border: string, drawing: string) { + UnityUtil.toUnity('SetCalibrationToolVerticalPlaneColours', UnityUtil.LoadingState.VIEWER_READY, JSON.stringify({ plane, fill, border, drawing })); - /** - * Sets tint and border colours of the image in the image preview, for the level that is not selected. - * Both properties must be provided, and as HTML colour strings. - * @category Calibration - */ - public static setCalibrationToolUnselectedColors(fill: string, border: string) { - UnityUtil.toUnity('SetCalibrationToolUnselectedColours', UnityUtil.LoadingState.VIEWER_READY, JSON.stringify({ fill, border })); } /** diff --git a/frontend/src/v4/routes/viewer3D/calibration3DInfoBox/calibration3DInfoBox.component.tsx b/frontend/src/v4/routes/viewer3D/calibration3DInfoBox/calibration3DInfoBox.component.tsx index 9b9e17fefb..f15a7ccc79 100644 --- a/frontend/src/v4/routes/viewer3D/calibration3DInfoBox/calibration3DInfoBox.component.tsx +++ b/frontend/src/v4/routes/viewer3D/calibration3DInfoBox/calibration3DInfoBox.component.tsx @@ -20,6 +20,8 @@ import { CalibrationContext } from '@/v5/ui/routes/dashboard/projects/calibratio import { CalibrationInfoBox } from '@/v5/ui/routes/dashboard/projects/calibration/calibrationInfoBox/calibrationInfoBox.component'; import { useContext } from 'react'; import CalibrationIcon from '@assets/icons/filled/calibration-filled.svg'; +import VerticalCalibrationIcon from '@assets/icons/viewer/vertical_calibration.svg'; + export const Calibration3DInfoBox = () => { const { step } = useContext(CalibrationContext); @@ -46,10 +48,10 @@ export const Calibration3DInfoBox = () => { description={formatMessage({ id: 'infoBox.verticalExtents.description', defaultMessage: ` - This step filters features from 3D to make them visible in 2D (i.e. Custom Tickets). - Place the bottom and top planes to define the vertical extents of your drawing. + This step filters features from 3D to make them visible in 2D (i.e. Custom Tickets). + Click on the {icon} to position the bottom plane and adjust the top plane to define the vertical extents of your drawing. `, - })} + }, { icon: })} /> ); }; diff --git a/frontend/src/v4/services/viewer/viewer.tsx b/frontend/src/v4/services/viewer/viewer.tsx index 166543d269..811f7f1353 100644 --- a/frontend/src/v4/services/viewer/viewer.tsx +++ b/frontend/src/v4/services/viewer/viewer.tsx @@ -19,6 +19,7 @@ import EventEmitter from 'eventemitter3'; import { UnityUtil } from '@/globals/unity-util'; import { isEmpty, isString } from 'lodash'; +import { COLOR, hexToOpacity } from '@/v5/ui/themes/theme'; import { IS_DEVELOPMENT } from '../../constants/environment'; import { VIEWER_EVENTS, @@ -1327,23 +1328,29 @@ export class ViewerService { } + // part of the hacek for callibratio tool plane + private calibrationtoolmode = 'none'; + /** * Drawings Calibration */ public setCalibrationToolMode(mode: string) { UnityUtil.setCalibrationToolMode(mode); + this.calibrationtoolmode = mode; } public setCalibrationToolVerticalPlanes(lower, upper) { UnityUtil.setCalibrationToolVerticalPlanes(lower, upper); } - public selectCalibrationToolUpperPlane() { - UnityUtil.selectCalibrationToolUpperPlane(); - } + public selectCalibrationToolPlane(plane) { + const selectedPlane = plane === 'none' ? 'upper' : plane; // If none plane is selected show as if the top plane is selected. + const unselectedPlane = selectedPlane === 'upper' ? 'lower' : 'upper'; - public selectCalibrationToolLowerPlane() { - UnityUtil.selectCalibrationToolLowerPlane(); + Viewer.setCalibrationToolVerticalPlaneColours(selectedPlane, hexToOpacity(COLOR.PRIMARY_MAIN_CONTRAST, 44), COLOR.PRIMARY_MAIN, COLOR.PRIMARY_MAIN_CONTRAST); + Viewer.setCalibrationToolVerticalPlaneColours(unselectedPlane, hexToOpacity(COLOR.PRIMARY_MAIN_CONTRAST, 0), COLOR.PRIMARY_MAIN, hexToOpacity(COLOR.PRIMARY_MAIN_CONTRAST, 0)); + + UnityUtil.selectCalibrationToolVerticalPlane(plane); } public setCalibrationToolDrawing(image: any, rect: number[]) { @@ -1358,16 +1365,8 @@ export class ViewerService { UnityUtil.setCalibrationToolFloorToObject(teamspace, modelId, meshId); } - public setCalibrationToolSelectedColors(fill, border) { - UnityUtil.setCalibrationToolSelectedColors(fill, border); - } - - public setCalibrationToolUnselectedColors(fill, border) { - UnityUtil.setCalibrationToolUnselectedColors(fill, border); - } - - public setCalibrationToolOcclusionOpacity(opacity) { - UnityUtil.setCalibrationToolOcclusionOpacity(opacity); + public setCalibrationToolVerticalPlaneColours(plane, fill, border, drawing) { + UnityUtil.setCalibrationToolVerticalPlaneColours(plane, fill, border, drawing); } } diff --git a/frontend/src/v5/ui/routes/dashboard/projects/calibration/calibration.types.ts b/frontend/src/v5/ui/routes/dashboard/projects/calibration/calibration.types.ts index eb5fad0cfd..eb1039abf5 100644 --- a/frontend/src/v5/ui/routes/dashboard/projects/calibration/calibration.types.ts +++ b/frontend/src/v5/ui/routes/dashboard/projects/calibration/calibration.types.ts @@ -27,4 +27,5 @@ export type Vector3D = Vector; export enum PlaneType { UPPER = 'upper', LOWER = 'lower', + NONE = 'none', } diff --git a/frontend/src/v5/ui/routes/dashboard/projects/calibration/calibrationStep/calibration2DHandler/calibration2DHandler.component.tsx b/frontend/src/v5/ui/routes/dashboard/projects/calibration/calibrationStep/calibration2DHandler/calibration2DHandler.component.tsx index 29e9587074..d585af3018 100644 --- a/frontend/src/v5/ui/routes/dashboard/projects/calibration/calibrationStep/calibration2DHandler/calibration2DHandler.component.tsx +++ b/frontend/src/v5/ui/routes/dashboard/projects/calibration/calibrationStep/calibration2DHandler/calibration2DHandler.component.tsx @@ -21,9 +21,7 @@ import { CalibrationContext } from '../../calibrationContext'; import { EMPTY_VECTOR } from '../../calibration.constants'; export const Calibration2DHandler = () => { - const { isCalibrating, step, setIsCalibrating2D, setVector2D } = useContext(CalibrationContext); - - const canCalibrate2D = isCalibrating && step === 1; + const { setIsCalibrating2D, setVector2D } = useContext(CalibrationContext); useEffect(() => { UnityUtil.setCalibrationToolMode('Vector'); @@ -34,9 +32,5 @@ export const Calibration2DHandler = () => { }; }, []); - useEffect(() => { - setIsCalibrating2D(canCalibrate2D); - }, [canCalibrate2D]); - return null; }; diff --git a/frontend/src/v5/ui/routes/dashboard/projects/calibration/calibrationStep/calibration3DHandler/calibration3DHandler.component.tsx b/frontend/src/v5/ui/routes/dashboard/projects/calibration/calibrationStep/calibration3DHandler/calibration3DHandler.component.tsx index 28df47e51c..91db83a80f 100644 --- a/frontend/src/v5/ui/routes/dashboard/projects/calibration/calibrationStep/calibration3DHandler/calibration3DHandler.component.tsx +++ b/frontend/src/v5/ui/routes/dashboard/projects/calibration/calibrationStep/calibration3DHandler/calibration3DHandler.component.tsx @@ -60,7 +60,6 @@ export const Calibration3DHandler = () => { useEffect(() => { UnityUtil.setCalibrationToolMode('Vector'); - Viewer.isModelReady().then(() => setIsCalibrating3D(true)); return () => { setIsCalibrating3D(false); diff --git a/frontend/src/v5/ui/routes/dashboard/projects/calibration/calibrationStep/verticalSpatialBoundariesHandler/verticalSpatialBoundariesHandler.component.tsx b/frontend/src/v5/ui/routes/dashboard/projects/calibration/calibrationStep/verticalSpatialBoundariesHandler/verticalSpatialBoundariesHandler.component.tsx index e0b5971556..488504accf 100644 --- a/frontend/src/v5/ui/routes/dashboard/projects/calibration/calibrationStep/verticalSpatialBoundariesHandler/verticalSpatialBoundariesHandler.component.tsx +++ b/frontend/src/v5/ui/routes/dashboard/projects/calibration/calibrationStep/verticalSpatialBoundariesHandler/verticalSpatialBoundariesHandler.component.tsx @@ -25,7 +25,6 @@ import { TreeActionsDispatchers } from '@/v5/services/actionsDispatchers'; import { getTransformationMatrix } from '../../calibration.helpers'; import { Vector2 } from 'three'; import { isNull } from 'lodash'; -import { COLOR, hexToOpacity } from '@/v5/ui/themes/theme'; import { useParams } from 'react-router'; import { ViewerParams } from '@/v5/ui/routes/routes.constants'; import { DrawingRevisionsHooksSelectors } from '@/v5/services/selectorsHooks'; @@ -53,9 +52,6 @@ export const VerticalSpatialBoundariesHandler = () => { [bottomLeft, bottomRight, topLeft].map((corner) => corner.applyMatrix3(tMatrix)); Viewer.setCalibrationToolDrawing(i, [...bottomLeft, ...bottomRight, ...topLeft]); - Viewer.setCalibrationToolSelectedColors(hexToOpacity(COLOR.PRIMARY_MAIN_CONTRAST, 40), COLOR.PRIMARY_MAIN); - Viewer.setCalibrationToolUnselectedColors(hexToOpacity(COLOR.PRIMARY_MAIN_CONTRAST, 10), COLOR.PRIMARY_MAIN_CONTRAST); - Viewer.setCalibrationToolOcclusionOpacity(0.5); }; }; @@ -64,23 +60,28 @@ export const VerticalSpatialBoundariesHandler = () => { }, [verticalPlanes]); useEffect(() => { - if (isCalibratingPlanes) { - Viewer.setCalibrationToolMode(planesAreSet ? 'Vertical' : 'None'); - Viewer.on(VIEWER_EVENTS.UPDATE_CALIBRATION_PLANES, setVerticalPlanes); - return () => { - Viewer.setCalibrationToolMode('None'); - Viewer.off(VIEWER_EVENTS.UPDATE_CALIBRATION_PLANES, setVerticalPlanes); - Viewer.clipToolDelete(); - }; + if (planesAreSet) { + Viewer.clipToolDelete(); } - }, [isCalibratingPlanes, planesAreSet]); + + Viewer.on(VIEWER_EVENTS.UPDATE_CALIBRATION_PLANES, setVerticalPlanes); + + return () => { + Viewer.off(VIEWER_EVENTS.UPDATE_CALIBRATION_PLANES, setVerticalPlanes); + }; + + }, [planesAreSet]); useEffect(() => { - if (!planesAreSet) { + Viewer.setCalibrationToolMode(planesAreSet ? 'Vertical' : 'None'); + setSelectedPlane(isCalibratingPlanes ? PlaneType.UPPER : PlaneType.NONE); + + if (!planesAreSet && isCalibratingPlanes) { const onClickFloorToObject = ({ account, model, id }) => { Viewer.setCalibrationToolFloorToObject(account, model, id); setSelectedPlane(PlaneType.UPPER); }; + TreeActionsDispatchers.stopListenOnSelections(); Viewer.on(VIEWER_EVENTS.OBJECT_SELECTED, onClickFloorToObject); return () => { @@ -88,7 +89,7 @@ export const VerticalSpatialBoundariesHandler = () => { Viewer.off(VIEWER_EVENTS.OBJECT_SELECTED, onClickFloorToObject); }; } - }, [planesAreSet]); + }, [planesAreSet, isCalibratingPlanes]); useEffect(() => { if (isAlignPlaneActive && planesAreSet) { @@ -113,20 +114,15 @@ export const VerticalSpatialBoundariesHandler = () => { }, [isAlignPlaneActive, selectedPlane, planesAreSet]); useEffect(() => { - if (selectedPlane === PlaneType.LOWER) { - Viewer.selectCalibrationToolLowerPlane(); - } else if (selectedPlane === PlaneType.UPPER) { - Viewer.selectCalibrationToolUpperPlane(); - } + Viewer.selectCalibrationToolPlane(selectedPlane); }, [selectedPlane]); useEffect(() => { - if (!src) return; + if (!src || !tMatrix) return; applyImageToPlane(); }, [src, tMatrix]); useEffect(() => { - setIsCalibratingPlanes(true); Viewer.setCalibrationToolVerticalPlanes(...verticalPlanes); return () => { diff --git a/frontend/unity/default/unity/Build/unity.data.unityweb b/frontend/unity/default/unity/Build/unity.data.unityweb index b6430af1f5..b5cc58243e 100644 Binary files a/frontend/unity/default/unity/Build/unity.data.unityweb and b/frontend/unity/default/unity/Build/unity.data.unityweb differ diff --git a/frontend/unity/default/unity/Build/unity.framework.js.unityweb b/frontend/unity/default/unity/Build/unity.framework.js.unityweb index bbc85c99c0..af84975069 100644 Binary files a/frontend/unity/default/unity/Build/unity.framework.js.unityweb and b/frontend/unity/default/unity/Build/unity.framework.js.unityweb differ diff --git a/frontend/unity/default/unity/Build/unity.loader.js b/frontend/unity/default/unity/Build/unity.loader.js index 725ef692bd..504eddaece 100644 --- a/frontend/unity/default/unity/Build/unity.loader.js +++ b/frontend/unity/default/unity/Build/unity.loader.js @@ -1 +1 @@ -function createUnityInstance(t,r,l){function d(e,t){if(!d.aborted&&r.showBanner)return"error"==t&&(d.aborted=!0),r.showBanner(e,t);switch(t){case"error":console.error(e);break;case"warning":console.warn(e);break;default:console.log(e)}}function n(e){var t=e.reason||e.error,r=t?t.toString():e.message||e.reason||"",n=t&&t.stack?t.stack.toString():"";(r+="\n"+(n=n.startsWith(r)?n.substring(r.length):n).trim())&&b.stackTraceRegExp&&b.stackTraceRegExp.test(r)&&h(r,e.filename||t&&(t.fileName||t.sourceURL)||"",e.lineno||t&&(t.lineNumber||t.line)||0)}function e(e,t,r){var n=e[t];void 0!==n&&n||(console.warn('Config option "'+t+'" is missing or empty. Falling back to default value: "'+r+'". Consider updating your WebGL template to include the missing config option.'),e[t]=r)}l=l||function(){};var o,b={canvas:t,webglContextAttributes:{preserveDrawingBuffer:!1,powerPreference:2},wasmFileSize:31750353,streamingAssetsUrl:"StreamingAssets",downloadProgress:{},deinitializers:[],intervals:{},setInterval:function(e,t){e=window.setInterval(e,t);return this.intervals[e]=!0,e},clearInterval:function(e){delete this.intervals[e],window.clearInterval(e)},preRun:[],postRun:[],print:function(e){console.log(e)},printErr:function(e){console.error(e),"string"==typeof e&&-1!=e.indexOf("wasm streaming compile failed")&&(-1!=e.toLowerCase().indexOf("mime")?d('HTTP Response Header "Content-Type" configured incorrectly on the server for file '+b.codeUrl+' , should be "application/wasm". Startup time performance will suffer.',"warning"):d('WebAssembly streaming compilation failed! This can happen for example if "Content-Encoding" HTTP header is incorrectly enabled on the server for file '+b.codeUrl+", but the file is not pre-compressed on disk (or vice versa). Check the Network tab in browser Devtools to debug server header configuration.","warning"))},locateFile:function(e){return e},disabledCanvasEvents:["contextmenu","dragstart"]};for(o in e(r,"companyName","Unity"),e(r,"productName","WebGL Player"),e(r,"productVersion","1.0"),r)b[o]=r[o];b.streamingAssetsUrl=new URL(b.streamingAssetsUrl,document.URL).href;var i=b.disabledCanvasEvents.slice();function a(e){e.preventDefault()}i.forEach(function(e){t.addEventListener(e,a)}),window.addEventListener("error",n),window.addEventListener("unhandledrejection",n);var s="",f="";function u(e){document.webkitCurrentFullScreenElement===t?t.style.width&&(s=t.style.width,f=t.style.height,t.style.width="100%",t.style.height="100%"):s&&(t.style.width=s,t.style.height=f,f=s="")}document.addEventListener("webkitfullscreenchange",u),b.deinitializers.push(function(){for(var e in b.disableAccessToMediaDevices(),i.forEach(function(e){t.removeEventListener(e,a)}),window.removeEventListener("error",n),window.removeEventListener("unhandledrejection",n),document.removeEventListener("webkitfullscreenchange",u),b.intervals)window.clearInterval(e);b.intervals={}}),b.QuitCleanup=function(){for(var e=0;e>2],usedWASMHeapSize:b.HEAPU32[t>>2],totalJSHeapSize:b.HEAPF64[r>>3],usedJSHeapSize:b.HEAPF64[n>>3],pageLoadTime:b.HEAPU32[o>>2],pageLoadTimeToFrame1:b.HEAPU32[i>>2],fps:b.HEAPF64[a>>3],movingAverageFps:b.HEAPF64[s>>3],assetLoadTime:b.HEAPU32[l>>2],webAssemblyStartupTime:b.HEAPU32[d>>2]-(b.webAssemblyTimeStart||0),codeDownloadTime:b.HEAPU32[f>>2],gameStartupTime:b.HEAPU32[u>>2],numJankedFrames:b.HEAPU32[u+4>>2]}}};function h(e,t,r){-1==e.indexOf("fullscreen error")&&(b.startupErrorHandler?b.startupErrorHandler(e,t,r):b.errorHandler&&b.errorHandler(e,t,r)||(console.log("Invoking error handler due to\n"+e),"function"==typeof dump&&dump("Invoking error handler due to\n"+e),h.didShowErrorMessage||(-1!=(e="An error occurred running the Unity content on this page. See your browser JavaScript console for more info. The error was:\n"+e).indexOf("DISABLE_EXCEPTION_CATCHING")?e="An exception has occurred, but exception handling has been disabled in this build. If you are the developer of this content, enable exceptions in your project WebGL player settings to be able to catch the exception or see the stack trace.":-1!=e.indexOf("Cannot enlarge memory arrays")?e="Out of memory. If you are the developer of this content, try allocating more memory to your WebGL build in the WebGL player settings.":-1==e.indexOf("Invalid array buffer length")&&-1==e.indexOf("Invalid typed array length")&&-1==e.indexOf("out of memory")&&-1==e.indexOf("could not allocate memory")||(e="The browser could not allocate enough memory for the WebGL content. If you are the developer of this content, try allocating less memory to your WebGL build in the WebGL player settings."),alert(e),h.didShowErrorMessage=!0)))}function m(e,t){if("symbolsUrl"!=e){var r=b.downloadProgress[e],n=(r=r||(b.downloadProgress[e]={started:!1,finished:!1,lengthComputable:!1,total:0,loaded:0}),"object"!=typeof t||"progress"!=t.type&&"load"!=t.type||(r.started||(r.started=!0,r.lengthComputable=t.lengthComputable),r.total=t.total,r.loaded=t.loaded,"load"==t.type&&(r.finished=!0)),0),o=0,i=0,a=0,s=0;for(e in b.downloadProgress){if(!(r=b.downloadProgress[e]).started)return;i++,r.lengthComputable?(n+=r.loaded,o+=r.total,a++):r.finished||s++}l(.9*(i?(i-s-(o?a*(o-n)/o:0))/i:0))}}b.SystemInfo=function(){var e,t,r,n,o=navigator.userAgent+" ",i=[["Firefox","Firefox"],["OPR","Opera"],["Edg","Edge"],["SamsungBrowser","Samsung Browser"],["Trident","Internet Explorer"],["MSIE","Internet Explorer"],["Chrome","Chrome"],["CriOS","Chrome on iOS Safari"],["FxiOS","Firefox on iOS Safari"],["Safari","Safari"]];function a(e,t,r){return(e=RegExp(e,"i").exec(t))&&e[r]}for(var s=0;s>>6:(r<65536?t[o++]=224|r>>>12:(t[o++]=240|r>>>18,t[o++]=128|r>>>12&63),t[o++]=128|r>>>6&63),t[o++]=128|63&r);return t},r.buf2binstring=function(e){return f(e,e.length)},r.binstring2buf=function(e){for(var t=new l.Buf8(e.length),r=0,n=t.length;r>10&1023,i[a++]=56320|1023&r)}return f(i,a)},r.utf8border=function(e,t){for(var r=(t=(t=t||e.length)>e.length?e.length:t)-1;0<=r&&128==(192&e[r]);)r--;return!(r<0)&&0!==r&&r+d[e[r]]>t?r:t}},"zlib/inflate.js":function(e,t,r){"use strict";var B=e("../utils/common"),L=e("./adler32"),O=e("./crc32"),R=e("./inffast"),I=e("./inftrees"),z=0,F=-2,H=1,n=852,o=592;function N(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function i(){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 B.Buf16(320),this.work=new B.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function a(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=H,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new B.Buf32(n),t.distcode=t.distdyn=new B.Buf32(o),t.sane=1,t.back=-1,z):F}function s(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,a(e)):F}function l(e,t){var r,n;return!e||!e.state||(n=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||15=e.wsize?(B.arraySet(e.window,t,r-e.wsize,e.wsize,0),e.wnext=0,e.whave=e.wsize):(n<(o=e.wsize-e.wnext)&&(o=n),B.arraySet(e.window,t,r-n,o,e.wnext),(n-=o)?(B.arraySet(e.window,t,r-n,n,0),e.wnext=n,e.whave=e.wsize):(e.wnext+=o,e.wnext===e.wsize&&(e.wnext=0),e.whave>>8&255,r.check=O(r.check,C,2,0),f=d=0,r.mode=2;else if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&d)<<8)+(d>>8))%31)e.msg="incorrect header check",r.mode=30;else if(8!=(15&d))e.msg="unknown compression method",r.mode=30;else{if(f-=4,_=8+(15&(d>>>=4)),0===r.wbits)r.wbits=_;else if(_>r.wbits){e.msg="invalid window size",r.mode=30;break}r.dmax=1<<_,e.adler=r.check=1,r.mode=512&d?10:12,f=d=0}}break;case 2:for(;f<16;){if(0===s)break e;s--,d+=n[i++]<>8&1),512&r.flags&&(C[0]=255&d,C[1]=d>>>8&255,r.check=O(r.check,C,2,0)),f=d=0,r.mode=3;case 3:for(;f<32;){if(0===s)break e;s--,d+=n[i++]<>>8&255,C[2]=d>>>16&255,C[3]=d>>>24&255,r.check=O(r.check,C,4,0)),f=d=0,r.mode=4;case 4:for(;f<16;){if(0===s)break e;s--,d+=n[i++]<>8),512&r.flags&&(C[0]=255&d,C[1]=d>>>8&255,r.check=O(r.check,C,2,0)),f=d=0,r.mode=5;case 5:if(1024&r.flags){for(;f<16;){if(0===s)break e;s--,d+=n[i++]<>>8&255,r.check=O(r.check,C,2,0)),f=d=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&((h=s<(h=r.length)?s:h)&&(r.head&&(_=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),B.arraySet(r.head.extra,n,i,h,_)),512&r.flags&&(r.check=O(r.check,n,h,i)),s-=h,i+=h,r.length-=h),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===s)break e;for(h=0;_=n[i+h++],r.head&&_&&r.length<65536&&(r.head.name+=String.fromCharCode(_)),_&&h>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=12;break;case 10:for(;f<32;){if(0===s)break e;s--,d+=n[i++]<>>=7&f,f-=7&f,r.mode=27;else{for(;f<3;){if(0===s)break e;s--,d+=n[i++]<>>=1)){case 0:r.mode=14;break;case 1:var A,A=P=void 0,P=r;if(D){for(Z=new B.Buf32(512),M=new B.Buf32(32),A=0;A<144;)P.lens[A++]=8;for(;A<256;)P.lens[A++]=9;for(;A<280;)P.lens[A++]=7;for(;A<288;)P.lens[A++]=8;for(I(1,P.lens,0,288,Z,0,P.work,{bits:9}),A=0;A<32;)P.lens[A++]=5;I(2,P.lens,0,32,M,0,P.work,{bits:5}),D=!1}if(P.lencode=Z,P.lenbits=9,P.distcode=M,P.distbits=5,r.mode=20,6!==t)break;d>>>=2,f-=2;break e;case 2:r.mode=17;break;case 3:e.msg="invalid block type",r.mode=30}d>>>=2,f-=2}break;case 14:for(d>>>=7&f,f-=7&f;f<32;){if(0===s)break e;s--,d+=n[i++]<>>16^65535)){e.msg="invalid stored block lengths",r.mode=30;break}if(r.length=65535&d,f=d=0,r.mode=15,6===t)break e;case 15:r.mode=16;case 16:if(h=r.length){if(0===(h=l<(h=s>>=5,f-=5,r.ndist=1+(31&d),d>>>=5,f-=5,r.ncode=4+(15&d),d>>>=4,f-=4,286>>=3,f-=3}for(;r.have<19;)r.lens[T[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,S={bits:r.lenbits},x=I(0,r.lens,0,19,r.lencode,0,r.work,S),r.lenbits=S.bits,x){e.msg="invalid code lengths set",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have>>16&255,w=65535&U,!((g=U>>>24)<=f);){if(0===s)break e;s--,d+=n[i++]<>>=g,f-=g,r.lens[r.have++]=w;else{if(16===w){for(E=g+2;f>>=g,f-=g,0===r.have){e.msg="invalid bit length repeat",r.mode=30;break}_=r.lens[r.have-1],h=3+(3&d),d>>>=2,f-=2}else if(17===w){for(E=g+3;f>>=g)),d>>>=3,f=f-g-3}else{for(E=g+7;f>>=g)),d>>>=7,f=f-g-7}if(r.have+h>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=30;break}for(;h--;)r.lens[r.have++]=_}}if(30===r.mode)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=30;break}if(r.lenbits=9,S={bits:r.lenbits},x=I(1,r.lens,0,r.nlen,r.lencode,0,r.work,S),r.lenbits=S.bits,x){e.msg="invalid literal/lengths set",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,S={bits:r.distbits},x=I(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,S),r.distbits=S.bits,x){e.msg="invalid distances set",r.mode=30;break}if(r.mode=20,6===t)break e;case 20:r.mode=21;case 21:if(6<=s&&258<=l){e.next_out=a,e.avail_out=l,e.next_in=i,e.avail_in=s,r.hold=d,r.bits=f,R(e,c),a=e.next_out,o=e.output,l=e.avail_out,i=e.next_in,n=e.input,s=e.avail_in,d=r.hold,f=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;p=(U=r.lencode[d&(1<>>16&255,w=65535&U,!((g=U>>>24)<=f);){if(0===s)break e;s--,d+=n[i++]<>v)])>>>16&255,w=65535&U,!(v+(g=U>>>24)<=f);){if(0===s)break e;s--,d+=n[i++]<>>=v,f-=v,r.back+=v}if(d>>>=g,f-=g,r.back+=g,r.length=w,0===p){r.mode=26;break}if(32&p){r.back=-1,r.mode=12;break}if(64&p){e.msg="invalid literal/length code",r.mode=30;break}r.extra=15&p,r.mode=22;case 22:if(r.extra){for(E=r.extra;f>>=r.extra,f-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;p=(U=r.distcode[d&(1<>>16&255,w=65535&U,!((g=U>>>24)<=f);){if(0===s)break e;s--,d+=n[i++]<>v)])>>>16&255,w=65535&U,!(v+(g=U>>>24)<=f);){if(0===s)break e;s--,d+=n[i++]<>>=v,f-=v,r.back+=v}if(d>>>=g,f-=g,r.back+=g,64&p){e.msg="invalid distance code",r.mode=30;break}r.offset=w,r.extra=15&p,r.mode=24;case 24:if(r.extra){for(E=r.extra;f>>=r.extra,f-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=30;break}r.mode=25;case 25:if(0===l)break e;if(r.offset>(h=c-l)){if((h=r.offset-h)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=30;break}m=h>r.wnext?(h-=r.wnext,r.wsize-h):r.wnext-h,h>r.length&&(h=r.length),b=r.window}else b=o,m=a-r.offset,h=r.length;for(l-=h=l>>16&65535|0,a=0;0!==r;){for(r-=a=2e3>>1:r>>>1;e[t]=r}return e}();t.exports=function(e,t,r,n){var o=s,i=n+r;e^=-1;for(var a=n;a>>8^o[255&(e^t[a])];return-1^e}},"zlib/inffast.js":function(e,t,r){"use strict";t.exports=function(e,t){var r,n,o,i,a,s,l=e.state,d=e.next_in,f=e.input,u=d+(e.avail_in-5),c=e.next_out,h=e.output,m=c-(t-e.avail_out),b=c+(e.avail_out-257),g=l.dmax,p=l.wsize,w=l.whave,v=l.wnext,k=l.window,y=l.hold,_=l.bits,x=l.lencode,S=l.distcode,E=(1<>>=n=r>>>24,_-=n,0==(n=r>>>16&255))h[c++]=65535&r;else{if(!(16&n)){if(0==(64&n)){r=x[(65535&r)+(y&(1<>>=n,_-=n),_<15&&(y+=f[d++]<<_,_+=8,y+=f[d++]<<_,_+=8),r=S[y&U];;){if(y>>>=n=r>>>24,_-=n,!(16&(n=r>>>16&255))){if(0==(64&n)){r=S[(65535&r)+(y&(1<>>=n,_-=n,(n=c-m)>3)<<3))-1,e.next_in=d-=o,e.next_out=c,e.avail_in=dh?(b=L[O+a[v]],T[A+a[v]]):(b=96,0),l=1<<(m=w-S),k=d=1<>S)+(d-=l)]=m<<24|b<<16|g|0,0!==d;);for(l=1<>=1;if(C=0!==l?(C&l-1)+l:0,v++,0==--P[w]){if(w===y)break;w=t[r+a[v]]}if(_e.length||31!=e[0]||139!=e[1])return!1;var n=e[3];if(4&n){if(t+2>e.length)return!1;if((t+=2+e[t]+(e[t+1]<<8))>e.length)return!1}if(8&n){for(;te.length)return!1;t++}return 16&n&&String.fromCharCode.apply(null,e.subarray(t,t+r.length+1))==r+"\0"}},br:{hasUnityMarker:function(e){var t="UnityWeb Compressed Content (brotli)";if(!e.length)return!1;var r=1&e[0]?14&e[0]?4:7:1,n=e[0]&(1<>3);if(commentOffset=1+r+2+1+2+(o<<3)+7>>3,17==n||commentOffset>e.length)return!1;for(var i=n+(6+(o<<4)+(t.length-1<<6)<>>=8)if(e[a]!=(255&i))return!1;return String.fromCharCode.apply(null,e.subarray(commentOffset,commentOffset+t.length))==t}}};function p(t){m(t);var e=b.fetchWithProgress,r=b[t],n=/file:\/\//.exec(r)?"same-origin":void 0;return e(b[t],{method:"GET",companyName:b.companyName,productName:b.productName,productVersion:b.productVersion,control:"no-store",mode:n,onProgress:function(e){m(t,e)}}).then(function(e){return a=e.parsedBody,s=b[t],new Promise(function(e,t){try{for(var r in g){var n,o,i;if(g[r].hasUnityMarker(a))return s&&console.log('You can reduce startup time if you configure your web server to add "Content-Encoding: '+r+'" response header when serving "'+s+'" file.'),(n=g[r]).worker||(o=URL.createObjectURL(new Blob(["this.require = ",n.require.toString(),"; this.decompress = ",n.decompress.toString(),"; this.onmessage = ",function(e){e={id:e.data.id,decompressed:this.decompress(e.data.compressed)};postMessage(e,e.decompressed?[e.decompressed.buffer]:[])}.toString(),"; postMessage({ ready: true });"],{type:"application/javascript"})),n.worker=new Worker(o),n.worker.onmessage=function(e){e.data.ready?URL.revokeObjectURL(o):(this.callbacks[e.data.id](e.data.decompressed),delete this.callbacks[e.data.id])},n.worker.callbacks={},n.worker.nextCallbackId=0),i=n.worker.nextCallbackId++,n.worker.callbacks[i]=e,void n.worker.postMessage({id:i,compressed:a},[a.buffer])}e(a)}catch(e){t(e)}});var a,s}).catch(function(e){var t="Failed to download file "+r;"file:"==location.protocol?d(t+". Loading web pages via a file:// URL without a web server is not supported by this browser. Please use a local development web server to host Unity content, or use the Unity Build and Run option.","error"):console.error(t)})}function w(){var t=performance.now(),m=(Promise.all([p("frameworkUrl").then(function(e){var s=URL.createObjectURL(new Blob([e],{type:"application/javascript"}));return new Promise(function(i,e){var a=document.createElement("script");a.src=s,a.onload=function(){if("undefined"==typeof unityFramework||!unityFramework){var e,t=[["br","br"],["gz","gzip"]];for(e in t){var r,n=t[e];if(b.frameworkUrl.endsWith("."+n[0]))return r="Unable to parse "+b.frameworkUrl+"!","file:"==location.protocol?void d(r+" Loading pre-compressed (brotli or gzip) content via a file:// URL without a web server is not supported by this browser. Please use a local development web server to host compressed Unity content, or use the Unity Build and Run option.","error"):(r+=' This can happen if build compression was enabled but web server hosting the content was misconfigured to not serve the file with HTTP Response Header "Content-Encoding: '+n[1]+'" present. Check browser Console and Devtools Network tab to debug.',"br"==n[0]&&"http:"==location.protocol&&(n=-1!=["localhost","127.0.0.1"].indexOf(location.hostname)?"":"Migrate your server to use HTTPS.",r=/Firefox/.test(navigator.userAgent)?"Unable to parse "+b.frameworkUrl+'!
If using custom web server, verify that web server is sending .br files with HTTP Response Header "Content-Encoding: br". Brotli compression may not be supported in Firefox over HTTP connections. '+n+' See https://bugzilla.mozilla.org/show_bug.cgi?id=1670675 for more information.':"Unable to parse "+b.frameworkUrl+'!
If using custom web server, verify that web server is sending .br files with HTTP Response Header "Content-Encoding: br". Brotli compression may not be supported over HTTP connections. Migrate your server to use HTTPS.'),void d(r,"error"))}d("Unable to parse "+b.frameworkUrl+"! The file is corrupt, or compression was misconfigured? (check Content-Encoding HTTP Response Header on web server)","error")}var o=unityFramework;unityFramework=null,a.onload=null,URL.revokeObjectURL(s),i(o)},a.onerror=function(e){d("Unable to load file "+b.frameworkUrl+"! Check that the file exists on the remote server. (also check browser Console and Devtools Network tab to debug)","error")},document.body.appendChild(a),b.deinitializers.push(function(){document.body.removeChild(a)})})}),p("codeUrl")]).then(function(e){b.wasmBinary=e[1],e[0](b),b.codeDownloadTimeEnd=performance.now()-t}),performance.now()),e=p("dataUrl");b.preRun.push(function(){b.addRunDependency("dataUrl"),e.then(function(t){var e=new TextDecoder("utf-8"),r=0;function n(){var e=(t[r]|t[r+1]<<8|t[r+2]<<16|t[r+3]<<24)>>>0;return r+=4,e}function o(e){if(g.gzip.hasUnityMarker(t))throw e+'. Failed to parse binary data file, because it is still gzip-compressed and should have been uncompressed by the browser. Web server has likely provided gzip-compressed data without specifying the HTTP Response Header "Content-Encoding: gzip" with it to instruct the browser to decompress it. Please verify your web server hosting configuration.';if(g.br.hasUnityMarker(t))throw e+'. Failed to parse binary data file, because it is still brotli-compressed and should have been uncompressed by the browser. Web server has likely provided brotli-compressed data without specifying the HTTP Response Header "Content-Encoding: br" with it to instruct the browser to decompress it. Please verify your web server hosting configuration.';throw e}var i="UnityWebData1.0\0",a=e.decode(t.subarray(0,i.length)),s=(a!=i&&o('Unknown data format (id="'+a+'")'),r+=i.length,n());for(r+s>t.length&&o("Invalid binary data file header! (pos="+r+", headerSize="+s+", file length="+t.length+")");rt.length&&o("Invalid binary data file size! (offset="+l+", size="+d+", file length="+t.length+")"),n()),u=(r+f>t.length&&o("Invalid binary data file path name! (pos="+r+", length="+f+", file length="+t.length+")"),e.decode(t.subarray(r,r+f)));r+=f;for(var c=0,h=u.indexOf("/",c)+1;0>2],usedWASMHeapSize:b.HEAPU32[t>>2],totalJSHeapSize:b.HEAPF64[r>>3],usedJSHeapSize:b.HEAPF64[n>>3],pageLoadTime:b.HEAPU32[o>>2],pageLoadTimeToFrame1:b.HEAPU32[i>>2],fps:b.HEAPF64[a>>3],movingAverageFps:b.HEAPF64[s>>3],assetLoadTime:b.HEAPU32[l>>2],webAssemblyStartupTime:b.HEAPU32[d>>2]-(b.webAssemblyTimeStart||0),codeDownloadTime:b.HEAPU32[f>>2],gameStartupTime:b.HEAPU32[u>>2],numJankedFrames:b.HEAPU32[u+4>>2]}}};function h(e,t,r){-1==e.indexOf("fullscreen error")&&(b.startupErrorHandler?b.startupErrorHandler(e,t,r):b.errorHandler&&b.errorHandler(e,t,r)||(console.log("Invoking error handler due to\n"+e),"function"==typeof dump&&dump("Invoking error handler due to\n"+e),h.didShowErrorMessage||(-1!=(e="An error occurred running the Unity content on this page. See your browser JavaScript console for more info. The error was:\n"+e).indexOf("DISABLE_EXCEPTION_CATCHING")?e="An exception has occurred, but exception handling has been disabled in this build. If you are the developer of this content, enable exceptions in your project WebGL player settings to be able to catch the exception or see the stack trace.":-1!=e.indexOf("Cannot enlarge memory arrays")?e="Out of memory. If you are the developer of this content, try allocating more memory to your WebGL build in the WebGL player settings.":-1==e.indexOf("Invalid array buffer length")&&-1==e.indexOf("Invalid typed array length")&&-1==e.indexOf("out of memory")&&-1==e.indexOf("could not allocate memory")||(e="The browser could not allocate enough memory for the WebGL content. If you are the developer of this content, try allocating less memory to your WebGL build in the WebGL player settings."),alert(e),h.didShowErrorMessage=!0)))}function m(e,t){if("symbolsUrl"!=e){var r=b.downloadProgress[e],n=(r=r||(b.downloadProgress[e]={started:!1,finished:!1,lengthComputable:!1,total:0,loaded:0}),"object"!=typeof t||"progress"!=t.type&&"load"!=t.type||(r.started||(r.started=!0,r.lengthComputable=t.lengthComputable),r.total=t.total,r.loaded=t.loaded,"load"==t.type&&(r.finished=!0)),0),o=0,i=0,a=0,s=0;for(e in b.downloadProgress){if(!(r=b.downloadProgress[e]).started)return;i++,r.lengthComputable?(n+=r.loaded,o+=r.total,a++):r.finished||s++}l(.9*(i?(i-s-(o?a*(o-n)/o:0))/i:0))}}b.SystemInfo=function(){var e,t,r,n,o=navigator.userAgent+" ",i=[["Firefox","Firefox"],["OPR","Opera"],["Edg","Edge"],["SamsungBrowser","Samsung Browser"],["Trident","Internet Explorer"],["MSIE","Internet Explorer"],["Chrome","Chrome"],["CriOS","Chrome on iOS Safari"],["FxiOS","Firefox on iOS Safari"],["Safari","Safari"]];function a(e,t,r){return(e=RegExp(e,"i").exec(t))&&e[r]}for(var s=0;s>>6:(r<65536?t[o++]=224|r>>>12:(t[o++]=240|r>>>18,t[o++]=128|r>>>12&63),t[o++]=128|r>>>6&63),t[o++]=128|63&r);return t},r.buf2binstring=function(e){return f(e,e.length)},r.binstring2buf=function(e){for(var t=new l.Buf8(e.length),r=0,n=t.length;r>10&1023,i[a++]=56320|1023&r)}return f(i,a)},r.utf8border=function(e,t){for(var r=(t=(t=t||e.length)>e.length?e.length:t)-1;0<=r&&128==(192&e[r]);)r--;return!(r<0)&&0!==r&&r+d[e[r]]>t?r:t}},"zlib/inflate.js":function(e,t,r){"use strict";var B=e("../utils/common"),L=e("./adler32"),O=e("./crc32"),R=e("./inffast"),I=e("./inftrees"),z=0,F=-2,H=1,n=852,o=592;function N(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function i(){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 B.Buf16(320),this.work=new B.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function a(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=H,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new B.Buf32(n),t.distcode=t.distdyn=new B.Buf32(o),t.sane=1,t.back=-1,z):F}function s(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,a(e)):F}function l(e,t){var r,n;return!e||!e.state||(n=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||15=e.wsize?(B.arraySet(e.window,t,r-e.wsize,e.wsize,0),e.wnext=0,e.whave=e.wsize):(n<(o=e.wsize-e.wnext)&&(o=n),B.arraySet(e.window,t,r-n,o,e.wnext),(n-=o)?(B.arraySet(e.window,t,r-n,n,0),e.wnext=n,e.whave=e.wsize):(e.wnext+=o,e.wnext===e.wsize&&(e.wnext=0),e.whave>>8&255,r.check=O(r.check,C,2,0),f=d=0,r.mode=2;else if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&d)<<8)+(d>>8))%31)e.msg="incorrect header check",r.mode=30;else if(8!=(15&d))e.msg="unknown compression method",r.mode=30;else{if(f-=4,_=8+(15&(d>>>=4)),0===r.wbits)r.wbits=_;else if(_>r.wbits){e.msg="invalid window size",r.mode=30;break}r.dmax=1<<_,e.adler=r.check=1,r.mode=512&d?10:12,f=d=0}}break;case 2:for(;f<16;){if(0===s)break e;s--,d+=n[i++]<>8&1),512&r.flags&&(C[0]=255&d,C[1]=d>>>8&255,r.check=O(r.check,C,2,0)),f=d=0,r.mode=3;case 3:for(;f<32;){if(0===s)break e;s--,d+=n[i++]<>>8&255,C[2]=d>>>16&255,C[3]=d>>>24&255,r.check=O(r.check,C,4,0)),f=d=0,r.mode=4;case 4:for(;f<16;){if(0===s)break e;s--,d+=n[i++]<>8),512&r.flags&&(C[0]=255&d,C[1]=d>>>8&255,r.check=O(r.check,C,2,0)),f=d=0,r.mode=5;case 5:if(1024&r.flags){for(;f<16;){if(0===s)break e;s--,d+=n[i++]<>>8&255,r.check=O(r.check,C,2,0)),f=d=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&((h=s<(h=r.length)?s:h)&&(r.head&&(_=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),B.arraySet(r.head.extra,n,i,h,_)),512&r.flags&&(r.check=O(r.check,n,h,i)),s-=h,i+=h,r.length-=h),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===s)break e;for(h=0;_=n[i+h++],r.head&&_&&r.length<65536&&(r.head.name+=String.fromCharCode(_)),_&&h>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=12;break;case 10:for(;f<32;){if(0===s)break e;s--,d+=n[i++]<>>=7&f,f-=7&f,r.mode=27;else{for(;f<3;){if(0===s)break e;s--,d+=n[i++]<>>=1)){case 0:r.mode=14;break;case 1:var A,A=P=void 0,P=r;if(D){for(Z=new B.Buf32(512),M=new B.Buf32(32),A=0;A<144;)P.lens[A++]=8;for(;A<256;)P.lens[A++]=9;for(;A<280;)P.lens[A++]=7;for(;A<288;)P.lens[A++]=8;for(I(1,P.lens,0,288,Z,0,P.work,{bits:9}),A=0;A<32;)P.lens[A++]=5;I(2,P.lens,0,32,M,0,P.work,{bits:5}),D=!1}if(P.lencode=Z,P.lenbits=9,P.distcode=M,P.distbits=5,r.mode=20,6!==t)break;d>>>=2,f-=2;break e;case 2:r.mode=17;break;case 3:e.msg="invalid block type",r.mode=30}d>>>=2,f-=2}break;case 14:for(d>>>=7&f,f-=7&f;f<32;){if(0===s)break e;s--,d+=n[i++]<>>16^65535)){e.msg="invalid stored block lengths",r.mode=30;break}if(r.length=65535&d,f=d=0,r.mode=15,6===t)break e;case 15:r.mode=16;case 16:if(h=r.length){if(0===(h=l<(h=s>>=5,f-=5,r.ndist=1+(31&d),d>>>=5,f-=5,r.ncode=4+(15&d),d>>>=4,f-=4,286>>=3,f-=3}for(;r.have<19;)r.lens[T[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,S={bits:r.lenbits},x=I(0,r.lens,0,19,r.lencode,0,r.work,S),r.lenbits=S.bits,x){e.msg="invalid code lengths set",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have>>16&255,w=65535&U,!((g=U>>>24)<=f);){if(0===s)break e;s--,d+=n[i++]<>>=g,f-=g,r.lens[r.have++]=w;else{if(16===w){for(E=g+2;f>>=g,f-=g,0===r.have){e.msg="invalid bit length repeat",r.mode=30;break}_=r.lens[r.have-1],h=3+(3&d),d>>>=2,f-=2}else if(17===w){for(E=g+3;f>>=g)),d>>>=3,f=f-g-3}else{for(E=g+7;f>>=g)),d>>>=7,f=f-g-7}if(r.have+h>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=30;break}for(;h--;)r.lens[r.have++]=_}}if(30===r.mode)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=30;break}if(r.lenbits=9,S={bits:r.lenbits},x=I(1,r.lens,0,r.nlen,r.lencode,0,r.work,S),r.lenbits=S.bits,x){e.msg="invalid literal/lengths set",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,S={bits:r.distbits},x=I(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,S),r.distbits=S.bits,x){e.msg="invalid distances set",r.mode=30;break}if(r.mode=20,6===t)break e;case 20:r.mode=21;case 21:if(6<=s&&258<=l){e.next_out=a,e.avail_out=l,e.next_in=i,e.avail_in=s,r.hold=d,r.bits=f,R(e,c),a=e.next_out,o=e.output,l=e.avail_out,i=e.next_in,n=e.input,s=e.avail_in,d=r.hold,f=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;p=(U=r.lencode[d&(1<>>16&255,w=65535&U,!((g=U>>>24)<=f);){if(0===s)break e;s--,d+=n[i++]<>v)])>>>16&255,w=65535&U,!(v+(g=U>>>24)<=f);){if(0===s)break e;s--,d+=n[i++]<>>=v,f-=v,r.back+=v}if(d>>>=g,f-=g,r.back+=g,r.length=w,0===p){r.mode=26;break}if(32&p){r.back=-1,r.mode=12;break}if(64&p){e.msg="invalid literal/length code",r.mode=30;break}r.extra=15&p,r.mode=22;case 22:if(r.extra){for(E=r.extra;f>>=r.extra,f-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;p=(U=r.distcode[d&(1<>>16&255,w=65535&U,!((g=U>>>24)<=f);){if(0===s)break e;s--,d+=n[i++]<>v)])>>>16&255,w=65535&U,!(v+(g=U>>>24)<=f);){if(0===s)break e;s--,d+=n[i++]<>>=v,f-=v,r.back+=v}if(d>>>=g,f-=g,r.back+=g,64&p){e.msg="invalid distance code",r.mode=30;break}r.offset=w,r.extra=15&p,r.mode=24;case 24:if(r.extra){for(E=r.extra;f>>=r.extra,f-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=30;break}r.mode=25;case 25:if(0===l)break e;if(r.offset>(h=c-l)){if((h=r.offset-h)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=30;break}m=h>r.wnext?(h-=r.wnext,r.wsize-h):r.wnext-h,h>r.length&&(h=r.length),b=r.window}else b=o,m=a-r.offset,h=r.length;for(l-=h=l>>16&65535|0,a=0;0!==r;){for(r-=a=2e3>>1:r>>>1;e[t]=r}return e}();t.exports=function(e,t,r,n){var o=s,i=n+r;e^=-1;for(var a=n;a>>8^o[255&(e^t[a])];return-1^e}},"zlib/inffast.js":function(e,t,r){"use strict";t.exports=function(e,t){var r,n,o,i,a,s,l=e.state,d=e.next_in,f=e.input,u=d+(e.avail_in-5),c=e.next_out,h=e.output,m=c-(t-e.avail_out),b=c+(e.avail_out-257),g=l.dmax,p=l.wsize,w=l.whave,v=l.wnext,k=l.window,y=l.hold,_=l.bits,x=l.lencode,S=l.distcode,E=(1<>>=n=r>>>24,_-=n,0==(n=r>>>16&255))h[c++]=65535&r;else{if(!(16&n)){if(0==(64&n)){r=x[(65535&r)+(y&(1<>>=n,_-=n),_<15&&(y+=f[d++]<<_,_+=8,y+=f[d++]<<_,_+=8),r=S[y&U];;){if(y>>>=n=r>>>24,_-=n,!(16&(n=r>>>16&255))){if(0==(64&n)){r=S[(65535&r)+(y&(1<>>=n,_-=n,(n=c-m)>3)<<3))-1,e.next_in=d-=o,e.next_out=c,e.avail_in=dh?(b=L[O+a[v]],T[A+a[v]]):(b=96,0),l=1<<(m=w-S),k=d=1<>S)+(d-=l)]=m<<24|b<<16|g|0,0!==d;);for(l=1<>=1;if(C=0!==l?(C&l-1)+l:0,v++,0==--P[w]){if(w===y)break;w=t[r+a[v]]}if(_e.length||31!=e[0]||139!=e[1])return!1;var n=e[3];if(4&n){if(t+2>e.length)return!1;if((t+=2+e[t]+(e[t+1]<<8))>e.length)return!1}if(8&n){for(;te.length)return!1;t++}return 16&n&&String.fromCharCode.apply(null,e.subarray(t,t+r.length+1))==r+"\0"}},br:{hasUnityMarker:function(e){var t="UnityWeb Compressed Content (brotli)";if(!e.length)return!1;var r=1&e[0]?14&e[0]?4:7:1,n=e[0]&(1<>3);if(commentOffset=1+r+2+1+2+(o<<3)+7>>3,17==n||commentOffset>e.length)return!1;for(var i=n+(6+(o<<4)+(t.length-1<<6)<>>=8)if(e[a]!=(255&i))return!1;return String.fromCharCode.apply(null,e.subarray(commentOffset,commentOffset+t.length))==t}}};function p(t){m(t);var e=b.fetchWithProgress,r=b[t],n=/file:\/\//.exec(r)?"same-origin":void 0;return e(b[t],{method:"GET",companyName:b.companyName,productName:b.productName,productVersion:b.productVersion,control:"no-store",mode:n,onProgress:function(e){m(t,e)}}).then(function(e){return a=e.parsedBody,s=b[t],new Promise(function(e,t){try{for(var r in g){var n,o,i;if(g[r].hasUnityMarker(a))return s&&console.log('You can reduce startup time if you configure your web server to add "Content-Encoding: '+r+'" response header when serving "'+s+'" file.'),(n=g[r]).worker||(o=URL.createObjectURL(new Blob(["this.require = ",n.require.toString(),"; this.decompress = ",n.decompress.toString(),"; this.onmessage = ",function(e){e={id:e.data.id,decompressed:this.decompress(e.data.compressed)};postMessage(e,e.decompressed?[e.decompressed.buffer]:[])}.toString(),"; postMessage({ ready: true });"],{type:"application/javascript"})),n.worker=new Worker(o),n.worker.onmessage=function(e){e.data.ready?URL.revokeObjectURL(o):(this.callbacks[e.data.id](e.data.decompressed),delete this.callbacks[e.data.id])},n.worker.callbacks={},n.worker.nextCallbackId=0),i=n.worker.nextCallbackId++,n.worker.callbacks[i]=e,void n.worker.postMessage({id:i,compressed:a},[a.buffer])}e(a)}catch(e){t(e)}});var a,s}).catch(function(e){var t="Failed to download file "+r;"file:"==location.protocol?d(t+". Loading web pages via a file:// URL without a web server is not supported by this browser. Please use a local development web server to host Unity content, or use the Unity Build and Run option.","error"):console.error(t)})}function w(){var t=performance.now(),m=(Promise.all([p("frameworkUrl").then(function(e){var s=URL.createObjectURL(new Blob([e],{type:"application/javascript"}));return new Promise(function(i,e){var a=document.createElement("script");a.src=s,a.onload=function(){if("undefined"==typeof unityFramework||!unityFramework){var e,t=[["br","br"],["gz","gzip"]];for(e in t){var r,n=t[e];if(b.frameworkUrl.endsWith("."+n[0]))return r="Unable to parse "+b.frameworkUrl+"!","file:"==location.protocol?void d(r+" Loading pre-compressed (brotli or gzip) content via a file:// URL without a web server is not supported by this browser. Please use a local development web server to host compressed Unity content, or use the Unity Build and Run option.","error"):(r+=' This can happen if build compression was enabled but web server hosting the content was misconfigured to not serve the file with HTTP Response Header "Content-Encoding: '+n[1]+'" present. Check browser Console and Devtools Network tab to debug.',"br"==n[0]&&"http:"==location.protocol&&(n=-1!=["localhost","127.0.0.1"].indexOf(location.hostname)?"":"Migrate your server to use HTTPS.",r=/Firefox/.test(navigator.userAgent)?"Unable to parse "+b.frameworkUrl+'!
If using custom web server, verify that web server is sending .br files with HTTP Response Header "Content-Encoding: br". Brotli compression may not be supported in Firefox over HTTP connections. '+n+' See https://bugzilla.mozilla.org/show_bug.cgi?id=1670675 for more information.':"Unable to parse "+b.frameworkUrl+'!
If using custom web server, verify that web server is sending .br files with HTTP Response Header "Content-Encoding: br". Brotli compression may not be supported over HTTP connections. Migrate your server to use HTTPS.'),void d(r,"error"))}d("Unable to parse "+b.frameworkUrl+"! The file is corrupt, or compression was misconfigured? (check Content-Encoding HTTP Response Header on web server)","error")}var o=unityFramework;unityFramework=null,a.onload=null,URL.revokeObjectURL(s),i(o)},a.onerror=function(e){d("Unable to load file "+b.frameworkUrl+"! Check that the file exists on the remote server. (also check browser Console and Devtools Network tab to debug)","error")},document.body.appendChild(a),b.deinitializers.push(function(){document.body.removeChild(a)})})}),p("codeUrl")]).then(function(e){b.wasmBinary=e[1],e[0](b),b.codeDownloadTimeEnd=performance.now()-t}),performance.now()),e=p("dataUrl");b.preRun.push(function(){b.addRunDependency("dataUrl"),e.then(function(t){var e=new TextDecoder("utf-8"),r=0;function n(){var e=(t[r]|t[r+1]<<8|t[r+2]<<16|t[r+3]<<24)>>>0;return r+=4,e}function o(e){if(g.gzip.hasUnityMarker(t))throw e+'. Failed to parse binary data file, because it is still gzip-compressed and should have been uncompressed by the browser. Web server has likely provided gzip-compressed data without specifying the HTTP Response Header "Content-Encoding: gzip" with it to instruct the browser to decompress it. Please verify your web server hosting configuration.';if(g.br.hasUnityMarker(t))throw e+'. Failed to parse binary data file, because it is still brotli-compressed and should have been uncompressed by the browser. Web server has likely provided brotli-compressed data without specifying the HTTP Response Header "Content-Encoding: br" with it to instruct the browser to decompress it. Please verify your web server hosting configuration.';throw e}var i="UnityWebData1.0\0",a=e.decode(t.subarray(0,i.length)),s=(a!=i&&o('Unknown data format (id="'+a+'")'),r+=i.length,n());for(r+s>t.length&&o("Invalid binary data file header! (pos="+r+", headerSize="+s+", file length="+t.length+")");rt.length&&o("Invalid binary data file size! (offset="+l+", size="+d+", file length="+t.length+")"),n()),u=(r+f>t.length&&o("Invalid binary data file path name! (pos="+r+", length="+f+", file length="+t.length+")"),e.decode(t.subarray(r,r+f)));r+=f;for(var c=0,h=u.indexOf("/",c)+1;0